Ok, I am not big on PHP terminology so I don't really know how to describe it but I will try my best to show you what I am doing and what I am having trouble with it.
Let's start by showing you the two scripts involved in this:
back.php
feed.php
Ok, and there are a few urls that are used in this script:
(The form page where you fill out the form)
(If the email is wrong this will activate the wrong email message)
(If the comments/questions are not filled out this will activate the error message)
(If the email was successfully sent this will activate the succesfully sent message.
The problem I am having here is getting these urls: "index.php?action=link&what=feed.php&action=complete&what=" to work one of those urls is loading a page onto the page in this case feed.php and then the seconds part is activating one of the php sections of the page to alert the user they filled something in wrong. If you look through the scripts you will see what I meen.
Now you might be saying now that its the index.php should be feed.php but no I am loading the feed.php into index.php so that is not the problem I guess the real problem is getting two of "action=complete&what=" these things in one url to work. To see an example of what I am talking about visit: http://www.oyoystudios.frih.net/Saunders/index.php?action=link&what=feed.php
I hope you can help =)
Last edited by cr3ativ3 on Sun Jan 28, 2007 11:24 pm; edited 1 time in total
Let's start by showing you the two scripts involved in this:
back.php
| Code: |
|
<?php $from = $_POST['from']; switch ($from) { case '': echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=index.php?action=link&what=feed.php&action=verifyemail&what=\">"; exit; case ' ': echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=index.php?action=link&what=feed.php&action=verifyemail&what=\">"; exit; } $info = $_POST['info']; switch ($info) { case '': echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=index.php?action=link&what=feed.php&action=verifytext&what=\">"; exit; case ' ': echo "<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=index.php?action=link&what=feed.php&action=verifytext&what=\">"; exit; } $name = $_POST['name']; $subject = $_POST['subject']; $to = "webmasteroy@gmail.com"; $subject = "$subject [Contact Us Form]"; $message = "$info --------------- This Message Was Sent By The Online Feed Back Form ---------------"; $headers = "From: $name [$from]" . "\r\n" . "Reply-To: $from" . "\r\n"; mail($to, $subject, $message, $headers); if (@mail($to, $subject, $message, headers)) { echo("<META HTTP-EQUIV=\"Refresh\" CONTENT=\"0; URL=index.php?action=link&what=feed.php&action=complete&what=\">"); } else { echo('<p>Mail could not be sent.</p>'); } ?> |
feed.php
| Code: |
|
<table width="95%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="18" height="31" background="UserFiles/corner1.PNG"></td> <td background="UserFiles/top.PNG" align="center"><font face="Arial, Helvetica, sans-serif"><b><!--Title-->Email Us</b></font></td> <td width="18" height="31" background="UserFiles/corner2.PNG"></td> </tr> <tr> <td background="UserFiles/side1.PNG"></td> <td align="center" valign="center"><font face="Arial, Helvetica, sans-serif"><!--Content--> <div align="center">Please fill out the form below with your comments/questions and we will recieve them by email and try to respond shortly.<br /><br><font size="-3"><font color="red">*</font>Required Fields</font><br /><br /><?php if (isset($_GET['action'])) { switch (strtolower($_GET['action'])) { case 'complete' : do_complete(@$_GET['what']); break; default : break; } } function do_complete() { Echo "<br><font color=\"red\">Succesfully You should recieve a response within 48 hours if you don't, feel free to resend your questions/comments or call us.</font>"; }; ?></div> <form action="back.php" method="post"> <table width="100%" border="0" cellspacing="0" cellpadding="5" align="center"> <tr> <td align="right" valign="top"><font face="Arial, Helvetica, sans-serif">Name:</font></td> <td align="left" valign="top"><input name="name" type="text" /></td> </tr> <tr> <td align="right" valign="top"><font face="Arial, Helvetica, sans-serif"><font color="red">*</font>Your Email Address:</font></td> <td align="left" valign="top"><input name="from" type="text" /><?php if (isset($_GET['action'])) { switch (strtolower($_GET['action'])) { case 'verifyemail' : do_verifyemail(@$_GET['what']); break; default : break; } } function do_verifyemail() { Echo "<br><font color=\"red\">Email Address Is Wrong</font>"; }; ?></td> <tr> <td align="right" valign="top"><font face="Arial, Helvetica, sans-serif">Subject:</font></td> <td align="left" valign="top"><input name="subject" type="text" /></td> </tr> </tr> <tr> <td align="right" valign="top"><font face="Arial, Helvetica, sans-serif"><font color="red">*</font>Questions/Comments:</font></td> <td align="left" valign="top"><textarea name="info" cols="25" rows="7"></textarea> <?php if (isset($_GET['action'])) { switch (strtolower($_GET['action'])) { case 'verifytext' : do_verifytext(@$_GET['what']); break; default : break; } } function do_verifytext() { Echo "<br><font color=\"red\">^Oops it appears that you havn't filled in this part^</font>"; }; ?> </td> </tr> </table> <div align="center"><input name="" type="submit" value="Submit" /></div> </form> </font></td> <td background="UserFiles/side2.PNG"></td> </tr> <tr> <td width="17" height="17" background="UserFiles/corner3.PNG"></td> <td background="UserFiles/bottom.PNG"></td> <td width="17" height="17" background="UserFiles/corner4.PNG"></td> </tr> </table><br /> |
Ok, and there are a few urls that are used in this script:
| Quote: |
| index.php?action=link&what=feed.php |
(The form page where you fill out the form)
| Quote: |
| index.php?action=link&what=feed.php&action=verifyemail&what= |
(If the email is wrong this will activate the wrong email message)
| Quote: |
| index.php?action=link&what=feed.php&action=verifytext&what= |
(If the comments/questions are not filled out this will activate the error message)
| Quote: |
| index.php?action=link&what=feed.php&action=complete&what= |
(If the email was successfully sent this will activate the succesfully sent message.
The problem I am having here is getting these urls: "index.php?action=link&what=feed.php&action=complete&what=" to work one of those urls is loading a page onto the page in this case feed.php and then the seconds part is activating one of the php sections of the page to alert the user they filled something in wrong. If you look through the scripts you will see what I meen.
Now you might be saying now that its the index.php should be feed.php but no I am loading the feed.php into index.php so that is not the problem I guess the real problem is getting two of "action=complete&what=" these things in one url to work. To see an example of what I am talking about visit: http://www.oyoystudios.frih.net/Saunders/index.php?action=link&what=feed.php
I hope you can help =)
Last edited by cr3ativ3 on Sun Jan 28, 2007 11:24 pm; edited 1 time in total
