[PHP-DB] Re: Html email
Hello- I've always had this type of mail statement work for me: mail($to, $Subject, $Body, From: $From\r\nContent-Type: text/html; charset=iso-8859-1); My guess is that Outlook doesnt know what to do with the header you're sending it (maybe too much info for outlook??)... Other than that I've got no idea =) -- Jason Wood Chief Technology Officer Expressive Tek, Inc. 407 Kehrs Mill Road Ballwin, MO 63011 Phone 636.256.1362 www.expressivetek.com Benny [EMAIL PROTECTED] wrote in message 001501c15c1d$7f2f5560$0b01a8c0@ISKAT">news:001501c15c1d$7f2f5560$0b01a8c0@ISKAT... Please help me. I have problem with html email. I send email to 3 email address : [EMAIL PROTECTED], [EMAIL PROTECTED] and [EMAIL PROTECTED] The email client for yahoo eudoramail is their web. And for the last destination, the email client is ms outlook. The html email for yahoo eudoramail are well received. But for the last destination the ms outlook display the wrong result like encrypted text. Below is my code and the result in ms outlook. My code : $s_to = '[EMAIL PROTECTED]'; $s_subject = 'Subject xxx'; $s_headers = From: [EMAIL PROTECTED]\r\n; $s_headers .= MIME-Version: 1.0\r\n; $s_boundary = uniqid(id); $s_headers .= Content-Type: multipart/alternative . ; boundary = $s_boundary\r\n\r\n; $s_headers .= This is a MIME encoded message.\r\n\r\n; $s_headers .= --$s_boundary\r\n . $s_headers .= Content-Type: text/html; charset=\iso-8859-1\\r\n . Content-Transfer-Encoding: base64\r\n\r\n; $s_headers2 = chunk_split(base64_encode(bla...bbla.../bbla...)); $s_headers = $s_headers.$s_headers2.'--'.$s_boundary.'--'; @mail ($s_to, $s_subject,, $s_headers); Result in ms outlook : Return-Path: [EMAIL PROTECTED] Delivered-To: [EMAIL PROTECTED] Received: (qmail 2773 invoked by uid 252); 22 Oct 2001 23:35:00 - Date: 22 Oct 2001 23:35:00 - Message-ID: [EMAIL PROTECTED] To: [EMAIL PROTECTED] Subject: Subject xxx From: [EMAIL PROTECTED] MIME-Version: 1.0 Content-Type: multipart/alternative; boundary = id3bd4ad2486465 This is a MIME encoded message. --id3bd4ad2486465 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: base64 PGZvbnQgZmFjZT0iVmVyZGEhlbHZldGljYSwgc2Fucy1zZXJpZiIgc2l6ZT0i aXY+PC9mb250C90cj48L3RhYmxlPg== --id3bd4ad2486465-- Regards; Benny. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP-DB] Re: PHP and MySQL queries...
Let me guess, the parse error is on the last line of the file? I get that all the time, its usually caused by a loop thats still open... and, in your case, your do and if statements arent closed try this. mysql_connect (db_hostname, db_username, db_password); mysql_select_db (db_name); if ($date == ) {$date = '%';} $result = mysql_query (SELECT fname,lname,address,city,state,zip,phonea,phone,email,crty,crnum,crmo,cryr,w eeks,ogden,rock,logan,ipaddress,ad,total,num,date,time FROM ads WHERE date LIKE '%$date%' LIMIT 0, 30 ); $count = -1; if ($row = mysql_fetch_array($result)) { $count ++; do { print BName: /B.$row['fname, lname'].BR\n; if (mysql_num_rows($results) ) { while( $row = mysql_fetch_array($result) ) { } } else { print No rows found; } } } Let me know if it works!! -- Jason Wood Chief Technology Officer Expressive Tek, Inc. 407 Kehrs Mill Road Ballwin, MO 63011 Phone 636.256.1362 www.expressivetek.com Jason [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Ok here is the script after changes... ?php mysql_connect (db_hostname, db_username, db_password); mysql_select_db (db_name); if ($date == ) {$date = '%';} $result = mysql_query (SELECT fname,lname,address,city,state,zip,phonea,phone,email,crty,crnum,crmo,cryr,w eeks,ogden,rock,logan,ipaddress,ad,total,num,date,time FROM ads WHERE date LIKE '%$date%' LIMIT 0, 30 ); $count = -1; if ($row = mysql_fetch_array($result)) { $count ++; do { print BName: /B.$row['fname, lname'].BR\n; if (mysql_num_rows($results) ) { while( $row = mysql_fetch_array($result) ) { } } else { print No rows found; } ? And now I get a parse error on line 201 which is below the html and php code, so there isn't anything to change. Please help? Rick Emery [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... First o all, GET RID of the 19 constructs using mysql_result(). You've already captured the row with the $row=mysql_fetch_array(). mysql_result() cannot be mixed with mysql_fetch_arry(). So instead of: echo BAddress: /B; printf(mysql_result($result,$count,address)); echo BR\n; use: print BAddress: /B.$row['address'].BR\n; Next, dates are stored in MySQL as -MM-DD. Use that format in your input. Next, don't combine that if(mysql_fetch_array()) with the do while() Instead, use: if (mysql_num_rows($results) ) { while( $row = mysql_fetch_array($result) ) { } } else { print No rows found; } Do the above. Re-submit. Tell me the results. W'ell go from there... rick -Original Message- From: Jason [mailto:[EMAIL PROTECTED]] Sent: Tuesday, October 23, 2001 12:37 PM To: [EMAIL PROTECTED] Subject: [PHP-DB] Re: PHP and MySQL queries... As of yet I have tried all sorts for date formating for the search field to work. I.E. 2001-10-23, 10/23/2001, 10/%/2001, 10%, %10%, etc. The date field in the database is stored as 10/23/2001 and yet when a user enters the date and clicks the search button it does not display the results. I am almost certain that as the user clicks the submit button the php script is parsing the search string (i.e. 10/23/2001) incorrectly. I believe it is parsing the sting as 10nsb;23nsb;2001 or something to that effect. If anyone has some more information on this please let me know. I am pretty sure I have exhausted my resources. Jason [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am having a hard time setting up a form for users to enter a date in the format of 00/00/ (of course they would use an actual date). My form is as follows... form name=auth method=post action=search.php p*I.E. - Format is 04/01/2001*/p pSearch for Ads by date: input type=text name=date /p p input type=submit name=login value=Submit input type=reset name=reset value=Reset /p /form On my search.php page I have the following MySQL connection and search parameters... ?php mysql_connect (db_hostname, db_username, db_password); mysql_select_db (db_name); if ($date == ) {$date = '%';} $result = mysql_query (SELECT fname,lname,address,city,state,zip,phonea,phone,email,crty,crnum,crmo,cryr,w eeks,ogden,rock,logan,ipaddress,ad,total,num,date,time FROM ads WHERE date LIKE '%$date%' LIMIT 0, 30 ); $count = -1; if ($row = mysql_fetch_array($result)) { $count ++; do { echo BName: /B; printf(mysql_result($result,$count,fname)); echo ; printf(mys
[PHP-DB] Re: PHP and MySQL queries...
I'm not positive, but try switching the day and month fields. ie: 28/04/1981 for April 28th, 1981 instead of 04/28/1981 Could work... I know alot of programs, etc, use this format, and I cant remember offhand right now. Let me know if it works for you!! -- Jason Wood Chief Technology Officer Expressive Tek, Inc. 407 Kehrs Mill Road Ballwin, MO 63011 Phone 636.256.1362 www.expressivetek.com Jason [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... I am having a hard time setting up a form for users to enter a date in the format of 00/00/ (of course they would use an actual date). My form is as follows... form name=auth method=post action=search.php p*I.E. - Format is 04/01/2001*/p pSearch for Ads by date: input type=text name=date /p p input type=submit name=login value=Submit input type=reset name=reset value=Reset /p /form On my search.php page I have the following MySQL connection and search parameters... ?php mysql_connect (db_hostname, db_username, db_password); mysql_select_db (db_name); if ($date == ) {$date = '%';} $result = mysql_query (SELECT fname,lname,address,city,state,zip,phonea,phone,email,crty,crnum,crmo,cryr,w eeks,ogden,rock,logan,ipaddress,ad,total,num,date,time FROM ads WHERE date LIKE '%$date%' LIMIT 0, 30 ); $count = -1; if ($row = mysql_fetch_array($result)) { $count ++; do { echo BName: /B; printf(mysql_result($result,$count,fname)); echo ; printf(mysql_result($result,$count,lname)); echo BR\n; echo BAddress: /B; printf(mysql_result($result,$count,address)); echo BR\n; echo BCity: /B; printf(mysql_result($result,$count,city)); echo BR\n; echo BState: /B; printf(mysql_result($result,$count,state)); echo BR\n; echo BZip: /B; printf(mysql_result($result,$count,zip)); echo BR\n; echo BPhone: /B(; printf(mysql_result($result,$count,phonea)); echo ) ; printf(mysql_result($result,$count,phone)); echo BR\n; echo BEmail: /B; printf(mysql_result($result,$count,email)); echo BR\n; echo BCredit Type: /B; printf(mysql_result($result,$count,crty)); echo BR\n; echo BCredit Number: /B; printf(mysql_result($result,$count,crnum)); echo BR\n; echo BCredit Card Date: /B; printf(mysql_result($result,$count,crmo)); echo ; printf(mysql_result($result,$count,cryr)); echo BR\n; echo BWeeks: /B; printf(mysql_result($result,$count,weeks)); echo BR\n; echo Btown1: /B; printf(mysql_result($result,$count,town1)); echo BR\n; echo Btown2: /B; printf(mysql_result($result,$count,town2)); echo BR\n; echo Btown3: /B; printf(mysql_result($result,$count,town3)); echo BR\n; echo BIP Address: /B; printf(mysql_result($result,$count,ipaddress)); echo BR\n; echo BAd: /B; $ad[$count] = (mysql_result($result,$count,ad)); $ad[$count] = ereg_replace (a, ', $ad[$count]); $ad[$count] = ereg_replace (q, \, $ad[$count]); $ad[$count] = ereg_replace (p, %, $ad[$count]); $ad[$count] = ereg_replace (bs, \\, $ad[$count]); echo $ad[$count]; echo BR\n; echo BTotal: /B; printf(mysql_result($result,$count,total)); echo BR\n; echo BAd Number: /B; printf(mysql_result($result,$count,num)); echo BR\n; echo BDate: /B; printf(mysql_result($result,$count,date)); echo BR\n; echo BTime: /B; printf(mysql_result($result,$count,time)); echo BR\n; } while($row = mysql_fetch_array($result)); } else {print Sorry, no records were found!;} ? So far I have come to the conclusion that the input from the user is probably where my problem is because I am assuming it is taking the / in the date they enter and doing something I don't want it to. In any event if someone could give me a clue as to how to resolve this issue it would be greatly appreciated. -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]