Closure Posted April 18, 2010 Share Posted April 18, 2010 Hello, I have a code to send mail to other users, I have recently created a feature where they can ask for tracking their mails to know its been read. I have the code, so you have a button to click if you want tracking. It pops up, you click OK then it takes you to the same page but with &track=Y in the URL. The code below is the main part, the send button will only work if the user has clicked track, it now wont send normal mail without clicking the track. The send button just doesnt work, just keep clicking and no actions done. I feel the error is to do with the INPUT forms, IE: <INPUT TYPE="button" value="Confirm Read" onClick="go_there()"><SCRIPT LANGUAGE="JavaScript"> and the send form: echo "<input type=submit value=Send>"; Are they conflicting each other? if the $track = Y then the Confirm Read form isnt there, therefore it works... Any help would be great. James if ($track != "Y"){?> <SCRIPT language="JavaScript"><!--function go_there(){ var where_to= confirm("Want confirmation of being read? (5 a day)"); if (where_to== true) { window.location="http://www.igamehere.com/imail.php?action=send&id=<? echo"$muser1[id]"; ?>&track=Y"; } else { window.location="http://www.igamehere.com/imail.php?action=send&id=<? echo"$muser1[id]"; ?>"; }}//--></SCRIPT> <BR><FORM><INPUT TYPE="button" value="Confirm Read" onClick="go_there()"><SCRIPT LANGUAGE="JavaScript">function popUp(URL) {day = new Date();id = day.getTime();eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=700,height=400,left = 470,top = 350');");}</script><A HREF="javascript:popUp('pophelp.php?note=receipt')"><img src=qmark1.png width=10 height=15></A><bR><bR><script language='javascript' type='text/javascript'>function shownormal(){var shownormallink=document.getElementById('normal').style;if(shownormallink.display!='block'){shownormallink.display='block';}else{shownormallink.display='none';}}</script></FORM><? }else{echo "<br>[<a href=imail.php?action=send&id=$muser1[id]>Remove Confirmation</a>]";$track = "Y";} echo "<p><img src=image/misc/imail.gif><b><font color=5EDA9E>Message</font></b>: <br>"; echo "<textarea rows=10 cols=70 wrap=on name=message>"; if ($repl == 1){ echo "\n\n\nReply to $muser1[username]'s message:\n"; echo "$repl5"; } echo "</textarea>"; echo "<input type=hidden name=action value=sent>"; echo "<input type=submit value=Send>"; echo "</form></center>"; } } Quote Link to comment https://forums.phpfreaks.com/topic/198908-form-probelms-help/ Share on other sites More sharing options...
TeddyKiller Posted April 18, 2010 Share Posted April 18, 2010 <input type=submit value=Send> doesn't have a name. eg: name="submit" Quote Link to comment https://forums.phpfreaks.com/topic/198908-form-probelms-help/#findComment-1044095 Share on other sites More sharing options...
Closure Posted April 19, 2010 Author Share Posted April 19, 2010 Hello, Thank you for your reply This is my new code, still doesnt work. Really thankful for your help. if ($track != "Y"){ ?> <SCRIPT language="JavaScript"> <!-- function go_there() { var where_to= confirm("Want confirmation of being read? (5 a day)"); if (where_to== true) { window.location="http://www.igamehere.com/imail.php?action=send&id=<? echo"$muser1[id]"; ?>&track=Y"; } else { window.location="http://www.igamehere.com/imail.php?action=send&id=<? echo"$muser1[id]"; ?>"; } } //--> </SCRIPT> <BR> <FORM> <INPUT TYPE="button" value="Confirm Read" onClick="go_there()"><SCRIPT LANGUAGE="JavaScript"> function popUp(URL) { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=700,height=400,left = 470,top = 350');"); } </script> <A HREF="javascript:popUp('pophelp.php?note=receipt')"><img src=qmark1.png width=10 height=15></A><bR><bR> <script language='javascript' type='text/javascript'> function shownormal() { var shownormallink=document.getElementById('normal').style; if(shownormallink.display!='block') { shownormallink.display='block'; } else { shownormallink.display='none'; } } </script> </FORM> <? }else{ echo "<br>[<a href=imail.php?action=send&id=$muser1[id]>Remove Confirmation</a>]"; $track = "Y"; } echo "<p><img src=image/misc/imail.gif><b><font color=5EDA9E>Message</font></b>: <br>"; echo "<textarea rows=10 cols=70 wrap=on name=message>"; if ($repl == 1){ echo "\n\n\nReply to $muser1[username]'s message:\n"; echo "$repl5"; } echo "</textarea>"; echo "<input type=hidden name=action value=sent>"; echo "<input type=submit name=Send value=Send>"; echo "</form></center>"; } } Quote Link to comment https://forums.phpfreaks.com/topic/198908-form-probelms-help/#findComment-1044488 Share on other sites More sharing options...
TeddyKiller Posted April 19, 2010 Share Posted April 19, 2010 You close the form with a </form> but you don't open it. Quote Link to comment https://forums.phpfreaks.com/topic/198908-form-probelms-help/#findComment-1044505 Share on other sites More sharing options...
Closure Posted April 19, 2010 Author Share Posted April 19, 2010 Hello, Sorry I have missed out the original form just before he code I put in. I will post my FULL code for the action "send" below. Sorry. I think the probem may be that I have a form within a form? and the first form is thinking its closed when I put </form> after the Track Form in the middle, if that makes sense. anyway, here is the code. Really thankful for your help. }elseif ($action == "send"){ echo "<center><form action=imail.php method=post>"; echo "[<a href=imail.php?action=send>New Imail</a>] || [<a href=imail.php?action=view>Inbox</a>] || [<a href=imail.php>Imail Menu</a>]<br><br>"; if($id){ $muser = mysql_query("SELECT * FROM userdb WHERE id = '$id'"); $muser1 = mysql_fetch_array($muser); echo "<b>To</b>: <a href=view.php?id=$muser1[id]>$muser1[username]</a><br>"; echo "<b>From</b>: <a href=view.php?id=$muser1[id]>$playerinfo[username]</a>"; echo "<input type=hidden name=tousr value=$id>"; echo "<input type=hidden name=track value=$track>"; }else{ echo "To: <input type=text name=tousr value=$id> (Use ID)"; } if ($repl == 1){ $messagedet = Mysql_query("Select * from maildb where messid='$messid'"); $message2 = Mysql_fetch_array($messagedet); $dscript_act = "decode"; $enter = $message2[message]; include ("dstml.php"); } if ($track != "Y"){ ?> <SCRIPT language="JavaScript"> <!-- function go_there() { var where_to= confirm("Want confirmation of being read? (5 a day)"); if (where_to== true) { window.location="http://www.igamehere.com/imail.php?action=send&id=<? echo"$muser1[id]"; ?>&track=Y"; } else { window.location="http://www.igamehere.com/imail.php?action=send&id=<? echo"$muser1[id]"; ?>"; } } //--> </SCRIPT> <BR> <FORM> <INPUT TYPE="button" value="Confirm Read" onClick="go_there()"><SCRIPT LANGUAGE="JavaScript"> function popUp(URL) { day = new Date(); id = day.getTime(); eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=1,width=700,height=400,left = 470,top = 350');"); } </script> <A HREF="javascript:popUp('pophelp.php?note=receipt')"><img src=qmark1.png width=10 height=15></A><bR><bR> <script language='javascript' type='text/javascript'> function shownormal() { var shownormallink=document.getElementById('normal').style; if(shownormallink.display!='block') { shownormallink.display='block'; } else { shownormallink.display='none'; } } </script> </FORM> <? }else{ echo "<br>[<a href=imail.php?action=send&id=$muser1[id]>Remove Confirmation</a>]"; $track = "Y"; } echo "<p><img src=image/misc/imail.gif><b><font color=5EDA9E>Message</font></b>: <br>"; echo "<textarea rows=10 cols=70 wrap=on name=message>"; if ($repl == 1){ echo "\n\n\nReply to $muser1[username]'s message:\n"; echo "$repl5"; } echo "</textarea>"; echo "<input type=hidden name=action value=sent>"; echo "<input type=submit value=Send>"; echo "</form></center>"; } } Quote Link to comment https://forums.phpfreaks.com/topic/198908-form-probelms-help/#findComment-1044537 Share on other sites More sharing options...
TeddyKiller Posted April 19, 2010 Share Posted April 19, 2010 The opening form tag in the middle.. should it have an action and an method at all? Quote Link to comment https://forums.phpfreaks.com/topic/198908-form-probelms-help/#findComment-1044607 Share on other sites More sharing options...
Closure Posted April 19, 2010 Author Share Posted April 19, 2010 Yes as that was the original coding, works by posting the message into the Database, action being the imail.php where the code lies. What would you suggest then? Thank you. Quote Link to comment https://forums.phpfreaks.com/topic/198908-form-probelms-help/#findComment-1044690 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.