New website PHP mishap

Hi, I’m starting a traffic exchange (safelist) for website promotion. I’m a HTML guy but in trying to insert images (title, etc.) into the header. Something went wacko. I emailed the script author and have not received a reply. I’ll have to fix it myself (with help!)… Its a western movie theme with header image and navigation links with western style wording.

At first it came out great but in trying to remove a test image something broke! Please take a look. I know it is all basic php but not to me. :frowning: Maybe someone can set me straight.

Thanks mucho!

The message is pretty clear: The file does not exists as where you want to include it from, in the upper directory of where your index file lays in.

Hi, Yes, even I could see that… BUT, I don’t see how the files could just vanish. I’m very careful, as is everyone, to keep everything intact. Later today I’ll go over and check, Can’t do it right now…


just checkout the last revision from your repository. No repository? Try GIT in the future.

Ok, checked out config… does not appear to be files missing… GIT? I’m familar with Github.

Is it ok to post the file here?? Just did part way.

…freshly downloaded…

<?php error_reporting(0); @ini_set('display_errors', 0); include "connect.php"; define('API_URL', ''); function askVerifyAndSaveLicenseKey() { if (empty($_POST['key'])) { renderLicenseForm('Please enter a license key'); exit(); } else { $license_key = preg_replace('/[^A-Za-z0-9-_]/', '', trim($_POST['key'])); } $checker = new Am_LicenseChecker($license_key, API_URL); if (!$checker->checkLicenseKey()) { renderLicenseForm($checker->getMessage()); exit(); } else { $update = mysql_query("update settings set setting='$license_key' where name='licensekey'"); return $license_key; } } function renderLicenseForm($errorMsg = null) { echo <<<CUT PHP Traffic Exchange Script body { padding-top: 80px; }

So do you get any additional errors when putting this file to the right path?

The problem isn’t the config.php code, the problem is where the index.php file is trying to include the config.php file at. Is there a folder, one level nearer to the disk root, from the folder where the index.php file is at, that contains the config.php file? What is the actual directory structure?

This could actually be a case where this particular error has always been occurring, but wasn’t being reported/displayed. Based on the start of the code in the config.php file, where it is disabling php’s error related settings, some/all of the other files are probably doing the same, and your editing could have either caused existing php error related settings, that are hiding problems, to become non-operational, or caused php error related settings, that do report and display errors, to become active.

Also, based on what code you have shown so far, this script is out of date and amateurish, using the obsolete and now removed mysql_ database extension, isn’t using ‘require’ for things that are required for the script to ‘function’, and is using bad programming practices, setting php’s error related settings in the code (these should be set on the server), using an @ error suppressor, having no error handling for database statements, and putting external data directly into an sql query (even it if is ‘sanitized.’)


Thank you for your reply. You would think that if you offer a ($90) script on the Net today it would at least be up to date in writing the script and not have out of date lines of code.

To fill in some details… I purchased the script by MISTAKE! Yup, it was not the one I wanted. Did not realize it until after purchase as I had several potential scripts in a text file… they looked similar. Anyway. It’s done. Did not mean to get away from the subject matter.

Can I post a link to the complete file on my site so you can all see for yourselves. And, or any related files? I think that along with myself it would be good to see what NOT to do for newbies to learn from. Should I convert it/them to text?


Ok, before we get too into it I am only a basic html guy… I would have to give the password to you to go and see for yourself. :-/ (I actually should not even be here on this forum!) I can however make some good looking websites! (not for hire, I only do my own stuff)

If this is a copyrighted script, you are not allowed to post any of it, without permission from the author.

Another, perhaps related, issue. The main page displays an administrative login form. If you submit that form, you get a 404 html error page. The form submits to main.php, which also doesn’t exist. If this login form previously worked, something has either deleted files or changed paths on your server (the code in the configuration file could be setting up paths for files.) Some of the other pages do appear to output expected content without any php errors being displayed. It is also possible that there are more php errors than the ones you see, that could help pin down the problem, if php’s error_reporting isn’t set to E_ALL.

Okay, so much for posting someone’s script. It looks like I’ll have to get the script I initially wanted. From what I see now I don’t think this script is worth repairing, not by a long shot!

By the way, my header/ index page looked great then poof! Lots of error messages. I contacted the author and never heard from him again… been over 7-8 days.

I think this is as far as this can go. I thank you all and especially you chorn, for your help.


np. You still have the option to learn PHP and ask people on this forum if you encounter specific problems.


duchaine again…

  1. I mistook phdr for chorn. So Thanks also to phdr!

  2. I just got a email from the author! (he does not know about this as far as I know)

"Hey Leo,

Im afraid this goes beyond the scope of our support.

If you can tell us exactly how you’d like to have your site modified we can give you a quote and simply do it all for you!

Let me know :slight_smile:



On 13 Aug 2019, 15:22 +0200, Leo Duchaine, wrote:

Well it went great. I made a nice top image, added matching buttons. There is a “try out” image that needs to be deleted.

Then server errors.

Can you take a look?

So, how can I expect to have the install corrected with the errors as pointed out by phdr? Even deletion and re-installation is "more of the same!’

Any comments?
Thanks, LD

Sponsor our Newsletter | Privacy Policy | Terms of Service