Wrox Programmer Forums
|
BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5
This is the forum to discuss the Wrox book Beginning PHP4 by Wankyu Choi, Allan Kent, Chris Lea, Ganesh Prasad, Chris Ullman; ISBN: 9780764543647
Welcome to the p2p.wrox.com Forums.

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
 
Old February 14th, 2004, 07:11 PM
Registered User
 
Join Date: Feb 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default cannot pass parameters between forms

I run a linux red hat 9 server and am attempting to pass parameters between pages and nothing works. I am now down to the text.html and text.php with no luck. In fact none of the examples out of the book or off the web work. I know its me or my PHP setup. Can someone help the dummie here?
For your convenience:
Text.html
<HTML>
<HEAD></HEAD>
<BODY>
<FORM METHOD=GET ACTION="text.php">
Who is your favourite author?
<INPUT NAME="Author" TYPE="TEXT">
<BR>
<BR>
<INPUT TYPE=SUBMIT>
</FORM>
</BODY>
</HTML>


Text.php
<HTML>
<HEAD></HEAD>
<BODY>
Your favorite author is:
<?php
echo $Author;
?>
</BODY>
</HTML>

Thanks in advance for your help!
Ron;)
 
Old February 15th, 2004, 09:25 AM
Registered User
 
Join Date: Feb 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to reign
Default

Hi Ron,

I have the same problem and going through the history of topics found this suggestion from Nikolai.

http://p2p.wrox.com/archive/beginnin...2002-11/17.asp
http://p2p.wrox.com/archive/beginnin...2002-09/63.asp
http://p2p.wrox.com/archive/beginning_php/2003-02/3.asp
http://p2p.wrox.com/topic.asp?TOPIC_ID=4017

I will work on it now and let you know if I got it to work.

Reign

- Something is for free, if you never have to pay for it -
 
Old February 15th, 2004, 09:57 AM
Registered User
 
Join Date: Feb 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to reign
Default

Changing the echo command to:

Your Favourite Author is:
<?php
echo $_GET['Author'];
?>

Did the trick on my server. (winxp / IIS)



- Something is for free, if you never have to pay for it -
 
Old February 15th, 2004, 05:12 PM
Registered User
 
Join Date: Feb 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to reign
Default

You can do the same thing with the $_POST['variable'];
statement. Now I've ran into some other problems with this problem, so right now I'm using a trick to declare a value in the beginning of my statements giving the name as they appear in the book. for example on page 117 my php code reads following:

<?php
$Question1 = $_POST['Question1'];
if ($Question1=="Lisabon") echo "You are Correct, Lisabon is the right Answer";
if ($Question1!="Lisabon") echo "You are incorrect, Lisabon is the right Answer";
?>

Note that there's a typo in the book with the second answer.
Hope this helps you.

- Something is for free, if you never have to pay for it -





Similar Threads
Thread Thread Starter Forum Replies Last Post
how to pass parameters in Crystal to subreports vayrapetov BOOK: Professional Crystal Reports for VS.NET 0 November 1st, 2007 09:37 AM
How to Pass parameters from JSP to ASP mrdesai Classic ASP Professional 2 June 17th, 2005 04:54 AM
to pass parameters rashmid HTML Code Clinic 1 May 30th, 2005 11:10 PM
How I can pass parameters to 2 ASP files at ones? zukit Classic ASP Databases 4 December 15th, 2004 05:20 AM
how to pass arrays as parameters ??? mrrgupta JSP Basics 2 October 23rd, 2004 06:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.