i dont recieve values in $_POST variables in all browsers except IE, it works in in IE well.
<form name="form_editoffs" method="post" action="editoffs.php" onsubmit="return validation();">
<input type="text" name="txt_date" id="txt_date" size="20" value="<?php echo $row['offs_date'];?>" readonly="readonly" />
<input type="text" name="txt_desc" id="txt_desc" size="75" value="<?php echo $row['offs_desc'];?>" />
<input type="submit" value="Update" name="btn_submit" />
</form>
<?php
if(isset($_POST['btn_submit']))
{
$offsh = null;
$offsd = null;
if(empty($_POST['txt_date']) || empty($_POST['txt_desc']))
{
echo $_POST['txt_date'];
echo $_POST['txt_desc'];
//echo "<font face='calibri' size=2>Please enter date or event/description</font>";
}
else
{
$offsh = $_POST['txt_date'];
$offsd = $_POST['txt_desc'];
}
$offsh = addslashes($offsh);
$offsd = addslashes($offsd);
}
?>
dont recieve values in $_POST variables
Moderator: General Moderators
-
internet-solution
- Forum Contributor
- Posts: 220
- Joined: Thu May 27, 2010 6:27 am
- Location: UK
Re: dont recieve values in $_POST variables
Since the issue is different in different browsers, my guess is that it is a javascript issue. Can you post your javascript function validation() ?
- phdatabase
- Forum Commoner
- Posts: 83
- Joined: Fri May 28, 2010 10:02 am
- Location: Fort Myers, FL
Re: dont recieve values in $_POST variables
Just as a general debugging note:
When I have this problem (and I do, a lot) I have a hunk of code I put at the top of the page that receives the FORM code.
Here it is:
echo"<pre>";
print_r($_POST);
print"</pre>;
First thing is find if the fault is in the form or the processing code.
When I have this problem (and I do, a lot) I have a hunk of code I put at the top of the page that receives the FORM code.
Here it is:
echo"<pre>";
print_r($_POST);
print"</pre>;
First thing is find if the fault is in the form or the processing code.
Re: dont recieve values in $_POST variables
My dump_array function does this, and includes file & line numbers so you don't forget where you called it from.phdatabase wrote:Just as a general debugging note:
When I have this problem (and I do, a lot) I have a hunk of code I put at the top of the page that receives the FORM code.
Here it is:
echo"<pre>";
print_r($_POST);
print"</pre>;
First thing is find if the fault is in the form or the processing code.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.