<?php
require("db.php");
mysql_connect($DBserver, $DBuser, $DBpass) or die(mysql_error());
mysql_select_db($DBname) or die(mysql_error());
// Get data from the "CRFAds" table
$result = mysql_query("SELECT * FROM CRFAds WHERE SubmitterName Like 'David%'")
or die(mysql_error());
// Keeps getting the next row until there are no more to get
while($row = mysql_fetch_array( $result )) {
//Get Ad Start Date
$AdStartDate = date("F d, Y",strtotime($row['StartDate']));
//Check to see if it is either new (expires in 90 days) or a renewal (expires in 120 days)
If ($row['NewOrRenewal']=="Renewal") {
$AdExpirationDate = date("F d, Y",strtotime($row['StartDate'] . '+120 days'));
//Calculate the difference between expiration date and today to see if it expires within 30 days
$today = date("F d, Y");
$DayDiff = abs(strtotime($AdExpirationDate) - strtotime($today));
$DaysToExpiration = floor(($DayDiff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));
if ($DaysToExpiration <= 30) {
$Expire30 = "Yes";
}else{
$Expire30 = "No";
}
}else{
$AdExpirationDate = date("F d, Y",strtotime($row['StartDate'] . '+90 days'));
//Calculate the difference between expiration date and today to see if it expires within 30 days
$today = date("F d, Y");
$DayDiff1 = abs(strtotime($AdExpirationDate) - strtotime($today));
$DaysToExpiration = floor(($DayDiff1- $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));
if ($DaysToExpiration <= 30) {
$Expire30 = "Yes";
}else{
$Expire30 = "No";
}
}
//Calculate the difference between today and start date to see if it is new within the last 30 days
$DayDiff2 = abs(strtotime($AdStartDate) - strtotime($today));
$DaysRunning = floor(($DayDiff2- $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));
if ($DaysRunning <= 30) {
$New30 = "Yes";
}else{
$New30 = "No";
}
}
?>
Warning: require(): open_basedir restriction in effect. File(db.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/PI9Ln on line 2
Warning: require(db.php): Failed to open stream: Operation not permitted in /in/PI9Ln on line 2
Fatal error: Uncaught Error: Failed opening required 'db.php' (include_path='.:') in /in/PI9Ln:2
Stack trace:
#0 {main}
thrown in /in/PI9Ln on line 2
Process exited with code 255.
Output for 8.0.13
Warning: require(db.php): Failed to open stream: No such file or directory in /in/PI9Ln on line 2
Fatal error: Uncaught Error: Failed opening required 'db.php' (include_path='.:') in /in/PI9Ln:2
Stack trace:
#0 {main}
thrown in /in/PI9Ln on line 2
Process exited with code 255.
Warning: require(db.php): failed to open stream: No such file or directory in /in/PI9Ln on line 2
Fatal error: require(): Failed opening required 'db.php' (include_path='.:') in /in/PI9Ln on line 2
Process exited with code 255.
Warning: require(): open_basedir restriction in effect. File(db.php) is not within the allowed path(s): (/tmp:/in:/etc) in /in/PI9Ln on line 2
Warning: require(db.php): failed to open stream: Operation not permitted in /in/PI9Ln on line 2
Fatal error: require(): Failed opening required 'db.php' (include_path='.:') in /in/PI9Ln on line 2
Process exited with code 255.
Warning: main(db.php): failed to open stream: No such file or directory in /in/PI9Ln on line 2
Fatal error: main(): Failed opening required 'db.php' (include_path='.:') in /in/PI9Ln on line 2
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Warning: main(db.php) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /in/PI9Ln on line 2
Fatal error: main() [http://www.php.net/function.main]: Failed opening required 'db.php' (include_path='.:') in /in/PI9Ln on line 2