...

View Full Version : $_POST not working for some odd reason



SDP2006
10-07-2003, 09:23 PM
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=Stevie&date=Tue%2C+October+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
$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

missing-score
10-07-2003, 09:29 PM
hmmm... have you specified a method for your form, as i think it is set automatically to GET

SDP2006
10-07-2003, 09:36 PM
:p Such a simple solution. I should have known! Yes, I didn't specify method="POST"

Thanks,



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum