
Originally Posted by
schoolboy
What information is this "form" going to capture?
Where is the information to be stored?
How is the information going to be used in your webshop?
If the data it captures is going to be used (either administratively or communicatively) as part of your store, then you will need to write/edit the php files so that the data is HANDLED properly.
If you just want a form to capture info, and don't need to use that data as an inherent component in the webshop, you could consider a nifty little tool like
Appnitro's MachForm.
I use it
HERE.
This captures data to a SEPARATE database, but in this case, it suits my client's needs.
I litterally Just want the form to submit the info to my email nothing else. I have the files working but dont know how to implement them as part of the site.
I have the following:
competition_entry.php:-
PHP Code:
<form action="competition_submit.php" method="post">
<h2 align="left">Competition - January Draw</h2>
<p>Enter Your details below to enter this months draw! </p>
<br />
Name: <input type="text" name="nameis" size="20" /> Email: <input type="text" name="visitormail" size="20" />
<br/>
</p>
<p align="left">
Quesiton - Name the characters from The Wizard of Oz?
<br />
<h3 align="left">Answer</h3>
<p align="left">
<textarea name="feedback" rows="6" cols="30">Type your answer here..</textarea>
</p>
<hr />
<p align="left">
<input type="submit" value="Enter Draw" />
</p>
</form>
competition_submit.php:-
PHP Code:
<h3 align="center">Your entry has been submitted, Good Luck!</h3>
<!-- VIP: change YourEmail to your real email -->
<?php
$ip = $_POST['ip'];
$httpagent = $_POST['httpagent'];
$httpref = $_POST['$httpref'];
$nameis = $_POST['nameis'];
$visitormail = $_POST['visitormail'];
$feedback = $_POST['feedback'];
$rating = $_POST['rating'];
$emailvalidation = $_POST['emailvalidation'];
$fieldvalidation = $_POST['fieldvalidation'];
$htmlcontrol= $_POST['htmlcontrol'];
$phpform = $_POST['phpform'];
$htmlform = $_POST['htmlform'];
$attn = $_POST['attn'];
if (eregi('http:', $feedback)) { die ("Do NOT try that! ! "); }
if((!$visitormail == "") && (!strstr($visitormail,"@") || !strstr($visitormail,".")))
{
echo "<h2>Use Back - Enter valid e-mail</h2>\n";
$tellem = "<h2>Entry was NOT submitted</h2>\n";
}
if(empty($nameis) || empty($feedback) || empty($visitormail)) {
echo "<h2>Use Back - fill in all fields</h2>\n";
}
echo $tellem;
if ($emailvalidation == "y") {
$req1 = "Email format Validation \n" ;
}
if ($fieldvalidation == "y") {
$req2 = "Required Form Field Validation \n";
}
if ($htmlcontrol == "y") {
$req3 = "More intergratd HTML (in form) \n";
}
if ($phpform == "y") {
$req4 = "Improved PHP form script generator \n";
}
if ($htmlform == "y") {
$req5 = "A complete HTML form generator \n";
}
$req = $req1 . $req2 . $req3 . $req4 . $req5;
$todayis = date("l, F j, Y, g:i a") ;
$month = date("F");
$attn = $attn;
$subject = $attn;
$feedback = stripcslashes($feedback);
$message = " $todayis \n
Your Email: $nameis ($visitormail)\n
Your Answer: $feedback \n
";
$from = "From: $visitormail\r\n";
mail("[email protected]", "COMPETITION ENTRY - ".$month, $message, $from);
$screenout = str_replace("\n", "<br/>", $message);
?>
<p align="center">
<?php echo $screenout ?>
</p>
the code is messy as I pulled it from an example I found on the net and have stripped it down to what I need, but it works, just want it to appear in the area where main_page and EZ pages etc appear....
Any suggestions?
Cheers (im stuck)