PHP - Moved Hosters Php Was 5.x Now 7.x Php Scripts No Longer Work.
I had to move hosters recently and I have a couple of scripts run using CRON to backup my MySql database and manage the number of backups that I keep. I can ask the hosters to deprecate the version of PHO backwards but I don't want to lose the opportunity of features that may be available in the new version. The main script essentially performs a MySqlDump to a specified directory and then emails me to tell me that it completed successfully. The second script just deletes any files in the backup folder more than x days old. I know mysqldump is a valid call so I should need to use anything other than that but I'm lost when it comes to seeing what is wrong with my scripts. backup.php
<?
/* CONFIGURE THE FOLLOWING SEVEN VARIABLES TO MATCH YOUR SETUP */
//$dbuser = $db_user, $conection ; // Database username
$command = "mysqldump -u $db_user --password=$db_password $db_name | gzip > $filename"; copy ($filename, $backdir.$newfile);
unlink($filename); //delete the backup file from the server
and delold.php
<?php
//echo "script is running";
if (is_dir("$path") )
}
Similar TutorialsI currently am hosting with 000webhost (Shittest thing ever) but I want to change hosts for a much more updated one but for free. I need them to supply me with free cpanel, phpmyadmin, mysql and sub-domain. I don't want to spend a penny.
Reason for upgrade: The Xenforo I was installing said it wasn't compatible because the phpMyAdmin was outdated.
Thanks.
This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=317963.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=310577.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=330946.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=321119.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=327247.0 This topic has been moved to PHP Regex. http://www.phpfreaks.com/forums/index.php?topic=314913.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=342142.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=356485.0 This topic has been moved to Other Web Server Software. http://www.phpfreaks.com/forums/index.php?topic=331514.0 This topic has been moved to Miscellaneous. http://www.phpfreaks.com/forums/index.php?topic=348530.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=356031.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=321864.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=330364.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=308528.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=349470.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=354151.0 This topic has been moved to Other Programming Languages. http://www.phpfreaks.com/forums/index.php?topic=354391.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=351058.0 Ok, I made some changes to my code (change in variable names only) and now it doesn't seem to work. Here is the code. <?php if ($_REQUEST['postal'] != "" && $_REQUEST['lbs'] != "") { $postal = $_REQUEST['postal']; $lbs = $_REQUEST['lbs']; $type = $_REQUEST['type']; if ($type == "splist") { $ztype = "cansp_zone" ; $lbstype = "sp"; } else { $ztype = "canmp_zone"; $lbstype = "mp"; } $qP1 = "SELECT * FROM " . $dbprefix . "_canzones WHERE canzone_postal = '$postal' "; $which = $handle_db2; $rsP1 = mysql_query($qP1,$which); if (mysql_num_rows($rsP1) > 0) { $row1 = mysql_fetch_array($rsP1); extract($row1); $prov = trim($canzone_prov); $zone = trim($canzone_zone); $dzone = $ztype.$zone; $dlbs = "can" . $lbstype . "_lbs"; $query = "SELECT $dzone FROM " . $dbprefix . "_can" . $type . " WHERE $dlbs = '$lbs' "; $which = $handle_db2; $result = mysql_query ($query,$which); $row = mysql_fetch_array($result); $dzone = $row[0]; $qP3 = "SELECT * FROM settings WHERE storeid = '$dbprefix' "; $which = $handle_db2; $rsP3 = mysql_query($qP3,$which); $row3 = mysql_fetch_array($rsP3); extract($row3); $taxsetting = trim($taxsetting); $gst = trim($gst); $pst = trim($pst); $hst = trim($hst); $cp_fuelcharge = trim($cp_fuelcharge); $cp_markup = trim($cp_markup); include("./inc/taxcalc.php"); include("./inc/markcalc.php"); ./inc/markcalc.php is as follows: <?php if ($cp_markup != "") { $cp_mark = ($dzone * ($cp_markup / 100)); When I output $cp_mark, it comes out as the same value as $cp_markup Any ideas? |