Meteotemplate - new free website template

www.patricksweeneydds.com/template/update/ed.php gives me a 404, file not found.

typo…edited
patricksweeneydds.com/template/update/wd.php?pass=12345

Can you attach a copy of your config.php file? You’ll need to change the filename to config.txt.

Here it is.

Removed it for security.

I don’t see the problem, have to wait for Jachym I think. Sorry not to be more help :frowning:

Thanks for looking, Niko. And thanks for removing the file…I was getting a little nervous with laying it all out. Some passwords will be changed anyway.

Good idea :slight_smile:

Hi,
if the password error shows up and you are sure you have 12345 in config.php for adminPass then I guess there is a problem with the CRON job. I think I remember one guy told me a while ago that his provider does not allow GET requests in CRON. This must be the same thing because there really is nothing that could potentially go wrong regarding this.

So what I suggest is this, we can take it step by step:

  1. Lets see if your server is accepting parameters from the URL

in wd.php
After this line:
$password = $_GET[‘pass’];
Simply insert this line:
echo "Password is: “.$password.”
";

Then run the page and see what you get as the result, if there is a problem with the server not accepting URL parameters, you will simply see nothing, ideally though you should see 12345 for password.

If this is the case, i.e. your server is not accepting parameters, then the only solution is to get rid of the password in wd.php (you can still use it for the admin section and all the rest, this is only concerned with CRON jobs).
Now obviously the problem is anyone could potentially update your database. Fortunately there is a solution even to this. First make sure that you do not have your server set to allow users view your server tree (view the structure of folders and files inside them, in 99% cases this is off by default, so hopefully it is your case too).

Then rename wd.php to something different, in other words, the name of the file will now work as the “password”. Say you rename it to w3UFM.php. Then, delete this from this file:

$password = $_GET['pass'];
	if($password!=$adminPassword){
		echo "Incorrect upload password!";
		die;
	}

This way you now removed the password. And then in your WD, set the updates, by simply specifying the name of your renamed wd.php, without any ?pass=… Now you are not using the password but noone can update your db anyway, because they would have to know the name of this file.

Let me know if any of this helped and also please let me know whether it was really the case your server is not reading URL parameters in case of CRONs. If that is the case, it means this is something that is not so unique and I will mention it in the wiki.

Hi Jachym,
Thanks for your help.
After inserting echo Password is: “.$password.”
";
to wd.php then running it, the page shows this:

Password is:
Incorrect upload password!

In config.php, this is line 40: $adminPassword = “12345”; // password for admin section

By the way, I am using iPage as webhost. If someone else is using them and has your template running, maybe they can help solve the mystery

I tried your solution 2 and got this when opening the page:

Latest DB record timestamp detected: 2015-08-31 05:03:12
Latest cached timestamp detected: 2015-08-31 05:04:02
Smallest interval between uploads to database set to: 300 seconds.
Difference between latest db timestamp and cached timestamp: 50 seconds.
The difference between last db update and current data is not yet larger than the set interval. Current data is saved into temporary cache.

So now the template is working. Thanks, Jachym
It must have been an iPage problem.
(I’m changing my admin password now)

Yes, so the first part means your server is not accepting the parameters.

The second output means it should now work.