I have been developing a web-based app for the last couple days and, out of the blue, my forms stopped posting any information. It happens across multiple browsers (firefox, chrome, safari). The strange part is up until yesterday, everything worked perfectly. I need new eyes on the page to maybe see something wrong, because I am baffled.
Major problem: When the form is submitted, $_POST['whatever'] always returns NULL.
<?php
session_start();
include('functions.php');
var_dump($_POST['todo']); //returning NULL
var_dump($_POST['amount']); //returning NULL
if(isset($_POST['todo']))
{
$todo='';
$todo=$_POST['todo'];
if($todo=='sellItem')
{
sellItem($_POST['type'],$_POST['flavor'],$_POST['amount']);
}
elseif($todo=='test'){
clearList();
$_SESSION['itemList']=array();
}
elseif($todo=='cashOut'){
itemListParse();
}
}
if(!isset($_SESSION['itemList']))
{
$_SESSION['itemList']=array();
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Comemos Register</title>
<meta name="" content="">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<meta name = "viewport" content = "width = device-width">
<meta name = "viewport" content = "initial-scale = 1.0">
<meta name = "viewport" content = "initial-scale = 2.3, user-scalable = no">
<link rel="stylesheet" href="css/visibleIf.css" type="text/css" />
<script type="text/javascript" src="js/EventHelpers.js">
</script>
<script type="text/javascript" src="js/visibleIf.js">
</script>
</head>
<body>
<div id="wrapper" style="width='100%'">
<?php
if($todo=='processJerky')
{
processJerky($_POST['amount']);
}else{ // If the jerky form isn't called, put up register ?>
<form name="jerky1" method="post" action="#">
<input type="hidden" name="amount" value=".1"/>
<input type="hidden" name="type" value="jerky" />
<input type="hidden" name="todo" value="processJerky" />
<input type="submit" name="submit" value="1/10#" />
</form>
<form name="jerky25" method="post" action="#">
<input type="hidden" name="amount" value=".25"/>
<input type="hidden" name="type" value="jerky" />
<input type="hidden" name="todo" value="processJerky" />
<input type="submit" name="submit" value="1/4#" />
</form>
<form name="jerky5" method="post" action="#">
<input type="hidden" name="amount" value=".5"/>
<input type="hidden" name="type" value="jerky" />
<input type="hidden" name="todo" value="processJerky" />
<input type="submit" name="submit" value="1/2#" />
</form>
<form name="jerky10" method="post" action="#">
<input type="hidden" name="amount" value="1"/>
<input type="hidden" name="type" value="jerky" />
<input type="hidden" name="todo" value="processJerky" />
<input type="submit" name="submit" value="1#" />
</form>
<?php } //Closes else statement (when nothing to do)
echo totalJerky().'lbs of jerky costs $'.jerkyCost();
//var_dump($_SESSION['itemList']); // Dumps item list for debuging
?>
<form name="clearCart" method="post" action="#">
<input type="hidden" name="todo" value="test" />
<input type="submit" name="submit" value="Empty Cart" />
</form>
<form name="cashOut" method="post" action="#">
<input type="hidden" name="todo" value="cashOut" />
<input type="submit" name="submit" value="Cash Out" />
</form>
<?php showJerky();?>
</div>
</body>
</html>