Jump to content

aschk

Staff Alumni
  • Posts

    1,245
  • Joined

  • Last visited

    Never

Everything posted by aschk

  1. You haven't defined your $strMyServer variable UNTIL you get into your first isset if case. If that case fails, then $strMyServer never gets "made" or "set". Thus the variable never exists if your statement fails at the top. So if you try and use it later on PHP can't access that variable as it doesn't exist. Hence your error. ALWAYS initialise your variables. Put this at the top of your code. $strMyServer = "";
  2. Don't use COOKIE, use SESSION instead. Sessions cant be altered directly by the user, cookies can.
  3. Just done a little test myself and MySQL DOES throw a warning when you do this evaluation. I got "Incorrect datetime value: '1969' for column 'console_Stamp' at row 1". I suspected it might give me something along those lines. Anyhow your statement should be either : 1) SELECT * FROM schedule WHERE appt_date >= CURRENT_TIMESTAMP AND id = $this_id ORDER BY appt_date 2) SELECT * FROM schedule WHERE appt_date >= '$this_day' AND id = $this_id ORDER BY appt_date Note that $this_day should ideally be a string in the format 'YYYY-MM-DD' as you said in the original post. e.g. $this_day = '2007-11-14'; p.s. CURRENT_TIMESTAMP is SQL standard, whereas NOW() is NOT...
  4. If i'm not mistaken you've not put in the qualifying inverted commas ('), so i expect your statement is currently coming out something like this : (example : date is 2004-12-23 and id is 34) SELECT * FROM schedule WHERE appt_date >= 2004-12-23 AND id = 34 ORDER BY appt_date Now as far as SQL is concerned what you've provided for it there is 2004 MINUS 12 MINUS 23 which gives it 1969, so really your statement looks like : SELECT * FROM schedule WHERE appt_date >= 1969 AND id = 34 ORDER BY appt_date I am however surprised that it's not causing a warning or error. Nevertheless appt_date is ALWAYS greater than 1969 (because the condition evaluates to true).
  5. Is it me or does that cron job run EVERY minute of EVERY hour of EVERY day of EVERY month... Is that what you intended?
  6. Is it coming up in the MySQL slow query log? Have you seen the running process happen multiple times? Is the PHP script processing this statement more than once? Is the table you're working with locked at the time? How do you know it's running more than once? What IS the actual SQL you're running? It might give us a more of an idea why it's running slowly or repeating.
  7. I'm curious about your statement. You do realise that having "WHERE 1=1" will ALWAYS evaluate to true. Making ALL rows item1 column zero (0)?
  8. Simple : $template->assign('TOTAL_USERS_ONLINE' , sprintf($lang['users_online'],$total_online_users));
  9. Is it possible that header redirects are disallowed ? It also occured to me that if PHP is bombing out it might be because of the following lines not being allowed : error_reporting(E_ERROR | E_WARNING | E_PARSE); ini_set('track_errors', true);
  10. Is your error message coming from Apache or your application? I would guess by the number (405) that it's an Apache error. Meaning it was unable to process the script possibly? Have you tried a simple script to see if PHP is installed/working? <?php phpinfo(); ?>
  11. Look at the source of the page you are sending to , and find what input fields they are using and their EXACT names. Also bear in mind that some sites may use a SESSION identifier either in the form or otherwise to make sure the session hasn't changed and the invisible value (maybe a hidden field) has been posted also.
  12. Your isReady variable is false. So it'll never execute the document.execCommand action.
  13. Haha, whoops, my fault. Although shouldn't it be : ^([a-zA-Z]*)$
  14. Something tells me the cron job is wrong... Remove the cron job. Run that PHP script through your browser (once) and await your email (singular).
  15. MySQL pivot table anyone? I'm considering, given the data, whether it is a viable option...
  16. By the looks of it you have a 4 dimensional array there (or more), so you need $i,$j,$k,$q to iterate your loop. Sample : for($i=0;$i<count($xml['FSHOST']);$i++{ $flightplans = $xml['FSHOST'][$i]['FLIGHTPLANS']; for($j=0;$j<count($flightplans);$j++){ $flightplan = $flightplans[$j]['FLIGHTPLAN']; for($k=0;$k<count($flightplan;$k++){ $statustext = $flightplan[$k]['STATUSTEXT'][0]['VALUE']; $playername = $flightplan[$k]['PLAYERNAME'][0]['VALUE']; $timefiledtext = $flightplan[$k]['TIMEFILEDTEXT'][0]['VALUE']; $timeopened = $flightplan[$k]['TIMEOPENED'][0]['VALUE']; $timeclosed = $flightplan[$k]['TIMECLOSED'][0]['VALUE']; $opentimetext = $flightplan[$k]['OPENTIMETEXT'][0]['VALUE']; } } } By the way i'm making a HUGE assumption here, in that once you get to the flightplan it's only got 1 status, 1 playername, 1 timefiledtext, 1 timeopened, 1 timeclosed, 1 opentimetext . You work out where you want your <tr><td> 's... All i can say is that XML is REALLY badly formed and if you have PHP5+ consider using SimpleXMLElement instead of loops.
  17. Change your die() statement to die("I died here"); And if you get "I died here" in your output then you know your if statement is failing.
  18. What you have there is a 3D form of the data you're trying to represent. MySQL won't allow you to insert "Today", "Yesterday", "Later" into the resultset like you want. What you can do is ORDER BY <dateColumn> in your SQL, and then have PHP parse through them checking whether the date is "Today", "Yesterday" or "Later". SQL: SELECT id, CASE WHEN '2007-11-11 14:23:11' >= CURRENT_DATE THEN 'Today' WHEN '2007-11-11 14:23:11' BETWEEN SUBDATE(CURRENT_DATE, INTERVAL 1 DAY) AND CURRENT_DATE THEN 'Yesterday' WHEN '2007-11-11 14:23:11' < SUBDATE(CURRENT_DATE, INTERVAL 1 DAY) THEN 'Later' ELSE 'Unknown Date' END as 'When' FROM news ORDER BY date DESC
  19. It depends, what URL did you go to? Do you have a file called get_user.php ?
  20. php_ser.so is what you're after in Linux. Make sure that extension is available though of course
  21. Hmm, interesting. Never attempted something quite as similar but the code looks ok. This may seem like a simple answer, but are you sure that the machine you're testing it on recognises the .pdf in the email as a pdf file? Does it show the mini-icon? Have you got adobe reader installed? I'd be curious to find out, what happens you try try and echo out the contents of $file, and send the application/pdf header straight to the browser?
  22. You are already forcing the input there. By using the switch statement you are already securing your input. You are never using the variables specified in the $_GET superglobal explicitly. What you have done is fine.
  23. Or generate a massive multi-dimensional array in Javascript and onclick parse through it to find the correct set of next level dropdowns.
  24. Take the value $_POST['dropdownBoxName'] and write your SQL query to have that in it. Don't forget to escape your input
  25. You might want to try using mysql_fetch_assoc or that $r (result) handle. e.g. $r=mysql_query("select [i]field[/i] from [i]table[/i] where Employee_Firstname like 'KS'"); $row = mysql_fetch_assoc($r); $date2 = $r['field']; $date1 = "curdate()";
×
×
  • 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.