Find the answer to your Linux question:
Results 1 to 4 of 4
mysql script wont' run "post" section here is the script from demo on webblazonry If I remove the if post then do I can force an update to the mysql ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Mar 2003
    Location
    USA
    Posts
    18

    mysql


    mysql script wont' run "post" section
    here is the script from demo on webblazonry

    If I remove the if post then do I can force an update to the mysql database by giving the variables assignments (instead of using form)

    but why will it not run if I try to use the form
    any ideas?
    thanks
    slam



    </HEAD>
    <BODY BGCOLOR="#FFFFFF">



    <FONT SIZE=5> Add Link </FONT></P>

    <?php
    # this is processed when the form is submitted
    # back on to this page (POST METHOD)
    echo ("hpre"); echo("$REQUEST_METHOD");
    if ($REQUEST_METHOD=="POST") {
    echo ("hi");
    # double-up apostrophes
    $description = str_replace("'","''",$description);
    $sitename = str_replace("'","''",$sitename);

    # setup SQL statement
    $SQL = " INSERT INTO links ";
    $SQL = $SQL . " (category, sitename, siteurl, description) VALUES ";
    $SQL = $SQL . " ('$category', '$sitename','$siteurl','$description') ";

    #execute SQL statement
    $result = mysql_db_query($db,"$SQL",$cid);

    # check for error
    if (!$result) { echo("ERROR: " . mysql_error() . "\n$SQL\n"); }

    echo ("

    New Link Added</P>\n");

    }

    ?>

  2. #2
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    What's the output from the script when you post to it?

  3. #3
    Just Joined!
    Join Date
    Mar 2003
    Location
    USA
    Posts
    18

    form

    it just shows the form again.

  4. $spacer_open
    $spacer_close
  5. #4
    Linux Guru
    Join Date
    Oct 2001
    Location
    Täby, Sweden
    Posts
    7,578
    It must at least display "hpre" also, right?

Posting Permissions

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