I am getting undefined index errors on a form, I have tried to isset the variable, but nothing, I have globalled all variables that I can find, but I am unable to find a solution, I am sure it is just something simple. But everything I have tried gives me a 500 error.. The issue lies around '{$_GET['XID']}' I have tried '{(isset($_GET['XID']))}' and get a 500 error, I have tried '{(!isset($_GET['XID']))}' I also get a 500 error off this..
Where am I going wrong?
Here is a snippet of the code, and this is the error message I get is:
Notice: Undefined index: XID in C:\wamp64\www\messages.php on line 1039 Call Stack: 0.0108 551240 1. {main}() C:\wamp64\www\messages.php:0 0.2587 1146104 2. mail_compose() C:\wamp64\www\messages.php:50 (would be on line 8 in this snippet though I am pretty sure..)
Snippet:
function mail_compose() { global $pl, $connection, $_SESSION, $q_ry, $_GET, $_POST, $cev, $thismess; echo "<center><table width = '75%' border = '0' cellspacing = '0' class = 'forum'> <tr bgcolor = '#999999'><td colspan=2><center><b>Send a message</b></td></tr> <form name = 'reply' method = 'post' action = 'messages.php?action=send'><tr> <td width = '25%' bgcolor = '#E3E3E3'><b>Users ID:</b></td> <td bgcolor=#E3E3E3><input type = 'text' name = 'to' size = '5' maxlength = '10' value = '{$_GET['XID']}'> <i><font size=2>(Example. 1)</font></i></td> </tr><tr> <td width=25% bgcolor=#E3E3E3><b>Subject:</b></td> <td bgcolor=#E3E3E3><input type = 'text' name = 'subject' size = '50' maxlength = '50' value=''> <i><font size=2>(Example. Hello)</font></i></td> </tr><tr><td bgcolor = '#E3E3E3' colspan = '2' align = 'center'> <a onClick=\"addwithEase(' :) ')\"><img src='images/smilies/smile.gif'></a> <a onClick=\"addwithEase(' :P ')\"><img src='images/smilies/tounge.gif'></a> <a onClick=\"addwithEase(' :( ')\"><img src='images/smilies/sad.gif'></a> <a onClick=\"addwithEase(' :o ')\"><img src='images/smilies/shocked.gif'></a> <a onClick=\"addwithEase(' :@ ')\"><img src='images/smilies/angry.gif'></a> <a onClick=\"addwithEase(' o_O ')\"><img src='images/smilies/sarcy.gif'></a> <a onClick=\"addwithEase(' :s ')\"><img src='images/smilies/confused.gif'></a> <a onClick=\"addwithEase(' ;) ')\"><img src='images/smilies/wink.gif'></a> <a onClick=\"addwithEase(' :* ')\"><img src='images/smilies/cool.gif'></a> <a onClick=\"addwithEase(' :|o ')\"><img src='images/smilies/psyc.gif'></a> <a onClick=\"addwithEase(' :| ')\"><img src='images/smilies/dissapointed.gif'></a> <a onClick=\"addwithEase(' :D ')\"><img src='images/smilies/grin.gif'></a> <a onClick=\"addwithEase(' xD ')\"><img src='images/smilies/histericle.gif'></a> <a onClick=\"addwithEase(' :L ')\"><img src='images/smilies/laughing.gif'></a> <a onClick=\"addwithEase(' xP ')\"><img src='images/smilies/histericletounge.gif'></a> </td></tr> <tr> <td bgcolor = '#E3E3E3'><b>Message:</b></td> <td width = '90%' bgcolor = '#E3E3E3'> <textarea name = 'message' rows = '10' cols = '75%'></textarea></td> </tr><tr bgcolor = '#E3E3E3'> <td colspan = '2'><center><input type = 'submit' value = 'Send'></center></td> </tr></form></table></center><script language=\"JavaScript\" type=\"text/javascript\"> function addwithEase(smileToAdd) { document.reply.message.value += smileToAdd;document.reply.message.focus(); } </script> <hr width = '75%'/>> <a href='messages.php'>Back</a><hr width = '75%'/>"; }
mysqlirelated? What is the URL you load this page with?