Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > Beginning PHP
| Search | Today's Posts | Mark Forums Read
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
  #1 (permalink)  
Old January 25th, 2004, 04:48 PM
Registered User
 
Join Date: Jan 2004
Location: Ikoyi, Lagos, Nigeria.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Beginning PHP Chapter 3-


I used text.html to get info from text.php. Each time I clicked Submit Query, it brings the text.php page, but without the information. But with the message:
"Your Favourite authur is:
 Notice: Undefined variable : Authur in C:\inetpub\wwwroot\text.php on line 6"

I checked on the codes again and again, but everything is as it is in the Book. Could it be a mistake in the code. Please look into it, because I am a biginner in PHP. This same applies to all the examples in this Chapter, which are Check Box, TextArea, etc.
  #2 (permalink)  
Old January 25th, 2004, 05:19 PM
richard.york's Avatar
Wrox Author
Points: 5,506, Level: 31
Points: 5,506, Level: 31 Points: 5,506, Level: 31 Points: 5,506, Level: 31
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Camby, IN, USA.
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
Default

Hi, the problem relates to the register_globals directive.

The solution is you must access the variable in the $_POST superglobal array, and not as a global variable...

So $_POST['Authur'] instead of $Authur if the method attribute of your html form is set to post.

Or $_GET['Authur'] instead of $Authur if the method attribute of your html form is set to get.

Here is the most important URL you will ever need when dealing with PHP:
http://www.php.net/manual/en/index.php

Here is the specific page on super-global variables:
http://www.php.net/manual/en/languag...predefined.php

A page discussing why register_globals is a potential security risk:
http://www.php.net/manual/en/securit...terglobals.php

More topics on p2p that discuss this:
http://www.google.com/search?q=regis...e:p2p.wrox.com

: )
Rich

:::::::::::::::::::::::::::::::::
Smiling Souls
http://www.smilingsouls.net
:::::::::::::::::::::::::::::::::


Similar Threads
Thread Thread Starter Forum Replies Last Post
chapter 10 Emailing with php - firstmail.php vijdev BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 July 19th, 2007 01:12 AM
begin php & mysql - chapter 12, user_form.php jon_stubber Beginning PHP 1 March 9th, 2006 10:57 AM
Beginning PHP: CH17, PHP Directory cyberjacky Beginning PHP 1 March 12th, 2004 11:39 AM
Beginning php 4 chapter 10 problems dakey Beginning PHP 3 February 13th, 2004 06:21 PM
Beginning php 4 chapter 10 problems ade Beginning PHP 2 June 19th, 2003 02:43 PM





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