Jump to content

suma237

Members
  • Posts

    282
  • Joined

  • Last visited

    Never

Everything posted by suma237

  1. code for connecting mysql with php $link = mysql_connect("localhost","databasename","password") or die("Could not connect: " . mysql_error()); mysql_select_db("databsename");
  2. Can you post the output for this code
  3. I'm not sure about it but remove the space from the page and check it. (you must call session_start() before anything is outputted to the browser.)
  4. hai, --Modify the code--- 1. // 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"; 2.$ok=mail($recipient_email,$subject,$content,$headers); if($ok==1){ $msg=" Your message was sent Thank you.";}else{ $msg=" Error"; } 3. <html> <body bgcolor="#282E2C"> <div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold"> <?=$msg;?> </div> </body> </html> <script>resizeTo(300, 300)</script>
  5. Hey, $sql = "SELECT Username,Password FROM `users` WHERE Username = '$username'"; use the above select statement and remove @ symbol.If you remove the @ sign ,then you will be able to sort out the error
  6. here is the code ....... <?php /* Mailer with Attachments */ $action = $_REQUEST['action']; global $action; function showForm() { ?> <form enctype="multipart/form-data" name="send" method="post" action="<?=$_SERVER['PHP_SELF']?>"> <input type="hidden" name="action" value="send" /> <input type="hidden" name="MAX_FILE_SIZE" value="10000000" /> <table border="0" cellpadding="2" cellspacing="2"> <tr><td colspan="2" align="center"><strong><font color="#FF0000">Send E-mail</font></strong></td></tr> <tr><td>Recipient Name:</td><td> <input name="to_name" size="50" /></td></tr> <tr><td>Recipient Email:</td><td> <input name="to_email" size="50" /></td></tr> <tr><td>From Name:</td><td><input name="from_name" size="50" /></td></tr> <tr><td>From Email:</td><td> <input name="from_email" size="50" /></td></tr> <tr><td>Subject:</td><td><input name="subject" size="50" /></td></tr> <tr><td valign="top">Message:</td><td><textarea name="body" rows="10" cols="50"></textarea></td></tr> <tr><td colspan="2"><strong>(Attach the files with extension *.doc,*.txt,*.pdf)</strong></td></tr> <tr><td>Attachment1:</td><td><input type="file" name="attachment" size="50" /></td></tr> <tr><td>Attachment2:</td><td><input type="file" name="attachment1" size="50" /></td></tr> <tr><td colspan="2" align="center"><input type="submit" value="Send Email" /></td></tr> </table> <!-- <p>Recipient Name: <input name="to_name" size="50" /><br /> Recipient Email: <input name="to_email" size="50" /><br /> From Name: <input name="from_name" size="50" /><br /> From Email: <input name="from_email" size="50" /><br /> Subject: <input name="subject" size="50" /><br /> Message: <textarea name="body" rows="10" cols="50"></textarea><br /> Attachment: <input type="file" name="attachment" size="50" /><br /> Attachment: <input type="file" name="attachment1" size="50" /><br /> <input type="submit" value="Send Email" /></p> --> <?php } function sendMail() { $to_name = $_POST['to_name']; $from_name =$_POST['from_name']; $subject = stripslashes($_POST['subject']); $body = stripslashes($_POST['body']); $to_email =$_POST['to_email']; $headers = "From: $from_name <" . $_POST['from_email'] . ">\n"; $headers .= "Reply-To: <" . $_POST['from_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 <" . $_POST['from_email'] . ">\n"; $headers .= "X-Mailer: PHP4\n"; $headers .= "X-Priority: 3\n"; //1 = Urgent, 3 = Normal $headers .= "Return-Path: <" . $_POST['from_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 .= "$body\n"; $message .= "\n"; $message .= "------=MIME_BOUNDRY_message_parts--\n"; $message .= "\n"; foreach($_FILES as $file => $value) { echo $_tmpname = $_FILES[$file]['tmp_name']; echo $_filename = $_FILES[$file]['name']; if (is_uploaded_file($_tmpname)) { $pathinfo = pathinfo($_filename); $ext = $pathinfo['extension']; if ($ext=="doc" || $ext=="pdf" || $ext=="txt") { $fp = fopen($_tmpname, "rb"); $data = fread($fp, filesize($_tmpname)); $data = chunk_split(base64_encode($data)); $message .= "------=MIME_BOUNDRY_main_message\n"; $message .= "Content-Type: application/octet-stream;\n\tname=\"" . $_filename . "\"\n"; $message .= "Content-Transfer-Encoding: base64\n"; $message .= "Content-Disposition: attachment;\n\tfilename=\"" . $_filename . "\"\n\n"; $message .= $data; $message .= "\n\n"; fclose($fp); } else { echo "(Attachment file type not supported. Attachment was not sent.) "; } } } $message .= "------=MIME_BOUNDRY_main_message--\n"; //$ok = mail($to_email, $subject, $message, $headers); if ($ok == 1) print "We've received your application. "; else print "Application could not be sent. "; } ?> <!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" xml:lang="en" lang="en"> <head> <style="css" type="text/css"> <!-- body { margin: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 12px; } a {color: #0000ff} --> </style> </head> <body> <?php switch ($action) { case "send": sendMail(); showForm(); break; default: showForm(); } ?> </body> </html>
  7. hey, try this code <from name="frmdel"> <table> <tr><td><input type="submit" value="delete" name="del" onclick="return deldel()"></td></tr> </table> </form> <script language="javascript"> function deldel() { var agree=confirm("Do you want to delete"); if(agree) return true; else return false; } </script>
  8. hey, query is not clear..are you trying to do this $query = 'SELECT * FROM performer WHERE performer_type = "Band"'; $result=mysql_query($query); while($row=mysql_fetch_array($result)){ echo $row['event']; }
  9. hey, <?php $to = 'nobody@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> Try to apply the above code
  10. can you explain the query in detail
  11. Try this code $name=$_POST['name']; $email=$_POST['email']; $comment=$_POST['comment']; $to="myemail@hotmail.com"; $subject="NEW message from"; $headers="From: $name"; $now=date("M d, Y"); $message="$comment ---------------------------- From: $name Sent: $now"; $ok=mail($to,$subject,$message,$headers); if($ok==1) { echo"message sucessfully send"; }else{ echo"Error!Try again"; }
  12. Try this Create 2 tables mp3_artists: - id_artist - name_artist mp3_musics -id_artist - id_music - title_music - playlist_music - date_music - active_music now the table mp3_musics will have foreginkey relation with first table and write one join query
  13. my code <?php session_start(); session_unset(); session_destroy(); ?> <? header('Location:dlfhome.php'); ?> BUT the browser still show the pages that already opened before logout. Thanks
  14. hi toon ..hope my query is still not clearly expressed/ understood.. i mentioned rediffmail as just an example . i'm developing a new website with login facillty and i want to redirect the user to login page once he logged out his session .
  15. Try this <script language="Javascript"> function validation(){ if (sondage_cpe.txtnum.value >4) { alert("S.V.P. rentrez le nombre d'installation.") sondage_cpe.txtnum.focus() return false } } </script> <form name="sondage_cpe" action="" method="POST"> <table> <tr><td>Number</td></tr> <tr><td><input type="texr" name="txtnum" onblur="return validation()"></td></tr> </table> </form>
  16. could you please post the code for logout ?. After logout i want to inactive the back button of the address bar .
  17. Try this... <?php $id = $_POST['id']; $delete = mysql_query("DELETE FROM `projects` WHERE id='$id'") or die(mysql_error()); header('Location: http://somesite.com/project.php'); <a href="main.php?id=<?=$row['id']?>" onclick="alert('Do you want to delete')">Delete</a> ?>
  18. Please print the query and check if is the query is executing or not ?
  19. you can use fetcharray & while loop instead of mysql_fetch_assoc.
  20. Try this... <select name="searchagent_industry" size=12 multiple width="350" style="width:350px" > <option value='1.0' >Auto Related - All Segments</option> </select>
  21. Try this Line 11:echo "You are now logged in as a $user_info[rights].";
  22. Try this <?php $tomorrow = mktime(0, 0, 0, date("m"), date("d")+1, date("y")); echo "Tomorrow is ".date("m/d/y", $tomorrow); ?>
  23. Help needed to prevent others from from accessing the secured page by "back button" once i've successfuly logged out my session. I need to set the page to ask the user to login again with the correct password when the user click the back button to access the previous secured page (the one i've logged out)
  24. hi, In which application you will be using infinite session.?
×
×
  • 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.