Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6
This is the forum to discuss the Wrox book Beginning PHP, Apache, MySQLWeb Development by Michael K. Glass, Yann Le Scouarnec, Elizabeth Naramore, Gary Mailer, Jeremy Stolz, Jason Gerner; ISBN: 9780764557446
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old September 2nd, 2004, 09:36 PM
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 12 - useraccount.php

Starting from the admin page.
I click on user I want to administer.
The "Modify Account" page is displayed.

The form field for name will only display the Admin name, and not the user I am modifying. I know at the top of the page the variables emptied. but for some reason the variable for name is not being assigned the proper value by the array. I tried some echos to see what the variable values were after they were assigned by the array. (echos were after the call to the header.php file. Every other value that is being returned is correct except for the name. I check the MySQL tables and every thing looks correct. I only have one admin, and one user in the db at this time. The only way I can seem to get the form field to display the users name that I am attempting to modify is to change the variable from $name to $uname as follows:

Code:
$name = $row['name'];
to
Code:
$uname = $row['name'];
And

Code:
echo htmlspecialchars($uname);
in the input field value setting.

Can someone explain why the variable $name is not being assigned properly by the query? Is the $name variable being somehow overwritten from the session?


There is no such thing as a stupid question, unless you ask it more than once :)
Reply With Quote
  #2 (permalink)  
Old September 3rd, 2004, 08:49 AM
Authorized User
 
Join Date: Jun 2004
Location: , , .
Posts: 37
Thanks: 0
Thanked 0 Times in 0 Posts
Default

One thing to look at: check your php.ini file to see if register_globals is enabled. If so, disable them.

Reply With Quote
  #3 (permalink)  
Old September 3rd, 2004, 02:48 PM
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes register_globals is off. PHP Version is 4.3.8, therefore its off by defauilt. I checked to be sure that it was off.

There is no such thing as a stupid question, unless you ask it more than once :)
Reply With Quote
  #4 (permalink)  
Old September 3rd, 2004, 02:53 PM
Registered User
 
Join Date: Sep 2004
Location: , , .
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Nevermind that last post. register_globals is off on my test server. BUT, it is on at my hosted site. have not clue why they changed the default to on its the same version I have on my local test server. anyhow, as soon as I added an htaccess file that turned register_globals off to the folder this script resides in, it worked fine. thanks!

There is no such thing as a stupid question, unless you ask it more than once :)
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 13, useraccount.php karlgg BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 4 February 16th, 2010 08:23 AM
chapter 12 modified register.php problem GOUR CHANDRA PAUL BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 June 6th, 2006 03:41 PM
begin php & mysql - chapter 12, user_form.php jon_stubber Beginning PHP 1 March 9th, 2006 09:57 AM
Chapter 12 update_account.php file andrene BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 0 July 25th, 2005 07:00 PM
Chapter 12 Transact-Article.php czambran BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 June 17th, 2004 01:58 PM



All times are GMT -4. The time now is 02:00 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.