5 Replies - 1490 Views - Last Post: 01 January 2011 - 03:17 AM Rate Topic: -----

#1 ghqwerty   User is offline

  • if($spareTime > 0){ $this->writeCode(); }
  • member icon

Reputation: 43
  • View blog
  • Posts: 903
  • Joined: 08-August 08

500 internal server error.

Posted 30 December 2010 - 08:37 AM

i was making a register page, and went to recycle some old code so i copied and padsted it in. however whenever i go to my register page it gives me a 500 internal server error. heres the code for the page

register.php
<?php
require("general.php");
session_start();
$signUp = new General;
$showRegister = $signUp->showRegister();
echo $showRegister;
$register = $signUp->register();
echo $register;

?>


and the functions showRegister and register :
showRegister
$output = '
			<html>
			<head>
			</head>
			<body>';		
			if(isset($_POST['submit'])){
					$output .= "";
			}else{
					$output .= "register";
			}
			$output .= '			
			<br />   
			<form method="post" action="" >
			Username:<input type="text" name="username" /><br />
			Password:<input type="password" name="password" /><br />
			email:<input type="text" name="email" id="email" /><br />			
			<br>
			<input type="submit" name="signup" value="sign up" />
			</form>
			</body>
			</html>';
		return $output;


register
		function register(){
		if(isset($_POST['signup'])){
		    //makes the text fields safer
		    $username = $this->cleanUpString($_POST['username']);
		    $password = $this->cleanUpString($_POST['password']);
			$email = trim($_POST['email']); 		    	    
			$usernamecheck = mysql_query("SELECT username FROM users WHERE username = '".$username."' ", $this->dblink) or die($this->mysqlErrorCode('register', 1));
			$yesorno = mysql_num_rows($usernamecheck);
				  
			for($x=0;$x<count($this->restrictedNames);$x++){
				if($username == $this->restrictedNames[$x]){
					$usernameCheck++;
				}
			}
				  
			//inserts all the data into the database
			if($yesorno >=1){//check if name is available 0 if yes 1 if no
				$output = "sorry name not available";		
			}elseif(($username == "") || ($password == "") || ($email == "")){ // checks that each field was populated
				$output = "sorry one or more of the required fields were not completed";
			}elseif($usernameCheck > 0){//checks against a list of invalid usernames
				$output = "Sorry invalid username";
			}elseif($this->gameState == 0 || $this->gameState == 3){//registering whilst game is broken or being made isn't possible. 
				$output = "Registering has been disabled. Game status = ".$this->gameStates[$this->gameState]."";
			}else{//everything is ok -> add user to database
				$query = mysql_query("INSERT INTO users (username, password, email) VALUES ('".$username."', '".$this->md5s($password)."', '".$email."')") or die($this->mysqlErrorCode('register', 2));   
				$output = "registered successfully<br> ";				
				$query1 = mysql_query("select id from users where username = '$username'", $this->dblink)  or die($this->mysqlErrorCode('register', 3));
				$this->id = mysql_result($query1, 0);
				$this->readTable($this->id);
				$this->logAction('register', $this->id, 0, 0, 0, 0, 0);			 
				$output .= "<a href='index.php'>Back to Login</a>";
			}
		}	
		return $output;
	}


when i put the contents of showRegister onto register.php and comment out the php above it works fine. so i dont know why this code is causing it to fail :S
is there something im doing wrong ?

Is This A Good Question/Topic? 0
  • +

Replies To: 500 internal server error.

#2 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6259
  • View blog
  • Posts: 24,028
  • Joined: 23-August 08

Re: 500 internal server error.

Posted 30 December 2010 - 08:54 AM

Did you check your error logs for parsing errors? Guarantee that's the problem.
Was This Post Helpful? 0
  • +
  • -

#3 ghqwerty   User is offline

  • if($spareTime > 0){ $this->writeCode(); }
  • member icon

Reputation: 43
  • View blog
  • Posts: 903
  • Joined: 08-August 08

Re: 500 internal server error.

Posted 30 December 2010 - 09:04 AM

i get this

Quote

[30-Dec-2010 09:52:46] PHP Warning: PHP Startup: Unable to load dynamic library '/usr/local/lib/php/extensions/no-debug-zts-20060613/ixed.5.2ts.lin' - /usr/local/lib/php/extensions/no-debug-zts-20060613/ixed.5.2ts.lin: undefined symbol: executor_globals_id in Unknown on line 0


which if im honest have no clue what it means.
Was This Post Helpful? 0
  • +
  • -

#4 JackOfAllTrades   User is offline

  • Saucy!
  • member icon

Reputation: 6259
  • View blog
  • Posts: 24,028
  • Joined: 23-August 08

Re: 500 internal server error.

Posted 30 December 2010 - 09:13 AM

Did you Google the error and read some links? That's what *I* would do.
Was This Post Helpful? 0
  • +
  • -

#5 ghqwerty   User is offline

  • if($spareTime > 0){ $this->writeCode(); }
  • member icon

Reputation: 43
  • View blog
  • Posts: 903
  • Joined: 08-August 08

Re: 500 internal server error.

Posted 30 December 2010 - 09:33 AM

bugger, it says to submit a support ticket/message support to fix it. but a friend of mine set up the hosting so i dont know who it is with :(

haha, ill get in touch with him but is there anyway to fix it via cpanel ?

---

edit:
i had googled it. but i just c&p'ed the whole error and it returned no matches. took out the date/time and got some matches.

This post has been edited by ghqwerty: 30 December 2010 - 09:37 AM

Was This Post Helpful? 0
  • +
  • -

#6 creativecoding   User is offline

  • Hash != Encryption
  • member icon


Reputation: 931
  • View blog
  • Posts: 3,216
  • Joined: 19-January 10

Re: 500 internal server error.

Posted 01 January 2011 - 03:17 AM

This may be a longshot but try to change your chmod to 0755.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1