cerberus478 Posted March 19, 2012 Share Posted March 19, 2012 Hi I would like to know how to make a form where a person can enter an email of a couple of friends. I have looked on the internet and I'm not finding anything. Can someone help. Thank you Quote Link to comment https://forums.phpfreaks.com/topic/259241-form-question/ Share on other sites More sharing options...
Muddy_Funster Posted March 19, 2012 Share Posted March 19, 2012 seriously? you couldn't find a "mail to" form/script on the internet? There are thousands of examples of mail forms, from the simple to->from using php mail() to the complex using server authentication and delayed sending. Quote Link to comment https://forums.phpfreaks.com/topic/259241-form-question/#findComment-1328951 Share on other sites More sharing options...
cerberus478 Posted March 19, 2012 Author Share Posted March 19, 2012 I have to save the emails into a database. Is it the same thing? Quote Link to comment https://forums.phpfreaks.com/topic/259241-form-question/#findComment-1328953 Share on other sites More sharing options...
Muddy_Funster Posted March 19, 2012 Share Posted March 19, 2012 storing the information into a database is as simple as inserting the contnents of the variables that you are using to build the mail. once you have the information then you can use it as many times for as many functions as you like. $to = "recipient@their.net"; $from = "sender@your.net"; $subject = "This Is an Email"; $body = <<<BODY This is your message body. You can store all this into a database either before or after it is sent. BODY; $query = "INSERT INTO myMailTable (m_to, m_from, m_subject, m_body) VALUES ('$to', '$from', '$subject', '$body')"; $insert = mysql_query($query) or die ("$query<br><SPAN STYLE=\"color:red;\">Caused The following error:</SPAN><BR><BR>".mysql_error()); $header_array = array( 'From: '.$from, 'Reply-To: replyAddress@optional.setting',...); $headers = implode ('\n\r', $header_array); $send_it = mail($to, $subject, $body, $headers); echo $send_it; Quote Link to comment https://forums.phpfreaks.com/topic/259241-form-question/#findComment-1328958 Share on other sites More sharing options...
Jamied_uk Posted March 19, 2012 Share Posted March 19, 2012 Hi i need a form for that reply above (php) as php on its own and it has no form, please help Quote Link to comment https://forums.phpfreaks.com/topic/259241-form-question/#findComment-1329016 Share on other sites More sharing options...
scootstah Posted March 19, 2012 Share Posted March 19, 2012 Hi i need a form for that reply above (php) as php on its own and it has no form, please help Huh? Quote Link to comment https://forums.phpfreaks.com/topic/259241-form-question/#findComment-1329018 Share on other sites More sharing options...
AyKay47 Posted March 19, 2012 Share Posted March 19, 2012 Hi i need a form for that reply above (php) as php on its own and it has no form, please help Third time that you have posted an off-topic post on someone else thread. Having a bit of fun or something? Quote Link to comment https://forums.phpfreaks.com/topic/259241-form-question/#findComment-1329019 Share on other sites More sharing options...
Jamied_uk Posted March 19, 2012 Share Posted March 19, 2012 only have fun learning lol i am stuck tryin 2 use mysql and php and yes other threads are close to same problems i am getting and know replys on existing posts are better as emails go out to experts like yourself to help but if that fails i could make a new thread but dint want multiples of threads tbh i doubt the moderators do either, but not 100% sure on that, all i know is im stuck lol Quote Link to comment https://forums.phpfreaks.com/topic/259241-form-question/#findComment-1329034 Share on other sites More sharing options...
dmikester1 Posted March 19, 2012 Share Posted March 19, 2012 Jamied_ui, I would recommend starting your own thread asking very specifically what you are looking for help with. And also indicate what you have tried so far. Mike Quote Link to comment https://forums.phpfreaks.com/topic/259241-form-question/#findComment-1329038 Share on other sites More sharing options...
Jamied_uk Posted March 19, 2012 Share Posted March 19, 2012 it wont let me comment or reply on my own thread so il have to ask where i can and also more subscribers to the thread is faster response time <?php error_reporting (E_ALL ^ E_NOTICE); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Members Upload Page</title> <link href="/css/loginmodule.css" rel="stylesheet" type="text/css" /> </head> <body> <body style="background:#000000"> <link rel="shortcut icon" href="/favicon.ico"> <style type="text/css"> A{font:18px/20px Verdana;color:#33CC66;margin-left:10px;} #Header{font:18px Verdana;font-weight:bold;text-align:center;color:#000000;} .TableHeader{font:18px Verdana;font-weight:bold;color:#000000;padding-left:15px;} .BodyCaption{font:18px/20px Verdana;font-weight:bold;color:#000000;} .BodyText{font:11px/20px Verdana;color:#000000;margin-left:20px;} </style> <a style="#00FF80"> <h1>Welcome <?php echo $_SESSION['SESS_FIRST_NAME'];?></h1> <a href="/">Back To Home Page</a> | <a href="/">Back</a> <p> <center> <p>Profile Picture Uploader </p> <tr> <td colspan="3"> <h1>J~Net</h1> <form enctype="multipart/form-data" action="up2.php" method="POST"> Please choose a file: <input name="uploaded" type="file" /><br /> <input type="submit" value="Upload" /pics> </form> <?php $target = "/pics"; $target = $target . basename( $_FILES['uploaded']['name']) ; $filename = $target . basename( $_FILES['uploaded']['name']) ; $path = $target = "/pics"; $mysql_path = $path."/".$filename; $ok=1; if(move_uploaded_file($_FILES['uploaded']['tmp_name'], $target)) { echo "The file ". basename( $_FILES['uploadedfile']['name']). " has been uploaded"; } else { echo "Please Browse For The File You Wish To Upload."; } ?> </td> <P>You Are Authorised To View The Following Pages... </p> <center> <a href="/developer/jay/uploads/">View Uploaded Files</a></p> <a href="/apps/time_clock/timeclock.php">Clock In</a></p> Default password is "password" and should be changed!<p> </p> </p> <a href="http://www.box.net/shared/a6ztyzdodn">J~Webs Start Page Update File (From Box.net)!</a></p> <?php include("connect.inc.php"); //sql query to be executed. $sql = "INSERT INTO `users`(`filename`,`path`) VALUES ('$filename','$mysql_path')"; ?> </a><br><br><form action="http://google.com/search" name=f><table cellpadding=0 cellspacing=0><tr valign=top><td width=25%> </td><td align=center nowrap><input name=hl type=hidden value=en><input maxlength=2048 name=q size=55 title="Google Search" value=""><br><input name=btnG type=submit value="Google Search"><input name=btnI type=submit value="I'm Feeling Lucky"></td><td nowrap width=25%><font size=-2> <a href=http://google.com/advanced_search?hl=en>Advanced Search</a><br> <a href=http://google.com/preferences?hl=en>Preferences</a><br> <a href=http://google.com/language_tools?hl=en>Language Tools</a></font></td></tr><tr><td align=center colspan=3><font size=-1><span style="text-align:left">Search: <input id=all type=radio name=meta value="" checked><label for=all> the web </label><input id=cty type=radio name=meta value="cr=countryUK|countryGB"><label for=cty> pages from the UK <p><a href="/"><img src="input.gif" </a> <center> <?php include "/css/footer.php"; ?> </body> </html> page shows but no file is uploaded and no database updates happen any ideas please? Quote Link to comment https://forums.phpfreaks.com/topic/259241-form-question/#findComment-1329095 Share on other sites More sharing options...
Muddy_Funster Posted March 19, 2012 Share Posted March 19, 2012 reading and adhearing to the rules, as well as not behaving like an ass on too many espresso's will get you far more productive responses than hijacking a thread. There is nothing wrong with your currently open thred, I could post a reply there if I wanted to. and before you even think about starting, this IS me helping you. Quote Link to comment https://forums.phpfreaks.com/topic/259241-form-question/#findComment-1329105 Share on other sites More sharing options...
Jamied_uk Posted March 19, 2012 Share Posted March 19, 2012 it wont let me post there iv said that and im not hijacking nothing where all in similar boats Quote Link to comment https://forums.phpfreaks.com/topic/259241-form-question/#findComment-1329109 Share on other sites More sharing options...
Jamied_uk Posted March 19, 2012 Share Posted March 19, 2012 sorted now moved to http://www.phpfreaks.com/forums/index.php?topic=356049.0 please help on that post to prevent the "hijacking" Quote Link to comment https://forums.phpfreaks.com/topic/259241-form-question/#findComment-1329118 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.