Form not passing data to php
Posted: Tue Jun 23, 2009 3:11 am
I am running on Mac OS leopard and I dont get the user input from the form when I try to access the variables in my php file
I have a simple html as follows
My process.php is as follows
the output I get when I enter some input value in the form and click submit is
something weird like below
'; ?>
can someone tell me what is wrong here ??...
I have simple php files working, have problems only when I try to access data from a html via POST or GET, I am not getting any data
I have spent several hours on this so far
Thanks
I have a simple html as follows
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html><body>
<h4>Tizag Art Supply Order Form</h4>
<form action="process.php" method="post">
<select name="item">
<option>Paint</option>
<option>Brushes</option>
<option>Erasers</option>
</select>
Quantity: <input name="quantity" type="text" />
<input type="submit" />
</form>
</body></html>
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html><body>
<?php
$quantity = $_POST['quantity'];
$item = $_POST['item'];
echo 'You ordered '. $quantity . ' ' . $item . '.<br />';
?>
</body></html>
something weird like below
'; ?>
can someone tell me what is wrong here ??...
I have simple php files working, have problems only when I try to access data from a html via POST or GET, I am not getting any data
I have spent several hours on this so far
Thanks