Skeleten Neteleks
Members-
Posts
51 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
Skeleten Neteleks's Achievements
Newbie (1/5)
0
Reputation
-
Form-to-email only sends email to hotmail...
Skeleten Neteleks replied to Skeleten Neteleks's topic in PHP Coding Help
I'm missing something obvious aren't I! -
Form-to-email only sends email to hotmail...
Skeleten Neteleks replied to Skeleten Neteleks's topic in PHP Coding Help
Actually this issue has popped up again. I am seeking help with my hosting company (no longer doing it in-house) but preliminary diagnosis seems to indicate that the script is fine... and their servers don't have any restrictions... about who mail is sent to... please help!!! -
I'll settle for passwording in Word for now! Another question (tell me if I'm asking for too much)... I will at some point be writing up a rather large form, preferrably in HTML so I don't get muddled up in PHP code. The form should post to a PHP file which: 1. Sends the user a html email which contains the form values, and... 2. Sends the user to a html page generated by the same code used for the email message Feel free to tell me to bugger off at any point! thanks
-
Form-to-email only sends email to hotmail...
Skeleten Neteleks replied to Skeleten Neteleks's topic in PHP Coding Help
Nevermind, we're using an in-house web server on the intranet. I ran the script on my 34sp.com PHP enabled server and it worked fine. thanks anyway -
Hi, I am using the script below to send two html emails. One goes to my personal hotmail address (which is set in the PHP script), and the other goes to an email address which is typed into the form. I have tested both methods and I have no problem receiving the email to my hotmail address. I have tried addresses ending in @webnet2000.net and @tiscali.co.uk and @fsmail.net - no email received on any of them. Junk folders are empty and there are no known spam blockers in effect. Can anyone tell me where I'm going wrong? [code]<?php function wpautop($pee, $br = 1) { $pee = $pee . "\n"; // just to make things a little easier, pad the end $pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee); // Space things out a little $pee = preg_replace('!(<(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)!', "\n$1", $pee); $pee = preg_replace('!(</(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])>)!', "$1\n\n", $pee); $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines $pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates $pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "$1<p>\n", $pee); // make paragraphs, including one at the end $pee = preg_replace('|<p>\s*?</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace $pee = preg_replace('!<p>\s*(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*</p>!', "$1", $pee); // don't pee all over a tag $pee = preg_replace("|<p>(<li.+?)</p>|", "$1", $pee); // problem with nested lists $pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $pee); $pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee); $pee = preg_replace('!<p>\s*(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)!', "$1", $pee); $pee = preg_replace('!(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*</p>!', "$1", $pee); if ($br) $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); $pee = preg_replace('!(</?(?:table|thead|tfoot|caption|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*<br />!', "$1", $pee); $pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)!', '$1', $pee); $pee = preg_replace('!(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') . stripslashes(clean_pre('$2')) . '</pre>' ", $pee); return stripslashes($pee); } $name = stripslashes($_POST['name']); $date = $_POST['date']; $email = $_POST['email']; $message = wpautop($_POST['message']); //change this to your email. $to1 = "someone@hotmail.com"; $from1 = "noreply@domain.com"; $subject1 = "$name's profile - $date"; //change this to your email. $to2 = "$email"; $from2 = "noreply@domain.com"; $subject2 = "$name's profile - $date"; //begin of HTML message $message1 = <<<EOF <html> <head></head> <body> Message: $message </body> </html> EOF; $message2 = <<<EOF <html> <head></head> <body> Message: $message </body> </html> EOF; //end of message $headers1 = "From: $from1\r\n"; $headers1 .= "Content-type: text/html\r\n"; $headers2 = "From: $from2\r\n"; $headers2 .= "Content-type: text/html\r\n"; //options to send to cc+bcc //$headers .= "Cc: [email][/email]"; //$headers .= "Bcc: [email][/email]"; header("Location: thankyou.html"); // now lets send the email. mail($to1, $subject1, $message1, $headers1); mail($to2, $subject2, $message2, $headers2); ?>[/code]
-
I also need to add links to some of the word document files that are on the server. I figure I can put the links in the "Description" box on my database? At the moment, anyone can download the word documents if they explore the diretcories of my site. Is there any way to use php to password protect the word document files so that only the clients on the database can access them for download? I will use Word's password feature in the meantime, but I don't know how secure that will be... I tried googling this but I kept getting mistaken results and it's just frustrating!!!
-
Form-to-email formatting script issue...
Skeleten Neteleks replied to Skeleten Neteleks's topic in PHP Coding Help
No takers? dang... thanks anyway -
Hi, I use the code below to send a html email which retains the paragraph formatting of form fields such as text areas and removes unwanted slashes. The problem is that any form field I use this script with, makes a white space above and below the data entered into the form field. For example, if someone types in a textarea "Hello world", it will display in my email message as: " Hello world " (the speech marks are used to indicate the extra space being added). Is there any way to stop the extra space being added? Please help! the offending code is below: [code]<?php function wpautop($pee, $br = 1) { $pee = $pee . "\n"; // just to make things a little easier, pad the end $pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee); // Space things out a little $pee = preg_replace('!(<(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)!', "\n$1", $pee); $pee = preg_replace('!(</(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])>)!', "$1\n\n", $pee); $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines $pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates $pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "<p>$1</p>\n", $pee); // make paragraphs, including one at the end $pee = preg_replace('|<p>\s*?</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace $pee = preg_replace('!<p>\s*(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*</p>!', "$1", $pee); // don't pee all over a tag $pee = preg_replace("|<p>(<li.+?)</p>|", "$1", $pee); // problem with nested lists $pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $pee); $pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee); $pee = preg_replace('!<p>\s*(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)!', "$1", $pee); $pee = preg_replace('!(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*</p>!', "$1", $pee); if ($br) $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); $pee = preg_replace('!(</?(?:table|thead|tfoot|caption|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*<br />!', "$1", $pee); $pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)!', '$1', $pee); $pee = preg_replace('!(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') . stripslashes(clean_pre('$2')) . '</pre>' ", $pee); return stripslashes($pee); } [/code] cheers
-
Erm... how would one go about configuring the pages to look like all the others on my website? I have experimented in adding my page template code into the script in index.php but with no luck - I get the PHP code display on the page in a chunk. My code needs to use both speech marks and apostrophies (some javascript involved). thanks
-
Great! It worked. cheers pal!
-
Hi, I'm using a PHP mailer script which I have used before successfully. However, now that I've configured the html output of the email message, I get this error: [quote]Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /usr/local/psa/home/vhosts/adkm.34sp.com/httpdocs/output.php on line 203[/quote] I'm not sure where the extra whitespace is... please help! [code] <?php function wpautop($pee, $br = 1) { $pee = $pee . "\n"; // just to make things a little easier, pad the end $pee = preg_replace('|<br />\s*<br />|', "\n\n", $pee); // Space things out a little $pee = preg_replace('!(<(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)!', "\n$1", $pee); $pee = preg_replace('!(</(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])>)!', "$1\n\n", $pee); $pee = str_replace(array("\r\n", "\r"), "\n", $pee); // cross-platform newlines $pee = preg_replace("/\n\n+/", "\n\n", $pee); // take care of duplicates $pee = preg_replace('/\n?(.+?)(?:\n\s*\n|\z)/s', "<p>$1</p>\n", $pee); // make paragraphs, including one at the end $pee = preg_replace('|<p>\s*?</p>|', '', $pee); // under certain strange conditions it could create a P of entirely whitespace $pee = preg_replace('!<p>\s*(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*</p>!', "$1", $pee); // don't pee all over a tag $pee = preg_replace("|<p>(<li.+?)</p>|", "$1", $pee); // problem with nested lists $pee = preg_replace('|<p><blockquote([^>]*)>|i', "<blockquote$1><p>", $pee); $pee = str_replace('</blockquote></p>', '</p></blockquote>', $pee); $pee = preg_replace('!<p>\s*(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|hr|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)!', "$1", $pee); $pee = preg_replace('!(</?(?:table|thead|tfoot|caption|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*</p>!', "$1", $pee); if ($br) $pee = preg_replace('|(?<!<br />)\s*\n|', "<br />\n", $pee); $pee = preg_replace('!(</?(?:table|thead|tfoot|caption|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|select|form|blockquote|address|math|p|h[1-6])[^>]*>)\s*<br />!', "$1", $pee); $pee = preg_replace('!<br />(\s*</?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)>)!', '$1', $pee); $pee = preg_replace('!(<pre.*?>)(.*?)</pre>!ise', " stripslashes('$1') . stripslashes(clean_pre('$2')) . '</pre>' ", $pee); return stripslashes($pee); } //change this to your email. $to = "myemail@hotmail.com"; $from = "noreply"; $subject = "$email's Job Search Evidence - $centre - $date"; $name = $_POST['name']; $date = $_POST['date']; $centre = $_POST['centre']; $email = $_POST['email']; $sitesandpapers = wpautop($_POST['sitesandpapers']); $phcompany1 = $_POST['phcompany1']; $phcompany2 = $_POST['phcompany2']; $phcompany3 = $_POST['phcompany3']; $phname1 = $_POST['phname1']; $phname2 = $_POST['phname2']; $phname3 = $_POST['phname3']; $phnumber1 = $_POST['phnumber1']; $phnumber2 = $_POST['phnumber2']; $phnumber3 = $_POST['phnumber3']; $phpurpose1 = $_POST['phpurpose1']; $phpurpose2 = $_POST['phpurpose2']; $phpurpose3 = $_POST['phpurpose3']; $phresult1 = $_POST['phresult1']; $phresult2 = $_POST['phresult2']; $phresult3 = $_POST['phresult3']; $updatedcv = $_POST['updatedcv']; $jobsearchactivities = wpautop($_POST['jobsearchactivities']); $appcom1 = $_POST['appcom1']; $appcom2 = $_POST['appcom2']; $appcom3 = $_POST['appcom3']; $appcom4 = $_POST['appcom4']; $appcom5 = $_POST['appcom5']; $appcom6 = $_POST['appcom6']; $appmet1 = $_POST['appmet1']; $appmet2 = $_POST['appmet2']; $appmet3 = $_POST['appmet3']; $appmet4 = $_POST['appmet4']; $appmet5 = $_POST['appmet5']; $appmet6 = $_POST['appmet6']; $apppos1 = $_POST['apppos1']; $apppos2 = $_POST['apppos2']; $apppos3 = $_POST['apppos3']; $apppos4 = $_POST['apppos4']; $apppos5 = $_POST['apppos5']; $apppos6 = $_POST['apppos6']; $appsent1 = $_POST['appsent1']; $appsent2 = $_POST['appsent2']; $appsent3 = $_POST['appsent3']; $appsent4 = $_POST['appsent4']; $appsent5 = $_POST['appsent5']; $appsent6 = $_POST['appsent6']; $appsent7 = $_POST['appsent7']; $appsent8 = $_POST['appsent8']; $appsent9 = $_POST['appsent9']; $appsent10 = $_POST['appsent10']; $appsent11 = $_POST['appsent11']; $appsent12 = $_POST['appsent12']; $appsent13 = $_POST['appsent13']; $appsent14 = $_POST['appsent14']; $appsent15 = $_POST['appsent15']; $appsent16 = $_POST['appsent16']; $appsent17 = $_POST['appsent17']; $appsent18 = $_POST['appsent18']; $appsent19 = $_POST['appsent19']; $appsent20 = $_POST['appsent20']; $appsent21 = $_POST['appsent21']; $appsent22 = $_POST['appsent22']; $appsent23 = $_POST['appsent23']; $appsent24 = $_POST['appsent24']; $appdatesent1 = $_POST['appdatesent1']; $appdatesent2 = $_POST['appdatesent2']; $appdatesent3 = $_POST['appdatesent3']; $appdatesent4 = $_POST['appdatesent4']; $appdatesent5 = $_POST['appdatesent5']; $appdatesent6 = $_POST['appdatesent6']; $appaddress1 = wpautop($_POST['appaddress1']); $appaddress2 = wpautop($_POST['appaddress2']); $appaddress3 = wpautop($_POST['appaddress3']); $appaddress4 = wpautop($_POST['appaddress4']); $appaddress5 = wpautop($_POST['appaddress5']); $appaddress6 = wpautop($_POST['appaddress6']); //begin of HTML message $message = <<<EOF <html> <head> <style type="text/css"> body, td { background-color: white; font-family: Arial; font-size: 12px; color: black; } </style> </head> <body> <table width="600" cellpadding="5" style="border: 3 double black"> <tr> <td style="font-size: 16px"><strong>$email's</strong> Job Search Evidence</td> <td align="right" style="font-size: 16px"><strong>$centre - $date</strong></td> </tr> </table> <div style="margin-left: 11px"> <p><strong>Web sites and newspapers:</strong> <br><font color="blue">$sitesandpapers</font> <p><strong>Phone Calls</strong> <br><table width="600"> <tr> <td>Company #1</td><td><font color="blue">$phcompany1</font></td> <td>Company #2</td><td><font color="blue">$phcompany2</font></td> <td>Company #3</td><td><font color="blue">$phcompany3</font></td> </tr> <tr> <td>Spoke to:</td><td><font color="blue">$phname1</font></td> <td>Spoke to:</td><td><font color="blue">$phname2</font></td> <td>Spoke to:</td><td><font color="blue">$phname3</font></td> </tr> <tr> <td>Number:</td><td><font color="blue">$phnumber1</font></td> <td>Number:</td><td><font color="blue">$phnumber2</font></td> <td>Number:</td><td><font color="blue">$phnumber3</font></td> </tr> <tr> <td>Purpose:</td><td><font color="blue">$phpurpose1</font></td> <td>Purpose:</td><td><font color="blue">$phpurpose2</font></td> <td>Purpose:</td><td><font color="blue">$phpurpose3</font></td> </tr> <tr> <td>Result:</td><td><font color="blue">$phresult1</font></td> <td>Result:</td><td><font color="blue">$phresult2</font></td> <td>Result:</td><td><font color="blue">$phresult3</font></td> </tr> </table> <p><strong>Other job search activities:</strong> <br><font color="blue">$jobsearchactivities</font> <p><strong>Applications</strong> <br><table width="600"> <tr> <td> Company #1: <font color="blue">$appcom1</font> / Method: <font color="blue">$appmet1</font> / Position: <font color="blue">$apppos1</font> <br>Sent: <font color="blue">$appsent1 $appsent2 $appsent3 $appsent4</font> / Date: <font color="blue">$appdatesent1</font> <br>Address: <font color="blue">$appaddress1</font></td> </tr> <tr> <td>Company #2: <font color="blue">$appcom2</font> / Method: <font color="blue">$appmet2</font> / Position: <font color="blue">$apppos2</font> <br>Sent: <font color="blue">$appsent5 $appsent6 $appsent7 $appsent8</font> / Date: <font color="blue">$appdatesent2</font> <br>Address: <font color="blue">$appaddress2</font></td> </tr> <tr> <td>Company #3: <font color="blue">$appcom3</font> / Method: <font color="blue">$appmet3</font> / Position: <font color="blue">$apppos3</font> <br>Sent: <font color="blue">$appsent9 $appsent10 $appsent11 $appsent12</font> / Date: <font color="blue">$appdatesent3</font> <br>Address: <font color="blue">$appaddress3</font></td> </tr> <tr> <td>Company #4: <font color="blue">$appcom4</font> / Method: <font color="blue">$appmet4</font> / Position: <font color="blue">$apppos4</font> <br>Sent: <font color="blue">$appsent13 $appsent14 $appsent15 $appsent16</font> / Date: <font color="blue">$appdatesent4</font> <br>Address: <font color="blue">$appaddress4</font></td> </tr> <tr> <td>Company #5: <font color="blue">$appcom5</font> / Method: <font color="blue">$appmet5</font> / Position: <font color="blue">$apppos5</font> <br>Sent: <font color="blue">$appsent17 $appsent18 $appsent19 $appsent20</font> / Date: <font color="blue">$appdatesent5</font> <br>Address: <font color="blue">$appaddress5</font></td> </tr> <tr> <td>Company #6: <font color="blue">$appcom6</font> / Method: <font color="blue">$appmet6</font> / Position: <font color="blue">$apppos6</font> <br>Sent: <font color="blue">$appsent21 $appsent22 $appsent23 $appsent24</font> / Date: <font color="blue">$appdatesent6</font> <br>Address: <font color="blue">$appaddress6</font></td> </tr> <tr> <td align="right" style="padding-right: 50px"><input type="button" value="Print" onclick="window.print()"></td> </tr> </table> </div> </body> </html> EOF; //end of message $headers = "From: $from\r\n"; $headers .= "Content-type: text/html\r\n"; //options to send to cc+bcc $headers .= "Cc: [email]$email[/email]"; //$headers .= "Bcc: [email][/email]"; header("Location: http://thankyou/"); // now lets send the email. mail($to, $subject, $message, $headers); ?>[/code]