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 PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0
This is the forum to discuss the Wrox book Beginning PHP5, Apache, and MySQL Web Development by Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz, Michael K. Glass; ISBN: 9780764579660
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 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 November 3rd, 2005, 07:55 PM
Registered User
 
Join Date: Apr 2005
Location: Anthony, New Mexico, USA.
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 13, useraccount.php

There seems to be a problem with the Modify Account function, in useraccount.php ... When you create an account, and modify the access level with an Administrator, the "Full Name" field is filled with your Admin's name field, instead of the account you're modifying. Therefore, if you change the access level and save it, you will change the new account's name to match your admin account!

What's worse, the screenshot in the book (page 456) shows this happening, the user "George Smith" gets modified, and "admin" is displayed in the edit box.

Changing the $name inside useraccount.php (I used $uname) fixes the functionality for it, but why is it happening? If there's a conflict with a global variable, why isn't the DB read overwriting YOUR logged-in-as name, instead of the other way around?

<SPAN ATTRIB="DORK">KarlGG</SPAN>
__________________
&lt;SPAN ATTRIB=\"DORK\"&gt;KarlGG&lt;/SPAN&gt;
Reply With Quote
  #2 (permalink)  
Old March 13th, 2008, 07:27 PM
Registered User
 
Join Date: Feb 2008
Location: , , .
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I ran into this same problem. From what I can tell, the $name variable gets set correctly, but when the require_once 'header.php' is issued after setting the variables, it releases $name for some reason.

Moving require_once 'header.php' to the top of the file (line 3) solved my problem.

Reply With Quote
  #3 (permalink)  
Old February 16th, 2010, 03:44 AM
Authorized User
 
Join Date: Feb 2010
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hey there,

Even weirder- I have had the useraccount.php working fine until I tried to set up the admin page! The first time I tried to modify a users details in the administrators login I ended up with that users name as the logged in name and since then once logged out any user that is logged in again it wont show any user name - till I try to modify a user acount then end up with that users name again..... I'm using Xampp with apache 2.4.14 AND PHP 5.3.1 on windows. Have checked php.ini and register globals is st to off. I've always had the $name changed to $username anyway and tried moving include header to the top as suggested above.....but alas still the same prrblem. I have to say I have modified the script from the book to fit into my own site so will now see if the same thing occurs using the code straight from the book.
Reply With Quote
  #4 (permalink)  
Old February 16th, 2010, 04:06 AM
Authorized User
 
Join Date: Feb 2010
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

ok, heres the rub... working fine in the book version.. but my code which is obviously very wrong i get this message...

Quote:
Warning: Unknown: Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively in Unknown on line 0
as i said before register globals is off... does that mean it should be on? considering im using php 5.3.1????

hmmmm... any thoughts anyone?
Reply With Quote
  #5 (permalink)  
Old February 16th, 2010, 08:23 AM
Authorized User
 
Join Date: Feb 2010
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

fixed it - typing error
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: Error in user.php pherank BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 July 4th, 2008 09:09 PM
Cahpter 13 remove.php Graham76 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 1 November 4th, 2004 12:33 PM
Chapter 12 - useraccount.php buzzuh BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 3 September 3rd, 2004 02:53 PM
chapter 13 of php4, user_auth.php Exitus BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 3 August 5th, 2004 09:02 AM
13. how can i execute a php script using command l phpsharma BOOK: Beginning PHP4/PHP 5 ISBN: 978-0-7645-4364-7; v5 ISBN: 978-0-7645-5783-5 3 October 31st, 2003 04:27 AM



All times are GMT -4. The time now is 12:11 PM.


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