PHP - Random Character Showing Up In Html Email Sent From Php...
sorry, this is kinda annoying to look at but its the best way to show my problem...
this : Code: [Select] $headers = "From: $email_from\r\n"; $headers .= "Content-type: text/html\r\n"; $email_message ='xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' .'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' .'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' .'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' .'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' .'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' .'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' .'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' .'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' .'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' .'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx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xxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx Do you see the '! ' ?? why why why why why why?!?!?! I'm going freaking crazy trying to figure this out!!!! Thanks a billion in advanced! Nick Similar TutorialsI have a simple contact form with a textarea field, where the visitor can type a message in. However, if the user enters paragraphs or any type of line breaks, then the email that is sent shows the "\r\n" characters. I've tried using the nl2br function to no avail. Here's a sample code snippet: Code: [Select] $message = $_POST["message"]; // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From: '. $_POST["email"]; mail($to, $subject, $message, $headers); Am I missing something? Besides the "\r\n" characters showing, everything else works fine. I would like to have a generator that basically creates a certain number of mixed characters. For example 6 characters which use A and B It would randomly produce things such as ABAABA BABABB I cannot think of any basic ways of achieving this. Any help would be appreciated even if its written rather than code. Thank you in advance. Hey all, I'm looking to produce a random 10 character string like: abcABC0123 when the below method is called: <?php function randomize(){ $chars = explode(' ',(range("a","z"))) . explode(' ',(range("A","Z"))) . explode(' ',(range("0","9"))); $pass = ""; for($i = 0; $i < $len; $i += 1){ array_push($pass,$chars[rand(count($chars)-1)]); } return $pass; } var_dump(randomize(10)); ?> But the randomize method is not returning desired result. Any idea what I'm doing wrong? Thanks for response. i have to tables... forums & subscription i would like to insert a random character string into 'forums' to be used as a subscription id. and then have the same random string to be inserted into 'subscription' This happens from time to time and it really drives me crazy. I cannot get the problem to reproduce, although I have plenty of evidence that it is happening. I have a php page that pulls in some database from mssql formats it in a nice table then send via email to a 3rd party. All of that works great. What happens is in some of the emails the first column will show the table cell information for the next column. See example: Code: [Select] Mascaw Mar. 8, 2012 - 6:15 pm Ronnie Johnson Newtown Pike<td width="150"> Mar. 8, 2012 - 6:15 pm Todd Doe Hall of Justice Mar. 8, 2012 - 6:15 pm Carol French I had this problem before with another emailing system and found that wrapping the email to 900 before sending it out fixed it. I wrapped this with $message = wordwrap($message, 900, "\n", true);() but it doesn't seem to make a difference. Anyone ran into this before? Any help would be greatly appreciated! Thanks Ok I am very new to php so please excuse my lack of knowledge. I have a simple contact form that I have placed onto one of my sites. The form works correctly in that it get sent to the correct address without any problems. The issue I am having is with the 'From' header. It will not show the senders email address as I would like. Instead it seems to be showing the server address. I have been 'playing' with the code for 2 days now and I still cannot get it to work. Any suggestions would be greatfully received. Regards. Code: [Select] <?php if(!$_POST) exit; $email = $_POST['Email']; $name = $_POST['Name']; $telephone = $_POST['Telephone']; $comments = $_POST['Comments']; //$error[] = preg_match('/\b[A-Z0-9._%-]+@[A-Z0-9.-]+\.[A-Z]{2,4}\b/i', $_POST['email']) ? '' : 'INVALID EMAIL ADDRESS'; if(!eregi("^[a-z0-9]+([_\\.-][a-z0-9]+)*" ."@"."([a-z0-9]+([\.-][a-z0-9]+)*)+"."\\.[a-z]{2,}"."$",$email )){ $error.="Invalid email address entered"; $errors=1; } if($errors==1) echo $error; else{ $values = array ('Name','Email','Telephone','Comments'); $required = array('Name','Email','Telephone','Comments'); $your_email = "**********************"; $email_name = "Message From your Website:"; foreach($values as $key => $value){ if(in_array($value,$required)){ if ($key != 'Name' && $key != 'Comments' && $key != 'Telephone') { if( empty($_POST[$value]) ) { echo 'Please go back and complete all fields, thank you.'; exit; } } $email_content .= $value.': '.$_POST[$value]."\n"; } } if(@mail($your_email,$email_name,$email_content)) { echo 'Thank you for your message, we will be in touch shortly'; } else { echo 'ERROR!'; } } $headers = "From: $email\r\n"."Reply-To: $email\r\n".'X-Mailer: PHP/' . phpversion(); @mail($your_email,$name,$email,$telephone,$comments,$headers); ?> I have this code to pull the first few words from the body text to use as a title. But, when the body contains apostrophe, it shows on my title as '. I found the following code that's supposedly fixes the code. But, I can't figure out how. I need to add this: $return = = htmlspecialchars_decode(token_replace($output, 'node', $node), ENT_QUOTES); Or something similar ... to this: Code: [Select] $limit = 10; $text = $node->body[$node->language][0]['value']; $text = strip_tags($text); $words = str_word_count($text, 2); $pos = array_keys($words); if (count($words) > $limit) { $text = substr( $text, 0, $pos[$limit]); $text = trim( $text ); $text = rtrim( $text, '.' ); $text = trim( $text ) . '...'; } return $text; Thanks in advance. I have a question regarding my email form submission. The email seems to work fine, but the recipient of the email can view my server information (see attached image for example) there are many website hosted on my server and i would like to hide the server info on form submissions. does anyone know of a way to do this? thanks I've put together a very simple form & processing script for my site.. Everything works great except the body of the email i receive when the form is submitted contains everything but the info that has been entered into the fields. I'm sure it's something simple that I'm overlooked, but I'm officially stumped. What am I doing wrong here? <?php $mymail = 'ordietryingodt@yahoo.com'; $cc = 'New Recruit To Add!'; $BoDy = ' '; $FrOm = 'FROM:' .$_POST['t1']; $FrOm .= 'Reply-To:' .$_POST['t1']; $FrOm .= 'X-MAILER: PHP'.phpversion(); $BoDy .= 'Quake Live Name: '; $BoDy .= $_POST['t1']; $BoDy .= "\n"; $BoDy .= 'Age: '; $BoDy .= $_POST['t2']; $BoDy .= "\n"; $BoDy .= 'Residing Country: '; $BoDy .= $_POST['t3']; $BoDy .= "\n"; $BoDy .= 'Favorite Game Type: '; $BoDy .= $_POST['t4']; $BoDy .= "\n"; $send = mail("$mymail", "$cc", "$BoDy", "$FrOm"); if($send) { echo '<html><head>'; echo '<meta http-equiv="refresh" content="0;URL=/submitted.htm">'; echo '</head><body>Email send....'; echo '</body></html>'; } ?> Hey guys im having a problem with emailing a link using local host mail. I'm using out look express with Mercury. I shorten the email below as much as possible. Its really wierd the target for the link is correct but clicking on it gives me this res ieframe.dll res://ieframe.dll/syntax.htm#http//localhost/stargate/users/account_settings.php? npd=82b1e0df295ee681f1fa2f213ade823d $to = $_POST['resendemail']; $from = "stargate@localhost.com"; $subject = "Stargate System Lords Password Recovery"; $message = "<html> <body background=\"#4B4B4B\"> <h1>Stargate System Lords Password Recovery</h1> Dear ".$users1['name'].", <br> <center> <a href="localhost/stargate/users/account_settings.php?npd=$new_password ">Log In</a> <p> <br /> </font> </body> </html>"; $headers = "From: Stargate Game Password Recovery <stargate@localhost.com>\r\n"; $headers .= "Content-type: text/html\r\n"; mail($to, $subject, $message, $headers); i'm in an internal organization sending out reminder emails and reports using PHP.. i have all the right encoding and a internal "from" email address. There is one url included in the email however it is an internal intranet site. Outlook still shows the warning message "this may be a phising message and is potentially unsafe..etc" of course the user can click that and then add to safe list but I would like by default that the emails are safe that way the users don't mistake it for spam. i use this to mail (with some other stuff above) $headers .= 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=UTF-8' . "\r\n"; if (!mail($to,$subject,$message,$headers)) echo "notification email failed to send"; any ideas? do i need to talk to my Exchange administrators and get them to add the from email to their safe list and this won't show up as phishing? I have noticed that today that some of the content that is saved from my form is printing random characters and crap. I am using htmlentities on the form input and it seems to be adding more rubbish. I am using the UTF-8 charset as a meta tag. Is this the correct way of using htmlentities? htmlentities($string, ENT_QUOTES, 'UTF-8') Also i noticed the other day with a problem I had that using htmlentities was replacing " with &" when i thought it should have just been " Hello all, I am trying to get a simple members.php page to show some HTML but I cannot figure out why it will not display.. Code: [Select] <?php mysql_connect("myserver", "myname", "mypass") or die(mysql_error()); mysql_select_db("mydb") or die(mysql_error()); if(isset($_COOKIE['ID_my_site'])) { $username = $_COOKIE['ID_my_site']; $pass = $_COOKIE['Key_my_site']; $check = mysql_query("SELECT * FROM Users WHERE name = '$name'")or die(mysql_error()); while($info = mysql_fetch_array( $check )) { if ($password != $info['password']) { header("Location: login.php"); } else { ?> <html> <body> <h1>WHY</h1> </body> </html> <?php } } } else { header("Location: login.php"); } ?> I was googling and read somewhere that it might be a session bug after the initial '<?php tag'? Any help would be greatly appreciated Tokae <?php include 'includes/header.php'; include 'includes/navbar.php'; include 'includes/leftSidebar.php'; ?> <?php if(isset($_GET['update'])){ $the_mentor_id = $_GET['update']; $query = "SELECT * FROM mentor WHERE mentor_id = '$the_mentor_id' "; $update_mentor = mysqli_query($db, $query); while ( $row = mysqli_fetch_assoc($update_mentor) ) { $mentor_id = $row['mentor_id']; ?> <h1>i am h1</h1> <?php } } ?> <?php include 'includes/footer.php'; ?> Why <h1> I am h1</h1> this line is not showing, I am totally new in PHP , Please Help me The php web video script that I'm using displays user/member account pages in google searches. For example, the url displaying the page is the https://webvideosite.com/@chrisj I'm looking for guidance/suggestions on how to have the user/member account pages not appear in searches, either by blocking that somehow, or only having access to it if you are logged into the site. I look forward to any replies I was wondering how does one go about showing results from SELECT query in columns in a html table. I have a list of products in a table, and would like to show them on the page in 4 columns. I have done many searches on google to try and find the sulution, but the majority of what im finding instead is about displaying a table from phpmyadmin as a table in html. If its a large operation to do this, I would be very happy if someone could poiint me in the direction of a tutorial maybe. Here is the code I have so far to display the products, but for some reason, it only show 1 row instead of all the rows from my table. Code: [Select] <?php $dbhost = "localhost"; $dbuser = "user"; $dbpass = "pass"; $dbname = "dbname"; mysql_connect ($dbhost, $dbuser, $dbpass)or die("Could not connect: ".mysql_error()); mysql_select_db($dbname) or die(mysql_error()); $result = mysql_query("SELECT * FROM mcproducts"); while($row = mysql_fetch_array($result)) { $products_local_id = $row['products_local_id']; $productname = $row['product_name']; $thumburl = $row['image_from_url']; $productlink = $row['product_local_url']; $thumbnail = $row['product_image_small']; $currencysymbol = $row['product_currency']; $price = $row['product_price']; $flagicon = $row['product_country_from']; } ?> <html> <head> <link href="style/stylesheet.css" rel="stylesheet" type="text/css" /> </head> <body> <div class="displaybox"> <div class="productimage"> <a href="<?php echo $productlink; ?><?php echo $products_local_id; ?>"><img src="<?php echo $thumburl; ?><?php echo $thumbnail ?>" width="150" height="150"></a> </div> <div class="productdescription"> <div class="pro_name"> <a href="<?php echo $productlink ?><?php echo $products_local_id; ?>"><?php echo $productname; ?></a> </div> <div class="pro_description"> </div> <?php if ($flagicon=="Ireland") { $flagicon = "<img src=\"flags/ireland.jpg\">"; } elseif ($flagicon=="UK") { $flagicon = "<img src=\"flags/uk.jpg\">"; } else echo ""; ?> <div class="pro_description"><?php echo $flagicon; ?><?php echo $currencysymbol ?> <?php echo $price ?></div> </div> </div> </body> </html> Many thanks, DB Hello! I have this code Code: [Select] <?php include_once('../database_connection.php'); $thiskeyword = addslashes($_REQUEST['keyword']); $sqlquery = "Select * from nba_info where player_id like '%$thiskeyword' OR fname like '%$thiskeyword' OR lname like '%$thiskeyword' OR team like '%$thiskeyword' OR email like '%$thiskeyword'"; $result = MYSQL_QUERY($sqlquery); $numberOfRows = MYSQL_NUM_ROWS($result); ?> <!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=utf-8" /> <title>Search Result</title> </head> <body><center><br /><br /> <?php if($numberOfRows==0) { die('You keywords haven\'t much any data from the database'); } else if($numberOfRows>0) { echo $numberOfRows. " Results have been found!"; $i = 0; ?> <table> <tr> <td>player_id</td> <td>fname</td> <td>lname</td> <td>team</td> <td>email</td> </tr> <?php while($i<$numberOfRows) { $player_id = MYSQL_RESULT($result,$i,"player_id"); $fname = MYSQL_RESULT($result,$i,"fname"); $lname = MYSQL_RESULT($result,$i,"lname"); $team = MYSQL_RESULT($result,$i,"team"); $email = MYSQL_RESULT($result,$i,"email"); ?> <tr> <td><? echo $player_id; ?></td> <td><? echo $fname; ?></td> <td><? echo $lname; ?></td> <td><? echo $team; ?></td> <td><? echo $email; ?></td> </tr> <?php $i++; } ?> </table> <?php } ?> <ul> <li><a href="/php/database/ManipulatingDatabase/add_database.php">Add New Player</a></li> <li><a href="/php/database/ManipulatingDatabase/edit_form.php">Edit Player</li> <li><a href="/php/database/ManipulatingDatabase/delete_form.php">Delete Player</li> <li><a href="/php/database/ManipulatingDatabase/search_form.php">Search Player</li> <li><a href="/php/database/ManipulatingDatabase/manipulate_database.php">BACK TO MAIN</a></li> </ul> </center> </body> </html> I have no problem with the sql statement as code Code: [Select] echo $numberOfRows. " Results have been found!"; is giving me a numbers of rows. The problem is the rows that have been found is not showing up in the html row. I wonder what the problem is.. anyone? i wanting users to be able to update there email address and check to see if the new email already exists. if the email is the same as current email ignore the check. i have no errors showing up but if I enter a email already in the db it still accepts the new email instead of bringing the back the error message. Code: [Select] // email enterd from form // $email=$_POST['email']; $queryuser=mysql_query("SELECT * FROM members WHERE inv='$ivn' ") or die (mysql_error()); while($info = mysql_fetch_array( $queryuser )) { $check=$info['email']; // gets current email // } if($check!=$email){ // if check not equal to $email check the new email address already exists// $queryuser=mysql_query("SELECT * FROM members WHERE email='$email' "); //$result=mysql_query($sql); $checkuser=mysql_num_rows($queryuser); if($checkuser != 0) { $error= "0"; header('LOCATION:../pages/myprofile.php?id='.$error.''); } } cheers Code: [Select] $headers = "From: webmaster@xxx.com\r\n" . "Reply-To: webmaster@xxx.com\r\n" . "BCC: ".$bcc."\r\n" . "Content-type: text/html\r\n"; The email sends fine, it's a form that you input some information into and it collects all the emails of the people that need to be notified. The only issue is that it's not in HTML. So, if in the email you send a <b> or <p>, it actually shows up in the email instead of actually make the text BOLD or whatever. Am I using the Content-type wrong? Hi there, I'm not really a php person more asp. I have to write an html send mail script. The email sends and receives perfect. When a user writes the message in the <textarea> box I need to be able to write a new line, so when they press enter and blank line will show in the textarea, how can I write <br> for every blank line. Heres my code so far..... <?php $from = $_POST['email']; $to = "[email]person@domain.com[/email]"; $subject = $_POST["subject"]; $name = $_POST['name']; $location = $_POST['location']; $message = $_POST['message']; $HTML = "<font size=2 face=arial><b><u>" . $name ." from " . $location . "</font></u></b>"; $HTML = $message sendHTMLemail($HTML,$from,$to,$subject); function sendHTMLemail($HTML,$from,$to,$subject) { $headers = "From: $from\r\n"; $headers .= "MIME-Version: 1.0\r\n"; $boundary = uniqid("HTMLEMAIL"); $headers .= "Content-Type: multipart/alternative;". "boundary = $boundary\r\n\r\n"; $headers .= "This is a MIME encoded message.\r\n\r\n"; $headers .= "--$boundary\r\n". "Content-Type: text/plain; charset=ISO-8859-1\r\n". "Content-Transfer-Encoding: base64\r\n\r\n"; $headers .= chunk_split(base64_encode(strip_tags($HTML))); $headers .= "--$boundary\r\n". "Content-Type: text/html; charset=ISO-8859-1\r\n". "Content-Transfer-Encoding: base64\r\n\r\n"; $headers .= chunk_split(base64_encode($HTML)); mail($to,$subject,"-f",$headers); } ?> The $message is the message the user writes. Any Thoughts Thanks |