Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
|
Beginning PHP Beginning-level PHP discussions. More advanced coders should post to the Pro PHP forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning PHP 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 November 22nd, 2003, 06:05 AM
Registered User
 
Join Date: Nov 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mespejo Send a message via Yahoo to mespejo
Default Can't display input variable passed on to php code

I have read similar problems posted on this forum regarding not being able to display input value called from html form & passed on to php - refer to the code below. I have tried the following recommendation but still can't make it work.

1) set "register_globals=off" in php.ini.
2) have used "$_GET[]" to display variable.

I'm running IIS 5.0 on W2K & PHP v4.3.4.

Any other idea?

HTML code:
-------------------------
<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>


PHP code:
-------------------------
<html>
<head></head>
<body>
Your favourite author is:
<?php
echo $_GET['Author'];
?>
</body>
</html>

 
Old November 22nd, 2003, 03:41 PM
richard.york's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

If that doesn't work then perhaps you have a problem with how PHP is set-up.

Can you see output from this script?:

<?php
phpinfo();
?>

: )
Rich


:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::
 
Old November 25th, 2003, 03:32 PM
Registered User
 
Join Date: Nov 2003
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to mespejo Send a message via Yahoo to mespejo
Default

Hi Rich,
Thanks for your input. PHP was reinstalled and now it's working perfectly.






Similar Threads
Thread Thread Starter Forum Replies Last Post
I need help with php variable passed to perl... nriv08 Beginning PHP 0 October 9th, 2008 12:54 PM
Global variable passed from s/proc not accepted ssharrock SQL Server DTS 1 February 24th, 2005 12:28 AM
PHP Session passed to different sub domains h8dk97 Pro PHP 3 November 6th, 2003 10:20 PM
form data not passed to php keng BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 2 September 4th, 2003 09:15 AM
Display bar code in a Form using user input text? phoenixcu Access VBA 1 June 6th, 2003 02:39 AM





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