Jump to content

Recommended Posts

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>";				}

}

Link to comment
https://forums.phpfreaks.com/topic/198908-form-probelms-help/
Share on other sites

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>";
			}
			}

Link to comment
https://forums.phpfreaks.com/topic/198908-form-probelms-help/#findComment-1044488
Share on other sites

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>";
			}
			}

Link to comment
https://forums.phpfreaks.com/topic/198908-form-probelms-help/#findComment-1044537
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.