tbare Posted December 5, 2007 Share Posted December 5, 2007 well, i got the sending e-mail part... here's the problem: i'm sending a URL (e.g. http://www.domain.com/play.php?file=blah%20blah.avi&title=blah%20blah) problem is, somewhere on the e-mail send page, i'm losing everything after the first %20 <?php // --- CONFIG PARAMETERS --- // $url = $_POST['url']; $custom_message = $_POST['custom_message']; $custom_message = stripslashes($custom_message); $email_recipient = $_POST['recipient_email']; $recipient_name = $_POST['recipient_name']; $email_sender = $_POST['sender_name']; $email_return_to = $_POST['sender_email']; $email_content_type = "text/html; charset=us-ascii"; $email_client = "PHP/" . phpversion(); // --- DEFINE HEADERS --- // $email_header = "From: " . $email_return_to . "\r\n"; $email_header .= "Reply-To: " . $email_return_to . "\r\n"; $email_header .= "Return-Path: " . $email_return_to . "\r\n"; $email_header .= "Content-type: " . $email_content_type . "\r\n"; $email_header .= "X-Mailer: " . $email_client . "\r\n"; // --- SUBJECT AND CONTENTS --- // $email_subject = "$email_sender has sent you a link from wannafork.com"; $email_contents = "<html>"; $email_contents .= "<h2>Your friend ($email_sender) has sent you, $recipient_name, a link!</h2>"; $email_contents .= "<br><b>Sender: </b>" . $email_sender; $email_contents .= "<br><b>link: </b>" . $url; $email_contents .= "<br><br><b>Message from </b>" . $email_sender; $email_contents .= ":<br>\n" . $custom_message; $email_contents .= "</html>"; // --- SEND MAIL --- // $email_result = mail($email_recipient, $email_subject, $email_contents, $email_header); if ($email_result) echo "Email has been sent!"; else echo "Email has failed!"; ?> where: $url = http://www.domain.com/play.php?file=blah%20blah.avi&title=blah%20blah any ideas? Quote Link to comment Share on other sites More sharing options...
tbare Posted December 5, 2007 Author Share Posted December 5, 2007 solved with a simple $url = preg_replace('/ /', '%20', $url); Quote Link to comment 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.