Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jan 2006
    Thanked 0 Times in 0 Posts

    PHP Access / Posting scripting

    Hey, I just started out with PHP and what not and I was wondering a few things.
    My plan is to create a access page where I can sign into my site from any where and post on it. My method was to have the homepage look via PHP for a file on the server and load the contents into that section [an embedded PHP script]. The way I hoped this file could be placed there was by a php page [that requires a password sign-in]that has 2 text fields, one that is for the title, and one for the content. When I click post / save, the title is in one fale and the content is in another. when the homepage loads it loads the title file into an appropiate place, and it loads the content into the appropiate space. The attempt I am going for is quite similar to a blog.
    However, I am not sure which scripting commands / methods to use. If anyone could please help me this would be appreciated. I looked at the FAQ tutorial but since I am a PHP n00b I am not positive on how to impliment this..
    would something for loading the titles work
    <?PHP $title = fopen('title.txt', 'r)' print $title; ?>
    Last edited by Gordie; 01-05-2006 at 07:09 AM.

  • #2
    Senior Coder
    Join Date
    Apr 2005
    Thanked 0 Times in 0 Posts
    use a database.

    find the database technology you wish to use (i.e mySQL) and create a table on the database. call the table whatever you want (descriptive names are best).

    then in php you will need to lookup running query's.

    i find the PEAR db object to be fairly simple enough to use.

    after connecting to the DB you will run something like this to return all titles.

    PHP Code:
    $sql "SELECT * FROM table_name ORDER BY id ASC";
    $results $db_object->query($sql);
    $item $results->fetchRow()){
    $item['title'] . "<br />";

    public string ConjunctionJunction(string words, string phrases, string clauses)
    return (String)(words + phrases + clauses);
    <--- Was I Helpfull? Let me know ---<


    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts