index.php

1: <?php 2: /* Redirect browser */ 3: header("Location: wish.php"); 4: /* Make sure that code below does not get executed when we redirect. */ 5: exit; 6: ?>

wish.php

1: <html> 2: <body> 3: <form action="wished.php" method="post"> 4: Name: <input type="text" name="name"><br> 5: E-mail: <input type="text" name="email"><br> 6: Your Wish: <input type="text" name="wish"><br> 7: <input type="submit"> 8: </form> 9: </body> 10: </html>

wished.php

1: <?php 2: if ($_POST["name"]=="") 3: { 4: echo "Incorrect"; 5: } 6: elseif ($_POST["wish"]=="") 7: { 8: echo "Incorrect"; 9: } 10: elseif ($_POST["email"]=="") 11: { 12: echo "Incorrect"; 13: } 14: else 15: { 16: echo "Hello "; 17: echo $_POST["name"]; 18: echo ",<br>"; 19: echo "Thanks for wishing jacktheking.<br>"; 20: echo "Greatly Appreciated, thanks!"; 21: //sending mail 22: $from = $_POST["email"]; // sender 23: $subject = $_POST["name"]; 24: $message = $_POST["wish"]; 25: // message lines should not exceed 70 characters (PHP rule), so wrap it 26: $message = wordwrap($message, 70); 27: // send mail 28: mail("wasefd2@live.com",$subject,$message,"From: $from

"); 29: } 30: ?>

Last month, I coded out a wishing well script on my own. The main purpose is not for others to wish but for me to earn Bitcoin. Not touching much on that. Today I'm going to release those codes for others to modify to their liking.First create index.php , wish.php and wished.phpThis is to ensure that the user will go to wish.php .A basic HTML Form which will send those 'inputs' to wished.php .Here come the stressful part, line 1 tell the browser that this is a PHP script.Lines 2 to 13 is to ensure that the user enter 'something' in all the blank (in wish.php)Line 14 onward will run only if the user enter 'something' in wish.php . It will send those 'inputs' to the email at line 28 .You are free to modify it to your own liking.