#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Randolph, NJ
    Posts
    36
    Rep Power
    15
    Ok. I have a basic script where the user adds their name, email, product name, and review of the product. Then I have a page that shows all of the entries in order of posted date. Now, I want the script to take the product name, and make a page for it, that pulls that row of the database. Here is the scenario.

    Name: Chris
    E-Mail: LaLa@LaLa.com
    Product: Red Balloons
    Review: Red balloons are the best. They are red and are really big balloons.

    Now, that row will be pulled on the reviews.php page (All variables except the review, which will be a link). reviews_add.php is the form page that posts to reviews_t.php that says thanks.

    On the reviews.php page, it shows the author name, email, product, and a link to the product page that PHP will make.

    Since the product is red balloons, PHP will make a page called red_balloons.php and will show the author, e-mail, product name, and the full review.

    That is the script. If it is unclear, send me an e-mail.

    If you can help me, help please. Any input is appreciated. If it can be done easier so that the review is viewed separately, let me know. Thank you in advance!!

    ------------------
    ================
    -Khill, www.tsrealm.com
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2000
    Location
    Randolph, NJ
    Posts
    36
    Rep Power
    15
    Here is an update...

    Ok. I have a review script where users can type in a review and it will be saved and viewed on a separate page. From a friend I got this scenario.

    reviews.php?a=add would be the page to add a review with the form fields of name, email, product, and review

    reviews.php?a=view would pull the name, email, and product name as well as a link to the full review (at the following address)

    reviews.php?a=view&id=0001 this would be the id number of the review and this page would have the name, email, product, and full review. the sql table would have an auto increment number so that all of the entries will be numbered and can be called

    I hope this is clear. I get the concept, but I am no to sure how to set up the reviews.php?a=add part...Do I use If statements? If you could help it would be greatly appreciated! Thanks.

    ------------------
    ================
    -Khill, www.tsrealm.com
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Location
    London/UK
    Posts
    91
    Rep Power
    15
    make a function for each 'bit' that you want to do

    i.e. add/edit/view

    then use the switch() function

    so you could do:
    <?
    switch($a) {

    case 'view':
    view_stuff();
    break;

    case 'edit':
    edit_stuff();
    break;

    case 'add':
    add_stuff_to_db();
    break;

    default:
    #stuff that happnes if the page is loaded with no $a set
    show_record_list();
    }

    ?>

    hth

    Bealers

    ------------------
    http://back-end.org

Similar Threads

  1. php script won't work inside "cgi-local" directory
    By Volitics in forum PHP Development
    Replies: 5
    Last Post: April 26th, 2004, 11:50 PM
  2. Perl script converting GIF and JPG images to BMP ???
    By Deanna475 in forum Perl Programming
    Replies: 20
    Last Post: February 17th, 2004, 07:35 PM
  3. iptables changed after S10network script
    By hunt3r in forum Linux Help
    Replies: 0
    Last Post: February 11th, 2004, 04:51 AM
  4. Replies: 2
    Last Post: February 11th, 2004, 12:03 AM
  5. How can I enable a power user to run this script?
    By Yamadatroy in forum Visual Basic Programming
    Replies: 2
    Last Post: January 19th, 2004, 10:39 PM

IMN logo majestic logo threadwatch logo seochat tools logo