reg.php

Started on the old forum in December 2009 · view the original in the archive · old links redirect here

11 replies · 989 views · started 16 years ago · 1 min read

5 participants
Pablo Developer · 164 posts #1

am here coding a registration page but am kinda stuck i neeed an error that shows that the name is already taken.....i do have one but when u register it a name thats not already there it still says already exits here is my coding please help out

<?php include("utils.php"); include("tbc.php"); //include("functions.php"); echo "<link rel=\"StyleSheet\" type=\"text/css\" href=\"http://chillblock.wapdesire.com/nt4_us/teamblaze_css\" />"; echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";

echo "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">";

?>

<?php $login = $_POST["login"]; $pass = $_POST["pass"]; $email = $_POST["email"]; echo "<head>"; echo "<link rel=\"icon\" type=\"favicon_ico\" href=\"http://chillblock.wapdesire.com/nt4_us/img/teamblaze.ico\" />"; echo "<title>NT4.us - mobile wapsite creator/Mobile site builder</title>"; echo "</head>"; echo " "; if($_POST["login"] == '' || $_POST["pass"] == ''|| $_POST["email"] == '' ) { $error = "<img src=\"img/no.gif\" alt=\"\"/> Please Fill out all the fields"; } else if(strlen($_POST["login"]) < 4) { $error = "<img src=\"img/no.gif\" alt=\"\"/> Username - (sitename) must be 4 characters or more"; } else if(strlen($_POST["pass"]) <4) { $error = "<img src=\"img/no.gif\" alt=\"\"/> Password must be 4 characters or more"; } else if(!ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'. '@'.'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.'[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$', $_POST['email'])) { $error = "<img src=\"img/no.gif\" alt=\"\"/> Please provide a valid email address"; } else if($_POST["login"]) { $error = "<img src=\"img/no.gif\" alt=\"\"/> Username - (sitename) is already taken, please try again"; }else{ mysql_query('INSERT INTO users (login, pass, email) VALUES ("' . addslashes($_POST['login']) . '", "' . md5($_POST['pass']) . '", "' . addslashes($_POST['email']) . '")'); $uid = mysql_insert_id(); echo "<img src=\"img/yes.gif\" alt=\"\"/> Site created successfully --- "; echo " "; echo "Site url: **$login$hostname** "; echo "Password: **$pass** "; echo "Email Address: **$email** --- "; echo "<a href=\"sitepanel.php\">Site Manager/Admin Control</a> "; echo " "; } echo "$error"; echo " "; ?>
Mysterio Lead · 630 posts #2

i will give you a simple example:

$does_it_exits = mysql_fetch_array(mysql_query("select count (*) from users where login = '".$login."' ")); if ($does_it_exits[0] > "0") { echo "User exist!"; exit(); }

mysterio.al - programming is a functional art

Pablo Developer · 164 posts #3

ok bro let me test that...

Pablo Developer · 164 posts #4

i keep getting this error

Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/chill/public_html/nt4_us/reg.php on line 38

and the table is in the sql.

Pablo Developer · 164 posts #6

exist = mysql_fetch_array(mysql_query("SELECT count (*) from users where login = '".$login."' "));

there

subzero Super moderator Fellow · 3,954 posts #7

Are they right tables in there !! ?? !!

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... _______…

Pablo Developer · 164 posts #8

yes it is i dont know y am getting that error

kei_ki7 Senior · 431 posts #9

i think 1 of there dont have value.

Did I help you? You can help me too Your donations will help me finance my studies.

Pablo Developer · 164 posts #10

i fixed it am now on the login page

kei_ki7 Senior · 431 posts #11

then that's good 🙂

Did I help you? You can help me too Your donations will help me finance my studies.

Pablo Developer · 164 posts #12

yeah functions kinda giving me problems atm

Sign in to reply.

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close