undefined index and constant!

Problems with the Windows version of XAMPP, questions, comments, and anything related.

undefined index and constant!

Postby laxabot » 22. November 2013 09:02

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’];
?>
laxabot
 
Posts: 1
Joined: 22. November 2013 08:55
Operating System: windows 7

Re: undefined index and constant!

Postby Altrea » 22. November 2013 14:54

Hi,

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

Best wishes,
Altrea
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 8297
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 10 Pro x64


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 52 guests