Page 1 of 1

undefined index and constant!

PostPosted: 22. November 2013 09:02
by laxabot
Hi everyone, I'm new to php and i just cant figure this out. when i click submit it returns me these errors:

Notice: Use of undefined constant ‘tireqty’ - assumed '‘tireqty’' in C:\xampp\htdocs\amit\process.php on line 6
Notice: Undefined index: ‘tireqty’ in C:\xampp\htdocs\amit\process.php on line 6
Notice: Use of undefined constant ‘oilqty’ - assumed '‘oilqty’' in C:\xampp\htdocs\amit\process.php on line 7
Notice: Undefined index: ‘oilqty’ in C:\xampp\htdocs\amit\process.php on line 7
Notice: Use of undefined constant ‘plugqty’ - assumed '‘plugqty’' in C:\xampp\htdocs\amit\process.php on line 8
Notice: Undefined index: ‘plugqty’ in C:\xampp\htdocs\amit\process.php on line 8

here are my codes.

HTML:
<html>
<body>
<form action=process.php method=”post”>
<label for="tire">Tire</label>
<input type="text" name="tireqty" id="tire"/><br/>
<label for="oil">Oil</label>
<input type="text" name="oilqty" id="oil"/><br/>
<label for="plug">Plugs</label>
<input type="text" name="plugqty" id="plug"/><br/>
<input type="submit" value="submit"/>
</form>
</body>
</html>

PHP:
<?php
$tireqty = $_POST[‘tireqty’];
$oilqty = $_POST[‘oilqty’];
$plugqty = $_POST[‘plugqty’];
?>

Re: undefined index and constant!

PostPosted: 22. November 2013 14:54
by Altrea
Hi,

You didn't use valid single quotes for the array keys.

Best wishes,
Altrea