Maq
Administrators-
Posts
9,363 -
Joined
-
Last visited
-
Days Won
3
Everything posted by Maq
-
Change: $update = mysql_query("UPDATE navigation SET URL='$old_link' WHERE ID='$id'"); To: $update = "UPDATE navigation SET URL='$old_link' WHERE ID='$id'"; mysql_query($update) or die(mysql_error());
-
What is wrong with my date comparison structure?
Maq replied to will_1990's topic in PHP Coding Help
Can you print out your vars to make sure they have values? Also, put die in instead of echo for the second line. Post the output for these lines: echo " ".$_POST['departure_date']." ".$_POST['return_date']." ".$stamp1." ".$stamp2." "; die("You cannot book a return flight before your out-going flight!"); -
Please learn how to print Arrays out. And yes it did work, you should have mentioned it printed out 'Array'. Class users { public static $usersToCacheByID = array(); } users::$usersToCacheByID[] = 'User1'; users::$usersToCacheByID[] = 'User2'; echo 'usersToCacheByID: '; foreach(users::$usersToCacheByID as $key => $value) { echo 'key: ' . $key . ' value: ' . $value . ' '; } echo '';
-
What is wrong with my date comparison structure?
Maq replied to will_1990's topic in PHP Coding Help
I just did a test and it works. Assuming that the user types/chooses dates in the following format- dd/mm/yyy. //$date_out = "11/12/2008"; //$date_return = "11/11/2008"; //echos out the error $date_out = "11/09/2008"; $date_return = "11/11/2008"; //echoes out have fun on your trip!! $stamp1 = strtotime($date_out); $stamp2 = strtotime($date_return); if($stamp2 { echo "You cannot book a return flight before your out-going flight!"; } else { echo "have fun on your trip!"; } I'm not sure what you're doing wrong. I will take another look at your script. -
Not sure if you mentioned this, but you need a linux server for cron, do you have that? If so it's easy...
-
What is wrong with my date comparison structure?
Maq replied to will_1990's topic in PHP Coding Help
I don't think it matters what format the date is in. The strtotime() function handles every "normal" date format and returns a timestamp, at least to my knowledge. Try it out! -
True, but how often is that...? Too often not to take it into account. Now that I think about it, you guys are right... The timeout is better because it will produce more accurate results.
-
What is wrong with my date comparison structure?
Maq replied to will_1990's topic in PHP Coding Help
Instead of: $nonUSdate1 = $date_out; list($day,$month,$year) = explode('/',$nonUSdate1); $newDate1 = "{$month}/{$day}/{$year}"; $stamp1 = strtotime($newDate1); Why can't you just do something like: $stamp1 = strtotime($date_out); -
That doesn't help. The error is saying either $tmpPeriodArray is NOT an array or in invalid form. Please post HOW this array is created, as requested before.
-
True, but how often is that...?
-
Or, you could just do a browser conditional and use an IE-specific function instead:
-
That's the funniest part, literally dozens... What...?
-
Why not? When they exit you can execute AJAX code to log when they left.
-
You can detect when the user exits the browser. Found this example on another site: Exit detector <br /> var linkClicked = false;<br /> function exitPage()<br /> {<br /> if (!linkClicked)<br /> {<br /> window.alert('You would need to execute your logging code in here');<br /> }<br /> }<br /> Click here to leave this page Click here to leave this page without flagging that you are
-
What exactly do you mean? Does it give you an error? Does anything display?
-
Sessions would work. What kind of information do you want, just time of entrance and exit?
-
Reading from a txt file and searching or entering in to database
Maq replied to dmccabe's topic in PHP Coding Help
For some reason when I copied your code it put a massive amount of linebreaks in my IDE (it's over 1,000 lines now ;/). Could you attach a .txt file or something? -
What line is 31? This one? $sql = "INSERT INTO `staff_info` VALUES('','{$location}','{$realname}','{$email}','{$id}')"; You're not specifying the fields you're inserting into, for example: $sql = "INSERT INTO `staff_info` (field1, location, realname, email, id) VALUES('','{$location}','{$realname}','{$email}','{$id}')";
-
Um, you have this: $info = $mysql_fetch_array($res); You need this: $info = mysql_fetch_array($res); mysql_fetch_array() is a function, NOT a variable.
-
$info = mysql_fetch_array($res); //remove the $ FYI: The '&' should be double '&&'. You also don't need {} around the variables in the SQL statements.
-
You can start now if you want. If you install WAMP on your local machine you can test everything out on your localhost. It's free...
-
Yeah I know, just ignore my post... :-X
-
He wanted to update and I use SELECT/INSERT. Today's going to be a long day.... :-\