Follow us on Twitter!
One mans freedom fighter, another's terrorist.
Friday, April 18, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 29
Guests Online: 24
Members Online: 5

Registered Members: 82829
Newest Member: mmoclauq
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

Email-redirect form


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 26-12-05 23:04
I need a form, when it's submitted the data needs to go to my email client and the page needs to be redirected.

Code
<script language="JavaScript">

function mailMe( form ) {
        // put some checks here
        return true;
}

</script>
<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


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 26-12-05 23:26
Code

<?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 script 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 on 26-12-05 23:31
Author

RE: Email-redirect form


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 26-12-05 23:28
Code
<?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


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 27-12-05 09:37
Xero wrote:
Code

<?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 script 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:
Code
<?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


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 27-12-05 11:33
check you have an smtp server properly set up. Sometimes it does take a while for the email to come through. btw the script worked for me.


Author

RE: Email-redirect form


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 27-12-05 11:34
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


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 27-12-05 13:28
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 script 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