Jump to content
Molle

Update script to PHP7.2

Recommended Posts

Posted (edited)

Hi.


I am trying to install a script to my home page. It wont work cuas the script are a bit old and it does not suite the PHP 7.  I have no knowledge in how to change the script.

I am now asking if there is anyone in here that would like to spare a little time to try and help me out? I would be very greatfull.
If It would make it easier for the one that would like to help me, I can send all log in info to the ftp server and to the database if needed..

This is the error I get when I visit http://bhdstats.com/install.php :
 

Fatal error: Uncaught Error: Call to undefined function mysql_pconnect() in /customers/a/f/2/bhdstats.com/httpd.www/common.php:41 Stack trace: #0 /customers/a/f/2/bhdstats.com/httpd.www/install.php(34): DBConnect() #1 {main} thrown in /customers/a/f/2/bhdstats.com/httpd.www/common.php on line 41 



About the scrip:

The script is called Neos_Chronos and is a stats and status script for a game server that I host. It has worked fine in the old days on older PHP-versions but as I typed above, it wont work on the newer PHP-versions.

I would be very greatfull for all help I can get.

Link to the webpage: bhdstats.com
Download the script:

 

http://bhdstats.com/Neos_Chronos.zip

 

Edited by Molle
Wrong spelling

Share this post


Link to post
Share on other sites

the php mysql_ extension has been removed from php. however, if the script is old enough to still be using the mysql_ extension, it is probably using other removed features (the error you got is just the first of many.) it would require reviewing the entire script and rewriting everything that's been removed and to also add security for database queries (php's attempt at protecting against sql special characters in external data from breaking sql queries was also removed.)

Share this post


Link to post
Share on other sites

So, what you are saying is, throw this php-script in the trash?

Share this post


Link to post
Share on other sites
43 minutes ago, Molle said:

So, what you are saying is, throw this php-script in the trash?

didn't state that. it is possible to convert old code to use a new database extension and to manually modify any sql query that has data being directly put into it to be a prepared query (the query function needs to accept a second optional array of input data and either just execute the query if there is no input data or prepare and execute the query if there is.) this is simpler if the code is using a database abstraction layer, which the code has (some user written functions), but isn't consistently using everywhere, so, it would first require that all database interactions be rewritten to use the existing functions.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.