Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    May 2003
    Location
    34° 54' N 82° 13' W
    Posts
    996
    Thanks
    0
    Thanked 0 Times in 0 Posts

    $_POST not working for some odd reason

    This is the first time I have had trouble with this. For some reason they are showing up in the Address bar of my browser like http://www.mydomain.com/ins.php?name...ober+7%2C+2003 etc.etc.

    Like I said, this is the first time I have ever had trouble with this..
    Here is the code I am working with
    PHP Code:
    <?php
    $thename 
    $_POST['name'];
    $thedate $_POST['date'];
    $thesubject $_POST['subject'];
    $themail $_POST['email'];
    $thenews $_POST['thenews'];
    include (
    'config.php');
    $link = @mysql_pconnect($location$username$password)
          or die(
    "Could not connect to the databaseserver. Please go back and try again or try again later.");
    @
    mysql_select_db($database$link)
          or die (
    "Could not select database. Please go back and try again or try again later.");
    $sql_insert "INSERT INTO News(Name,Date,Subject,Email,TheNews) VALUES('"$thename "','"$thedate ."','"$thesubject ."','" $themail ."','" $thenews ."')";
    $result mysql_query($sql_insert$link);
    echo (
    mysql_affected_rows($link) . " News entry sucessfully inserted!");
    echo (
    "<hr>");
    echo (
    "Here is what you just inserted -");
    echo (
    "<br>");
    echo 
    $thename
    echo (" | ");
    echo 
    $thedate
    echo ("<br>");
    echo 
    $thesubject
    echo ("<br>");
    echo 
    $thenews
    ?>
    Thanks
    Stevie Peele
    Neverside IRC Network - irc.veonex.net | tc.tutorialnetwork.org
    #dev - any programming,etc. question
    #design - design discussion and critque
    #central - general chat
    Come join us!

  • #2
    Senior Coder missing-score's Avatar
    Join Date
    Jan 2003
    Location
    UK
    Posts
    2,194
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hmmm... have you specified a method for your form, as i think it is set automatically to GET

  • #3
    Regular Coder
    Join Date
    May 2003
    Location
    34° 54' N 82° 13' W
    Posts
    996
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Such a simple solution. I should have known! Yes, I didn't specify method="POST"

    Thanks,
    Stevie Peele
    Neverside IRC Network - irc.veonex.net | tc.tutorialnetwork.org
    #dev - any programming,etc. question
    #design - design discussion and critque
    #central - general chat
    Come join us!


  •  

    Posting Permissions

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