Session variable seemingly altering unrelated html text

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
morewhitespaceplease
Forum Newbie
Posts: 2
Joined: Sun Apr 08, 2012 10:04 am

Session variable seemingly altering unrelated html text

Post by morewhitespaceplease »

The code is rather lengthy to post, and all I am really interested in is if anyone has ever encountered this issue. Thus, no code is posted in this message. If need be, it can be posted after further discussion.

Anyway, I have separated my html and php for a project. I have an html option element with an id of "gender" and a php session variable that gets set called { ["FORMDATA"]["gender"] }. When the php outputs the html file, the id "gender" becomes the assignment of the session variable (in this case, either "F" or "M"). There is absolutely no rewrite to this portion of the html for this to occur. Additionally, if I change the session variable to {["FORMDATA"]["Gender"]}, the html id remains intact, but the option's text label ("Gender:") is now altered (either "F:" or "M:"). All other session variables have not created any issues, but these variables are not equivalent to any of the html text (i.e. the html "mstatus" is referenced as a php session variable "mStatus"). Obviously, or perhaps not, if I change the session variable to "GENDER", none of the html text is altered.

So, I am merely wondering if this is a known issue/bug, some basic rule that I have overlooked, or just a randomly odd occurrence. Thanks in advance.
morewhitespaceplease
Forum Newbie
Posts: 2
Joined: Sun Apr 08, 2012 10:04 am

Re: Session variable seemingly altering unrelated html text

Post by morewhitespaceplease »

EDIT: If the session var is renamed to "GENDER", it still replaces the "Gender:" html text. However, if I change the html text to "GENDER", it remains undisturbed. I had that reversed.
Post Reply