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 November 17th, 2004, 09:53 PM
Registered User
 
Join Date: Nov 2004
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to aboo Send a message via Yahoo to aboo
Default Help on sending data between forms

We can use GET or POST to transfer data between PHP files. But, as per the text "Beginning PHP4, we can access the variables passed just by calling as follows.

     Form1 :

                In a form $Author has a value and we use GET method to submit it.

             In the receiving form I tried to access the variable but it says : Author undeclared. I checked the Case. It is correct. And the URL is having the variable included. But no result.

         It works when I access the variable as follows:

                 $_GET['Author']


Please help
 
Old December 7th, 2004, 03:47 PM
Authorized User
 
Join Date: Dec 2004
Posts: 53
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to peg110
Default

First of all the reason it's undeclared, is, I suspect you are posting to the $PHP_SELF thus the first time you get to the page no value is passed and thus the variable is Undeclared (until it actually contains data)

You can control this by adjusting level of error reporting. You can either change that in the PHP.INI or you can suppress the error a couple of ways. You can change

$_GET['Author'] to @$_GET['Author']

or you can use many functions to check the variable such as the isset() or emtpy() function.
http://us2.php.net/manual/en/function.isset.php
http://us2.php.net/manual/en/function.empty.php

These will prevent the throwing of an error (I believe that they are only NOTICE type errors too.)

Hope this helps

Paul Gardner
------------------
PHP-LIVE help
Via Web @ http://www.mnetweb.co.uk/irc
Via IRC Client pgardner.net:6667
room #PHP





Similar Threads
Thread Thread Starter Forum Replies Last Post
problem in e-mail structure sending data from data tiawebchd General .NET 3 May 5th, 2008 08:07 AM
Sending info to HTML forms.... Sildaekar C++ Programming 0 April 2nd, 2007 01:24 PM
Sending data between 2 computers u3 Pro PHP 3 September 15th, 2005 07:34 PM
Sending data to next page (C#) shazia1 VS.NET 2002/2003 2 June 30th, 2005 03:24 AM
Sending data to next page (C#) shazia1 VS.NET 2002/2003 1 June 29th, 2005 09:45 PM





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