Jump to content

robert_gsfame

Members
  • Posts

    876
  • Joined

  • Last visited

Everything posted by robert_gsfame

  1. I just tried in IE 6.0 and it works How to make both mozilla and IE works?? Is it because MIME ?? Please help me solving this..thx
  2. Really confused!! I run once and it worked, but when i tried today...it didn't work Which part is missing if(isset($_POST['upload'])){ $filename=$_FILES['file']['name']; $filetype=$_FILES['file']['type']; $filesize=$_FILES['file']['size']; if(empty($filename)){ $warning="<span class=style2><font color=red>* You did not upload any file</font></span>";}else if((!empty($filename))&&($filetype!='application/msword')){ $warning="<span class=style2><font color=red>* Word document only allowed to be uploaded</font></span>"; }else if((!empty($filename))&&($filesize>120000)){ $warning="<span class=style2><font color=red>* File size exceeds maximum allowed</font></span>"; }else{ COPY TO UPLOAD BLABLABLA..} THe problem is that when i upload the word document with less than 120 kb filesize, "* Word document only allowed to be uploaded"
  3. okay i've modified the code into below: $to = $email; $from = $from_name; $subject ="Hello world"; $message = "Nice Weather"; $headers = "From: firstname_lastname@yahoo.com"; // boundary $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; // headers for attachment $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\""; // multipart boundary $message = "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type: text/plain; charset=\"iso-8859-1\"\n" . "Content-Transfer-Encoding: 7bit\n\n" . $message . "\n\n"; $message .= "--{$mime_boundary}\n"; $file = fopen($files,"rb"); $data = fread($file,filesize($files)); fclose($file); $data = chunk_split(base64_encode($data)); $message .= "Content-Type: {\"application/octet-stream\"};\n" . " name=\"$files\"\n" . "Content-Disposition: attachment;\n" . " filename=\"$filename\"\n" . "Content-Transfer-Encoding: base64\n\n" . $data . "\n\n"; $message .= "--{$mime_boundary}\n"; mail($to, $subject, $message, $headers); } THis code works, but this part (From:) i got this firstname@yahoo.com, it should be firstname_lastname@yahoo.com Secondly in which part, should i modify to attach more than one file?? thanx
  4. Below is the code and it didn't work well as file uploaded not in word document, Moreover, i always find the file attached twice (DOUBLE). Another question is that how can i have 2 attachment let say one in word and the other in JPEG format. Please add more code as i'm not familiar with this. Thx in advance $file="upload_file/".$document; $file_size = filesize($file); $handle = fopen($file, "r"); $content = fread($handle, $file_size); fclose($handle); $content = chunk_split(base64_encode($content)); $uid = md5(uniqid(time())); $name = basename($file); $headers = "From: $from_name<" . $email . ">\n"; $headers .= "Reply-To: <" . $email . ">\n"; $headers .= "MIME-Version: 1.0\n"; $headers .= "Content-Type: multipart/related; type=\"multipart/alternative\"; boundary=\"----=MIME_BOUNDRY_main_message\"\n"; $headers .= "X-Sender: $from_name<" . $email . ">\n"; $headers .= "X-Priority: 1\n"; //1 = Urgent, 3 = Normal $headers .= "Return-Path: <" . $email . ">\n"; $headers .= "This is a multi-part message in MIME format.\n"; $headers .= "------=MIME_BOUNDRY_main_message \n"; $headers .= "Content-Type: multipart/alternative; boundary=\"----=MIME_BOUNDRY_message_parts\"\n"; $message = "------=MIME_BOUNDRY_message_parts\n"; $message .= "Content-Type: text/plain; charset=\"iso-8859-1\"\n"; $message .= "Content-Transfer-Encoding: quoted-printable\n"; $message .= "\n"; $message .= "$message\n"; $message .= "\n"; $message .= "------=MIME_BOUNDRY_message_parts--\n"; $message .= "\n"; $message .= "------=MIME_BOUNDRY_main_message\n"; $message .= "Content-Type: application/pdf;\n\tname=\"" . $name . "\"\n"; $message .= "Content-Transfer-Encoding: base64\n"; $message .= "Content-Disposition: attachment;\n\tfilename=\"" . $name . "\"\n\n"; $message .= $message; //The base64 encoded message $message .= "\n"; $message .= "------=MIME_BOUNDRY_main_message--\n"; $mailto = $recipient_email; $subject = "mymessage"; // send the message mail($mailto, $subject, $message, $headers);
  5. Below is my code: echo "<input type='button' value='redirect' onClick='location.href=index.htm'>"; what is wrong with the code?? it's not working
  6. i don't think so.. can you give me several possibilities that might cause this problem?
  7. i have my php file let say myfile.php, all the code was written correctly.. it runs well. Yesterday, when i tried to run it on my browser (localhost), then the page kept on loading but didn't open What is actually the problem source?my localhost or php file itself last question: will it create the same problem when i run it on my domain (not localhost)??
  8. guys, i got confused with the code below: what i want is that when user choose radiobutton1 (radio1) then textbox4 (txt4) (value=yes) can left empty but if not, then textbox4 (txt4) cannot left empty this code doesn't work well as when radiobutton1 not chosen (let say i choose radiobutton2 (value='no')) , textbox4 still cannot left empty if(((isset($_POST['submit']))&&(!empty($_POST['txt1']))&&(!empty($_POST['txt2']))&&(!empty($_POST['txt3']))&&((($_POST['radio1'])=='yes')&&(!empty($_POST['txt4']))){ echo "complete";} thx for any helps
  9. not even that... when i use that code tjen the alert will come together with a blank page i want have it in javascript function (onclick)
  10. this is not what i'm looking for... i want create an alert in javascript
  11. Can anyone help me? i would like to give some alert once submit button was clicked and (!isset($_POST['checkbox'])) thx
  12. I put require_once after session_start() before<html> as i will use it to run certain query when submit button was pressed <form action=<?php echo $_SERVER[php_SELF]?>. The problem is that when i run this on my mozilla browser the <title> was turned into Untitled document though i've changed my <title> into let say <title>This is my first page</title>, but when i remove the require_once then it turned into "this is my first page". So where should i put the require_once then, to have it works properly??
  13. Let say i click on http://www.mydomain.com/ ...and i need to wait for 5 seconds before index.php opened. Can i have some words shown up like this: " Please Wait while we redirect you to the page..." How to do it?? thx in advance
  14. okay got it!! border-collapse:collapse; sorry i'm still newbie on CSS, thx for everyone
  15. i want to create a table with let say 3 column<td> and i use css to have it bordered. But it didn't look nice as it has been separated with unseen border as i did this <border=0> Can anyone help me? removing this border so that i can have my <td> looks unseparate
  16. guys, i wish that anyone can help me solving this problem I actually want to let user send email with attachment to other users (Yahoo or google email) Let say user has uploaded a word document, and the name of the document is XXX.txt and it has been stored into mysql database How can i send this together with an email to users (Yahoo or google email) using mail() thanx in advance
  17. I wish to have a preloader for my php page, can anyone give me some idea bout this?
  18. how can i use EXISTS in the query Thx
  19. So i tried to restart the computer and i can delete the unfinished folder, but still to copy the folder from Localhost didn't work Copying... and stuck!! when i tried to restart the computer, then they copying the remain! But before finished, my computer already shut down This never happened to my computer before, Please help me so i can copying my folder
  20. didn't work! i tried to delete the folder that half copied and it error appeared Cannot Delete, file might be used! What to do?? really annoying!i can't copy my data
  21. I know this is not the place for this topic, but i don't where to post this problem.. I've tried to copy a folder (back up) which is used to store all data (php files and everything related to my website project) into another folder inside the drive, but it got stucked when copying the data...I've tried so many times but still didn't work. What happen to my Xampp folder?? Can anyone give me some solution?? Thx so much
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.