
|
View Full Version : Web development help please, this is baffling the crap out of me
FirestormNetworks 12-04-2006, 07:26 PM ok, I have a site that's using a signup form for people to enter a bunch of information, then I'm storing it in session variables until the final submission, when I then insert it all into the database in 1 shot. The point of this is to keep from cluttering up the database with half-entered forms and whatnot.
What I've found, when using IE7 to do the signup form, for some odd reason that I haven't been able to determine, the session value "username" (e.g. $_SESSION['username']) keeps getting reset from what's posted from the form values to the string "iecssfix".
I have put echos into the pages to see what's in the session values, and what is being sent to the page through http post, and there's nothing in the post itself that would be doing this. I've also did a grep on the entire directory structure of the website's account, and that string does NOT appear in any file in the entire site.
Google has 0 hits for the string "iecssfix", so I'm struggling here. I've talked to 2 other developer friends, and neither of them can figure out where the hell it's coming from either.
This only happens with IE of course, but it has to be supported on this site, so I'm lost... has *anyone* ever seen this?
Thanks
zwolf 12-04-2006, 09:51 PM Hi, I did a quick search on Google, and it seems it may be a bug with ie7. Check out: http://www.google.com/search?num=30&hl=en&safe=on&q=ie7+%26+session+variables&meta=
Damn m$ cr@py software. :(
Burhan 12-05-2006, 02:04 AM I cannot replicate your problem on IE7 here. Please give a simple test case of what you are experiencing.
I tested it by creating a form, then submitting it via post to another PHP script, where I store the information in a session, then checking the session in a third script and I didn't see the bug you mention (I also stored it in 'username').
FirestormNetworks 12-05-2006, 02:08 AM https://www.wetrainamerica.com/signup.php is the page that the problem exists on.
if you go through the steps (just put in bogus info if you want), after the second page you'll see the error. The top 2 arrays that are being echoed are session and post, top and bottom respectively
Burhan 12-05-2006, 02:20 AM That doesn't help me much, unless you show me the code.
Edit:
Remove <style type="text/css">.imcm .imsubc{background-image:url(ie_css_fix);}</style> and try it again.
zwolf 12-05-2006, 02:22 AM Just wondering is the problem only with the variable "username"? If yes, have you tried to name it to say "username1" or something else?
FirestormNetworks 12-05-2006, 02:25 AM foreach($_POST as $key => $value) {
if(!empty($value)) {
$_SESSION[$key] = $value;
}else{
$_SESSION[$key] = "none";
}
}
That's what moves the data into the session variables. I should also mention that I've tried this with IE6, Firefox, and Opera and it doesn't happen.
FirestormNetworks 12-05-2006, 02:27 AM Just wondering is the problem only with the variable "username"? If yes, have you tried to name it to say "username1" or something else?
I haven't, but I would rather find the root cause of this, as I can't believe that MS would be so stupid as to intentionally rewrite that session value somehow. There are thousands of sites that use a session variable named "username".
Burhan 12-05-2006, 02:40 AM as I can't believe that MS would be so stupid as to intentionally rewrite that session value somehow.
You are quite right, as they are not.
zwolf 12-05-2006, 02:41 AM Are you using IE7 Beta Version 1 by chance? I found a few sites discussing session problems with this version, that seems to have been fixed in more recent updates.
FirestormNetworks 12-05-2006, 02:42 AM Are you using IE7 Beta Version 1 by chance? I found a few sites discussing session problems with this version, that seems to have been fixed in more recent updates.
No, this is straight from windows update.
Burhan 12-05-2006, 03:00 AM Your problem is not IE, its with your script as I am unable to reproduce the error here using IE 7.0.5730.11 (the latest from Windows update as of 04/12/2006).
FirestormNetworks 12-05-2006, 03:06 AM I have to ask, did you submit the second step? The issue doesn't appear until the 3rd step of the page, so if you didn't go far enough, you wouldn't have seen it.
When it echos the session values upon submission of the first page, it's right, it's only after you submit the second page that it happens.
edit: that's the same version of IE7 I am using.
zwolf 12-05-2006, 03:26 AM It's strange because if it is simply a script error, wouldn't it reflect in IE6 and other browsers?
How about trying to save as another session variable name on the 2nd page , pass that variable to the third page, and then fill "username' on the third page with the other variable. Just a suggestion.
I am curious though if fyrestrtr has the same problem on the third page. I am using IE6.
zacharooni 12-05-2006, 03:41 AM Warning: Cannot modify header information - headers already sent by (output started at /home/wetrain/public_html/signup.php:29) in /home/wetrain/public_html/signup.php on line 48
FirestormNetworks 12-05-2006, 03:45 AM Warning: Cannot modify header information - headers already sent by (output started at /home/wetrain/public_html/signup.php:29) in /home/wetrain/public_html/signup.php on line 48
Where are you seeing this? I suspect it's when you try to complete the registration, as I've got a redirect in there to submit the actual values to the database. It makes sense that it would do that with the arrays being echoed if that were the case.
zacharooni 12-05-2006, 04:21 AM Yeah, on the last page, right on top of the main box.
I haven't, but I would rather find the root cause of this, as I can't believe that MS would be so stupid as to intentionally rewrite that session value somehow. There are thousands of sites that use a session variable named "username".
IE7 (or any browser in general) cannot "rewrite" session values. It could only "rewrite"/change/lose the session ID, but then all session values would be lost and not only a specific one.
latheesan 12-05-2006, 08:36 AM Im also on IE7 and i see this odd message on your site header:
Array
(
)
Array
(
)
O_O;
Anyway, if $_SESSION is not working out for you, why not use cookies ?
FirestormNetworks 12-05-2006, 06:05 PM Im also on IE7 and i see this odd message on your site header:
Array
(
)
Array
(
)
O_O;
Anyway, if $_SESSION is not working out for you, why not use cookies ?
yes, as I've explained, I've got 2 print_r() statements in the page echoing out the values of the post and session variables at the top of the page for troubleshooting purposes.
|