Jump to content

[SOLVED] POST value is blank


jeff5656

Recommended Posts

In the editcurrent.php the value for which_month is blank:

 

include ("../connectdb.php");

$curr_month = $_POST['which_month'];
$consultsq1 = "SELECT * FROM `staffsched` WHERE `which_month`='".$curr_month."'";
$result = mysql_query ($consultsq1) or die ("Invalid query: " . mysql_error ());
$row = mysql_fetch_array ($result);
?>

 

Here is the form that sends that value:

<form name="pickmonth" method="post" action="editcurrent.php"><input type="hidden" name ="which_date" value="<?php echo $row['which_month']; ?>"/>  <input type="submit" value="Edit"/></form>

 

FYI, when I echo $row['which_month'] in this form, I do get the correct current month.

Link to comment
https://forums.phpfreaks.com/topic/134537-solved-post-value-is-blank/
Share on other sites

The POST Variable that is looking for is the name of your hidden input

 

change your hidden input's name to which_month...

 

<form name="pickmonth" method="post" action="editcurrent.php"><input type="hidden" name ="which_month" value="<?php echo $row['which_month']; ?>"/>  <input type="submit" value="Edit"/></form>

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.