You are currently viewing the BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
I have just started with this book and
something is strange here. In chapter 3
page 76 / 79 Get is explained there.
If I input an author and i press Submit Query
I go to text.php. In the adressline I see this
file:\\\e:\cwindows\desktop\text.php?author=megumi +hayashibara,
but the page is totally blank.
If I use POST instead of GET then I will get an output.
Can someone please help me?
this is the source from text.html:
<html>
<head>
<title>Forms</title>
</head>
<body>
<form METHOD=GET action="text.php">
Who is your favourite singer?
<input Name="singer" type="Text">
<br>
<br>
<input type=submit>
</form>
</body>
</html>
and this is from text.php:
<html>
<head></head>
<body>
Your favorite Singer is:
<?php
echo $singer;
?>
<p>
Answer again right <a href="text.html">here</a>
</body>
</html>
Add this line before echo $singer;
$singer=$_GET['singer'];
That line guarantee that variable $singer contains the value from the query string's part named "signer".