Jump to content

akoh

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Everything posted by akoh

  1. Thanks for the reply, EdwinPaul. It works now. However, my ultimate aim is to be able to send the autoresponder (code above) based on the "orderdate" by user. For example, when user fill out the form and select a specify date to send the card. When the actual date arrives, the autoresponder (ecard) send out to the recipient email address entered on my form. Do you think this is possible? Thanks again for all your help, really appreciate it.
  2. Hi EdwinPaul, The date picker was in my form: <label for="orderdate" style="width:300px; text-align:left;">When would you like the card to be sent?</label> <input type="button" onClick="alert(this.form.orderdate.value)" value="Show date value passed"> <script>DateInput('orderdate', true)</script> and this script in the <head>: <script type="text/javascript" src="js/calendarDateInput.js"></script> Let me know if you need to see more.. Thanks.
  3. Hi EdwinPaul, I have tried the suggestion you made, it's now storing all the date user select into MySQL but it doesn't send on the date specified on my date picker js. I am not sure what I did wrong here: // Send autoresponder $template = 'emailer/autoresponder.html'; $fd = fopen($template,"r"); $sdate = date("M d Y"); $query="SELECT ID,email,rvar_card_email,rvar_card_description,rvar_card_message,rvar_card_signature,orderdate FROM test WHERE orderdate=NOW()"; $result=mysql_query($query) or die ($query . "<br />" . mysql_error()); while($row=mysql_fetch_array($result)){ echo $row['ID'] . " " . $row['email']; echo "<br />"; echo $row['rvar_card_email']; echo "<br />"; echo $row['orderdate']; echo "<br />"; echo $row['rvar_card_description']; echo "<br />"; echo $row['rvar_card_message']; echo "<br />"; echo $row['rvar_card_signature']; echo "<br />"; } $TO = $_POST['rvar_card_email']; $SUBJECT = "XXX"; $FROM = "[email][email protected][/email]"; $HEADER = 'MIME-Version: 1.0' . "\r\n"; $HEADER .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $HEADER .= "From: $FROM"; $MESSAGE = fread($fd, filesize($template)); $original = array("{rvar_card_description}", "{rvar_card_message}", "{rvar_card_signature}"); $replace = array($rvar_card_description, $rvar_card_message, $rvar_card_signature); $MESSAGE = str_replace($original,$replace, $MESSAGE); mail($TO,$SUBJECT,$MESSAGE,$HEADER); fclose($fd); Really appreciate it.
  4. Thanks a lot, EdwinPaul. I will try that.
  5. Hi, Thanks for the reply. Are you saying that I should remove the "if" function?
  6. Hi, Basically what I am trying to achieve here is if sendDate (select by user on the form) matches today's date, send out the autoresponder automatically. I am still learning PHP MySQL and here are my code: HTML Form (i am using datetimepicker javascript): <label for="sendDate">When would you like<br /><span style="margin-top:-5px; float:right;">the card to be sent?</span></label> <input id="sendDate" name="sendDate" type="date" size="25" value="<?php echo $_POST['sendDate']; ?>"><a href="javascript:NewCal('sendDate','mmddyyyy')"><img src="img/cal.gif" width="16" height="16" border="0" alt="Pick a date"></a> When submit, the date store in MySQL. Here is my process.php code (for the autoresponder): // Send autoresponder $template = 'emailer/autoresponder.html'; $fd = fopen($template,"r"); $sdate = date("M-d-Y"); $query="SELECT ID,email,sendDate FROM test WHERE sendDate='".$sdate."'"; $result=mysql_query($query) or die ($query . "<br />" . mysql_error()); if($sdate==$sendDate) { $TO = $_POST['rvar_card_email']; $SUBJECT = "Mikey Network Donation - E-Card"; $FROM = "[email protected]"; $HEADER = 'MIME-Version: 1.0' . "\r\n"; $HEADER .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $HEADER .= "From: $FROM"; $MESSAGE = fread($fd, filesize($template)); $original = array("{rvar_card_description}", "{rvar_card_message}", "{rvar_card_signature}"); $replace = array($rvar_card_description, $rvar_card_message, $rvar_card_signature); $MESSAGE = str_replace($original,$replace, $MESSAGE); mail($TO,$SUBJECT,$MESSAGE,$HEADER); fclose($fd); } Please help. Thank you.
×
×
  • 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.