Jump to content
Larry Ullman's Book Forums


  • Posts

  • Joined

  • Last visited

alex's Achievements


Newbie (1/14)



  1. solved! $header_ = 'MIME-Version: 1.0' . "\r\n" . 'Content-type: text/plain; charset=UTF-8' . "\r\n"; $header .= "From : " ."=?UTF-8?B?".base64_encode ($name). "?=" . "<" .$email. ">\r\n"; $body = "Enquiry :" . "\r\n" . "\r\n" . $comments . "\r\n" . "\r\n" . "\r\n" ."\r\n" . "City / Country : " . $region . "\r\n"; mail($to, '=?UTF-8?B?'.base64_encode($subject).'?=',$body, $header_ . $header); Thanks
  2. solved! function datediff ($expri) { $now = time(); $diff = strtotime ($expri) - $now; // $expri will be take from DB. return floor($diff/86400); } the main thing was "floor" results thanks to all
  3. dear bahaa, I am also sufferng with this encoding problem. and I tried '=?UTF-8?B?'.base64_encode($subject).'?=' but still there is no effect, I have a feedback form that returns me Name, Email, Regions, Subject and Comments in Arabic letter (genrally). client, is windows live user and there is showing only ط¹ط¨ط¯ظ‡ ط¬ط§ط¨ط± (like this) where I put this function I give you whole cod if needed.
  4. Hi all my question is about duo date by reference of this thread I read the MySQL's DATEDIFF(expr1,expr2) but still I dont know how it will be work. Mr. pswason told to use SELECT DATEDIFF(expiration_date, CURDATE()) WHERE id=$id; and he dont know about ... he says "I don't know if a card is considered expired if the expiration date is the current date" I give the current date as not expiration date so I make my script as: $tdy = date('Ymd'); in detail our many cards have expiry date like 19-08-2011, and we like to see how much days remaining by substract today date from. my whole code is <?php $timezone = new DateTimeZone( "Asia/Riyadh" ); $date = new DateTime(); $date->setTimezone( $timezone ); echo $today = $date->format( 'H:i:s A / D, M jS, Y' ); echo '<br />'; function datediff ($expri, $tdy) { $tdy = date('Ymd'); $tmr = (($expri - $tdy)/100*30); // $expri will be take from DB. return $tmr; } $query = 'SELECT * FROM staff'; $result = mysql_query ($query); while ($row = mysql_fetch_array ($result, MYSQL_ASSOC) ) { echo '<tr valign="top">'; echo '<td>' . $row['id'] . '</td> <td>'. $row['name'] . '</td><td align="center">' . $row['nationality'] . '</td><td align="center">' . $row['card_no']; '</td><td align="center">'; $exdate = 'SELECT DATEDIFF(card_expiry_date, CURDATE())';// I dont know how to use mysql's condtions in php. echo '</td><td align="center">' . datediff($expri = $row['card_expiry_date'], $tdy); echo '</tr>'; } mysql_free_result($result); mysql_close(); ?>
  5. hi all, I am new here, by searching on google I know about this site. I have some trouble with mysql that is my back is in .sql format and 1.5 GB when I start importing it by phpmyadmin it cannot take that file,said file is too big how can I fix it? I am using local machine as : localhost xampplite 1.7.2 MySQL 5.1.37 PHP 5.3 phpMyAdmin in windows xp platform plz help me
  • Create New...