Jump to content

Problem with code in php! It works on another server!


ryugold

Recommended Posts

Always I try to access my login.php shows the message: 

 

the path is: http://rpgmakergold2003.heliohost.org/php/ckeditor/samples/login.php

 

Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator at webmaster@rpgmakergold2003.heliohost.org to inform them of the time this error occurred, and the actions you performed just before this error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.

 

 

 

please help me with this!

Edited by ryugold
Link to comment
Share on other sites

http://rpgmakergold2003.heliohost.org/ - This needs to be fixed first.

 

Here's the code for classe-db.php:

 

<?php
	if(!class_exists('DB')){
		class DB {
			public function __construct(){
				$mysqli = new mysqli('localhost', 'ryugold', '[redacted]', 'ryugold_cms');
				
				if($mysqli->connect_errno){
					printf("Conexão falhou %s\n", $mysqli->connect_error);
					exit();
				}
				
				$this->connection = $mysqli;
			}
			
			public function insert($query){
							
				$result = $this->connection->query($query);
				
				return $result;
			}
			
			public function select($query){
				$result = $this->connection->query($query);
				
				while($obj = $result->fetch_object()){ // This is what initially caused the error
					$results[] = $obj;
				}
				
				return $results;
			}
		}
	}
	   
	$db = new DB;

?>
I tried to help this person through Discord but it turned out that I was too rarted and here we are.
Link to comment
Share on other sites

the login system use another database and don't use this file(classe-db) to connect to database!

it was fixed! this error appears because there's no news posted in database! it seaches for the news, if it does not find, return this error!

Edited by ryugold
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...