
benchew0904
Members-
Posts
43 -
Joined
-
Last visited
Never
Everything posted by benchew0904
-
won't echo out text after space in textbox
benchew0904 replied to benchew0904's topic in PHP Coding Help
oh ok, thanks a lot -
won't echo out text after space in textbox
benchew0904 replied to benchew0904's topic in PHP Coding Help
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> -
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
-
Sorry, i'm quite weak in php..May I know which line i should add in the if (mysql_num_rows($sql1) == 0){
-
oh ok.. by the way what you meant by checking mysql_num_rows($sql1)?
-
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
-
I have edited but it also didn't show the link
-
I tried adding in the while loop but it didnt print out the link..
-
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"; } } } ?>
-
.. 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
-
how should i go about doing it if i want to send all the ids to one email?
-
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.
-
oh okay, thanks sorry, i'm a weak in php
-
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
-
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 />';} } ?>
-
From your example, "array($letter,3,4,2)", is I want to just a for loop for the following data, is it possible?
-
Anyone can help me with plotting of multiple line graph in php. I have researched on multiple line graph online and I would like to plot the graph by taking data from my database but the example below is inserting the graph data manually. Anyone can teach me how to use a for loop inside an array? <?php //Include the code require_once 'phplot.php'; //Define the object $plot = new PHPlot(800,600); //Set titles $plot->SetTitle("A 3-Line Plot\nMade with PHPlot"); $plot->SetXTitle('X Data'); $plot->SetYTitle('Y Data'); //Define some data $example_data = array( array('a',3,4,2), array('b',5,3,1), array('c',7,2,6), array('d',8,1,4), array('e',2,4,6), array('f',6,4,5), array('g',7,2,3) ); $plot->SetDataValues($example_data); //Turn off X axis ticks and labels because they get in the way: $plot->SetXTickLabelPos('none'); $plot->SetXTickPos('none'); //Draw it $plot->DrawGraph(); ?>
-
you might want to take a look this website, http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/datePickerStartEnd.html
-
Thanks a lot. You have helped me solve my problem. Really appreciate it..
-
Sorry, I have confused myself as i have been struggling with this query for a few days already. I just realized my type for date i used varchar. I just change back to date and all the date are in this format (yyyy-mm-dd, e.g. 2012-01-01). I rephrase my question and maybe you can let me know which query I should use as I think i have confused myself. E.g. I have these few dates in my database. 2011-12-31, 2012-01-02, 2012-01-03, 2012-01-03, 2012-01-03, 2012-01-04 I just want want to retreive these few dates, 2012-01-03, 2012-01-03, 2012-01-03, and the email from table 1 which is 2 days before today or should I say 2 days after today date?
-
Sorry, i'm using mysql. I want to retrive email, u_id from table 1 when the date from table 2 is 2 days before current date. Earlier on, I tried this query and it fetch me all data from my database. SELECT * FROM table1 t1 JOIN table2 t2 ON t1.u_id = t2.u_id WHERE t2.date <= CURRENT_DATE AND t2.date <= (CURRENT_DATE - INTERVAL 2 DAY ) I tried both your query and it's also did not fetch any data out.
-
I have a few data in my database which the dates are 2 days before today date I tried that query on my localhost but it didn't fetch any data..
-
Anyone can help me with a SQL query? I want to retrieve data from my database which must be 2 days before current date. I need to use a JOIN as there's 2 table. Table 1 u_id | name | email Table 2 id | u_id | date * For table 2 u_id is the same as table 1 u_id I tried using this query but it dosen't seems to work select * from table1 t1 JOIN table2 t2 ON t1.u_id = t2.u_id where t2.date <= (DATE('d-m-y')) and t2.date >= ( DATE('d-m-y') - INTERVAL 2 day )
-
Sorry, I'm not strong in programming. What do you mean by "just put the email from the database and it will email everyone with an appointment on that day."? You mean put at "$To = "?
-
I'm new to PHP, can anyone can help me with auto sending email? I have a database which store my customer data which includes their next appointment date etc and I would like to auto send an email reminder to them. I have some problem with the script and I'm not sure it's work. My email script "To", I'm not sure how should I state the recipient email as there might be a few customers which have the same appointment date. Please do advise on my code. <?php include 'cogfig.php'; #here store all my connection $sql = "select email from user where appointment_date <= CURRENT_DATE and appointment_date >= ( CURRENT_DATE - INTERVAL 1 day )"; while (mysql_fetch_array($results)) { if ($query) { $to = $subject = "Appointment Reminder"; $message = "Dear Customer \n\n" . "We would like to inform you that your appointment is tomorrow. \n" . "Your Sincerely\n" . "Admin"; $from = "[email protected]"; $headers = "From: $from"; $sentMail = mail($to, $subject, $message, $headers); if ($sentMail) { $statusMessage = "Appointment Reminder Successfully Sent. \n"; } else { $statusMessage = "Appointment Reminder Unsuccessfully Sent"; } } } ?>