Jump to content

benchew0904

Members
  • Posts

    43
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Male

benchew0904's Achievements

Member

Member (2/5)

0

Reputation

  1. oh ok, thanks a lot
  2. ooppss..sorry, here is my code <form name ="form" method = "POST" action ="profile.php"> <table style="width: 65%"> <tr> <td>Name</td> <td><input type="text" name="name" value =<?php echo $name; ?> /> </td> </tr> <tr> <td>Email</td> <td><input type="text" name="email" value=<?php echo $email; ?> ></td> </tr> </table> </form>
  3. I have some problem when I want to echo out a text which is retrieve from my database and place it inside a text box but it stops showing when there's a space. If I echo it out outside of the textbox, then there's no problem. May I know how to resolve this problem. Thanks
  4. Sorry, i'm quite weak in php..May I know which line i should add in the if (mysql_num_rows($sql1) == 0){
  5. oh ok.. by the way what you meant by checking mysql_num_rows($sql1)?
  6. This is my code <?php include 'config.php'; $sql = "SELECT * from customer c WHERE c.uid = " . $_SESSION['uid'] . "and c.appointmentDate BETWEEN CURRENT_DATE AND (CURRENT_DATE + INTERVAL 7 DAY )"; $sql1 = exeSelectQuery($sql); if (isset($_POST['submit'])) { if ($sql1) { $to = $_SESSION['mail']; $subject = "Appointment Reminder"; $body = "Dear Customer <br/><br/>" . "Please confirm your following appointment date by clicking on the link. <br/>"; while ($row = mysqli_fetch_assoc($sql)) { $body .= "<a href='http://abc.php?{$row['appointment_id']}'> http://abc.php?{$row['appointment_id']}</a> <br/>"; } $body .= "Regard<br/>" . "Admin"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: [email protected]' . "\r\n"; $deliver = mail($to, $subject, $body, $headers); if ($deliver) { echo "Appointment Reminder Sent. \n"; } else { echo "Appointment Reminder Sending Fail. \n"; } } } ?> This is the output which I have received. Dear Customer Please confirm your following appointment date by clicking on the link. Yours Sincerely Admin
  7. I have edited but it also didn't show the link
  8. I tried adding in the while loop but it didnt print out the link..
  9. Email are stored in session after customer log in.. They will click on the button to send.. This is the code after clicking on the button <?php include 'config.php'; //my configuration, username, password etc $sql = "SELECT * from customer c WHERE c.uid = " . $_SESSION['uid'] . "and c.appointmentDate BETWEEN CURRENT_DATE AND (CURRENT_DATE + INTERVAL 7 DAY )"; $sql1= exeSelectQuery($sql); if (isset($_POST['submit'])) { //after clicking on the button if ($sql1) { $to = $_SESSION['mail']; $subject = "Appointment Reminder"; $body = "Dear Customer \n\n" . "Please confirm your following appointment date by clicking on the link . \n" . "http://abc.php?40 \n" . #40 is the appointment_id "http://abc.php?42 \n" . #42 is the appointment_id "Regard\n" . "Admin"; $header = 'From: [email protected]' ; $deliver = mail($to, $subject, $body, $header); if ($deliver) { echo "Appointment Reminder Sent. \n"; } else { echo "Appointment Reminder Sending Fail. \n"; } } } ?>
  10. .. No..i'm trying to extract my friend appointment_id and send an email to them if they have any appointment date on the following week. And the email content will be the link to their appointment date to let them confirm their appointment date. E.g. of the email content www.abc.php?40 (40 will be my friend appointment_id) www.abc.php?42 (42 will be my friend appointment_id) Hope you get what i mean
  11. how should i go about doing it if i want to send all the ids to one email?
  12. I need some help over here. I want to send an email to my friends by checking the database and extract the id. After extracting the id from the database, i want to include a URL with the id. E.g. www.abc.php?35 (35 is the id) www.abc.php?40 (40 is the id) May I know how to send an email with multiple url? Is it using a for loop in the php email function? Your help is greatly appreciated.
  13. oh okay, thanks sorry, i'm a weak in php
  14. If I use the above code and if I select 3 options, it will show 3 Item(s) selected3 Item(s) selected3 Item(s) selected
  15. hi, I want to count the total number of multiple select that user has selected instead of getting the value the user has selected How should I go about doing the counting part? <form action="1.php" method="post"> <select name="test[]" multiple="multiple"> <option value="one">one</option> <option value="two">two</option> <option value="three">three</option> <option value="four">four</option> <option value="five">five</option> </select> <input type="submit" value="Send" /> </form> <?php $test=$_POST['test']; if ($test){ foreach ($test as $t){echo 'You selected ',$t,'<br />';} } ?>
×
×
  • 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.