+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: admin panel for php page

  1. #1
    bnrj_sjy is offline x10Hosting Member bnrj_sjy is an unknown quantity at this point
    Join Date
    Apr 2008
    Posts
    18

    admin panel for php page

    i have created a php page with dreamweaver having an article and a heading inside the page

    now i want to create an admin panel for that page so that i can change the contents of that page so that i dont have to upload the php page evry time i make a change

    thanks

    help needed urgent

  2. #2
    webmatrix is offline x10Hosting Member webmatrix is an unknown quantity at this point
    Join Date
    Sep 2009
    Posts
    2

    Re: admin panel for php page

    its easy dude but need lots of work you have to create database for this if you can post your php page i will try to help u out

  3. #3
    smithee's Avatar
    smithee is offline x10Hosting Member smithee is an unknown quantity at this point
    Join Date
    Aug 2009
    Location
    NIMBY
    Posts
    45

    Re: admin panel for php page

    you can also use XML instead of a database

  4. #4
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: admin panel for php page

    cPanel->FileManager->Edit is not an option?
    Nothing is always absolutely so.

  5. #5
    xav0989's Avatar
    xav0989 is offline Community Public Relation xav0989 is just really nice
    Join Date
    Jul 2008
    Location
    ifk
    Posts
    4,438

    Re: admin panel for php page

    What you want to create is basically a dynamic page. As it has been said before, you have different options: updating in DW and uploading, editing from cPanel, creating a database or XML file backend and creating an management utility, or creating a management utility that directly edits the page.

    I personally recommend the database/XML file approach but you can choose.
    Xavier L | Community Public Relations Manager (Free Hosting Support)
    █ Yes, my position is too cool to even exist!
    How am I helping? Rate this post by clicking the icon below! (this is even better than "liking" a post)
    Terms of Service | Acceptable Use Policy | x10Hosting Wiki

  6. #6
    bnrj_sjy is offline x10Hosting Member bnrj_sjy is an unknown quantity at this point
    Join Date
    Apr 2008
    Posts
    18

    Re: admin panel for php page

    thanks for the reply but how can i do that in xml
    pls guide me

  7. #7
    descalzo's Avatar
    descalzo is offline Grim Squeaker descalzo has a brilliant futuredescalzo has a brilliant futuredescalzo has a brilliant future
    Join Date
    Jul 2009
    Location
    Ankh-Morpork
    Posts
    7,636

    Re: admin panel for php page

    What you want to do is just change the heading and change the contents of the article?
    Nothing is always absolutely so.

  8. #8
    smithee's Avatar
    smithee is offline x10Hosting Member smithee is an unknown quantity at this point
    Join Date
    Aug 2009
    Location
    NIMBY
    Posts
    45

    Exclamation Re: admin panel for php page

    I've done a pretty basic model of some sort, but it actually writes to a text file rather than an XML, mainly because it was a lot easier to handle and you can even add your own HTML inside it (whereas in XML it may complain about this!). Here's my version (somewhat rather basic!):

    http://csmith.x10hosting.com/editpag...tpage_form.php

    And here's the related code snippets... I've only put in the relevant stuff, such as the PHP code where it would normally be hidden from the browser. This one is on editpage_form.php, where you edit the page on:

    HTML Code:
    <form id="form1" name="form1" method="post" action="editpage_show.php">
        <textarea name="page_content" cols="100" rows="10" wrap="soft" style="font-family:Verdana, Arial, Helvetica, sans-serif; color:#0000FF;"><?php if (file_exists("page.txt")) { echo file_get_contents("page.txt"); } ?></textarea>
        <br />
        <input name="save_btn" type="submit" value="Save" />
    </form>
    And this one is where you see your page you've just created, in editpage_show.php:

    PHP Code:
    <?php
    if (isset($_POST['page_content'])){
        
    // To create/overwrite the text file
        
    $textFile fopen("page.txt","w+b");
        
    // To load the content of the text box and format it accordingly
        
    $content $_POST['page_content'];
        
    $content htmlentities($content,ENT_QUOTES); 
        
    $content str_ireplace("\\&quot;","&quot;",$content);     
        
    $content str_ireplace("\\& #039;","& #039;",$content); //delete the spaces between the & and #039;
        
    $content str_ireplace("&lt;","<",$content); 
        
    $content str_ireplace("&gt;",">",$content); 
        
    // Writes the new content to the file
        
    fwrite($textFile,$content);
        
    // Closes the file writing session
        
    fclose($textFile);
    } else {
        
    // Checks to see if text file exists, and exit if it doesn't
        
    if (!(file_exists('page.txt'))) {
            exit(
    'Failed to open page.txt.');
        }
    }
    // Grabs the content of the text file, and formats it accordingly (again!) 
    $content "<p>".file_get_contents("page.txt")."</p>";
    $content str_ireplace("\r\n","</p><p>",$content);
    // Displays the formatted test
    echo $content
    ?>
    Any problems or other queries, just give a reply

    Edit: Whenever you start a new line by hitting return/enter, it automatically adds paragragh tags to the final page... I'll make this better as the days go by
    Last edited by smithee; 09-14-2009 at 07:15 PM. Reason: "& #039;" (without the space) was showing up as a single quote... not good for presentation purposes!

  9. #9
    bnrj_sjy is offline x10Hosting Member bnrj_sjy is an unknown quantity at this point
    Join Date
    Apr 2008
    Posts
    18

    Re: admin panel for php page

    thanks very much for the help
    will be back to you if required any further help

  10. #10
    bnrj_sjy is offline x10Hosting Member bnrj_sjy is an unknown quantity at this point
    Join Date
    Apr 2008
    Posts
    18

    Re: admin panel for php page

    dear smithee

    i have managed to make my content as you have guided me

    but now a problem arises
    it is that

    when i have uploaded to my server it takes a \ (backslash) behind every quotes (" , ')

    how to solve it please help me

    and many many thanks for all previous helps

+ Reply to Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Using Include Files with html on X10Hosting
    By frankfriend in forum Tutorials
    Replies: 0
    Last Post: 07-06-2009, 01:38 PM
  2. New x10 Hosting Account Splash Page
    By brainiacinside in forum Free Hosting
    Replies: 2
    Last Post: 04-27-2009, 01:58 PM
  3. C Panel P/W - ADMIN
    By visualwebsitedesigns in forum Free Hosting
    Replies: 1
    Last Post: 03-23-2008, 10:59 AM
  4. vBulletin - Optimization !!!!!
    By bin_asc in forum Scripts & 3rd Party Apps
    Replies: 7
    Last Post: 08-05-2005, 04:27 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers