Hey guys, I'm trying to figure out where I've gone wrong with the following php code. I'm sure it's something basic, as my php skills leave a lot to be desired.
Any php pros around today?
8
Hey guys,
I'm trying to figure out where I've gone wrong with the following php code. I'm sure it's something basic, as my php skills leave a lot to be desired.
The problem is, it is redirecting to nomatch.html even when it's not supposed to. Any ideas?
I'm trying to figure out where I've gone wrong with the following php code. I'm sure it's something basic, as my php skills leave a lot to be desired.
PHP Code:
<?php
// Get URL text from address bar
// example --> www.website.com/script.php?url_date1=9-6-2010&url_date2=9-7-2010&url_date3=9-8-2010
$url_date1=$_GET['url_date1'];
$url_date2=$_GET['url_date2'];
$url_date3=$_GET['url_date3'];
// Get the current date (EST), and save it as a variable
date_default_timezone_set('America/New_York');
$current_date = date("n-j-Y");
// Check to see if the current date matches any of the 3 URL dates.
// If so, stay on current webpage (www.website.com/script.php).
// If current date does not match any of the 3 URL dates, redirect to www.website.com/nomatch.html
if ($current_date != ($url_date1 || $url_date2 || $url_date3)) {header("Location: http://www.website.com/nomatch.html");
}
?> - Andy Fletcher
- [ 1 ] Thanks
- [1] reply
- Brandon Tanner
- zeeshi570
- [ 1 ] Thanks
- bugbuguk
- [ 1 ] Thanks
- [1] reply
- ussher
- [ 1 ] Thanks
- [1] reply
Next Topics on Trending Feed
-
8