This command should also work on a Linux server (not tested on my server though):
or
depening where your file is located
This command should also work on a Linux server (not tested on my server though):
or
depening where your file is located
I still cant get it - i am sure i have the correct information but I must be just mixing it up? Anyone have any other suggestions?
I am still stuck with this.
Currently I have the file like this:
DEFINE ('/')
//Get Zen Cart configuration data
require_once('/home/dirtysic/public_html/imnaughty.net/currency_update.php/includes/configure.php');
('/home/dirtysic/public_html/imnaughty.net/currency_update.php/includes/database_tables.php');
But it still comes up with this error:
Warning: define() expects at least 2 parameters, 1 given in /home/dirtysic/public_html/imnaughty.net/currency_update.php on line 17
Warning: require_once(home/dirtysic/public_html/imnaughty.net/includes/configure.php) [function.require-once]: failed to open stream: No such file or directory in /home/dirtysic/public_html/imnaughty.net/currency_update.php on line 20
Fatal error: require_once() [function.require]: Failed opening required 'home/dirtysic/public_html/imnaughty.net/includes/configure.php' (include_path='.:/usr/lib/php:/usr/local/lib/php') in /home/dirtysic/public_html/imnaughty.net/currency_update.php on line 20
Can anyone see what is wrong? If there is someone who knows how this works, I will pay to get this sorted as It is really taking too much of my time.
We can't see your server paths from the outside, but my best guess would be that you should set the first line to
and set the next two back toPHP Code:DEFINE('PATH_TO_STORE_ROOT','');
This is based on a reading of your warning and error messages that seem to suggest that you have placed the currency update file in your site's root folderPHP Code:// Get Zen Cart configuration data
require_once(PATH_TO_STORE_ROOT . 'includes/configure.php');
require_once(PATH_TO_STORE_ROOT . 'includes/database_tables.php');
Kuroi Web Design and Development | Twitter
(Questions answered in the forum only - so that any forum member can benefit - not by personal message)
Kuroi - you a legend, or possibly the zen God. It looks like that worked. I just used the original file that i downloaded intially. It looks like it worked and now just waiting for the cron job to go through.
Can I ask one more thing?
now that the file is changed back to the original do i still need to make the changes to the code at the bottom? As mentioned in other posts such as #169:
$newrates = $newrates."\n".$currency['code']." ".$rate;
if ($rate) {mysql_db_query(DB_DATABASE, "update " . TABLE_CURRENCIES . " set value = '" . $rate . "', last_updated = now() where currencies_id = '" . $currency['currencies_id']. "'", $link);}
}
}
mysql_close($link);
//end lookup
$to = "[email protected]";
$subject = "Currency Update";
$thedate = getdate();
$thedate = $thedate['hours'].":".$thedate['minutes'].".".$thedate['seconds']." ".$thedate['mday']."/".$thedate['mon']."/".$thedate['year'];
$body = "mywebsite.com\n\ncurrency_update.php script has been run on ".$thedate."\nRate: ".$newrates;
if (mail($to, $subject, $body)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
OR does the standard file work?
Mal
Those changes aren't part of this mod as such. They are a notification for the store owner that a change has occurred in the case where somebody triggers it manually by browsing to the file (CRON can usually be set to send an email in cases where the changes occur as planned).
However, this is only relevant when the file has been installed below the web root (in your case public_html). The mod is designed such that the file can be placed outside the web root, in which case nobody without inside access to the server would be able to execute the script anyway.
Even with it installed below the web root, I don't really see any risk. While I don't like the idea of a visitor being able to trigger a script on your site, in this case it would simply mean that they've improved the accuracy of your rates slightly before you do it yourself - so no real downside, i.e. I wouldn't bother with these additions.
Kuroi Web Design and Development | Twitter
(Questions answered in the forum only - so that any forum member can benefit - not by personal message)
IT WORKED!
Thank you Kuroi, all I had to do is use the default file and not make any changes to it. I put in the CRON job and it works. Thank you. Kuroi - sent you a PM
Just set this up on my third store albeit on a different server to the other two and with newer version of cPanel.
At first I placed the file into various locations, used this command to no avail
then moved it to top level and used the command/usr/local/bin/php /home/MY_ACCOUNT/public_html/FOLDER/currency_update.php
Result:![]()
I'm using this mod.
I installed this months ago, and had a bit of trouble getting it work but I figured it out soon after.
Randomly, a couple of days ago, I'm getting an error in the cron email:
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /nfs/c04/h02/blah/blahblah/data/currency_update.php on line 51
Any ideas?
Nothing changed to the code or anything...![]()
I've dumped the file up on my server, altered the root path and it works!
However, if I don't set up the cron job at all, I wont be able to get automatic updates will I?
In which case, I can just run it say once a day myself by typing in the URL?