Randy
-
Posts
4 -
Joined
-
Last visited
Posts posted by Randy
-
-
windows 7 x64
php v 5.3.1
MySQL client version: 5.1.41
XAMPP for Windows 1.7.3
Any one have any modifications suggestions to the login script (script 4.3 page 146) to avoid the headers already sent warning?
I'm using the downloaded script and am having issues figuring this one out.
Warning: session_regenerate_id() [function.session-regenerate-id]: Cannot regenerate session id - headers already sent in C:\xampp\xampp\php\PEAR\Auth.php on line 830
Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\xampp\htdocs\PHP5Advanced\phpvqp2_scripts\Ch04\login.php:50) in C:\xampp\xampp\php\PEAR\Auth.php on line 85
Thanks
-
Larry,
Thanks for the response. I've figured it out (after a bit more debugging and using phpmyadmin). This wan't a MYSQL DATA privilege (select, insert, update, delete, or file) it was a STRUCTURE issue in the privileges. The only thing I toggled on was the Execute without the Executue on it doesn't work.
GRANT SELECT , INSERT , UPDATE , DELETE , FILE , EXECUTE ON * . * TO 'username'@'localhost' (or 'someuser' or whoever)
Else you get this error
Warning: mysqli_query() [function.mysqli-query]: (42000/1370): execute command denied to user 'username'@'localhost' for routine 'zips.return_distance' in C:\xampp\xampp\htdocs\PHP5Advanced\Chapter3\distance.php on line 99~Andy
-
windows 7 x64
php v 5.3.1
MySQL client version: 5.1.41
I was trying to get this:
"SELECT name, CONCAT_WS('<br />', address1, address2), city, state, stores.zip_code, phone, store_image,ROUND(return_distance($lat, $long, latitude, longitude)) AS distance FROM stores LEFT JOIN zip_codes USING (zip_code) ORDER BY distance ASC LIMIT 3"
to work in my distance.php script (store_image was an added field).
It took me a while to debug this problem, but I eventually got it to work. My 'someuser' (and I'm guessing others who jumped from your PHP6 MYSQL5 book to this one) doesn't have the same privileges to mysqli functions as the 'root' user does, so I couldn't get this script to run outside the admin programs.
I don't want to give 'someuser' ALL PRIVILEGES, so which additional privileges do I need to enable for 'someuser'(currently SELECT, INSERT, UPDATE, DELETE, FILE)?
Thanks for the great books (and any help),
~Randy
Chapter 4 Login.Php
in PHP 5 Advanced: Visual QuickPro Guide (2nd Edition)
Posted
Okay,
I found a solution on a different website. Move $auth->start() before the ?><!DOCTYPE as shown below. Any problems with this approach?