Reply
Problem With Register
Old 11-18-2007, 06:17 AM Problem With Register
evans123's Avatar
Ultra Talker

Posts: 269
Im using a ereg for my username on my login it just contains letters numbers and a few special characters but sometimes it accepts the username dd and other times it doesnt and i get this error.

PHP Code:
WarningUnknownYour script possibly relies on a session side-effect which existed until PHP 4.2.3Please be advised that the session extension does not consider global variables as a source of dataunless register_globals is enabledYou can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to offrespectivelyin Unknown on line 0 
__________________
SoldierExteme.com - Free MMORPG - sign-up today!
Backthebulls.com - Free online games (mad_willsy's)
Msnextra.co.uk - Msn Items

Last edited by evans123 : 11-18-2007 at 06:29 AM.
evans123 is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
     
Old 11-18-2007, 09:17 AM Re: Problem With Register
Arenlor's Avatar
Ultra Talker

Posts: 463
Name: Jerod Lycett
Location: /home/arenlor
Do you use $_POST and/or $_GET or $_COOKIE?
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 11-18-2007, 11:02 AM Re: Problem With Register
evans123's Avatar
Ultra Talker

Posts: 269
$_POST
__________________
SoldierExteme.com - Free MMORPG - sign-up today!
Backthebulls.com - Free online games (mad_willsy's)
Msnextra.co.uk - Msn Items
evans123 is offline
Reply With Quote
View Public Profile
 
Old 11-18-2007, 11:54 AM Re: Problem With Register
Arenlor's Avatar
Ultra Talker

Posts: 463
Name: Jerod Lycett
Location: /home/arenlor
The next question is do you have register_globals on? Also is there a test user I can use to look at this with?
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 11-18-2007, 12:33 PM Re: Problem With Register
amw_drizz's Avatar
Ultra Talker

Posts: 301
Name: Jon
Location: New York
also it may help to the script that is throwing out the errors, so we can look at it and help you figure it out. cause just debugging with the errors with out the code that is causing the errors is not going to work to easilly
__________________
AMW_Drizz
Php 5.2 Mysql 4.1 IIS 6 Win2k3 Server && PHP 5.2 MySQL 4.1 Apache 2.2 (separate machine of course)
amw_drizz is offline
Reply With Quote
View Public Profile Visit amw_drizz's homepage!
 
Old 11-18-2007, 01:06 PM Re: Problem With Register
evans123's Avatar
Ultra Talker

Posts: 269
heres the script:

PHP Code:
<?php
include("**.php");
session_start();
$imgtxt rand(1000,9999);

if(isset(
$_POST['register']))
{
$error false;
$username $_POST['username'];
$pass1 $_POST['password1'];
$pass2 $_POST['password2'];
$email $_POST['email'];
$imgno $_POST['imgno'];
$realno $_POST['realno'];
$teamname $_POST['teamname'];

$search3 mysql_fetch_array(mysql_query("SELECT * from championship__login where username='$username'"));
$search_email3 mysql_fetch_array(mysql_query("SELECT * from championship__login where email='$email'"));
$team_name mysql_num_rows(mysql_query("SELECT * from championship__login where team_name='$teamname'"));

if(
ereg("^[a-zA-Z0-9[:space:] [.[.] [.].] \_ \{ \} -]{3,12}$"$username)) 
{
$message '';
}else {
$message '<p align="center" class="normalText">Username can only contain letters, numbers and []{
}_-</p>'
;
$error true;
}
if (
$pass1 == $pass2)
{
if (empty(
$pass1) || empty($pass2))
{
$message '<p align="center" class="normalText">You need to fill up the password and confirm password fields.</p>';
$error true;
} elseif (
$search3){
$message '<p align="center" class="normalText">Sorry,but the username is already taken.</p>';
$error true;
}elseif ( empty (
$username) )
{
$message '<p align="center" class="normalText">You didnt enter a username.</p>';
$error true;
}elseif ( empty (
$email) )
{
$message '<p align="center" class="normalText">You need to fill in your email address.</p>';
$error true;
}elseif ( 
$search_email3 )
{
$message '<p align="center" class="normalText">Your email address already exists on the database and no multiple accounts are allowed.<br>If you have forgotten your password, you can reset it by clicking <a href="forgotten.php">here</a>.</p>';
$error true;
}else if (
strlen ($imgno) < 4)
{
$message '<p align="center" class="normalText">You did not enter a valid validation number.</p>';
$error true;
}else if (
$imgno != $realno)
{
$message '<p align="center" class="normalText">You did not enter a valid validation number</p>';
$error true;
}
else if (empty(
$teamname) || $team_name == 1)
{
$message '<p align="center" class="normalText">Team name already taken.</p>';
$error true;
}else if (
strlen ($email) < 5)
{
$message '<p align="center" class="normalText">You did not enter a valid email</p>';
$error true;
}else if(
$pass1 != $pass2) {
$message '<p align="center" class="normalText">Your passwords doesn\'t match.</p>';
$error true;
}
}
if (
$error == true)
{
$message2 '<p align="center" class="normalText"><a href="register.php?username='.$username.'&email='.$email.'"><b>Retry?</b></a></p>';
}else{
$sql mysql_query("INSERT into championship__login (username, password, email, date, team_name, logo, comment, points, rank, last_rank) VALUES ('$username','" md5($pass1) . "', '$email','" time() . "', '$teamname','','','','','')");
$message '<p class="normalText"><b>Successfully Registered</b><br/>You are registered! There is no need to activate you account so you can login and start straight away on planning your next ChampionshipFL team.</b>';
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>ChampionshipFL - #1 Championship Fantasy League</title>
<link rel="stylesheet" href="images/Refresh.css" type="text/css" />

<title>refresh</title>
</head>

<body>
<!-- wrap starts here -->
<div id="wrap">
        
        <!--header -->
        <div id="header">            
                
      <h1 id="logo-text">ChampionshipFL<span class="gray"></span></h1>        
      <h2 id="slogan">#1 Championship Fantasy League ...</h2>
            <?php echo $showclock?>
            <h3 id="scores"><strong>Live Scores:</strong> 
        <marquee scrollamount="5"><?php 
echo parser2(implode('',file('http://www.sportinglife.com/football/popup/football365/latest_scores.auto?/opt/ASFapache/htdocs/site/football/live/latestscores/cc_champ.insdat')));
        
?></marquee></h3>    
  </div>
        <!-- menu -->    
        <div  id="menu">
                <ul>
                <?php
                
echo toplinks();
                 
?>        
            </ul>
        </div>                    
            
        <!-- content-wrap starts here -->
  <div id="content-wrap">
                
            <div id="sidebar">
                    
                <h1>Menu</h1>
              <div class="left-box"><ul class="sidemenu">
                    <?php echo links(); ?>                
                    </ul>    </div>
                <?php echo login(); ?>
                <h1>Latest Results </h1>
                <div class="left-box">
                    <p>No Results </p>
                    
              </div>    
                
                <h1>Latest News </h1>
                <div class="left-box">
                    <p>No News </p>
                </div>
                            
                
            </div>
                
    <div id="main">
              <h1>Register</h1>
                
      <p>If you wish to register with ChampionshipFl then fill in the form below and click register. 
      <form method="post" action="register.php">
<?php echo "$message"?><br />
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          <tr>
            <td colspan="13" class="panelheader">Register</td>
          </tr>
          <tr>
            <td class="table"><div align="center">Type</div></td>
            <td width="126" class="table"><div align="center">Information</div></td>
            <td width="4" class="table">&nbsp;</td>
            <td width="4" class="table">&nbsp;</td>
            <td width="6" class="table">&nbsp;</td>
            <td width="27" class="table">&nbsp;</td>
            <td width="4" class="table">&nbsp;</td>
            <td width="21" class="table">&nbsp;</td>
            <td width="21" class="table">&nbsp;</td>
            <td width="86" class="table">&nbsp;</td>
            <td width="46" class="table">&nbsp;</td>
            <td width="4" class="table">&nbsp;</td>
            <td width="52" class="table">&nbsp;</td>
          </tr>
          <tr>
            <td width="116" class="row"><div align="left"><strong>Username</strong></div></td>
            <td class="row"><input name="username" type="text" id="username" value="<?php print $_GET['username'];
?>" size="20"/></td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
          </tr>
          <tr>
            <td class="row"><div align="left"><strong>Password:</strong></div></td>
            <td class="row"><input name="password1" type="password" class="textfield" id="password1" value="<?php print $_GET['password'];
?>" size="20"/></td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
          </tr>
          <tr>
            <td class="row"><div align="left"><strong>Confirm Password: </strong></div></td>
            <td class="row"><input name="password2" type="password" class="textfield" id="password2" value="<?php print $_GET['password'];
?>" size="20"/></td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
          </tr>
          <tr>
            <td class="row"><div align="left"><strong>Team Name: </strong></div></td>
            <td class="row"><input name="teamname" type="text" class="textfield" id="teamname" size="20"/></td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
          </tr>
          <tr>
            <td class="row"><div align="left"><strong>Email:</strong></div></td>
            <td class="row"><input name="email" type="text" class="textfield" id="email" value="<?php print $_GET['email'];
?>" size="20"/></td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
          </tr>
          <tr>
            <td class="row"><strong>Validation:</strong></td>
            <td class="row"><div align="center">Enter text shown in the image below:<br />
                  <img src="makeimg.php?imgtxt=<?php print $imgtxt;
?>" alt=" " />
                  <input type="hidden" name="realno" value="<?php echo "$imgtxt"?>" />
                  <br />
                <input type="text" name="imgno" size="20" maxlength="4" class="textfield" />
            </div></td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
          </tr>
          <tr>
            <td class="row">&nbsp;</td>
            <td class="row"><input name="register" type="submit" class="button" id="register" value="Register" /></td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
            <td class="row">&nbsp;</td>
          </tr>
        </table>
      </form>
      </p>
</div>
        
  </div>
                    
        <!--footer starts here-->
        <div id="footer">
            
            <p>
            &copy; 2007 <strong>ChampionshipFL</strong> | 
            Design by: <a href="http://www.styleshout.com/">styleshout  </a> | Edited By: Ben Compton | 
            Valid <a href="http://validator.w3.org/check?uri=referer">XHTML</a> | 
            <a href="http://jigsaw.w3.org/css-validator/check/referer">CSS</a>
           </p>
                
        </div>    

<!-- wrap ends here -->
</div>

</body>
</html>
__________________
SoldierExteme.com - Free MMORPG - sign-up today!
Backthebulls.com - Free online games (mad_willsy's)
Msnextra.co.uk - Msn Items
evans123 is offline
Reply With Quote
View Public Profile
 
Old 11-18-2007, 04:37 PM Re: Problem With Register
Arenlor's Avatar
Ultra Talker

Posts: 463
Name: Jerod Lycett
Location: /home/arenlor
Why are you GETting the username password and email in the entry form? I'm sure that may have something to do with it.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 11-19-2007, 01:38 AM Re: Problem With Register
evans123's Avatar
Ultra Talker

Posts: 269
What do you mean is it this bit?

PHP Code:
$username $_POST['username'];
$pass1 $_POST['password1'];
$pass2 $_POST['password2'];
$email $_POST['email'];
$imgno $_POST['imgno'];
$realno $_POST['realno'];
$teamname $_POST['teamname']; 
</span></span>
__________________
SoldierExteme.com - Free MMORPG - sign-up today!
Backthebulls.com - Free online games (mad_willsy's)
Msnextra.co.uk - Msn Items
evans123 is offline
Reply With Quote
View Public Profile
 
Old 11-19-2007, 08:07 PM Re: Problem With Register
Arenlor's Avatar
Ultra Talker

Posts: 463
Name: Jerod Lycett
Location: /home/arenlor
No I mean this part here.
PHP Code:
<td class="row"><input name="password2" type="password" class="textfield" id="password2" value="<?php print $_GET['password'];
?>" size="20"/></td>
There are many other areas you have it too.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Reply     « Reply to Problem With Register
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML