Hello all!
I’m currently working my way through the above book, and I have come up against a problem when trying to use the example on page 82, introducing how URL query strings behave. I’m using the most up to date, non beta versions of PHP, Apache and MySQL and I have had no other issues with the examples so far, so with that said here we go;
welcome1.html contains the following;
<!DOCTYPE html PUBLIC "-W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>PHP and MySQL Training Test</title>
<meta http-equiv="content-type"
content="text/html; charset=utf-8"/>
</head>
<body>
<a href="welcome1.php?name=Kevin">Hi, I’m Kevin!</a>
</body>
</html>
and welcome1.php contains the following;
<!DOCTYPE html PUBLIC "-W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>PHP and MySQL Training Test</title>
<meta http-equiv="content-type"
content="text/html; charset=utf-8"/>
</head>
<body>
<?php
$name = $_GET['name'];
echo 'Welcome to our web site, '.name.'!';
?>
</body>
</html>
and when accessing welcome1.html and clicking the link on the page (to go to welcome.php) I get the following;
Notice: Use of undefined constant name - assumed 'name' in C:\\Program Files\\Apache Software Foundation\\Apache2.2\\htdocs\ raining\\welcome1.php on line 12
Welcome to our web site, name!
I’ve been looking at this for about an hour now and I expect that it is a very simple mistake but just can’t spot.
Any help that anyone could provide would be hugely appreciated.
Cheers