Hey Friends Im New To this stuff (php etc) i want learn php.. plzz help i want loging and register script etc.. plzz bro
Help
Collapse
This topic is closed.
X
X
-
Here i made one i m nt sure abt it bt ask some experts if this got any ERROR
This to header.php
Code:<? $connect=mysql_connect("localhost","username", "password"); mysql_select_db("userdata",$connect) or die (mysql_errno().":<b> ".mysql_error()."</b>"); ?>
This is Sql Query to run
Code:CREATE TABLE 'userdata' ( 'id_user' INT NOT NULL AUTO_INCREMENT , 'name' VARCHAR( 128 ) NOT NULL , 'email' VARCHAR( 64 ) NOT NULL , 'phone_number' VARCHAR( 16 ) NOT NULL , 'username' VARCHAR( 16 ) NOT NULL , 'pass' VARCHAR( 32 ) NOT NULL , PRIMARY KEY ( 'id_user' ) )
This to login.php
Code:<? include('header.php'); $login = mysql_fetch_assoc(mysql_query('SELECT * FROM users;')); echo '<div class=menu>Login Admin:</div><div class=a> <form method="post" action="login.php?"> Password :<br> <input class="enter" type="password" name="pass"><br> <input class="buttom" type="submit" value="Submit"> </form></div>'; if(($_POST['pass'] == $login['password'])) { header('Location: home.php'); exit; } else{ echo 'Wrong Password. Please Try Again'; } ?>
This to register.php
Code:<? include('header.php); echo'<form name="registration_page" method="post" action="register.php"> <input type="text" name="name"> <input type="text" name="email"> <input type="text" name="username"> <input type="password" name="pass"> <input type="password" name="password_confirmation"> <input type="text" name="phone_number"> <input type="submit" value="Register"> </form>'; $insert_query = 'insert into userdata ( name, email, phone_number, username, password ) values ( "' . $_POST['name'] . '", "' . $_POST['email'] . '", "' . $_POST['phone_number'] . '", "' . $_POST['username'] . '", "' . md5($_POST['pass']) . '" )'; mysql_query($insert_query); echo'<script language = "Javascript"> function Validate() { if (document.registration_page.name.value == '') { alert('Please fill in your name!'); return false; } if (document.registration_page.email.value == '') { alert('Please fill in your email address!'); return false; } if (document.registration_page.username.value == '') { alert('Please fill in your desired username!'); return false; } if (document.registration_page.password.value == '') { alert('Please fill in your desired password!'); return false; } if (document.registration_page.password_confirmation.value == '') { alert('Please fill in your password again for confirmation!'); return false; } if (document.registration_page.password.value != document.registration_page.password_confirmation.value) { alert("The two passwords are not identical! "+ "Please enter the same password again for confirmation"); return false; } if (document.registration_page.phone_number.value == '') { alert('Please fill in your phone number!'); return false; } return true; } </script> Include this piece of code on your page, and change the <form> tag to trigger the execution of the Validate() function on form submit: <form name="registration_page" method="post" action="register.php onsubmit="return Validate();">'; ?>
Aw i found Some error in it ! Experts its my first try to make own codes please tell me my faults ! :DLast edited by funtowap; 21.03.11, 02:56.
-
i don't know ...
i guest he didn't search the forum for scripts like this is download-able lolVisit: Chat4u.mobi - The New Lay Of being a site of your dreams!
Visit: WapMasterz Coming Back Soon!
_______
SCRIPTS FOR SALE BY SUBZERO
Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
_______
Info & Tips
php.net
w3schools.com
Comment
-
Open Search type Lavalair then click search.
Find a zip then download done..Visit: Chat4u.mobi - The New Lay Of being a site of your dreams!
Visit: WapMasterz Coming Back Soon!
_______
SCRIPTS FOR SALE BY SUBZERO
Chat4u Script : coding-talk.com/f28/chat4u-mobi-script-only-150-a-17677/ - > Best Script for your site no other can be hacked by sql or uploaders.
FileShare Script : coding-talk.com/f28/file-wap-share-6596/ -> Uploader you will never regret buying yeah it mite be old now but it still seems to own others...
_______
Info & Tips
php.net
w3schools.com
Comment
Comment