Failed to initializing Php scripts correctly in Linux.
It works in Windows however when I upload to my web host which is Linux eventually nothing happens when you pressed the register button.
DEMO: (Ads not intended)
PHP Script:
PHP Code:
<?php
if(isset($todo) and $todo=="post"){
$reg_password = md5($_POST['reg_password']);
$password2 = md5($_POST['password2']);
$status = "OK";
$msg="";
// if username is less than 3 char then status is not ok
if(mysql_num_rows(mysql_query("SELECT Username FROM members WHERE Username = '$reg_username'"))){
$msg=$msg."Username already exists. Please try another one<br />";
$status= "NOTOK";}
elseif(!isset($reg_username) or strlen($reg_username) <5){
$msg=$msg."Username Must Exceed 5 Characters!<br />";
$status= "NOTOK";}
else $msg=$msg."<font color=green>Hooray...Username Available!</font><br />";
if ( strlen($reg_password) < 5 ){
$msg=$msg."Password Must Exceed 5 Characters!<br />";
$status= "NOTOK";}
elseif ( $reg_password <> $password2 ){
$msg=$msg."Both Passwords Did Not Match!<br />";
$status= "NOTOK";
}
else $msg=$msg."<font color=green>Password Succeed!</font><br />";
if ( strlen($reg_email) == null) {
$msg=$msg."Valid Email Are Required!<br />";
$status= "NOTOK";}
else $msg=$msg."<font color=green>Email Succeed!</font><br />";
if ( strlen($reg_name) == null) {
$msg=$msg."Name Are Required!<br />";
$status= "NOTOK";}
else $msg=$msg."<font color=green>Name Succeed</font><br />";
if($status<>"OK"){
echo "<font face='Verdana' size='2' color=red>$msg</font><br />";
}else{ // if all validations are passed.
$query=mysql_query("insert into members(Username, Password, Name, Email, Rank, `Register Date`, IP_Address) values('$reg_username', '$reg_password' ,'$reg_email','$reg_name','$reg_rank','$reg_date','$reg_IP')");
echo "<font face='Verdana' size='2' color=green>Welcome, You Have Completely Signed Up!<br /><br/></font>";
}
}
?>
Can anyone explain me why?
Re: Failed to initializing Php scripts correctly in Linux.
Turn on error reporting and see if there's an error. I don't think it has as much to do with Linux as it does different PHP configurations or versions. Compare the versions of PHP you had for Windows with the one you're using on Linux. There could be a problem higher up in the script, too. Is there any PHP relying on deprecated, outdated, or disabled modules? Look into that.
Re: Failed to initializing Php scripts correctly in Linux.
$msg=$msg."Username Must Exceed 5 Characters!<br />"; That is not right.
What's up with that
Quote:
if($status<>"OK"){
?
Quote:
else $msg=$msg."<font color=green>Name Succeed</font><br />";
How exactly are you gonna display that if the script is continuing? That's where to script stops. Nothing happens after that o.o
I have no idea how you made this script work on your Windows. But .... its weird.
Re: Failed to initializing Php scripts correctly in Linux.
Quote:
Originally Posted by
kutsumo
$msg=$msg."Username Must Exceed 5 Characters!<br />"; That is not right.
What's up with that
?
How exactly are you gonna display that if the script is continuing? That's where to script stops. Nothing happens after that o.o
I have no idea how you made this script work on your Windows. But .... its weird.
I haven't clean the codes yet :blink:
@SPN how to turn on error reporting?
Re: Failed to initializing Php scripts correctly in Linux.