Members Online
Total Online: 32 Web Spiders: 17
Guests Online: 30
Members Online: 2
Registered Members: 70179 Newest Member: prankst3r
|
View Thread
| Author |
Email-redirect form |
superpimp
Member
Posts: 113
Location: Belgium
Joined: 17.12.05 Rank: Monster |
|
I need a form, when it's submitted the data needs to go to my email client and the page needs to be redirected.
<scblockedript language="Javascblockedript">
function mailMe( form ) {
// put some checks here
return true;
}
</scblockedript>
<form action="mailto:fredje138@gmail.com" method="POST"
enctype="text/plain" name="email"
onsubmit="return mailMe( this.form )">
<p align="center">Name:<br>
<input type="text" size="30" name="filled by"><br>
kom je (ja/nee)<br>
<input type="text" size="30" name="komst "
value="ja"><br>
E-mail:<br>
<input type="text" size="30" name="EMAIL ADRESS"><br>
<input type="submit" value="Submit "></font></p>
</form>
This one sends the data to my email but doesnt redirect and it asks to be sent or not, I want it to be sent without notice and afterwards redirected to another site. Is it possible?
If the submitting to email without notice isnt possible then submitting to a web page, that only I can view, is ok too. PHP can do the trick too, just dunno how :P
Help is appreciated.
thx!


 |
|
| Author |
RE: Email-redirect form |
Xero
Member
Posts: 259
Location: AmeriKKKa
Joined: 04.12.04 Rank: Hacker Level 2 |
|
|
<?php
if(isset($_POST["submit"]))
{
$frm = $_POST["name"]." <".$_POST["email"].">";
mail("fredje138@gmail.com", "The Subject", $_POST["msg"], "From: $frm");
echo "<meta http-equiv=\"refresh\"content="0; url=page_to_redirect_to.php\">
}
else
{
?>
<form method="POST" enctype="text/plain" name="email" action="<?=$_SERVER["PHP_SELF"]; ?>">
<p align="center">
Name:<br>
<input type="text" size="30" name="name"><br><br>
Email Address:<br>
<input type="text" name="email"><br><br>
Message:<br>
<input type="text" size="30" name="msg"><br>
<input type="submit" name="submit" value="Submit "></font></p>
</form>
<?php
}
?>
There's a scblockedript in PHP that will have them fill out the form with their Name, Email Address, and their Message. Then it will mail the information to you and redirect them page_to_redirect_to.php.
Tweak it as necessary. If you need help changing something in this, let me know.
Also, make sure you save this with a "php" extension and upload it to a server that supports PHP.
Edited by Xero on 26-12-05 23:31 |
|
| Author |
RE: Email-redirect form |
willeH
Banned
Posts: 210
Location:
Joined: 14.10.05 Rank: HBH Guru |
|
|
<?php
if (isset($_POST['Subject']) OR isset($_POST['Body'])) {
$message = wordwrap($_POST['Body'], 70);
mail('fredje138@gmail.com', $_POST['Subject'] , $message);
echo "Message Sent";
} else {
echo "<form action=\"send.php\" method=\"post\">
Subject<input type=\"text\" name=\"Subject\"><br>
Message<input type=\"text\" name=\"Body\"><br>
<input type=\"Submit\" value=\"Send\">
</form>";
}
?>
rushed, should do the trick.
|
|
| Author |
RE: Email-redirect form |
superpimp
Member
Posts: 113
Location: Belgium
Joined: 17.12.05 Rank: Monster |
|
Xero wrote:
<?php
if(isset($_POST["submit"]))
{
$frm = $_POST["name"]." <".$_POST["email"].">";
mail("fredje138@gmail.com", "The Subject", $_POST["msg"], "From: $frm");
echo "<meta http-equiv=\"refresh\"content="0; url=page_to_redirect_to.php\">
}
else
{
?>
<form method="POST" enctype="text/plain" name="email" action="<?=$_SERVER["PHP_SELF"]; ?>">
<p align="center">
Name:<br>
<input type="text" size="30" name="name"><br><br>
Email Address:<br>
<input type="text" name="email"><br><br>
Message:<br>
<input type="text" size="30" name="msg"><br>
<input type="submit" name="submit" value="Submit "></font></p>
</form>
<?php
}
?>
There's a sc blockedript in PHP that will have them fill out the form with their Name, Email Address, and their Message. Then it will mail the information to you and redirect them page_to_redirect_to.php.
Tweak it as necessary. If you need help changing something in this, let me know.
Also, make sure you save this with a "php" extension and upload it to a server that supports PHP.
this one gives this error: Parse error: parse error, unexpected ';' in C:\Program Files\wamp\www\test.php on line 15
willeH wrote:
<?php
if (isset($_POST['Subject']) OR isset($_POST['Body'])) {
$message = wordwrap($_POST['Body'], 70);
mail('fredje138@gmail.com', $_POST['Subject'] , $message);
echo "Message Sent";
} else {
echo "<form action=\"send.php\" method=\"post\">
Subject<input type=\"text\" name=\"Subject\"><br>
Message<input type=\"text\" name=\"Body\"><br>
<input type=\"Submit\" value=\"Send\">
</form>";
}
?>
rushed, should do the trick.
no errors here but, I redirected it to the send.php page and that worked, but i didnt get an email :(


 |
|
| Author |
RE: Email-redirect form |
willeH
Banned
Posts: 210
Location:
Joined: 14.10.05 Rank: HBH Guru |
|
check you have an smtp server properly set up. Sometimes it does take a while for the email to come through. btw the scblockedript worked for me.
|
|
| Author |
RE: Email-redirect form |
willeH
Banned
Posts: 210
Location:
Joined: 14.10.05 Rank: HBH Guru |
|
btw you must name the file you save it as to 'send.php' or change the form action to be the new name.
|
|
| Author |
RE: Email-redirect form |
superpimp
Member
Posts: 113
Location: Belgium
Joined: 17.12.05 Rank: Monster |
|
|
willeH wrote:
check you have an smtp server properly set up. Sometimes it does take a while for the email to come through. btw the scblockedript worked for me.
I need to setup an smtp server too? I got WAMP php server set up but that wont do i presume. How do I install a smtp server


 |
|
|
|
|