![]() |
getting post and session in a file
Hi, now that my site is populated i cant just quickly sneak a peak at the session or post like i used to with live customers on the site.
So im wanting to learn how to print_r to a file rather than to the browser, that way i can troubleshoot without interferring with members visits. Thanks. If i cant get this working right i will come back and let you all know whats up, but i dont want to just come here first, i want to figure it out or try like heck to figure out the issue im having with the session. More later if i hit a dead end. Hope i can learn how to do a file rather than a browser display so i can start on this troubleshooting, thanks. |
Use the second argument to return rather than print:
PHP Code:
|
PHP Code:
right.. and it would write it in the same folder i am in currently or the root? |
Yup, it'd add the current date/time with no punctuation, such as print_r.20121005020936.txt, where 20121005020936 is October 5th, 2012, 2:09:36am, and place it in the same folder as the current file.
You could also just hard code the file name as `print_r.txt` or whatever you'd like and continue to overwrite it if you plan on checking in on the file each and every refresh. Or use session_id() for a per-user basis: PHP Code:
|
well i thought i had it, it didnt work so i even tried something very very simple
PHP Code:
checked every dir all the way back to the root and no file. |
Nevermin i got it, i changed the permissions of the file to 666 and whallla content ...
Thanks so much :) |
Quote:
Run this in phpmyadmins SQL page: Code:
CREATE TABLE `sessions` (PHP Code:
PHP Code:
Of course if you really want... you can always use code to open each users session file on the disk instead... but that really is a bit more complex. |
Very nice tango thanks so much, above and beyond the call of duty, thanks for that. And thanks for the compliment i am proud of some of the things i have done and things i have overcome but then again i have those days where i feel like a third grader trying to figure out how to use a calculater lol... :)
Such as my current issue as to why if using sessions which is suppose to be a superglobal and should be available anywhere in the script. Then why when i do PHP Code:
|
| All times are GMT +1. The time now is 10:55 PM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.