jac.kock Posted October 28, 2013 Share Posted October 28, 2013 how can help me to get the post in my code i been try'ng for days:( my code: <?php if($_POST['Submit']) { echo "Submit here"; } if($_POST['del']) { echo "del here"; } if($_POST['add']) { echo "add here"; } ?> <table width="100%" align="top" border="1"> <tr> <td align="top" valign="top"> <!-- START: profile photo and options --> <table width="100%"> <tr> <td align="center" valign="center"> <img src="upload/users/<?=$x['user_photo'];?>" width="140px" height="187px" alt="<?=$x['user_name'];?>" /> </td> </tr> <tr> <td align="top" valign="left"> <form name="proinfo" action="?<?=$_SERVER['QUERY_STRING'];?>" method="post" enctype="multipart/form-data"> <input type="hidden" id="abuseid" name="abuseid" value="<?=$x['user_id'];?>"/> <input type="hidden" id="fromid" name="fromid" value="<?=$log['user_id'];?>"/> <input name="abuse" type="image" id="abuse" value="Submit" src="modules/community/abuse.png" alt="" width="20" height="20" border="0" align="absmiddle"> report<br /> <input name="add" type="image" id="add" value="add" src="modules/community/abuse.png" alt="" width="20" height="20" border="0" align="absmiddle"> add<br /> <input name="del" type="image" id="del" value="del" src="modules/community/abuse.png" alt="" width="20" height="20" border="0" align="absmiddle"> del<br /> </form> </td> </tr> </table> <!-- END: profile photo and options --> </td> </tr> </table> i can't seem to get the post what am i doing wrong? pls help Quote Link to comment Share on other sites More sharing options...
mentalist Posted October 28, 2013 Share Posted October 28, 2013 Your method of testing is wrong... you are testing the value of the POST not that it is set, Change these: if($_POST['Submit']){} to if(isset($_POST['Submit'])){} also not sure your form is right either since all buttons / img-buttons are in the same form??? Quote Link to comment Share on other sites More sharing options...
jac.kock Posted October 28, 2013 Author Share Posted October 28, 2013 Your method of testing is wrong... you are testing the value of the POST not that it is set, Change these: if($_POST['Submit']){}to if(isset($_POST['Submit'])){}also not sure your form is right either since all buttons / img-buttons are in the same form??? hi, i want to use 1 form for more options so i have named them differant. I wnat to review the POST to see witch action must be taken there exp: if del then del_user if add then add_user if abuse then abuse_report do you know what i mean? can you help me to get the right steps? Quote Link to comment Share on other sites More sharing options...
Ch0cu3r Posted October 28, 2013 Share Posted October 28, 2013 If you're using an image as the submit button some browsers only send the X,Y coords for where the user clicked the button. So you'll want to check for this too <?php if(isset($_POST['abuse']) || isset($_POST['abuse_x'])) { echo "Submit here"; } if(isset($_POST['del']) || isset($_POST['del_x'])) { echo "del here"; } if(isset($_POST['add']) || isset($_POST['add_x'])) { echo "add here"; } ?> Quote Link to comment Share on other sites More sharing options...
mentalist Posted October 28, 2013 Share Posted October 28, 2013 You can't do it that way, when a form is submitted all of its contents are sent... You could using Javascript, but then you wouldn't need a form... For you, i'd just get the submit working first and then play / test a little! Quote Link to comment Share on other sites More sharing options...
Solution jac.kock Posted October 28, 2013 Author Solution Share Posted October 28, 2013 thnx all i get a reding so i can continu Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.