Molle Posted April 9, 2019 Share Posted April 9, 2019 (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 April 9, 2019 by Molle Wrong spelling Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted April 9, 2019 Share Posted April 9, 2019 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.) Quote Link to comment Share on other sites More sharing options...
Molle Posted April 9, 2019 Author Share Posted April 9, 2019 So, what you are saying is, throw this php-script in the trash? Quote Link to comment Share on other sites More sharing options...
mac_gyver Posted April 9, 2019 Share Posted April 9, 2019 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.