Jump to content

Not shoving even it must to


loonie35

Recommended Posts

Hy! I started to learn PHP above month ago, i do not understand why this code always shows me the second result (echo "<input type='text' name='username' value='$username'>":) even i have in database in column nick_change '+'.

			if($_SESSION['nick_change']== "-")				{					echo "<b>$username</b>   [<a class='change_name' href='#'>Change username</a>]";				}				else				{					echo "<input type='text' name='username' value='$username'>";				}

Thanks for help!

Link to comment
Share on other sites

Are you calling session_start() in all the related scripts?Does one of your scripts actually assign "-" to $_SESSION['nick_change'] ?You might try var_dump ($_SESSION) just to see what's actually in there. Do it right after you call session_start() and then call exit.(Obviously, if this is an AJAX script, then your javascript end will have to alert the output.)

Link to comment
Share on other sites

I didn't try to solve any coding problem because I don't see any. Substituting the "variables" of the situation, here's a paraphrase of your problem:

I do not understand why "nick_change" is never '-' even though I have '+' in the database column "nick_change."
It's not '-' because you told it to be '+'.
Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...