PHP Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming LanguagesPHP Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old November 3rd, 2012, 06:02 AM
WESTSIDE200 WESTSIDE200 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2012
Posts: 17 WESTSIDE200 Negative: is most likely a SPAMMER and a traitor to the cause. 
Time spent in forums: 5 h 35 m 29 sec
Reputation Power: 0
Problelms with registration script

<html>
<body>
<form method="post" action="register.php" >
Enter your user name:
<input name="user" type=" text" /><br /><br />


Plesse enter your password:
<input name="password" type="password" /><br /><br />


Please enter your Email
<input name="email" type="text" />

<br />
<br />
Do you wish to recieve email from use
<input name="recieveEmail" type="radio" value="1" checked="checked" ? />yes
<input name="recieveEmail" type="radio" value="0" /> NO<br />

<input type="submit" value="register" />
</form>
include("abakwa.inc");
<?php
function dbconnect(){
$db = mysql_pconnect("localhost", "admin","anthony")or die ("cannot connet to your database");
mysql_select_db("abakwa",$db)or die ("cannot select database");
}
function isValidEmail($email){
return eregi("^[a-z0-9_]+@[a-z0-9\-]+\.+[a-z0-9\-\.]+$",$email);
}

$user = $_POST["user"];
$password = $_POST["password"];
$email = $_POST["email"];
$user = addslashes($user);
$email = addslashes($email);
$password=addslashes($password);
if($user and $password and $email){
if(isValidEmail($email)){
dbconnect();
$query="SELECT * FROM user WHERE name='".$user."'";
$result=mysql_query("$query")or die("query was not successful");
if(mysql_num_rows($result)==0){
$results=mysql_query("INSERT INTO user(name,passward) VALUES('$user','$password')");
if($results){
$logged_in_user==$user;
sesion_register("logged_in_user");
$result=mysql_query("SELECT * FROM user WHERE name ='".name .'');
if(!$result)fail("select query fail on register page ");
$record=mysql_fetch_assoc($result);
$logged_userID=$result["userID"];
setup_page("Register","Registration complete");
echo "Your details have been added to the database"."$logged_in_user";
echo "Your details have been register";
echo "<a href='main.php'>Click here to proceed to main page</a>" ."<br />
<br />";
echo "<a href='logg_out.php'>click here to logg out</a>";
exit;
echo" <br /><br />";
}
else
{
fail("database query fail,registration page",true );
}
} else
{
echo "sorry that user name has been taken please try another";
}
}
else{
setup_page("Registration","invalid registration");
echo "Please submit a valid email address.";
}
}

elseif($user||$password||$email){
echo "please fill all fields";
}else
{
// setup_page("Registratiom","Registration");
echo "Please enter your details to register.";
}
?>

</body>
</html>
Comments on this post
ptr2void disagrees: Read the damn New User Guide!

Reply With Quote
  #2  
Old November 3rd, 2012, 06:21 AM
maximas maximas is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 29 maximas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 22 m 30 sec
Reputation Power: 0
as I see,your code has problem.Because,eregi function has been depreceated by php...latter,session_register is so as well.The main problem,what is your question?,I couldn't understand it..

You should use strpos or preg_match instead of eregi function.

Reply With Quote
  #3  
Old November 3rd, 2012, 07:00 AM
ptr2void ptr2void is offline
I haz teh codez!
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Dec 2003
Posts: 2,476 ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level)ptr2void User rank is General 18th Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 2 Days 6 h 20 m 11 sec
Reputation Power: 2194
How many more posts will it take before you actually use code tags? And maybe read the New User Guide?

Just posting code with no explanation is crap.

And maximas, when someone does this, don't give them any help. They need to learn to actually ask a question, or they'll keep posting crap threads like this.
__________________
I ♥ ManiacDan & requinix

This is a sig, and not necessarily a comment on the OP:
Please don't be a help vampire!

Reply With Quote
  #4  
Old November 3rd, 2012, 07:51 AM
maximas maximas is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2012
Posts: 29 maximas User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 16 h 22 m 30 sec
Reputation Power: 0
Quote:
Originally Posted by ptr2void
How many more posts will it take before you actually use code tags? And maybe read the New User Guide?

Just posting code with no explanation is crap.

And maximas, when someone does this, don't give them any help. They need to learn to actually ask a question, or they'll keep posting crap threads like this.


@ptr2void
okey.thanks for your advice.

Reply With Quote
  #5  
Old November 3rd, 2012, 08:13 AM
sreejithkini sreejithkini is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2012
Location: India
Posts: 1 sreejithkini User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 17 m 9 sec
Reputation Power: 0
Facebook
Its all jumbled up. You can refer to this site:
simplecodecs.com/simple-php-login-system
The register.php contains the info on registering. Simple query has to be run to register the value. The forum is not allowing me to highlight the link.Damn!

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming LanguagesPHP Development > Problelms with registration script

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap