PHP/HTML on Safari from Mac Os 10.6.5 works very slowly -


this script:

<?php  require_once 'swift-mailer/lib/swift_required.php';  $name = $_post['name']; $email = $_post['email']; $form_subject = $_post['form_subject']; $form_message = $_post['form_message'];  if (isset($_post['submit'])) {          if ($_post['name'] != "") {             $_post['name'] = filter_var($_post['name'], filter_sanitize_string);             if ($_post['name'] == "") {                 $errors .= 'please enter valid name.<br/><br/>';             }         } else {             $errors .= 'please enter name.<br/>';         }          if ($_post['email'] != "") {             $email = filter_var($_post['email'], filter_sanitize_email);             if (!filter_var($email, filter_validate_email)) {                 $errors .= "$email <strong>not</strong> valid email address.<br/><br/>";             }         } else {             $errors .= 'please enter email address.<br/>';         }          if ($_post['form_subject'] != "") {             $form_subject = filter_var($_post['form_subject'], filter_sanitize_string);             if ($_post['form_subject'] == "") {                 $errors .= 'please enter valid subject.<br/><br/>';             }         } else {             $errors .= 'please enter subject.<br/>';         }          if ($_post['form_message'] != "") {             $form_message = filter_var($_post['form_message'], filter_sanitize_string);             if ($_post['form_message'] == "") {                 $errors .= 'please enter valid comment.<br/><br/>';             }         } else {             $errors .= 'please enter comment.<br/>';         }   if (!$errors) {   //file upload  // file going placed  $target_path = "uploads/";  // add original filename our target path.   //result "uploads/filename.extension"  $target_path = $target_path . basename($_files['uploadedfile']['name']);  if (is_uploaded_file($_files['uploadedfile']['tmp_name'])) {  if(move_uploaded_file($_files['uploadedfile']['tmp_name'], $target_path)) {     echo "the file ".  basename($_files['uploadedfile']['name']).      " has been uploaded"; } else{     echo "there error uploading file, please try again!"; }    } //end of file upload  //create transport $transport = swift_mailtransport::newinstance();  //create mailer using created transport $mailer = swift_mailer::newinstance($transport);  //create message $message = swift_message::newinstance();    //give message subject $message->setsubject('new data submitted');  $ip=$_server['remote_addr']; $date=date("l, f j, y, g:i a");    //give body $message->setbody("here information submitted  www.polycysticliverdisease.com/html/contact_email.php  $ip on $date.\n\n --------------------------------\n\n name: $name \n\n email address: $email \n\n subject: $form_subject \n\n comment: $form_message");    //add alternative parts addpart() //$message->addpart('my amazing body in plain text', 'text/plain');  //create attachment // * note can technically leave content-type parameter out $attachment = swift_attachment::frompath($target_path);    //attach message $message->attach($attachment);  //using setto() set recipients in 1 go $message->setto(array('info@polycysticliverdisease.com' => 'diane smith'));  //set from: address including name $message->setfrom(array('info@polycysticliverdisease.com' => 'contact us'));  //send message $numsent = $mailer->send($message);  //printf("sent %d messages\n", $numsent);  if(isset($_files['uploadedfile'])){ $pathfile = "/home/vitusya/eximi.dreamhosters.com/hawaii/html/uploads/" . $_files['uploadedfile']['name']; @unlink($pathfile); }  $to = "$email"; $subject = "thank you!"; $body = "thank e-mailing us.  reply possible."; mail($to, $subject, $body);          }           else {             echo '<div style="color: red">' . $errors . '<br/>                 </div>';            }     }    ?>  

this form:

    <form name="contact" action="contact_email.php" method="post" enctype="multipart/form-data">         <table>             <tr>                 <td>                     <h2 class="lower">contact us</h2>                 </td>                </tr>             <tr>                 <td class="pretty_border">                     <label for="name">your name:</label><br />                     <input class="text" type="text" name="name" />                     <br />                 </td>                </tr>             <tr>                 <td class="pretty_border">                     <label for="email">your e-mail address:</label><br />                     <input class="text" type="text" name="email" />                     <br />                 </td>                </tr>             <tr>                 <td class="pretty_border">                     <label for="form_subject">subject:</label><br />                     <input class="text" type="text" name="form_subject" />                     <br />                 </td>                </tr>             <tr>                     <td class="textarea_border">                     <label for="form_message">your message:</label><br />                     <textarea rows="7" cols="50" name="form_message"></textarea>                     <br />                 </td>                </tr>             <tr>                     <td>                     <div class="fileinputs">                         <input type="submit" class="file" name="submit" />                         <div class="fakefile">                                 <img src="../assets/images/submit_btt.png" />                         </div>                     </div>                     <div class="fileinputs">                         <input type="file" class="file" name="uploadedfile" />                         <div class="fakefile">                                 <img src="../assets/images/uf_btt.png" />                         </div>                     </div>                     <div class="fileinputs">                         <input type="reset" class="file" />                         <div class="fakefile">                                 <img src="../assets/images/reset_btt.png" />                         </div>                     </div>                     <div class="fileinputs">                         <input type="button" class="file" onclick="window.print()" />                         <div class="fakefile">                                 <img src="../assets/images/print_btt.png" />                         </div>                                           </div>                 </td>                </tr>          </table>         </form> 

all works fine on windows browser, works fine on iphone , ipad. seems problem in mac. script executes , sends 'thank you' letter user wrong email address. seems google chrome on mac has same problem.

what think be?

thank you!

the execution time has nothing browser php serverside language should debug code echo out various variable have through out script , check if have value they're suppose to, if not might code previous echo'd out variable find might have gone wrong


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -