Forum Moderators: coopster
I am pretty sure these are the 2 files it uses.
1
<?phpinclude('lib/mysql.inc');
include('lib/sessionlib.inc');
include('lib/generallib.inc');
$user_id=$_REQUEST['user_id']+0;
//check if already exsits
$select=sqlquery("SELECT * FROM `users` WHERE (`id`='".$user_id."')and(`valid`=1);");
if (sqlnumrows($select)>0)
{
header("Location: index.php?p=home");
die;
}
if($_REQUEST['type']=='1')
{
$query="UPDATE `users` SET `valid`='1' WHERE (`id`=\"".$user_id."\") LIMIT 1";
sqlquery($query);
$query="UPDATE `teams` SET `valid`='1' WHERE (`id`=\"".$_REQUEST['team_id']."\") LIMIT 1";
sqlquery($query);
}
else
{
$query="UPDATE `users` SET `valid`='1', `pending`='0' WHERE (`id`=\"".$user_id."\") LIMIT 1";
sqlquery($query);
}
$select_userinfo=sqlquery("SELECT * FROM `users` WHERE (`id`=\"".$user_id."\") LIMIT 1");
$userinfo=sqlfetchobject($select_userinfo);
//insert same info from your form into phpbb database. Only use the columns that you need.
mysql_db_query("freeroll_phpb1","INSERT INTO phpbb_users (username, user_password, user_email, user_regdate) VALUES ('".$userinfo->login."','".$userinfo->pass."','".$userinfo->email."','".mktime()."');");
$phpbb_user_id=mysql_insert_id();
mysql_db_query("freeroll_phpb1","INSERT INTO phpbb_groups (group_type, group_description, group_single_user) VALUES ('1','Personal User','1');");
$phpbb_group_id=mysql_insert_id();
mysql_db_query("freeroll_phpb1","INSERT INTO phpbb_user_group (group_id, user_id, user_pending) VALUES ('".$phpbb_group_id."','".$phpbb_user_id."','0');");
header("Location: index.php?p=home");
?>
2
<?phpinclude('lib/mysql.inc');
include('lib/sessionlib.inc');
include('lib/generallib.inc');
require("lib/imageresizelib.inc");
$signup_ip=$REMOTE_ADDR;
$errors=array();
//image
if ($_FILES['file']['tmp_name']!="")
{
$fis=fopen($_FILES['file']['tmp_name'],"r");
$filedata=fread($fis,filesize($_FILES['file']['tmp_name']));
ob_start();
outputResizedImage($filedata,$_FILES['file']['type'],100,75,1);
$filedata=ob_get_contents();
ob_end_clean();
$filedata=addslashes($filedata);
fclose($fis);
$query="INSERT INTO `images` (`owner_table`,`filetype`, `filedata`) VALUES ".
"(\"".teams."\",\"".$_FILES['file']['type']."\",\"".$filedata."\");";
sqlquery($query);
$image_id=sqlinsertid();
}
else $image_id=0;
//check for errors
$select=sqlquery("SELECT * FROM `users` WHERE (`login`='".$_REQUEST['login']."') LIMIT 1");
if (sqlnumrows($select)!=0)
$errors['login']="Login Name allready exists!";
if (validateLogin($_REQUEST['login'], 4)==false)
$errors['login']="Invalid Login Name!";
if (validatePass($_REQUEST['pass'], 5)==false)
$errors['pass']="Invalid Password!";
if ($_REQUEST['pass']!= $_REQUEST['repass'])
$errors['repass']="Retype Same Password!";
$select=sqlquery("SELECT * FROM `users` WHERE (`email`='".$_REQUEST['email']."') LIMIT 1");
if (sqlnumrows($select)!=0)
$errors['email']="A member is already registered with this email!";
if (validateMail($_REQUEST['email'])==false)
$errors['email']="Invalid Email Address!";
if ($_REQUEST['type']=='1')
{
$select=sqlquery("SELECT * FROM `teams` WHERE (`name`='".$_REQUEST['team_name']."') LIMIT 1");
if (sqlnumrows($select)!=0)
$errors['team']="Team Name allready exists!";
if (validateString($_REQUEST['team_name'], 1)==false)
$errors['team']="Invalid Team Name!";
}
else
{
if ($_REQUEST['team']==0) $errors['team']="Please select a team!";
}
//registration with valid data
if (count($errors)==0)
{
if ($_REQUEST['type']=='1')
{
$query="INSERT INTO `teams` (`banner`, `banner_link` , `name`) VALUES ($image_id, \"".addslashes($_REQUEST['banner_link'])."\", \"".addslashes($_REQUEST['team_name'])."\")";
sqlquery($query);
$user_id=sqlinsertid();
$team_id=sqlinsertid();
$query="INSERT INTO `users` (`type`, `team` , `login` , `pass` , `email` , `signup_ip`, `signup_time`) VALUES (\"".addslashes($_REQUEST['type'])."\", $team_id, \"".addslashes($_REQUEST['login'])."\",'".md5($_REQUEST['pass'])."' , \"".addslashes($_REQUEST['email'])."\", '".$signup_ip."', NOW())";
sqlquery($query);
$user_id=sqlinsertid();
$email_address=$_REQUEST['email'];
}
else
{
$query="INSERT INTO `users` (`type`, `team` , `login` , `pass` , `email` , `signup_ip`, `signup_time`) VALUES (\"".addslashes($_REQUEST['type'])."\", \"".addslashes($_REQUEST['team'])."\", \"".addslashes($_REQUEST['login'])."\",'".md5($_REQUEST['pass'])."' , \"".addslashes($_REQUEST['email'])."\", '".$signup_ip."', NOW())";
sqlquery($query);
$user_id=sqlinsertid();
$email_address=$_REQUEST['email'];
}
$confaddress="http://".$_SERVER['HTTP_HOST']. str_replace(basename($PHP_SELF),"activateuseraccount.php", $_SERVER['SCRIPT_NAME'])."?user_id=".$user_id."&team_id=". $team_id."&type=".$_REQUEST['type']."";
$sender= 'The Poker Forum Challenge';
$email_subject = 'Activate Your Account';
$content= "We are having an error with the activation link. To have you account
activated please send an email to admin@example.com along with your username.<br/><br/>Click the following link once to activate your account you will be added to the site and forum: <a href='".$confaddress."' target='_blank'>Activatation Link</a>";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers.= "From: ".$sender;
@mail($email_address, $email_subject ,$content, $headers);
//Header("Location:index.php?".$sessq."&p=regconfirm");
Header("Location:index.php?p=regconfirm");
}
//return to registration with previous invalid data
else
{
//Header("Location:index.php?".$sessq."&p=register&errors=".base64_encode(serialize($errors))."&values=".base64_encode(serialize($_REQUEST))."");
Header("Location:index.php?p=register&errors=".base64_encode(serialize($errors))."&values=".base64_encode(serialize($_REQUEST))."");
}
?>
[edited by: jatar_k at 12:32 pm (utc) on Dec. 22, 2007]
[edit reason] example.com [/edit]
If it is a specific software like WordPress or phpBB you may need to upgrade the version to have it PHP5 compatable. Make sure if you do upgrade you will have to resinstal all mods and custom modifications, so save a complate old version to your hard drive, including the database.
If the software is not a popular platform you may need to hack it, to make it PHP5 competable.
Or, an alternative is to move to a hosting service that still runs PHP5, rent dedicated server and ask them to run PHP4 on it.
You may actually even run parallel versions on a server, PHP4 and PHP5
Please refer to [php.net...]
The biggest PITA change is how classes and object are handled.
This maybe the root of your problem.
[phpfreaks.com...]
Write and Close handlers are called after destructing objects since PHP 5.0.5. Thus destructors can use sessions but session handler can't use objects. In prior versions, they were called in the opposite order. It is possible to call session_write_close() from the destructor to solve this chicken and egg problem.
Good luck,
Igor
It goes back to the registration page asking and ask you to Please select a team, Invalid login name, and Invalid password and Invalid Email. I also noticed when someone does try and sign up it also leaves out the person IP address in the database before the upgrade it worked fine.
[edited by: jatar_k at 12:31 pm (utc) on Dec. 22, 2007]
[edit reason] no urls thanks [/edit]
Or, an alternative is to move to a hosting service that still runs PHP5, rent dedicated server and ask them to run PHP4 on it.
Bad idea. No new versions of php4 are being released from the end of 2007, and support for security fixes is dropped mid next year. You would be running an unsupported and potentially insecure (i say potentially as after support is dropped any flaws found will be ignored).
Anyway to the original posters question. Do you have error_reporting enabled? If not enable it as it may give you an insight into any undeclared vars etc that may be causing your problem.
I would recommend migration pathway case by case depending on one's needs and resources.
As Webmasters and Developers we deal with limited resources every day, and have to prioretize what is important.
If you have a custom build Website with a few thousand coding hours of development and you are not in a position to migrate to PHP5 fo what ever resons that you do not have time or financial budget to do it, what will your choice be?
Stay on PHP4 and deal with securety updates as time requires! I know people still using Windows 98 and they do not want to do Vista!
So no bad choices in Development World, only bad implementations.
I recently spoke to a 20 years IBM Asia Pacific main frame consultant and he told me 90 % of back office banking computing is still being done on main frames with Fortran and Coble.
If new technology is always best, why not run the bank operations on AMD X2 4800 processor with blade servers under PHP5 and MySql?
You should be consulting Bank of America and Citibank to change all their computing operations..:)
Regards,
Igor