Jump to content

joel24

Members
  • Posts

    760
  • Joined

  • Last visited

Everything posted by joel24

  1. something like SELECT DISTINCT x.u,`group` FROM xernt_mailing x WHERE date <= DATE_ADD("2012-01-27 00:29:31",INTERVAL (SELECT `interval` FROM u_notifications u WHERE u.id = x.u LIMIT 1) HOUR) AND `group` <> "0"
  2. what part of it is not working? try run <script src="snow.js" type="text/javascript"></script> <script type="text/javascript"> //<![CDATA[ window.onload = function() { alert("working..."); try { snow.count = 30; // number of flakes snow.delay = 20; // timer interval snow.minSpeed = 2; // minimum movement/time slice snow.maxSpeed = 5; // maximum movement/time slice snow.start(); } catch(e) { // no snow } }; //]]> </script> if it isn't working, attach it to your <body onload="function"> event. otherwise - what is snow.js?
  3. google. have a look at this or... alternate
  4. I would send the confirmation email on the success of the first - i.e. if (@mail('email', 'subject', 'message', 'headers')) { //send confirmation email mail( $_POST['email'], "Thank you", "$ParentsName, Thank you. etc etc ", 'From: admin@domain.com' . "\r\n" . 'Reply-To: admin@domain.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion() ); }
  5. Yes mail( $_POST['email'], "Thank you", "$ParentsName, Thank you. etc etc ", 'From: admin@domain.com' . "\r\n" . 'Reply-To: admin@domain.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion() );
  6. you'll need to crop the image using imagecopy()... scroll down on that page and the example show code which will crop
  7. //have a static width and find the percentage of that in terms of the original width, then times it by the original height $width = $imageWidth; $height = $imageHeight; $newWidth = 300; $newHeight = $newWidth / $width * $height;
  8. in the results table, have it set up like results [ home (teamID from teams table) away (teamID from teams table) homeScore, awayScore, season, year ]
  9. second highest value?! i.e. max-1.. something like this should work $result = mysql_query("SELECT f.*, ( SELECT max(id) FROM links l WHERE (l.username = f.addee OR l.username = f.adder) AND id < (SELECT max(id) FROM links l2 WHERE (l2.username = f.addee OR l2.username = f.adder) ) AS maxValue FROM friends f WHERE f.adder = 'jack' OR f.addee='jack'"); //edit - misread your query if you want to get the max, 2nd, 3rd etc (multiple values) you will have to perform a separate query; SELECT `id` FROM links WHERE adder = 'jack' OR addee='jack' ORDER BY `id` desc
  10. couldn't you combine it all into one query? $result = mysql_query("SELECT f.*, (SELECT max(id) FROM links l WHERE l.username = f.addee OR l.username = f.adder) AS maxValue FROM friends f WHERE f.adder = 'jack' OR f.addee='jack'");
  11. have a look at some jquery mouseover - or you may want the hoverintent jQuery plugin...
  12. have a relational DB with a table for the teams and another table for the results (including year, season etc) i.e. teams [id, name, city, etc, etc] results [team1, team2, winner, score, season, year]
  13. have a database with the file locations, store the files in a folder with permissions restricting public access.. then retrieve the file with PHP (after fetching the location from the mysql database) header("Content-type: application/force-download"); header("Content-Transfer-Encoding: Binary"); header("Content-length: ".filesize($file)); header("Content-disposition: attachment; filename=".basename($file)); readfile("$file");
  14. joel24

    mail()

    I recommend trying out the phpMailer class - makes PHP mail a piece of cake!
  15. have a look at jQuery UI's droppable() function. There is a lot of documentation to help you on your way!
  16. while ($picP=mysql_fetch_array($pic)) { $base=basename($picP['title']); #... code to iterate between images goes here, # you'll need a counter and when that reaches 3 or modulus 3 == 0, then echo a new table row }
  17. you have many ifs with no enclosing parenthesis, the same with your while loops. <?php //get cookie do step1,step2,step3 if (isset($_COOKIE["user"])) { //step1 mysql_connect("localhost", "root", ""); mysql_select_db("register_db"); $result = mysql_query("SELECT * FROM register_vote WHERE name = '{$_COOKIE["user"]}'"); //step2 if ($result) { while($row = mysql_fetch_array($result)){ //step3 echo $row['name'] . "|gtop100:" . $row['gtop100'] . "|mcservers:" . $row['mcservers'] . "|xtremetop100:" . $row['xtremetop100']; } //close the while loop } //end if result true //if user has not inserted usernmae just echo false user } else { //else if cookie not set echo "false|gtop100:false|mcservers:false|xtremetop100:false"; //if user submited username set cookie and start at step 1 } ?>
  18. what does it display? post your code
  19. You need to put in a html anchor tag to link it... while ($row = mysql_fetch_assoc($sql)) { $body .= "<a href='http://abc.php?{$row['appointment_id']}'>http://abc.php?{$row['appointment_id']}</a> \n"; } #edit you should set the content type to HTML if you're having links in there read this //FROM php.net // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  20. you have no closing parenthesis on the while loop - while(condition) { } and yes you can use isset $_COOKIE, I would use an if and set $user to contain the user id variable at the start of the code, then continue with your logic using $user if (isset($_COOKIE['user'])) { $user = $_COOKIE['user']; } else if (isset($_POST['user'])) { $user = $_POST['user']; } else { #user not set, error exit("User not set."); } #code in here ## $sql="INSERT INTO register_vote (id, user) VALUES ('','$user')"; [/code]
  21. you need another while loop for the second mysql query, at the moment you're only retrieving the first image returned from the query.
  22. <?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"; while ($row = mysql_fetch_assoc($sql)) { $body .= "http://abc.php?{$row['appointment_id']} \n"; } $body .= "Regard\n" . "Admin"; $header = 'From: myemail@abc.com' ; $deliver = mail($to, $subject, $body, $header); if ($deliver) { echo "Appointment Reminder Sent. \n"; } else { echo "Appointment Reminder Sending Fail. \n"; } } } ?>
  23. what are the fields in the db table? where are the emails stored...? just to make sure I'm understanding your intentions; you want to extract the appointments from the database and send an email to each user with their appointments?
  24. You're not updating or inserting anything for mysql_affected_rows() to return anything
×
×
  • 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.