I have an email script, I have not tested it, although someone tested it for me and said it worked fine. I started to make modifications to the code after using the basic structure. This is my HTML form;
Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
<!--
#form1 p {
color: #000;
font-size: 24px;
}
.text {
color: #F00;
font-size: 36px;
}
-->
</style>
</head>
<body>
<span class="text">Email Test Form</span><br />
<form id="form1" name="form1" method="post" action="mailer.php">
<table width="520" height="255" border="1">
<tr>
<td>To: </td>
<td><input name="to" type="text" id="to" size="75" /></td>
</tr>
<tr>
<td>From:</td>
<td><input name="from" type="text" id="from" size="75" /></td>
</tr>
<tr>
<td>Subject:</td>
<td><input name="subject" type="text" id="subject" size="75" /></td>
</tr>
<tr>
<td>Message:</td>
<td><textarea name="message" cols="72" rows="10" id="message"></textarea></td>
</tr>
<tr>
<td> </td>
<td><span class="style3"><center><img src="Newsletter Beta/pngimg.php" alt="" width="82" height="32" align="middle" /><br />
<input name="user_code" type="text" size="10" value="<?php echo $form->value("captcha"); ?>" />
</center></span></td>
</tr>
<tr>
<td> </td>
<td><center><input type="submit" name="button" id="button" value="Send" />
<input type="reset" name="button2" id="button2" value="Reset" /></center></td>
</tr>
</table>
</form>
</body>
</html>
Now here is the PHP handler for this form;
Code: <?php
$to = "$to";
$from_header = "From: $from";
if($message != "")
{
//send mail - $subject & $contents come from surfer input
mail($to, $subject, $contents, $from_header);
// redirect back to url visitor came from
header("Location: $HTTP_REFERER");
print("<HTML><BODY>You're newsletter has been sent.");
print("</BODY></HTML>");
}
else
{
print("<HTML><BODY>Please check your form, there was an error somewhere. If this was not the case, please contact the Administrator.");
print("</BODY></HTML>");
}
?>
There may be faults in this code, let me know if there is and provide a fix if possible.
What I aim to do here.. is like with a register form, submit the details, it gets sent. Afterwards, the form replaces with an "Your mail has been sent" if there was an error, to display ABOVE the form "There was an error processing this mail, please check the form and try again. If this does not solve your problem contact the administrator" or simply label it "goodnews" "badnews"
Also, either help me with this or not. Set it with error fields. (Probably will have to make the table with 3 collumns) At the last collumn after each field.. set an error field, so that if it does not get filled in, or its incorrect information, invalid emails (which shouldn't happen.. but just to take precautions) so.. that if something isn't submitted it proceeds with the error field, but doesn't remove the form. Unless its submitted and passed the problems and recieves the goodnews.
I shall note that you DO NOT have to create all error fields, doing ONE, will help me in working out the others.
Maybe.. hook up the captcha, although.. I haven't done the captcha properly yet.. many parts missing to it. (The bits that actually create the code) unless your willing to do this aswell.. but I don't expect you to.. I'll sort that out when the rest of this is done, as its last priority.
Each paragraph comes in order of prority.. its your choose if you assist with the coding, if not.. some help, and ideas of how to do it will deffinately be useful to me.
Thanks
php call servlet
I have done a php backup application .So there is a form that user pick some files to zip and download.Because of a problem with greek characters I make a servet (java) to create the zip.But I want
isset undefined variable
Hi all,Hope someone can point out the obvious. I've a log in script, if you dont enter a username or pw, you get a red asterix show by the field and a pop up.If you enter an email but not the pw, it
Trying to add functions to table
I have this list of characters and I'm trying to figure out what I have to do to put the results of these functions into the table or what not. Keep in mine that these functions are included in a file
I apologise! It's a newbie to PHP feedback form problem!
Hi,I am a total newbie to PHP. I am also a unemployed and need to get a job. So after 100% rejection rate for job applications since last November, I have built me a little 'self-marketing' site with
Batch Related Pricing
Hi, I need some clarity on the batch related pricing
Map.php
I am a complete beginner to PHP and am looking for some help with a program I am messing around with.I found this incomplete source code, and I wanted to finish it, but I have no idea what I am
LOOPing Problem
Hello All!The following code loops through the data and displays the data accordingly. My problem is that the $listPR->HoursWorked; array repeats itself. The foreach($listLocations as
Storing/displaying image urls in a database?
HiBasically I have the following scenario:User chooses picture from list. Picture info is added into the db, including url.However I can't figure out how exactly i should be storing the url for the
Array question
Does anyone know how to create a program that takes the $ amount for 8 different departments and give the total amount of sales?
Error in Configure System Landscape Directory phase
Hi