php - problem with $_SERVER['PHP_SELF'] -


I have a link in one of my php pages where users of logged in user are shown and there is a link in this page For each friend of this type of user below:

  echo "& lt; a href = 'profile.php? Id = $ row [friend_id]' & gt; $ friend_row [name] & Lt; / a & gt; ";  

And as you can see, the friend's identity is given to the profile page and in the profile page, users can view their profile and leave comments for them. Here's the form:

  & lt; Form name = "comment" method = "post" action = "& gt; Phcho echo $ _SERVER ['PHP_SELF'] ;? & gt;" & Gt; & Lt; Input type = "text" name = "comment" class = "comment" /> & Lt; Input type = "submit" name = "submit" value = "submit" class = "comment" /> & Lt; / Form & gt;  

and this php code is as follows:

  $ insert = "Enter any comment (login_id, friend_id, msg) value ('$ _SESSION [Friend_id] '' $ _ session [id] ',' $ _ post [comment] ') "; $ Result = mysql_query (insert $) or die (mysql_error ());  

Now my question is that $ _ session [friend_id] which is $ _ GET [id] equal to this command No value was found before $ _SESSION [friend_ID] = $ _GET [id] and the page was passed and after submitting the form my appears on the SQL table 0. I tried to resonate this PHP script before executing it and it was a true value, but after executing this php code, that's it! !!!

Can anyone tell me why? No one can tell you why your variable does not have a different value than what you expected;


Comments

Popular posts from this blog

asp.net - Javascript/DOM Why is does my form not support submit()? -

sockets - Delphi: TTcpServer, connection reset when reading -

javascript - Classic ASP "ExecuteGlobal" statement acting differently on two servers -