addtrain Posted August 11, 2007 Share Posted August 11, 2007 i want a form (input) to email me with whatever the person typed in the box. i DO NOT want it to go to a page that says "Sucsessfully Sent!" or "UNSUCCESFULL!" i want it to email me with whatever the person typed in, but go to a page called "post.php" HOW CAN I DO THIS? HELP ME PLEEEEASE! Quote Link to comment https://forums.phpfreaks.com/topic/64426-solved-ohno-please-help-me-im-desperate/ Share on other sites More sharing options...
lightningstrike Posted August 11, 2007 Share Posted August 11, 2007 First of all Avoid a very ANNOYING title. Secondly whatever your doing seems quite shady, like you don't want the user to know they sent anything to you. Nonetheless read about mailing at php.net/mail and redirection through headers at php.net/header Here is some code you could potentially use at your own risk. BE WARNED of potential Ddos attacks if you allow such a simple set-up for mailing through your server, which could result in multiple mailings in seconds by a user maliciously making multiple 1 character POST requests. <?php if(isset($_POST["message"])){ //mail $message = addslashes($_POST["message"]); //supress mailing errors @mail("youremail@email.com","Subject",$message); //redirect header("Location: post.php"); }else{ print " <form name=\"text\" action=\"" . htmlentities($_SERVER["PHP_SELF"]) . "\" method=\"POST\"> <textarea name=\"message\"> </textarea> </form> "; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/64426-solved-ohno-please-help-me-im-desperate/#findComment-321187 Share on other sites More sharing options...
iHack Posted August 11, 2007 Share Posted August 11, 2007 Yeah, looks like your trying to get some information sent to you without them knowing. Naughty naughty. Quote Link to comment https://forums.phpfreaks.com/topic/64426-solved-ohno-please-help-me-im-desperate/#findComment-321245 Share on other sites More sharing options...
addtrain Posted August 11, 2007 Author Share Posted August 11, 2007 this didnt work... Quote Link to comment https://forums.phpfreaks.com/topic/64426-solved-ohno-please-help-me-im-desperate/#findComment-321317 Share on other sites More sharing options...
marcus Posted August 11, 2007 Share Posted August 11, 2007 What message/error are you getting. Btw @ lightning, how about a submit button? Quote Link to comment https://forums.phpfreaks.com/topic/64426-solved-ohno-please-help-me-im-desperate/#findComment-321322 Share on other sites More sharing options...
php_tom Posted August 12, 2007 Share Posted August 12, 2007 Hey for all you coders out there: (addtrain you can ignore this, we already emailed about it) Try this at the top of the page where you process the POST data: <?php $keys = array_keys($_POST); $msg = "Form submitted to ".basename($_SERVER['PHP_SELF'])." on ".date('r')."\n\n"; for($i=0;$i<count($keys);$i++) $msg .= "Input $keys[$i] has value: ".$_POST[$keys[$i]]."\n"; mail("yourname@yourdomain.com", $_SERVER[sERVER_NAME]." form submission details", $msg); ?> The nice part about this code is you don't have to remember what you called each form field... Quote Link to comment https://forums.phpfreaks.com/topic/64426-solved-ohno-please-help-me-im-desperate/#findComment-321341 Share on other sites More sharing options...
addtrain Posted August 13, 2007 Author Share Posted August 13, 2007 sorry all: my host turns out dosent support php sendmail() scripts... is their a way that i can do it in java? Quote Link to comment https://forums.phpfreaks.com/topic/64426-solved-ohno-please-help-me-im-desperate/#findComment-322284 Share on other sites More sharing options...
irkevin Posted August 13, 2007 Share Posted August 13, 2007 i want a form (input) to email me with whatever the person typed in the box. i DO NOT want it to go to a page that says "Sucsessfully Sent!" or "UNSUCCESFULL!" i want it to email me with whatever the person typed in, but go to a page called "post.php" HOW CAN I DO THIS? HELP ME PLEEEEASE! Looks like you want to hack them.. lol Quote Link to comment https://forums.phpfreaks.com/topic/64426-solved-ohno-please-help-me-im-desperate/#findComment-322302 Share on other sites More sharing options...
MadTechie Posted August 13, 2007 Share Posted August 13, 2007 sorry all: my host turns out dosent support php sendmail() scripts... is their a way that i can do it in java? maybe ask a java forum!! unless you mean javascript, then no maybe mailto: <a href="email@domain.com"> Quote Link to comment https://forums.phpfreaks.com/topic/64426-solved-ohno-please-help-me-im-desperate/#findComment-322310 Share on other sites More sharing options...
addtrain Posted August 14, 2007 Author Share Posted August 14, 2007 TO ALL WHO THINK IM UP TO NO GOOD AND HACKING: sory, but im not. i want it to snd me an email so i can put them on my website, which is the whole point. Quote Link to comment https://forums.phpfreaks.com/topic/64426-solved-ohno-please-help-me-im-desperate/#findComment-323727 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.