Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Results 1 to 7 of 7
  1. #1
    Member
    Join Date
    Aug 2005
    Posts
    87
    Member #
    10945
    I am not completely interested in relying on OpenSource CMS because I'd like to learn how to do this sort of thing through tutorials and personal experience. I am getting better with my CSS layout skills and combining CSS with HTML for webpages that look good in Mozilla and IE. But I'd love to tackle PHP, especially since I've heard it's useful for updating websites using only word documents and text files.

    So how do we create our own content management system using PHP and HTML? I previously explored this issue by going to this website: http://www.devarticles.com/c/a/PHP/T...ar-Web-Page/2/
    however it doesn't really focus in on what I'd like to know because my friends and customers clamber about not wanting to learn HTML and CSS for updating their site because it would take to long for them. (as for my friends, they're just laaaaazzzzyyyyy :classic: )

    I look forward to your valued replies and thanks very much.

  2.  

  3. #2
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    Hey.

    PHP is indeed a good choice for reading in text files containing content.

    The PHP code would go inside the HTML of your page.

    Maybe an example would show what I mean:

    PHP Code:
    <div class="content">
       <?php
             
    include("news.txt");
       
    ?>
    </div>
    That PHP code snippet inserts whatever is inside new file news.txt inside that div.
    Note: you do not have to have the code inside a div or indeed any other element, but definitely inside the <body> </body> tags.

    Content Management wise, 2 roads..

    1: file storage
    2: database storage

    For a content management system, option 2 is preferred, as databases are generally faster, and much more versatile than file storage.

    Example of a content management system:

    User signs in, all his previous posts are editable, deletable, and if he wants, he can create a new post.

    All these posts and data are stored inside a database.
    The language used to interact with these databases is SQL.

    Useful links:

    http://www.w3schools.com/sql/default.asp
    http://www.w3schools.com/php/php_ref_mysql.asp
    http://www.intranetjournal.com/php-cms/
    http://www.tutorialized.com/tutorial...t-Management/1
    http://www.alistapart.com/articles/phpcms/ ** <-- looks good

    I hope some of that helped.. Good luck

  4. #3
    Member
    Join Date
    Apr 2006
    Posts
    45
    Member #
    13115
    You can always look for free scripts at hotscripts.com that would do the job for you. No need for you to start from scratch.

  5. #4
    Senior Member
    Join Date
    Apr 2006
    Posts
    146
    Member #
    13110
    Liked
    1 times
    here is a code i am going to try on my site, i havent tested it or fully finished it yet but here it is:

    PHP Code:
    <?php
    $filename 
    $POST_[link];
    $body $POST_[body];
    $name $POST_[title];
    $msg "<a href\"$filename\" target=\"f1\">$name</a><br>";
    $blog "blog/blog.txt";
    $pt "tutorials/php.html";
    $ht "tutorials/html.html";
    $ct "tutorials/css.html";
    $jt "tutorials/javascript.html";
    $gt "tutorials/gimp.html";
    $pht "tutorials/photoshop.html";
    $ft "tutorials/flash.html";
    $at "tutorials/actionscript.html";
    $mt "tutorials/math.html";
    $act "tutorials/autocad.html";


    if ((
    $_POST[kind] == "Main")) {
    $intoblog = @fopen($blog"a+") or die("could not add to blog");
    @
    fwrite($intoblog$body) or die("could not write to blog");
    fclose($intoblog);
    }
    else {
    $newfile = @fopen($filename"a+") or die("file could not be created");
    @
    fwrite($newfile$body) or die("could not write to file");
    fclose($newfile);
        if ((
    $_POST[kind] == "PHP Tutorial")) {
        
    $intophp = @fopen($pt"a+") or die("could not open php");
        @
    fwrite($intophp,$msg) or die("could not write to php");
        }
        else if ((
    $_POST[kind] == "HTML Tutorial")) {
        
    $intohtml = @fopen($ht"a+") or die("could not open html");
        @
    fwrite($intohtml,$msg) or die("could not write to html");
        }
        else if ((
    $_POST[kind] == "CSS Tutorial")) {
        
    $intocss = @fopen($ct"a+") or die("could not open css");
        @
    fwrite($intocss,$msg) or die("could not write to css");
        }
        else if ((
    $_POST[kind] == "Javascript Tutorial")) {
        
    $intojs = @fopen($jt"a+") or die("could not open javascript");
        @
    fwrite($intojs,$msg) or die("could not write to javascript");
        }
        else if ((
    $_POST[kind] == "Math Tutorial")) {
        
    $intomath = @fopen($mt"a+") or die("could not open math");
        @
    fwrite($intomath,$msg) or die("could not write to math");
        }
        else if ((
    $_POST[kind] == "GIMP Tutorial")) {
        
    $intogimp = @fopen($gt"a+") or die("could not open gimp");
        @
    fwrite($intogimp,$msg) or die("could not write to gimp");
        }
        else if ((
    $_POST[kind] == "Photoshop Tutorial")) {
        
    $intocs2 = @fopen($pht"a+") or die("could not open photoshop");
        @
    fwrite($intocs2,$msg) or die("could not write to photoshop");
        }
        else if ((
    $_POST[kind] == "Autocad Tutorial")) {
        
    $intoauto = @fopen($act"a+") or die("could not open autocad");
        @
    fwrite($intoauto,$msg) or die("could not write to autocad");
        }
        else if ((
    $_POST[kind] == "Actionscript Tutorial")) {
        
    $intoaction = @fopen($at"a+") or die("could not open actionscript");
        @
    fwrite($intoaction,$msg) or die("could not write to actionscript");
        }
        else if ((
    $_POST[kind] == "Flash Tutorial")) {
        
    $intoflash = @fopen($ft"a+") or die("could not open flash");
        @
    fwrite($intoflash,$msg) or die("could not write to flash");
        }
    }
    ?>


    I use filesystem access. Also, as expected you will have to edit the code but if you edit it right it should work.


    cheers

  6. #5
    Senior Member
    Join Date
    Apr 2006
    Posts
    146
    Member #
    13110
    Liked
    1 times
    Almost forgot, here is the code were you type in the updates:

    Code:
    <html>
    <head></head>
    <body>
    <center>
    <form method="post" action="submit.php">
        File Path: <input type="text" value="link" name="link"><br />
        Name: <input type="text" value="title" name="title"><br />
        Body: <textarea name="body" cols="65" rows="10" wrap="virtual"></textarea><br />
        <input type="radio" name="kind" value="PHP Tutorial">PHP Tutorial<br />
        <input type="radio" name="kind" value="HTML Tutorial">HTML Tutorial<br />
        <input type="radio" name="kind" value="Javascript Tutorial">Javascript Tutorial<br />
        <input type="radio" name="kind" value="CSS Tutorial">CSS Tutorial<br />
        <input type="radio" name="kind" value="Math Tutorial">Math Tutorial<br />
        <input type="radio" name="kind" value="GIMP Tutorial">GIMP Tutorial<br />
        <input type="radio" name="kind" value="Photoshop Tutorial">Photoshop Tutorial<br />
        <input type="radio" name="kind" value="Autocad Tutorial">Autocad Tutorial<br />
        <input type="radio" name="kind" value="Actionscript Tutorial">Actionscript Tutorial<br />
        <input type="radio" name="kind" value="Flash Tutorial">Flash Tutorial<br />
        <input type="radio" name="kind" value="Main">Main<br />
        <input type="submit" value="submit">
    </form>
    </center>
    </body>
    </html>

  7. #6
    Senior Member
    Join Date
    May 2003
    Location
    UK
    Posts
    2,354
    Member #
    1326
    1: Near the top of your code, you have $POST.
    At the bottom, you have $_POST. The bottom is correct. Whereever you have $POST change it to $_POST

    2: Where you have $_POST[kind], it should be $_POST['kind'] (single quotes around the form element name's value).

    3: Same with these,
    PHP Code:
    $filename $POST_[link];
    $body $POST_[body];
    $name $POST_[title]; 
    Should be
    PHP Code:
    $filename $_POST['link'];
    $body $_POST['body'];
    $name $_POST['title']; 
    Good luck, post back with your results if you have trouble.

  8. #7
    Senior Member
    Join Date
    Apr 2006
    Posts
    146
    Member #
    13110
    Liked
    1 times
    thank you very much


Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 05:04 AM.
Powered by vBulletin® Version 4.2.3
Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com