SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Jul 2000
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I keep getting a parse error on this line in the page:
    <form action="<?php echo($PHP_SELF): ?>" method=post>

    Here are the surrounding things:
    // Get lists of authors and categories for the select box and checkboxes.
    $authors = mysql_query("select id, name from authors");
    $cats = mysql_query("select id, name from categories);
    ?>

    <form action="<?php echo($PHP_SELF): ?>" method=post>
    <p>Edit the joke:<br>
    <textarea name="joketext" rows 15 cols=45 wrap><?php echo($joketext); ?> </textarea>
    <p>Author: <select name="aid" size=1>
    <?php
    while ($author = mysql_fetch_array($authors)) {
    $aid = $author["id"];
    $aname = $author["name"];
    if ($aid == $authid) {
    echo("<option selected value-'$aid'>$aname\n");
    } else {
    echo("<option value='$aid'>$aname\n");
    }
    }
    ?>
    </select>

    I have tested all the other pages and this is the only one I am having a problem with...

    TIA
    Yvonne


    ------------------
    ~~~~~~~~~~~~~~~~
    "It's the question that drives us..."
    -- Trinity, from The Matrix

  2. #2
    SitePoint Wizard
    Join Date
    Jul 1999
    Location
    Chicago
    Posts
    2,629
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This is an easy one! Just change the ':' in the line you showed us to ';' .

    <form action="<?php echo($PHP_SELF): ?>" method=post>

    Changes to..

    <form action="<?php echo($PHP_SELF); ?>" method=post>

  3. #3
    SitePoint Member
    Join Date
    Jul 2000
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dang! I can't believe that got posted like that...

    Well, it always had the semicolon, I just copied it wrong somehow, soo, it still doesn't work. 8(

    Yvonne

  4. #4
    SitePoint Author Kevin Yank's Avatar
    Join Date
    Apr 2000
    Location
    Melbourne, Australia
    Posts
    2,571
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You're missing a quote at the end of your SQL query:

    $cats = mysql_query("select id, name from categories);

    See it?


    ------------------
    -Kevin Yank.
    http://www.SitePoint.com/
    Helping Small Business Grow Online!


Bookmarks

Posting Permissions

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