Jump to content

pixeltrace

Members
  • Posts

    577
  • Joined

  • Last visited

    Never

Everything posted by pixeltrace

  1. guys, i need help. how can i combine my formpage and the submit page into just 1 page? this is the code in my form page <!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"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> <style type="text/css"> <!-- body { margin-top: 0px; } --> </style></head> <body> <table width="546" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="546" class="text5"> : Send us your Feedback : </td> </tr> <tr> <td> </td> </tr> <tr> <td><table width="100" border="1" align="center" cellpadding="0" cellspacing="0" bordercolor="#9F9F9F" style="border-collapse:collapse"> <tr> <td><form method="post" action="feedbacksend.php"> <table width="494" border="0" cellspacing="2" cellpadding="0"> <tr> <td colspan="2"> </td> </tr> <tr> <td colspan="2" align="center" bgcolor="#e5e5e5" class="text7">Please make sure that correct information is supplied so we can get back to you. </td> </tr> <tr> <td colspan="2"> </td> </tr> <tr> <td width="119" align="right" class="text6">name : </td> <td width="369"><input name="name" type="text" class="field3" /> <span class="text3">*</span> </td> </tr> <tr> <td align="right" class="text6">email : </td> <td><input name="email" type="text" class="field3" /> <span class="text3">* </span></td> </tr> <tr> <td align="right" class="text6">contact number : </td> <td><input name="contact" type="text" class="field3" /> <span class="text3">* </span></td> </tr> <tr> <td align="right" class="text6">type of inqiuiry : </td> <td><select name="inquiry" class="field3"> <option value="General" selected="selected">--General--</option> <option value="Referral/Job Application">--Referral/Job Application--</option> <option value="Recruiting/Job Post">--Recruiting/Job Post--</option> <option value="Resources">--Resources--</option> <option value="Advertisement">--Advertisement--</option> </select> </td> </tr> <tr> <td align="right" class="text6">subject : </td> <td><input name="subject" type="text" class="field3" /></td> </tr> <tr> <td align="right" class="text6">your message : </td> <td> </td> </tr> <tr> <td> </td> <td><textarea name="message" cols="40" rows="5" class="field3"></textarea></td> </tr> <tr> <td> </td> <td> </td> </tr> <tr> <td> </td> <td><input name="Submit" type="submit" class="button1" value="Submit" /> <input type="hidden" name="recipient" value="Postmaster@jobhirings.com" /> <input type="hidden" name="cc" value="don@jobhirings.com" /> <input type=hidden value=http://www. name=redirect></td> </tr> <tr> <td colspan="2"> </td> </tr> </table> </form></td> </tr> </table></td> </tr> </table> </body> </html> and this is the code in my feedbacksend.php <?php include("validate.php"); $name = $_POST['name']; $email = $_POST['email']; $contact = $_POST['contact']; $inquiry = $_POST['inquiry']; $subject = $_POST['subject']; $message = $_POST['message']; $recipient = $_POST['recipient']; $cc = $_POST['cc']; if ($name=='' or $email=='' or $contact=='') { error ('Some required fields are blank.\\n'. 'Please fill them in and try again.'); } if (!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $email)){ error("Invalid e-mail address"); } $Message = ""; $Message .= "A Feedback Inquiry from: $name\n"; $Message .= "Contact Number: $contact\n"; $Message .= "Email Address: $email\n"; $ip = getenv("REMOTE_ADDR"); $Message .="IP address:".$ip."\n"; $Message .= "\n\n"; $Message .= "Type of Inquiry: $inquiry\n"; $Message .= "Subject: $subject\n"; $Message .= "\n\n"; $Message .= "Message: $message\n"; $Message .= "\n\n"; $Header = $email; $To = "$recipient, $cc"; $Subject = "JH Feedback Inquiry"; // mail($To,$Subject,$Message,"From: $Header","-f $EmailAdd"); last parameter might not be supported mail($To,$Subject,$Message,"From: $Header"); echo '<script language=javascript> alert("Your message has been sent!");top.location = "contactus.php?id=3";</script>'; ?> hope you could help me on this. thanks!
  2. hi, the while loop is already in my code this is the only part that i am having problems the output that i wanted should look like this: | link 1 | link2 | link3 | ....... hope you could help me on this. thanks!
  3. hi, this is the current codes that i have for my implode | <? $string = "<a href='echo $link;'>echo $row->title;</a>"; implode ('','$string'); ?> <?php but its not working. the output that i wanted is like this: | link1 | link2 | link3 |.... hope you could help me fix it. thanks!
  4. guys, how do i implode this correctly? <a href="<?php echo $link;?>"> <?php echo $row->title;?></a> the output that i want to happen here is like this: | link1 | lin2 | link3 |.... hope you could assist me on this. thanks!
  5. guys, anyone here who is familiar with joomla? i need to get my joomla connected to mysql database but i dont know how to do it. hope you guys can help me. thanks!
  6. its working now thanks!
  7. guys, i need help on my update page. i dont know what happened here because it was working before i gave it to my client, now they came back to me at told me that the update page is not working. i double checked already but i can't find whats wrong. below is the codes for my update form page <? session_start(); if (session_is_registered("username")){ //$username = $_POST['username']; $uid = $_GET[uid]; include '../db_connect.php'; $query = mysql_query("SELECT * FROM admin_user WHERE userid= '$uid'") or die(mysql_error()); $row = mysql_fetch_array( $query ); $uid = $row["userid"]; $uname = $row["username"]; $password = $row["password"]; $fname = $row["first_name"]; $lname = $row["last_name"]; $jobtitle = $row["job_title"]; $email = $row["email"]; $userlevel = $row["user_level"]; ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>:: JobHiRings :: Administration Page</title> <link href="../css.css" rel="stylesheet" type="text/css"> </head> <body> <table width="712" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" align="right"><a href="add.php" class="link2">add new user account </a> | <a href="view.php" class="link2">view user lists </a> </td> </tr> <tr> <td colspan="3"><img src="../images/spacer.gif" width="710" height="6"></td> </tr> <tr> <td width="6"><img src="../images/spacer.gif" width="6" height="10" /></td> <td width="700"><table width="216" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1"></td> <td width="214" valign="top"><form action="update.php" method="post"> <table width="460" border="0" cellspacing="2" cellpadding="0"> <tr> <td colspan="3" valign="top"><img src="../images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td colspan="3" bgcolor="#999999"> </td> </tr> <tr> <td colspan="3" valign="top"><img src="../images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td width="137" align="right" class="text6">account ID : </td> <td> </td> <td class="text7">USR<? echo "$uid"; ?></td> </tr> <tr> <td align="right" class="text6">username : </td> <td width="7" rowspan="2"> </td> <td width="308"><input type="text" name="uname" value="<? echo "$uname"; ?>" class="textfield"></td> </tr> <tr> <td align="right" class="text6">first name : </td> <td width="308"><input type="text" name="fname" value="<? echo "$fname"; ?>" class="textfield"></td> </tr> <tr> <td align="right" class="text6">last name :</td> <td rowspan="2"> </td> <td><span class="text7"> <input type="text" name="lname" value="<? echo "$lname"; ?>" class="textfield"> </span></td> </tr> <tr> <td align="right" class="text6">job title :</td> <td><span class="text7"> <input type="text" name="jobtitle" value="<? echo "$jobtitle"; ?>" class="textfield"> </span></td> </tr> <tr> <td align="right" class="text6">email address : </td> <td> </td> <td><span class="text7"> <input type="text" name="email" value="<? echo "$email"; ?>" class="textfield"> </span></td> </tr> <tr> <td align="right" class="text6">user level : </td> <td> </td> <td><span class="text7"> <input name="userlevel" type="radio" value="administrator" <? if ($userlevel == 'administrator'){ echo "checked";}?>> </span><span class="text8">Administrator</span><span class="text7"> <input name="userlevel" type="radio" value="staff" <? if ($userlevel == 'staff'){ echo "checked";}?>> </span><span class="text8">Staff</span></td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td align="right" class="text6">change password : </td> <td> </td> <td> </td> </tr> <tr> <td align="right" class="text6">new : </td> <td> </td> <td><input name="newpasswd" type="password" class="textfield"></td> </tr> <tr> <td align="right" class="text6">confirm new password : </td> <td> </td> <td><input name="newpasswd2" type="password" class="textfield"></td> </tr> <tr> <td rowspan="2"> </td> <td rowspan="2"> </td> <td><input name="update" type="submit" value="update acount"></td> </tr> <tr> <td><input name="uid" type="hidden" value="<? echo "$uid"; ?>"> <input name="password" type="hidden" value="<? echo "$password"; ?>"></td> </tr> </table> </form></td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1"></td> </tr> </table></td> <td width="6"><img src="../images/spacer.gif" width="6" height="10" /></td> </tr> </table> <? }else{ echo "<font face=\"Arial\">You are not authorized to access this page ... Please <a href='index.php'>Login</a></font>"; } ?> </body> </html> and this is the code for my update.php <?php session_start(); if (session_is_registered("username")){ }else{ echo "<font face=\"Arial\">You are not authorized to access this page ... Please <a href='index.php'>Login</a></font>"; } include '../db_connect.php'; $uid = $_POST['uid']; $uname = $_POST['uname']; $password = $_POST['password']; $fname = $_POST['fname']; $lname = $_POST['lname']; $jobtitle = $_POST['jobtitle']; $email = $_POST['email']; $userlevel = $_POST['userlevel']; $newpasswd = $_POST['newpasswd']; $newpasswd2 = $_POST['newpasswd2']; print_r($_POST); if ($newpasswd == ''){ $password = $password; } elseif($newpasswd == $newpasswd2){ $password = md5($newpasswd); $sql="UPDATE admin_user SET username ='$uname', first_name='$fname', last_name='$lname', job_title='$jobtitle', email='$email', user_level='$userlevel', password='$password' WHERE userid='$uid'"; mysql_query($sql) or die("error:".mysql_error()); print_r($sql); echo '<script language=javascript> alert("account has been updated!");window.location = "view.php";</script>'; }else{ echo '<script language=javascript>alert("Password does not match!");window.location = "view.php";</script>'; exit(); } ?> hope you could help me fix this. thanks!
  8. thanks! its working fine now
  9. any help for this? i just need to fix this line <script language=javascript> alert("Username is already used!");top.location = "add.php";</script>'; what code should i add or replace here so it will go back to the frame name "iframe" instead of going back on the top? thanks!
  10. guys, i have a problem and i need help. i got a page and has an iframe. my problem now, i have a form that is being loaded inside the iframe and after sending the form, instead of going back to its page (i mean the pages inside the iframe) i loads back on the top. meaning, if my page is www.form.com and on that page i have iframe with name="iframe" after the form is sent, instead of loading back inside iframe it loads on top changing www.form.com url to what i have set in my codes. need help on how to solve this please. below is my codes for the formsend page that needs to be loaded back inside the iframe name="iframe" <? include '../db_connect.php'; include("validate.php"); $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $email = $_POST['email']; $job_title = $_POST['job_title']; $username = $_POST['username']; $password = $_POST['password']; $user_level = $_POST['user_level']; $first_name = stripslashes($first_name); $last_name = stripslashes($last_name); $email = stripslashes($email); $job_title = stripslashes($job_title); $username = stripslashes($username); $password = stripslashes($password); $user_level = stripslashes($user_level); if ($first_name=='' or $last_name=='' or $username=='' or $password='') { error ('Some required fields are blank.\\n'. 'Please fill them in and try again.'); } $sql_username_check = mysql_query("SELECT username FROM admin_user WHERE username='$username'"); $username_check = mysql_num_rows($sql_username_check); if($username_check > 0){ echo '<script language=javascript> alert("Username is already used!");top.location = "add.php";</script>'; unset($username); exit(); } $db_password = md5($password); $sql = mysql_query("INSERT INTO admin_user (first_name, last_name, email, job_title, username, password, user_level) VALUES('$first_name', '$last_name', '$email', '$job_title', '$username', '$db_password', '$user_level')") or die (mysql_error()); if(!$sql){ echo '<script language=javascript> alert("Error creating account!");top.location = "add.php";</script>'; exit(); } else { $userid = mysql_insert_id(); echo '<script language=javascript> alert("New account has been added!");top.location = "add.php";</script>'; } ?> i think the problem is in the javascript (top.location) how do i change this so it will load back to iframe? thanks!
  11. guys, i need help. i have a problem with session. it seems that its not working i have a page that uses session, on the first time you load the page everything is working fine i even used print_r to see the session values but if you refresh the page, its changing the session values with the values of the ones with the latest id in my database hope you could help me solve this problem below is the code for my page <? session_start(); if (session_is_registered("username")){ $username = $_SESSION['username']; $user_level = $_SESSION['user_level']; print_r($_SESSION); //$username = $_POST['username']; include 'db_connect.php'; $query = mysql_query("SELECT userid, username, first_name, last_name, job_title, email, user_level FROM admin_user WHERE username= '$username'") or die(mysql_error()); $row = mysql_fetch_array( $query ); $userid = $row["userid"]; $username = $row["username"]; $first_name = $row["first_name"]; $last_name = $row["last_name"]; $job_title = $row["job_title"]; $email = $row["email"]; $user_level = $row["user_level"]; ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>:: JobHiRings :: Administration Page</title> <style type="text/css"> <!-- body { margin-left: 0px; margin-top: 10px; margin-right: 0px; margin-bottom: 0px; } --> </style> <link href="css.css" rel="stylesheet" type="text/css"> </head> <body> <table width="778" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td colspan="2" background="images/headerbg.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="226" align="left"><img src="images/header.gif" width="226" height="148"></td> <td> </td> </tr> </table></td> <td background="images/headerbg.gif"><img src="images/headeright.gif" width="16" height="148"></td> </tr> <tr> <td width="16" rowspan="2" align="left" valign="top" background="images/left.gif"><img src="images/left.gif" width="16" height="14"></td> <td width="745" valign="top"><table width="746" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3"> </td> </tr> <tr> <td colspan="3" class="text4">CMS USER MANAGER</td> </tr> <tr> <td colspan="3" align="right"> </td> </tr> <tr> <td colspan="3"><img src="images/spacer.gif" width="10" height="6"></td> </tr> <tr> <td width="224" valign="top"><table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1"></td> <td width="214" valign="top"><? include 'sidemenu.php'; ?> </td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1"></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1"></td> </tr> </table></td> <td colspan="2" align="center" valign="top"> <iframe id="usermngr" src="user/view.php" width=730 height=400 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=yes></iframe></td> </tr> <tr> <td colspan="3"> </td> </tr> </table></td> <td width="16" rowspan="2" align="right" valign="top" background="images/right.gif"><img src="images/spacer.gif" width="1" height="1"><img src="images/right.gif" width="16" height="14"></td> </tr> <tr> <td valign="top"><img src="images/spacer.gif" width="746" height="10"></td> </tr> <tr> <td background="images/footerbg.gif"><img src="images/footerleft.gif" width="16" height="43"></td> <td background="images/footerbg.gif"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0"> <tr> <td height="10" colspan="2" align="left"><img src="images/spacer.gif" width="12" height="10"></td> </tr> <tr> <td width="746" align="center" valign="top" class="footer">Copyright © 2007 www.jobhirings.com. All Rights Reserved</td> </tr> </table></td> <td background="images/footerbg.gif"><img src="images/footeright.gif" width="16" height="43"></td> </tr> </table> <? }else{ echo "<font face=\"Arial\">You are not authorized to access this page ... Please <a href='index.php'>Login</a></font>"; } ?> </body> </html>
  12. hi, i was able to make the bcc worked. however i got another problem on my first email blast you wont be seeing any errors but the second time you blast an email you will be getting this error message Warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in c:\hosting\webhost4life\member\diorgrace\admean\email\Mail.php on line 32 below is my code for the blast.php page <?php session_start(); ob_start(); include '../db_connect.php'; include_once("FileUpload.php"); include_once("Functions.php"); $active = false; $error = ""; $text = "List: "; $subject = stripslashes($_POST['SUBJECT']); $header = isset($_POST['FROM']) ? stripslashes($_POST['FROM']) : "JobHiRings<postmaster@jobhirings.com>"; $url = isset($_POST['URL']) ? stripslashes($_POST['URL']) : ""; // Clear All if(isset($_POST['CANCEL'])){ //unset($_SESSION['LIST']); unset($_SESSION['URL']); } // Clear URL Content if(isset($_POST['CLEARURL']))unset($_SESSION['URL']); if(isset($_POST['AMEND'])){ $_SESSION['URL'] = stripslashes($_POST['URLPREVIEW']); } // Get URL Content if(isset($_POST['GETURL'])){ if(trim($_POST['URL']) == ""){ $error = "Please fill in the url"; }else{ $file = fopen($_POST['URL'], "r") or exit("Invalid URL!"); //Output a line of the file until the end is reached while(!feof($file)) { $body .= fgets($file); //mail($email,"To $email", "Hi there!", "From: ncy@museik.net"); } fclose($file); //$body = str_replace("%name%", "chuyang", $body); $_SESSION['URL'] = $body; } } if(isset($_POST['SEND'])){ //print_r($_POST); $dbemail = array(); if ($_POST['to'] == "all"){ $query = mysql_query("SELECT email FROM applicant WHERE subscribe = 'yes'") or die(mysql_error()); while($row = mysql_fetch_array( $query )){ $dbemail[] = $row['email']; } } if ($_POST['to'] == "notall"){ $specialization = $_POST['specialization']; $query = mysql_query("SELECT email FROM applicant WHERE specialization LIKE '%".$specialization."%' AND subscribe = 'yes'") or die(mysql_error()); while($row = mysql_fetch_array( $query )){ $dbemail[] = $row['email']; }; } if ($_POST['to'] == "peremail"){ $dbemail[] = $_POST['email']; } //print_r($dbemail); print_r($dbemail); //$to = "pixeltrace@gmail.com"; // After getting list of $dbemail, then send accordingly: // : $mail->SendHTML($dbemail,$subject,$new_msg); if(trim($_POST['SUBJECT'] == ""))$error = "Please fill in a subject title"; if($error == ""){ require_once("Mail.php"); $mail = new Mail(); $email_list = implode(",", $dbemail);// change this print_r($email_list); $bcc = "Bcc: ".$email_list;//implode(",", $dbemail); $header.=" ".$bcc; $mail->SetHeader($header); $original_msg = $_SESSION['URL']; $mail->SendHTML("cvgnse@gmail.com",$subject,$original_msg); } } if($active){ $file = fopen("html.txt", "r") or exit("Unable to open file!"); //Output a line of the file until the end is reached while(!feof($file)) { $email .= fgets($file); //mail($email,"To $email", "Hi there!", "From: ncy@museik.net"); } fclose($file); $email = str_replace("\"", "\\\"", $email); print $email; print "END"; } //$bodytag = str_replace("'", "\'", $body); echo $error; ?> <script language="JavaScript"> function event_action(spl_value) { if(spl_value=="peremail") { test.style.visibility="visible"; test2.style.visibility='hidden'; } else if(spl_value=="notall") { test2.style.visibility="visible"; test.style.visibility='hidden'; } else { test.style.visibility='hidden'; test2.style.visibility='hidden'; } } </script> <link href="../../css.css" rel="stylesheet" type="text/css" /> <link href="../css.css" rel="stylesheet" type="text/css" /> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../images/spacer.gif" width="6" height="10" /></td> <td valign="top"><table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> <td width="214" valign="top"><form action="<?=$PHP_SELF;?>" method="post" enctype="multipart/form-data" name="form1" id="form1"> <table border="0" cellspacing="0" cellpadding="3"> <tr> <td colspan="2" valign="top" nowrap="nowrap" class="text3"><img src="../images/spacer.gif" width="469" height="7" /></td> </tr> <tr> <td width="83" align="left" nowrap="nowrap" class="text3">Subject:</td> <td width="381" align="left"><input name="SUBJECT" type="text" id="SUBJECT" value="<?php print $subject;?>" class="textfield1"></td> </tr> <tr> <td align="left" class="text3">From:</td> <td align="left"><input name="FROM" type="text" id="FROM" value="<?php print $header;?>" class="textfield1" /></td> </tr> <tr> <td align="left" class="text3">Sent to :</td> <td align="left"><span class="text7"> <select name="to" class="textfield1" onchange="event_action(this.value);"> <option selected="selected" value="">--Email Option--</option> <option value="all">Entire list</option> <option value="notall">Specialization</option> <option value="peremail">Individual Email</option> </select> <!--<input name="select" type="submit" id="select" value="select" />//--> </span></td> </tr> <!-- condition for the select menu --> <tr id="test2" style="visibility:hidden"> <td align="left" class="text3">Specialization:</td> <td align="left"><select name="specialization" class="textfield1"> <option value="" selected="selected">-- Select Here --</option> <? $uSql = "SELECT specialization FROM specialization"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; }else{ while($uRow = mysql_fetch_array($uResult)){ ?> <option value="<?= $uRow[specialization]?>"> <?= $uRow[specialization]?> </option> <? } } ?> </select> </td> </tr> <tr id="test" style="visibility:hidden"> <td align="left" class="text3">Email:</td> <td align="left"><input type="text" name="email" value="" class="textfield1" /></td> </tr> <!-- end --> <tr> <td align="left" class="text3">URL:</td> <td align="left"><input name="URL" type="text" id="URL" value="<?php print $url;?>" class="textfield1" /></td> </tr> <tr> <td> </td> <td align="left"><?php if(isset($_SESSION['URL'])){?> <textarea name="URLPREVIEW" cols="60" rows="10" id="URLPREVIEW" class="textfield1"><?php print $_SESSION['URL']?></textarea> <br /> <input name="CLEARURL" type="submit" id="CLEARURL" value="Clear" /> <input name="AMEND" type="submit" id="AMEND" value="Change" /> <?php }?> <input name="GETURL" type="submit" id="GETURL" value="Get URL" /> </td> </tr> <tr> <td> </td> <td align="left"><input name="SEND" type="submit" id="SEND" value="Send" /> <input name="CANCEL" type="submit" id="CANCEL" value="Cancel" /></td> </tr> <tr> <td colspan="2"><span class="text3"><img src="../images/spacer.gif" width="469" height="7" /></span></td> </tr> </table> </form></td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> </table></td> <td><img src="../images/spacer.gif" width="6" height="10" /></td> <td valign="top"><table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../images/spacer.gif" width="6" height="10" /></td> <td><table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> <td width="214" valign="top"> </td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> </table></td> <td><img src="../images/spacer.gif" width="6" height="10" /></td> </tr> </table></td> </tr> </table> <?php ob_end_flush();?> and this is the code in Mail.php page <?php class Mail { function Mail() { // $this->headers = "From: CompanionSeek <Admin@localhost.com>"; $this->headers = "From: JobHiRings<postmaster@jobhirings.com>"; } function SendMail($to,$subject,$msg) { $subject = stripslashes($subject); $msg = stripslashes($msg); $to = stripslashes($to); if(MAIL_ACTIVE)mail($to, $subject, $msg, $this->headers); } function SendHTML($to,$subject,$msg){ $mime_boundary = uniqid("HTMLMESSAGE"); $this->headers .= "\nMIME-Version: 1.0\nContent-Type: multipart/alternative; boundary=\"{$mime_boundary}\""; //$this->headers .= "\r\nBCC: ".$bcc; //plain text version of message //HTML version of message $data = chunk_split(base64_encode($msg)); $msg = "--{$mime_boundary}\r\n" . "Content-Type: text/html; charset=ISO-8859-1\r\n" . "Content-Transfer-Encoding: base64\r\n\r\n". $data. "\n\n" . "--{$mime_boundary}--\n"; mail($to, $subject, $msg, $this->headers); } function SetHeader($val){ $this->headers = 'From: '.$val; } } ?> hope you could help me with this because its realy freaking me out. thanks!
  13. guys, i need help in my sendmail. i have been seeking help here for 2 weeks already about this and unfortunately i still cant make it work. my sendmail scripts is working except that i wanted to have the emails addresses be in bcc and right now i cant make it worked. below is my codes for my blast.php page <?php session_start(); ob_start(); include '../db_connect.php'; include_once("FileUpload.php"); include_once("Functions.php"); $active = false; $error = ""; $text = "List: "; $subject = stripslashes($_POST['SUBJECT']); $header = isset($_POST['FROM']) ? stripslashes($_POST['FROM']) : "JobHiRings<postmaster@jobhirings.com>"; $url = isset($_POST['URL']) ? stripslashes($_POST['URL']) : ""; // Clear All if(isset($_POST['CANCEL'])){ //unset($_SESSION['LIST']); unset($_SESSION['URL']); } // Clear URL Content if(isset($_POST['CLEARURL']))unset($_SESSION['URL']); if(isset($_POST['AMEND'])){ $_SESSION['URL'] = stripslashes($_POST['URLPREVIEW']); } // Get URL Content if(isset($_POST['GETURL'])){ if(trim($_POST['URL']) == ""){ $error = "Please fill in the url"; }else{ $file = fopen($_POST['URL'], "r") or exit("Invalid URL!"); //Output a line of the file until the end is reached while(!feof($file)) { $body .= fgets($file); //mail($email,"To $email", "Hi there!", "From: ncy@museik.net"); } fclose($file); //$body = str_replace("%name%", "chuyang", $body); $_SESSION['URL'] = $body; } } if(isset($_POST['SEND'])){ //print_r($_POST); $dbemail = array(); if ($_POST['to'] == "all"){ $query = mysql_query("SELECT email FROM applicant WHERE subscribe = 'yes'") or die(mysql_error()); while($row = mysql_fetch_array( $query )){ $dbemail[] = $row['email']; } } if ($_POST['to'] == "notall"){ $specialization = $_POST['specialization']; $query = mysql_query("SELECT email FROM applicant WHERE specialization LIKE '%".$specialization."%' AND subscribe = 'yes'") or die(mysql_error()); while($row = mysql_fetch_array( $query )){ $dbemail[] = $row['email']; }; } if ($_POST['to'] == "peremail"){ $dbemail[] = $_POST['email']; } //print_r($dbemail); // After getting list of $dbemail, then send accordingly: // : $mail->SendHTML($dbemail,$subject,$new_msg); if(trim($_POST['SUBJECT'] == ""))$error = "Please fill in a subject title"; if($error == ""){ require_once("Mail.php"); $mail = new Mail(); $mail->SetHeader($header); $bcc = implode(",", $dbemail); $to = "pixeltrace@gmail.com"; $original_msg = $_SESSION['URL']; $mail->SendHTML($to,$subject,$original_msg); if(isset($_SESSION['LIST'])){ foreach($_SESSION['LIST'] as $key=>$val){ $new_msg = str_replace("%name%", $val[0], $original_msg); // See above $mail->SendHTML($val[1],$subject,$new_msg); } session_destroy(); header("Location:$PHP_SELF"); } } } if($active){ $file = fopen("html.txt", "r") or exit("Unable to open file!"); //Output a line of the file until the end is reached while(!feof($file)) { $email .= fgets($file); //mail($email,"To $email", "Hi there!", "From: ncy@museik.net"); } fclose($file); $email = str_replace("\"", "\\\"", $email); print $email; print "END"; } //$bodytag = str_replace("'", "\'", $body); echo $error; ?> <script language="JavaScript"> function event_action(spl_value) { if(spl_value=="peremail") { test.style.visibility="visible"; test2.style.visibility='hidden'; } else if(spl_value=="notall") { test2.style.visibility="visible"; test.style.visibility='hidden'; } else { test.style.visibility='hidden'; test2.style.visibility='hidden'; } } </script> <link href="../../css.css" rel="stylesheet" type="text/css" /> <link href="../css.css" rel="stylesheet" type="text/css" /> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../images/spacer.gif" width="6" height="10" /></td> <td valign="top"><table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> <td width="214" valign="top"><form action="<?=$PHP_SELF;?>" method="post" enctype="multipart/form-data" name="form1" id="form1"> <table border="0" cellspacing="0" cellpadding="3"> <tr> <td colspan="2" valign="top" nowrap="nowrap" class="text3"><img src="../images/spacer.gif" width="469" height="7" /></td> </tr> <tr> <td width="83" align="left" nowrap="nowrap" class="text3">Subject:</td> <td width="381" align="left"><input name="SUBJECT" type="text" id="SUBJECT" value="<?php print $subject;?>" class="textfield1"></td> </tr> <tr> <td align="left" class="text3">From:</td> <td align="left"><input name="FROM" type="text" id="FROM" value="<?php print $header;?>" class="textfield1" /></td> </tr> <tr> <td align="left" class="text3">Sent to :</td> <td align="left"><span class="text7"> <select name="to" class="textfield1" onchange="event_action(this.value);"> <option selected="selected" value="">--Email Option--</option> <option value="all">Entire list</option> <option value="notall">Specialization</option> <option value="peremail">Individual Email</option> </select> <!--<input name="select" type="submit" id="select" value="select" />//--> </span></td> </tr> <!-- condition for the select menu --> <tr id="test2" style="visibility:hidden"> <td align="left" class="text3">Specialization:</td> <td align="left"><select name="specialization" class="textfield1"> <option value="" selected="selected">-- Select Here --</option> <? $uSql = "SELECT specialization FROM specialization"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; }else{ while($uRow = mysql_fetch_array($uResult)){ ?> <option value="<?= $uRow[specialization]?>"> <?= $uRow[specialization]?> </option> <? } } ?> </select> </td> </tr> <tr id="test" style="visibility:hidden"> <td align="left" class="text3">Email:</td> <td align="left"><input type="text" name="email" value="" class="textfield1" /></td> </tr> <!-- end --> <tr> <td align="left" class="text3">URL:</td> <td align="left"><input name="URL" type="text" id="URL" value="<?php print $url;?>" class="textfield1" /></td> </tr> <tr> <td> </td> <td align="left"><?php if(isset($_SESSION['URL'])){?> <textarea name="URLPREVIEW" cols="60" rows="10" id="URLPREVIEW" class="textfield1"><?php print $_SESSION['URL']?></textarea> <br /> <input name="CLEARURL" type="submit" id="CLEARURL" value="Clear" /> <input name="AMEND" type="submit" id="AMEND" value="Change" /> <?php }?> <input name="GETURL" type="submit" id="GETURL" value="Get URL" /> </td> </tr> <tr> <td> </td> <td align="left"><input name="SEND" type="submit" id="SEND" value="Send" /> <input name="CANCEL" type="submit" id="CANCEL" value="Cancel" /></td> </tr> <tr> <td colspan="2"><span class="text3"><img src="../images/spacer.gif" width="469" height="7" /></span></td> </tr> </table> </form></td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> </table></td> <td><img src="../images/spacer.gif" width="6" height="10" /></td> <td valign="top"><table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../images/spacer.gif" width="6" height="10" /></td> <td><table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> <td width="214" valign="top"> </td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> </table></td> <td><img src="../images/spacer.gif" width="6" height="10" /></td> </tr> </table></td> </tr> </table> <?php ob_end_flush();?> and this is the code for my Mail.php page <?php class Mail { function Mail() { // $this->headers = "From: CompanionSeek <Admin@localhost.com>"; $this->headers = "From: JobHiRings<postmaster@jobhirings.com>"; } function SendMail($to,$subject,$msg) { $subject = stripslashes($subject); $msg = stripslashes($msg); $to = stripslashes($to); if(MAIL_ACTIVE)mail($to, $subject, $msg, $this->headers); } function SendHTML($to,$subject,$msg){ $mime_boundary = uniqid("HTMLMESSAGE"); $this->headers .= "\nMIME-Version: 1.0\nContent-Type: multipart/alternative; boundary=\"{$mime_boundary}\""; $this->headers .= "\nBCC: $bcc\""; //plain text version of message //HTML version of message $data = chunk_split(base64_encode($msg)); $msg = "--{$mime_boundary}\r\n" . "Content-Type: text/html; charset=ISO-8859-1\r\n" . "Content-Transfer-Encoding: base64\r\n\r\n". $data. "\n\n" . "--{$mime_boundary}--\n"; mail($to, $subject, $msg, $this->headers); } function SetHeader($val){ $this->headers = 'From: '.$val; } } ?> hope you could help me with this. currently the error that i am getting here is this Warning: mail() [function.mail]: SMTP server response: 501 5.5.4 Invalid Address in c:\hosting\webhost4life\member\diorgrace\admean\email\Mail.php on line 32 thanks!
  14. Guys, I need help please, i've been trying to solve this for a couple of days already and i haven't solved it eversince. my HTML email blasting page is already working, expect that i want the email addresses of the people i am emailing be hidden from each other or in Bcc. my problem is i dont know how to do it and the codes that i currently have was also just given to me hear and the person who gave this to me never came back to me again for follow ups. in this code it has the SendHTML function and i think the problem lies there and the SendHTML function in the Mail.php which is included in this page. i dont know how and what codes or items that i need to add so I hope you guys can help me with this because i am already getting migraine for days already because of this. below is the code for my blast.php page <?php session_start(); ob_start(); include '../db_connect.php'; include_once("FileUpload.php"); include_once("Functions.php"); $active = false; $error = ""; $text = "List: "; $subject = stripslashes($_POST['SUBJECT']); $header = isset($_POST['FROM']) ? stripslashes($_POST['FROM']) : "JobHiRings<postmaster@jobhirings.com>"; $url = isset($_POST['URL']) ? stripslashes($_POST['URL']) : ""; // Clear All if(isset($_POST['CANCEL'])){ //unset($_SESSION['LIST']); unset($_SESSION['URL']); } // Clear URL Content if(isset($_POST['CLEARURL']))unset($_SESSION['URL']); if(isset($_POST['AMEND'])){ $_SESSION['URL'] = stripslashes($_POST['URLPREVIEW']); } // Get URL Content if(isset($_POST['GETURL'])){ if(trim($_POST['URL']) == ""){ $error = "Please fill in the url"; }else{ $file = fopen($_POST['URL'], "r") or exit("Invalid URL!"); //Output a line of the file until the end is reached while(!feof($file)) { $body .= fgets($file); //mail($email,"To $email", "Hi there!", "From: ncy@museik.net"); } fclose($file); //$body = str_replace("%name%", "chuyang", $body); $_SESSION['URL'] = $body; } } if(isset($_POST['SEND'])){ //print_r($_POST); $dbemail = array(); if ($_POST['to'] == "all"){ $query = mysql_query("SELECT email FROM applicant WHERE subscribe = 'yes'") or die(mysql_error()); while($row = mysql_fetch_array( $query )){ $dbemail[] = $row['email']; } } if ($_POST['to'] == "notall"){ $specialization = $_POST['specialization']; $query = mysql_query("SELECT email FROM applicant WHERE specialization LIKE '%".$specialization."%' AND subscribe = 'yes'") or die(mysql_error()); while($row = mysql_fetch_array( $query )){ $dbemail[] = $row['email']; }; } if ($_POST['to'] == "peremail"){ $dbemail[] = $_POST['email']; } //print_r($dbemail); // After getting list of $dbemail, then send accordingly: // : $mail->SendHTML($dbemail,$subject,$new_msg); if(trim($_POST['SUBJECT'] == ""))$error = "Please fill in a subject title"; if($error == ""){ require_once("Mail.php"); $mail = new Mail(); $mail->SetHeader($header); $original_msg = $_SESSION['URL']; $mail->SendHTML(implode(",", $dbemail),$subject,$original_msg); if(isset($_SESSION['LIST'])){ foreach($_SESSION['LIST'] as $key=>$val){ $new_msg = str_replace("%name%", $val[0], $original_msg); // See above $mail->SendHTML($val[1],$subject,$new_msg); } session_destroy(); header("Location:$PHP_SELF"); } } } if($active){ $file = fopen("html.txt", "r") or exit("Unable to open file!"); //Output a line of the file until the end is reached while(!feof($file)) { $email .= fgets($file); //mail($email,"To $email", "Hi there!", "From: ncy@museik.net"); } fclose($file); $email = str_replace("\"", "\\\"", $email); print $email; print "END"; } //$bodytag = str_replace("'", "\'", $body); echo $error; ?> <script language="JavaScript"> function event_action(spl_value) { if(spl_value=="peremail") { test.style.visibility="visible"; test2.style.visibility='hidden'; } else if(spl_value=="notall") { test2.style.visibility="visible"; test.style.visibility='hidden'; } else { test.style.visibility='hidden'; test2.style.visibility='hidden'; } } </script> <link href="../../css.css" rel="stylesheet" type="text/css" /> <link href="../css.css" rel="stylesheet" type="text/css" /> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../images/spacer.gif" width="6" height="10" /></td> <td valign="top"><table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> <td width="214" valign="top"><form action="<?=$PHP_SELF;?>" method="post" enctype="multipart/form-data" name="form1" id="form1"> <table border="0" cellspacing="0" cellpadding="3"> <tr> <td colspan="2" valign="top" nowrap="nowrap" class="text3"><img src="../images/spacer.gif" width="469" height="7" /></td> </tr> <tr> <td width="83" align="left" nowrap="nowrap" class="text3">Subject:</td> <td width="381" align="left"><input name="SUBJECT" type="text" id="SUBJECT" value="<?php print $subject;?>" class="textfield1"></td> </tr> <tr> <td align="left" class="text3">From:</td> <td align="left"><input name="FROM" type="text" id="FROM" value="<?php print $header;?>" class="textfield1" /></td> </tr> <tr> <td align="left" class="text3">Sent to :</td> <td align="left"><span class="text7"> <select name="to" class="textfield1" onchange="event_action(this.value);"> <option selected="selected" value="">--Email Option--</option> <option value="all">Entire list</option> <option value="notall">Specialization</option> <option value="peremail">Individual Email</option> </select> <!--<input name="select" type="submit" id="select" value="select" />//--> </span></td> </tr> <!-- condition for the select menu --> <tr id="test2" style="visibility:hidden"> <td align="left" class="text3">Specialization:</td> <td align="left"><select name="specialization" class="textfield1"> <option value="" selected="selected">-- Select Here --</option> <? $uSql = "SELECT specialization FROM specialization"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; }else{ while($uRow = mysql_fetch_array($uResult)){ ?> <option value="<?= $uRow[specialization]?>"> <?= $uRow[specialization]?> </option> <? } } ?> </select> </td> </tr> <tr id="test" style="visibility:hidden"> <td align="left" class="text3">Email:</td> <td align="left"><input type="text" name="email" value="" class="textfield1" /></td> </tr> <!-- end --> <tr> <td align="left" class="text3">URL:</td> <td align="left"><input name="URL" type="text" id="URL" value="<?php print $url;?>" class="textfield1" /></td> </tr> <tr> <td> </td> <td align="left"><?php if(isset($_SESSION['URL'])){?> <textarea name="URLPREVIEW" cols="60" rows="10" id="URLPREVIEW" class="textfield1"><?php print $_SESSION['URL']?></textarea> <br /> <input name="CLEARURL" type="submit" id="CLEARURL" value="Clear" /> <input name="AMEND" type="submit" id="AMEND" value="Change" /> <?php }?> <input name="GETURL" type="submit" id="GETURL" value="Get URL" /> </td> </tr> <tr> <td> </td> <td align="left"><input name="SEND" type="submit" id="SEND" value="Send" /> <input name="CANCEL" type="submit" id="CANCEL" value="Cancel" /></td> </tr> <tr> <td colspan="2"><span class="text3"><img src="../images/spacer.gif" width="469" height="7" /></span></td> </tr> </table> </form></td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> </table></td> <td><img src="../images/spacer.gif" width="6" height="10" /></td> <td valign="top"><table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../images/spacer.gif" width="6" height="10" /></td> <td><table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> <td width="214" valign="top"> </td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> </table></td> <td><img src="../images/spacer.gif" width="6" height="10" /></td> </tr> </table></td> </tr> </table> <?php ob_end_flush();?> and this is the code for my Mail.php page <?php class Mail { function Mail() { // $this->headers = "From: CompanionSeek <Admin@localhost.com>"; $this->headers = "From: JobHiRings<postmaster@jobhirings.com>"; } function SendMail($to,$subject,$msg) { $subject = stripslashes($subject); $msg = stripslashes($msg); $to = stripslashes($to); if(MAIL_ACTIVE)mail($to, $subject, $msg, $this->headers); } function SendHTML($to,$subject,$msg){ $mime_boundary = uniqid("HTMLMESSAGE"); $this->headers .= "\nMIME-Version: 1.0\nContent-Type: multipart/alternative; boundary=\"{$mime_boundary}\""; //$this->headers .= "\nBCC: $bcc\"; //plain text version of message //HTML version of message $data = chunk_split(base64_encode($msg)); $msg = "--{$mime_boundary}\r\n" . "Content-Type: text/html; charset=ISO-8859-1\r\n" . "Content-Transfer-Encoding: base64\r\n\r\n". $data. "\n\n" . "--{$mime_boundary}--\n"; mail($to, $subject, $msg, $this->headers); } function SetHeader($val){ $this->headers = 'From: '.$val; } } ?> the SendHTML function is just between line 67 to 73 for blast.php page. hope you could help me with this. thanks a lot!
  15. any help on this please? thanks!
  16. Hi, Thanks its working now. but i got another problem. definitely the people where i emailed will get mad at me because, they can see each other's email address. How do i set it up so that there there email will be in bcc or maybe will be sent to all the email list 1 at a time? hope you could help me on the codes for this. thanks!
  17. hi, how do i place a "," on each email in my entire list or specialization condition? i tried using implode (",", $dbemail); but i am getting an function.implode error on line 96 hope you could help me fix this below is my code for this page <?php session_start(); ob_start(); include '../db_connect.php'; include_once("FileUpload.php"); include_once("Functions.php"); //$dir = "D:/xampp/htdocs/test/data/"; //$dir = "/home/museikne/www/misc/"; $active = false; $error = ""; $text = "List: "; $subject = stripslashes($_POST['SUBJECT']); $header = isset($_POST['FROM']) ? stripslashes($_POST['FROM']) : "JobHiRings<postmaster@jobhirings.com>"; $url = isset($_POST['URL']) ? stripslashes($_POST['URL']) : ""; // Clear All if(isset($_POST['CANCEL'])){ //unset($_SESSION['LIST']); unset($_SESSION['URL']); } // Clear URL Content if(isset($_POST['CLEARURL']))unset($_SESSION['URL']); if(isset($_POST['AMEND'])){ $_SESSION['URL'] = stripslashes($_POST['URLPREVIEW']); } // Get URL Content if(isset($_POST['GETURL'])){ if(trim($_POST['URL']) == ""){ $error = "Please fill in the url"; }else{ $file = fopen($_POST['URL'], "r") or exit("Invalid URL!"); //Output a line of the file until the end is reached while(!feof($file)) { $body .= fgets($file); //mail($email,"To $email", "Hi there!", "From: ncy@museik.net"); } fclose($file); //$body = str_replace("%name%", "chuyang", $body); $_SESSION['URL'] = $body; } } // Import name list /*if(isset($_POST['IMPORT'])){ $validFile = array("txt"); // valid file formats $file = $_FILES['FILE']; if($file['name'] != ''){ unset($_SESSION['LIST']); $fu = new FileUpload($file, $dir); $fu->CheckFileFormat($validFile); $fu->UploadFile(); $file = fopen($dir."list.txt", "r") or exit("Unable to open file!"); //Output a line of the file until the end is reached while(!feof($file)) { $email = fgets($file); $email = explode(",",$email); $_SESSION['LIST'][] = $email; //mail($email,"To $email", "Hi there!", "From: ncy@museik.net"); } fclose($file); }else{ unset($_SESSION['LIST']); $error = "Please locate the file"; } //header("Location:$PHP_SELF"); } if(isset($_SESSION['LIST'])){ $i = 1; foreach($_SESSION['LIST'] as $key=>$val){ $name = $val[0]; $email = $val[1]; $text.= "$i ."."$name - $email "; $i++; } print $text; }*/ if(isset($_POST['SEND'])){ print_r($_POST); if ($_POST['to'] == "all"){ $query = mysql_query("SELECT email FROM applicant WHERE subscribe = 'yes'") or die(mysql_error()); while ($sendemail = mysql_fetch_array($query)){ $dbemail = $sendemail['email']; echo '$dbemail'; } } if ($_POST['to'] == "notall"){ $specialization = $_POST['specialization']; $query = mysql_query("SELECT email FROM applicant WHERE specialization LIKE '%".$specialization."%' AND subscribe = 'yes'") or die(mysql_error()); while ($sendemail = mysql_fetch_array($query)){ $dbemail = $sendemail['email']; $dbemail = implode(',',$dbemail); print_r($dbemail); } } if ($_POST['to'] == "peremail"){ $dbemail = $_POST['email']; } //print_r($dbemail); // After getting list of $dbemail, then send accordingly: // : $mail->SendHTML($dbemail,$subject,$new_msg); if(trim($_POST['SUBJECT'] == ""))$error = "Please fill in a subject title"; if($error == ""){ require_once("Mail.php"); $mail = new Mail(); $mail->SetHeader($header); $original_msg = $_SESSION['URL']; $mail->SendHTML($dbemail,$subject,$original_msg); if(isset($_SESSION['LIST'])){ foreach($_SESSION['LIST'] as $key=>$val){ $new_msg = str_replace("%name%", $val[0], $original_msg); // See above $mail->SendHTML($val[1],$subject,$new_msg); } session_destroy(); header("Location:$PHP_SELF"); } } } if($active){ $file = fopen("html.txt", "r") or exit("Unable to open file!"); //Output a line of the file until the end is reached while(!feof($file)) { $email .= fgets($file); //mail($email,"To $email", "Hi there!", "From: ncy@museik.net"); } fclose($file); $email = str_replace("\"", "\\\"", $email); print $email; print "END"; } //$bodytag = str_replace("'", "\'", $body); echo $error; ?> <script language="JavaScript"> function event_action(spl_value) { if(spl_value=="peremail") { test.style.visibility="visible"; test2.style.visibility='hidden'; } else if(spl_value=="notall") { test2.style.visibility="visible"; test.style.visibility='hidden'; } else { test.style.visibility='hidden'; test2.style.visibility='hidden'; } } </script> <link href="../../css.css" rel="stylesheet" type="text/css" /> <link href="../css.css" rel="stylesheet" type="text/css" /> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../images/spacer.gif" width="6" height="10" /></td> <td valign="top"><table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> <td width="214" valign="top"><form action="<?=$PHP_SELF;?>" method="post" enctype="multipart/form-data" name="form1" id="form1"> <table border="0" cellspacing="0" cellpadding="3"> <tr> <td colspan="2" valign="top" nowrap="nowrap" class="text3"><img src="../images/spacer.gif" width="469" height="7" /></td> </tr> <tr> <td width="83" align="left" nowrap="nowrap" class="text3">Subject:</td> <td width="381" align="left"><input name="SUBJECT" type="text" id="SUBJECT" value="<?php print $subject;?>" class="textfield1"></td> </tr> <tr> <td align="left" class="text3">From:</td> <td align="left"><input name="FROM" type="text" id="FROM" value="<?php print $header;?>" class="textfield1" /></td> </tr> <tr> <td align="left" class="text3">Sent to :</td> <td align="left"><span class="text7"> <select name="to" class="textfield1" onchange="event_action(this.value);"> <option selected="selected" value="">--Email Option--</option> <option value="all">Entire list</option> <option value="notall">Specialization</option> <option value="peremail">Individual Email</option> </select> <!--<input name="select" type="submit" id="select" value="select" />//--> </span></td> </tr> <!-- condition for the select menu --> <tr id="test2" style="visibility:hidden"> <td align="left" class="text3">Specialization:</td> <td align="left"><select name="specialization" class="textfield1"> <option value="" selected="selected">-- Select Here --</option> <? $uSql = "SELECT specialization FROM specialization"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; }else{ while($uRow = mysql_fetch_array($uResult)){ ?> <option value="<?= $uRow[specialization]?>"> <?= $uRow[specialization]?> </option> <? } } ?> </select> </td> </tr> <tr id="test" style="visibility:hidden"> <td align="left" class="text3">Email:</td> <td align="left"><input type="text" name="email" value="" class="textfield1" /></td> </tr> <!-- end --> <tr> <td align="left" class="text3">URL:</td> <td align="left"><input name="URL" type="text" id="URL" value="<?php print $url;?>" class="textfield1" /></td> </tr> <tr> <td> </td> <td align="left"><?php if(isset($_SESSION['URL'])){?> <textarea name="URLPREVIEW" cols="60" rows="10" id="URLPREVIEW" class="textfield1"><?php print $_SESSION['URL']?></textarea> <br /> <input name="CLEARURL" type="submit" id="CLEARURL" value="Clear" /> <input name="AMEND" type="submit" id="AMEND" value="Change" /> <?php }?> <input name="GETURL" type="submit" id="GETURL" value="Get URL" /> </td> </tr> <tr> <td> </td> <td align="left"><input name="SEND" type="submit" id="SEND" value="Send" /> <input name="CANCEL" type="submit" id="CANCEL" value="Cancel" /></td> </tr> <tr> <td colspan="2"><span class="text3"><img src="../images/spacer.gif" width="469" height="7" /></span></td> </tr> </table> </form></td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> </table></td> <td><img src="../images/spacer.gif" width="6" height="10" /></td> <td valign="top"><table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../images/spacer.gif" width="6" height="10" /></td> <td><table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> <td width="214" valign="top"> </td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> </table></td> <td><img src="../images/spacer.gif" width="6" height="10" /></td> </tr> </table></td> </tr> </table> <?php ob_end_flush();?> thanks!
  18. help please thanks!
  19. Hi, I tried it again and its working but i got another problem, from the entire list and specialization condition its only sending to the last email address that is registered or save on my database. how or whatelse should i add in my code so that it will send to all the email addresses that is in my database considering the set conditions in my query? need help please below is my current code <?php session_start(); ob_start(); include '../db_connect.php'; include_once("FileUpload.php"); include_once("Functions.php"); $dir = "D:/xampp/htdocs/test/data/"; $dir = "/home/museikne/www/misc/"; $active = false; $error = ""; $text = "List: "; $subject = stripslashes($_POST['SUBJECT']); $header = isset($_POST['FROM']) ? stripslashes($_POST['FROM']) : "JobHiRings<postmaster@jobhirings.com>"; $url = isset($_POST['URL']) ? stripslashes($_POST['URL']) : ""; // Clear All if(isset($_POST['CANCEL'])){ unset($_SESSION['LIST']); unset($_SESSION['URL']); } // Clear URL Content if(isset($_POST['CLEARURL']))unset($_SESSION['URL']); if(isset($_POST['AMEND'])){ $_SESSION['URL'] = stripslashes($_POST['URLPREVIEW']); } // Get URL Content if(isset($_POST['GETURL'])){ if(trim($_POST['URL']) == ""){ $error = "Please fill in the url"; }else{ $file = fopen($_POST['URL'], "r") or exit("Invalid URL!"); //Output a line of the file until the end is reached while(!feof($file)) { $body .= fgets($file); //mail($email,"To $email", "Hi there!", "From: ncy@museik.net"); } fclose($file); //$body = str_replace("%name%", "chuyang", $body); $_SESSION['URL'] = $body; } } // Import name list if(isset($_POST['IMPORT'])){ $validFile = array("txt"); // valid file formats $file = $_FILES['FILE']; if($file['name'] != ''){ unset($_SESSION['LIST']); $fu = new FileUpload($file, $dir); $fu->CheckFileFormat($validFile); $fu->UploadFile(); $file = fopen($dir."list.txt", "r") or exit("Unable to open file!"); //Output a line of the file until the end is reached while(!feof($file)) { $email = fgets($file); $email = explode(",",$email); $_SESSION['LIST'][] = $email; //mail($email,"To $email", "Hi there!", "From: ncy@museik.net"); } fclose($file); }else{ unset($_SESSION['LIST']); $error = "Please locate the file"; } //header("Location:$PHP_SELF"); } if(isset($_SESSION['LIST'])){ $i = 1; foreach($_SESSION['LIST'] as $key=>$val){ $name = $val[0]; $email = $val[1]; $text.= "$i ."."$name - $email "; $i++; } print $text; } if(isset($_POST['SEND'])){ print_r($_POST); if ($_POST['to'] == "all"){ $query = mysql_query("SELECT email FROM applicant WHERE subscribe = 'yes'") or die(mysql_error()); $row = mysql_fetch_array( $query ); $dbemail = $row['email']; } if ($_POST['to'] == "notall"){ $specialization = $_POST['specialization']; $query = mysql_query("SELECT email FROM applicant WHERE specialization = '$specialization' AND subscribe = 'yes'") or die(mysql_error()); $row = mysql_fetch_array( $query ); $dbemail = $row['email']; print_r($dbemail); } if ($_POST['to'] == "peremail"){ $dbemail = $_POST['email']; } //print_r($dbemail); // After getting list of $dbemail, then send accordingly: // : $mail->SendHTML($dbemail,$subject,$new_msg); if(trim($_POST['SUBJECT'] == ""))$error = "Please fill in a subject title"; if($error == ""){ require_once("Mail.php"); $mail = new Mail(); $mail->SetHeader($header); $original_msg = $_SESSION['URL']; $mail->SendHTML($dbemail,$subject,$original_msg); if(isset($_SESSION['LIST'])){ foreach($_SESSION['LIST'] as $key=>$val){ $new_msg = str_replace("%name%", $val[0], $original_msg); // See above $mail->SendHTML($val[1],$subject,$new_msg); } session_destroy(); header("Location:$PHP_SELF"); } } } if($active){ $file = fopen("html.txt", "r") or exit("Unable to open file!"); //Output a line of the file until the end is reached while(!feof($file)) { $email .= fgets($file); //mail($email,"To $email", "Hi there!", "From: ncy@museik.net"); } fclose($file); $email = str_replace("\"", "\\\"", $email); print $email; print "END"; } //$bodytag = str_replace("'", "\'", $body); echo $error; ?> <script language="JavaScript"> function event_action(spl_value) { if(spl_value=="peremail") { test.style.visibility="visible"; test2.style.visibility='hidden'; } else if(spl_value=="notall") { test2.style.visibility="visible"; test.style.visibility='hidden'; } else { test.style.visibility='hidden'; test2.style.visibility='hidden'; } } </script> <link href="../../css.css" rel="stylesheet" type="text/css" /> <link href="../css.css" rel="stylesheet" type="text/css" /> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../images/spacer.gif" width="6" height="10" /></td> <td valign="top"><table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> <td width="214" valign="top"><form action="<?=$PHP_SELF;?>" method="post" enctype="multipart/form-data" name="form1" id="form1"> <table border="0" cellspacing="0" cellpadding="3"> <tr> <td colspan="2" valign="top" nowrap="nowrap" class="text3"><img src="../images/spacer.gif" width="469" height="7" /></td> </tr> <tr> <td width="83" align="left" nowrap="nowrap" class="text3">Subject:</td> <td width="381" align="left"><input name="SUBJECT" type="text" id="SUBJECT" value="<?php print $subject;?>" class="textfield1"></td> </tr> <tr> <td align="left" class="text3">From:</td> <td align="left"><input name="FROM" type="text" id="FROM" value="<?php print $header;?>" class="textfield1" /></td> </tr> <tr> <td align="left" class="text3">Sent to :</td> <td align="left"><span class="text7"> <select name="to" class="textfield1" onchange="event_action(this.value);"> <option selected="selected" value="">--Email Option--</option> <option value="all">Entire list</option> <option value="notall">Specialization</option> <option value="peremail">Individual Email</option> </select> <!--<input name="select" type="submit" id="select" value="select" />//--> </span></td> </tr> <!-- condition for the select menu --> <tr id="test2" style="visibility:hidden"> <td align="left" class="text3">Specialization:</td> <td align="left"><select name="specialization" class="textfield1"> <option value="" selected="selected">-- Select Here --</option> <? $uSql = "SELECT specialization FROM specialization"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; }else{ while($uRow = mysql_fetch_array($uResult)){ ?> <option value="<?= $uRow[specialization]?>"> <?= $uRow[specialization]?> </option> <? } } ?> </select> </td> </tr> <tr id="test" style="visibility:hidden"> <td align="left" class="text3">Email:</td> <td align="left"><input type="text" name="email" value="" class="textfield1" /></td> </tr> <!-- end --> <tr> <td align="left" class="text3">URL:</td> <td align="left"><input name="URL" type="text" id="URL" value="<?php print $url;?>" class="textfield1" /></td> </tr> <tr> <td> </td> <td align="left"><?php if(isset($_SESSION['URL'])){?> <textarea name="URLPREVIEW" cols="60" rows="10" id="URLPREVIEW" class="textfield1"><?php print $_SESSION['URL']?></textarea> <br /> <input name="CLEARURL" type="submit" id="CLEARURL" value="Clear" /> <input name="AMEND" type="submit" id="AMEND" value="Change" /> <?php }?> <input name="GETURL" type="submit" id="GETURL" value="Get URL" /> </td> </tr> <tr> <td> </td> <td align="left"><input name="SEND" type="submit" id="SEND" value="Send" /> <input name="CANCEL" type="submit" id="CANCEL" value="Cancel" /></td> </tr> <tr> <td colspan="2"><span class="text3"><img src="../images/spacer.gif" width="469" height="7" /></span></td> </tr> </table> </form></td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> </table></td> <td><img src="../images/spacer.gif" width="6" height="10" /></td> <td valign="top"><table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../images/spacer.gif" width="6" height="10" /></td> <td><table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> <td width="214" valign="top"> </td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> </table></td> <td><img src="../images/spacer.gif" width="6" height="10" /></td> </tr> </table></td> </tr> </table> <?php ob_end_flush();?>
  20. guys, i need help, its been several days already and i havent fixed thoroughly my problem on my HTML email sending below is my page http://www.jobhirings.com/admean/email/blast.php this blasting page is working for individual email sending only. but if i select entire list or specialization. its not working and i intentionally print the POST so i can see if its picking up the emails on this two options. my friend told me to just loop the dbemail variabbles for entire list and specialization option but i dont know how and where to place it. hope you could help me with this. below is my codes for the blast.php page <?php session_start(); ob_start(); include '../db_connect.php'; include_once("FileUpload.php"); include_once("Functions.php"); $dir = "D:/xampp/htdocs/test/data/"; $dir = "/home/museikne/www/misc/"; $active = false; $error = ""; $text = "List: "; $subject = stripslashes($_POST['SUBJECT']); $header = isset($_POST['FROM']) ? stripslashes($_POST['FROM']) : "JobHiRings<postmaster@jobhirings.com>"; $url = isset($_POST['URL']) ? stripslashes($_POST['URL']) : ""; // Clear All if(isset($_POST['CANCEL'])){ unset($_SESSION['LIST']); unset($_SESSION['URL']); } // Clear URL Content if(isset($_POST['CLEARURL']))unset($_SESSION['URL']); if(isset($_POST['AMEND'])){ $_SESSION['URL'] = stripslashes($_POST['URLPREVIEW']); } // Get URL Content if(isset($_POST['GETURL'])){ if(trim($_POST['URL']) == ""){ $error = "Please fill in the url"; }else{ $file = fopen($_POST['URL'], "r") or exit("Invalid URL!"); //Output a line of the file until the end is reached while(!feof($file)) { $body .= fgets($file); //mail($email,"To $email", "Hi there!", "From: ncy@museik.net"); } fclose($file); //$body = str_replace("%name%", "chuyang", $body); $_SESSION['URL'] = $body; } } // Import name list if(isset($_POST['IMPORT'])){ $validFile = array("txt"); // valid file formats $file = $_FILES['FILE']; if($file['name'] != ''){ unset($_SESSION['LIST']); $fu = new FileUpload($file, $dir); $fu->CheckFileFormat($validFile); $fu->UploadFile(); $file = fopen($dir."list.txt", "r") or exit("Unable to open file!"); //Output a line of the file until the end is reached while(!feof($file)) { $email = fgets($file); $email = explode(",",$email); $_SESSION['LIST'][] = $email; //mail($email,"To $email", "Hi there!", "From: ncy@museik.net"); } fclose($file); }else{ unset($_SESSION['LIST']); $error = "Please locate the file"; } //header("Location:$PHP_SELF"); } if(isset($_SESSION['LIST'])){ $i = 1; foreach($_SESSION['LIST'] as $key=>$val){ $name = $val[0]; $email = $val[1]; $text.= "$i ."."$name - $email "; $i++; } print $text; } if(isset($_POST['SEND'])){ print_r($_POST); if ($_POST['to'] == "all"){ $query = mysql_query("SELECT email FROM applicant WHERE subscribe = 'yes'") or die(mysql_error()); $row = mysql_fetch_array( $query ); $dbemail = $row['email']; } if ($_POST['to'] == "notall"){ $specialization = $_POST['specialization']; $query = mysql_query("SELECT email FROM applicant WHERE specialization = '$specialization' AND subscribe = 'yes'") or die(mysql_error()); $row = mysql_fetch_array( $query ); $dbemail = $row['email']; } if ($_POST['to'] == "peremail"){ $dbemail = $_POST['email']; } //print_r($dbemail); // After getting list of $dbemail, then send accordingly: // : $mail->SendHTML($dbemail,$subject,$new_msg); if(trim($_POST['SUBJECT'] == ""))$error = "Please fill in a subject title"; if($error == ""){ require_once("Mail.php"); $mail = new Mail(); $mail->SetHeader($header); $original_msg = $_SESSION['URL']; $mail->SendHTML($dbemail,$subject,$original_msg); if(isset($_SESSION['LIST'])){ foreach($_SESSION['LIST'] as $key=>$val){ $new_msg = str_replace("%name%", $val[0], $original_msg); // See above $mail->SendHTML($val[1],$subject,$new_msg); } session_destroy(); header("Location:$PHP_SELF"); } } } if($active){ $file = fopen("html.txt", "r") or exit("Unable to open file!"); //Output a line of the file until the end is reached while(!feof($file)) { $email .= fgets($file); //mail($email,"To $email", "Hi there!", "From: ncy@museik.net"); } fclose($file); $email = str_replace("\"", "\\\"", $email); print $email; print "END"; } //$bodytag = str_replace("'", "\'", $body); echo $error; ?> <script language="JavaScript"> function event_action(spl_value) { if(spl_value=="peremail") { test.style.visibility="visible"; test2.style.visibility='hidden'; } else if(spl_value=="notall") { test2.style.visibility="visible"; test.style.visibility='hidden'; } else { test.style.visibility='hidden'; test2.style.visibility='hidden'; } } </script> <link href="../../css.css" rel="stylesheet" type="text/css" /> <link href="../css.css" rel="stylesheet" type="text/css" /> <table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../images/spacer.gif" width="6" height="10" /></td> <td valign="top"><table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> <td width="214" valign="top"><form action="<?=$PHP_SELF;?>" method="post" enctype="multipart/form-data" name="form1" id="form1"> <table border="0" cellspacing="0" cellpadding="3"> <tr> <td colspan="2" valign="top" nowrap="nowrap" class="text3"><img src="../images/spacer.gif" width="469" height="7" /></td> </tr> <tr> <td width="83" align="left" nowrap="nowrap" class="text3">Subject:</td> <td width="381" align="left"><input name="SUBJECT" type="text" id="SUBJECT" value="<?php print $subject;?>" class="textfield1"></td> </tr> <tr> <td align="left" class="text3">From:</td> <td align="left"><input name="FROM" type="text" id="FROM" value="<?php print $header;?>" class="textfield1" /></td> </tr> <tr> <td align="left" class="text3">Sent to :</td> <td align="left"><span class="text7"> <select name="to" class="textfield1" onchange="event_action(this.value);"> <option selected="selected" value="">--Email Option--</option> <option value="all">Entire list</option> <option value="notall">Specialization</option> <option value="peremail">Individual Email</option> </select> <!--<input name="select" type="submit" id="select" value="select" />//--> </span></td> </tr> <!-- condition for the select menu --> <tr id="test2" style="visibility:hidden"> <td align="left" class="text3">Specialization:</td> <td align="left"><select name="specialization" class="textfield1"> <option value="" selected="selected">-- Select Here --</option> <? $uSql = "SELECT specialization FROM specialization"; $uResult = mysql_query($uSql, $connection); if(!$uResult){ echo 'no data found'; }else{ while($uRow = mysql_fetch_array($uResult)){ ?> <option value="<?= $uRow[specialization]?>"> <?= $uRow[specialization]?> </option> <? } } ?> </select> </td> </tr> <tr id="test" style="visibility:hidden"> <td align="left" class="text3">Email:</td> <td align="left"><input type="text" name="email" value="" class="textfield1" /></td> </tr> <!-- end --> <tr> <td align="left" class="text3">URL:</td> <td align="left"><input name="URL" type="text" id="URL" value="<?php print $url;?>" class="textfield1" /></td> </tr> <tr> <td> </td> <td align="left"><?php if(isset($_SESSION['URL'])){?> <textarea name="URLPREVIEW" cols="60" rows="10" id="URLPREVIEW" class="textfield1"><?php print $_SESSION['URL']?></textarea> <br /> <input name="CLEARURL" type="submit" id="CLEARURL" value="Clear" /> <input name="AMEND" type="submit" id="AMEND" value="Change" /> <?php }?> <input name="GETURL" type="submit" id="GETURL" value="Get URL" /> </td> </tr> <tr> <td> </td> <td align="left"><input name="SEND" type="submit" id="SEND" value="Send" /> <input name="CANCEL" type="submit" id="CANCEL" value="Cancel" /></td> </tr> <tr> <td colspan="2"><span class="text3"><img src="../images/spacer.gif" width="469" height="7" /></span></td> </tr> </table> </form></td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> </table></td> <td><img src="../images/spacer.gif" width="6" height="10" /></td> <td valign="top"><table width="100" border="0" cellspacing="0" cellpadding="0"> <tr> <td><img src="../images/spacer.gif" width="6" height="10" /></td> <td><table width="216" border="0" cellspacing="0" cellpadding="0"> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td align="left" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> <td width="214" valign="top"> </td> <td align="right" bgcolor="#3261BB" width="1"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> <tr> <td colspan="3" valign="top" bgcolor="#3261BB"><img src="images/spacer.gif" width="1" height="1" /></td> </tr> </table></td> <td><img src="../images/spacer.gif" width="6" height="10" /></td> </tr> </table></td> </tr> </table> <?php ob_end_flush();?> thanks!
  21. its working. thanks!
  22. Hi, the date, subject and header is correct. but the message is being sent as a file not HTML the file is "noname" with no extension file. hope you could help me fix this. thanks!
  23. help please thanks!
  24. any help for this one please
  25. guys, i need help on this script i got this from another site. it is a sendmail script that can send HTML email when i test it, the header, subject, etc is ok except for the body or the message because its not appearing on my test mails. hope you could help me figure out the problem why its not showing the message or body part of the email below is the codes <?php //define the receiver of the email $to = 'youraddress@example.com'; //define the subject of the email $subject = 'Test HTML email'; //create a boundary string. It must be unique //so we use the MD5 algorithm to generate a random hash $random_hash = md5(date('r', time())); //define the headers we want passed. Note that they are separated with \r\n $headers = "From: webmaster@example.com\r\nReply-To: webmaster@example.com"; //add boundary string and mime type specification $headers .= "\r\nContent-Type: multipart/alternative; boundary=\"PHP-alt-".$random_hash."\""; //define the body of the message. ob_start(); //Turn on output buffering ?> --PHP-alt-<?php echo $random_hash; ?> Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Hello World!!! This is simple text email message. --PHP-alt-<?php echo $random_hash; ?> Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: 7bit <h2>Hello World!</h2> <p>This is something with <b>HTML</b> formatting.</p> --PHP-alt-<?php echo $random_hash; ?>-- <? //copy current buffer contents into $message variable and delete current output buffer $message = ob_get_clean(); //send the email $mail_sent = @mail( $to, $subject, $message, $headers ); //if the message is sent successfully print "Mail sent". Otherwise print "Mail failed" echo $mail_sent ? "Mail sent" : "Mail failed"; ?> thanks!
×
×
  • 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.