
duffman014
Members-
Posts
20 -
Joined
-
Last visited
Never
Profile Information
-
Gender
Not Telling
duffman014's Achievements

Newbie (1/5)
0
Reputation
-
can someone point me in the right direction maybe to some tutorials im using flash actionscript 2.0 and im trying to just figure out how to send variables to and from.. i cant find anything that gives me good information... any help or tips???
-
hey there im really new to php.. i'm trying to understand exactly how php pulls information from a database... and can u just pull one piece of information from a table or do u have to pull the whole array and then pull out the one piece of information... such as this do u have to query the database every time u want one piece of information or can u just keep it the " connection" open and pull whenver u want $data = mysql_query("SELECT * FROM $tbl_name") or die(mysql_error()); $row1 = mysql_fetch_array($data) or die(mysql_error()); $tentqty = $bullshit['tentqty']; $shackqty = $row1['shackqty']; echo "tentqty=".$bullshit['tentqty'];
-
I KNOW ITS A SIMPLE MISTAKE!!! WERE IS IT -_-
duffman014 replied to duffman014's topic in PHP Coding Help
i got it to work.. thanks guys -
I KNOW ITS A SIMPLE MISTAKE!!! WERE IS IT -_-
duffman014 replied to duffman014's topic in PHP Coding Help
i fixed the if statment.. but now it just keeps saying that i cant connect to my database.... i dont understand one second it'll connect but why does it say it wont connect.... OMG so confused.. HELP <?php $host="********"; // Host name $username="*****"; // Mysql username $password="****"; // Mysql password $db_name="*****"; // Database name $tbl_name="registration"; // Table name mysql_connect ("$host, $username, $password") or die ("cannot connect"); mysql_select_db ("$db_name")or die("cannot select DB"); $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $verifypassword=$_POST['verifypassword']; $email=$_POST['email']; IF ($mypassword == $verifypassword) { header("location: registration.php"); } else { echo "finaly got one "; } ?> -
I KNOW ITS A SIMPLE MISTAKE!!! WERE IS IT -_-
duffman014 replied to duffman014's topic in PHP Coding Help
still getting this error????? Parse error: syntax error, unexpected '}' in D:\Hosting\4688039\html\test1\registration.php on line 21 -
I'm making just a basic registration script... i want it to compare the passwords to see if they are the same? when i run it. i get this error Parse error: syntax error, unexpected T_ELSE in D:\Hosting\4688039\html\test1\registration.php on line 21 i think i just wrote the if statment incorrectly.... if so could u please show me what i did wrong.. <?php $host="********"; // Host name $username="*****"; // Mysql username $password="****"; // Mysql password $db_name="*****"; // Database name $tbl_name="registration"; // Table name mysql_connect ("$host, $username, $password") or die ("cannot connect"); mysql_select_db ("$db_name")or die("cannot select DB"); $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $verifypassword=$_POST['verifypassword']; $email=$_POST['email']; IF ($mypassword == $verifypassword) { header("location: registration.php") else { echo "finaly got one " } } $sql="INSERT INTO $tbl_name(myusername, mypassword, email)VALUES('$myusername', '$password', '$email')"; $result=mysql_query($sql); ?>
-
<?php mysql_connect("cndlogin.********.com","cnd****","1"); mysql_select_db('users'); $uname = $_POST['uname']; $pw = $_POST['pw']; $vpw = $_POST['vpw']; $email = $_POST['email']; $sql = "SELECT COUNT(*) FROM UserTable WHERE uname= '" . $_POST['uname'] . "'"; $result = mysql_query($sql) or trigger_error(mysql_error(),E_USER_ERROR); if($result){ if(mysql_result($result,0) == 0){ //username not taken }else{ //username taken } }else{ //problem with query } ?> This is my registration code that im trying to make... i'm trying to validate username make sure its not taken. but i keep getting this error... Fatal error: No database selected in D:\Hosting\4688039\html\login5\regform1.php on line 13 did i mess up on the sql side???.. and can someone help me make a code to verify that someone enterd an email adress....
-
How to make if statment for registration page.....
duffman014 replied to duffman014's topic in PHP Coding Help
$query = "SELECT * FROM UserTable WHERE username=".$_Post['username']; $Con = mysql_query($query, $connection) or die(mysql_error()); $row = mysql_fetch_assoc($Con); $totalRows = mysql_num_rows($Con); if($totalRows>0) { echo 'Username exist'; } else { echo 'Unique Username'; } I tried using this but i could never get it right... i -
<? $host="cndlogin.db.asdf.com"; // Host name $username="cin"; // Mysql username $password="sorry"; // Mysql password $db_name="casdfogin"; // Database name $tbl_name="login"; // Table name // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // Get values from form $uname=$_POST['uname']; $pw=$_POST['pw']; $vpw=$_POST['vpw']; $email=$_POST['email']; $ip=$_POST['ip']; // Insert data into mysql $sql="INSERT INTO $tbl_name(uname, pw, email, ip)VALUES('$uname', '$pw', '$email', 'ip')"; $result=mysql_query($sql); if($name == false || $pass == false || $email == false) { echo "Please fill in all the required fields."; }; if($pass != $pass_conf){ echo "Passwords do not match."; } else { echo "thank you for your registration to cndalliance.com"; mysql_close(); } ?> Ok here the code i've come up wtih thus far... i'm trying to make an if statment that will check if the username has been taken???? i just cant figure it out i've seen some examples i just cant encorporate thema nd put them all togeather... any ideas or help greatley appreceated... Thx,
-
CAN SOMEONE CHECK THIS CODE TELL ME WHAT I MISSED PLZ
duffman014 replied to duffman014's topic in PHP Coding Help
ok i got more of it to work YAY... there is hope after all ... ok enough of the good news... bak to my horrific problems lol... YOU GUYS ARE AWESOME BY THE WAY... alright next up to bat.. its automatically echoing my check to see if all lines are filled. 2. it wont check my password check to see if they are the same... and i have an ip check on there and it wont show the ip for me... is my whole statment wrong and if so how should i rewrite it... one last question how do u chek and make sure that there is an at symbol in your email line // Connect to server and select database. mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); // Get values from form $uname=$_POST['uname']; $pw=$_POST['pw']; $vpw=$_POST['vpw']; $email=$_POST['email']; $ip=$_POST['ip']; // Insert data into mysql $sql="INSERT INTO $tbl_name(uname, pw, email, ip)VALUES('$uname', '$pw', '$email', 'ip')"; $result=mysql_query($sql); if($name == false || $pass == false || $email == false) { echo "Please fill in all the required fields."; }; if($pass != $pass_conf){ echo "Passwords do not match."; } else { echo "thank you for your registration to cndalliance.com"; mysql_close(); } ?> -
CAN SOMEONE CHECK THIS CODE TELL ME WHAT I MISSED PLZ
duffman014 replied to duffman014's topic in PHP Coding Help
Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'bludgeonaccount.db.4688039.hostedresource.com, bludgeonaccount, Greater99' (11004) in C:\xampp\htdocs\login2\do_reg.php on line 9 cannot connect i did that on xampp same error... sorry guys i'm terrible at this lol... and im using go daddy.com as a hosting service... www.cndalliance.com/login2/registration.php -
CAN SOMEONE CHECK THIS CODE TELL ME WHAT I MISSED PLZ
duffman014 replied to duffman014's topic in PHP Coding Help
Warning: mysql_connect() [function.mysql-connect]: Unknown MySQL server host 'bludgeonaccount.db.4688039.hostedresource.com, bludgeonaccount, Greater99' (11004) in D:\Hosting\4688039\html\login2\do_reg.php on line 9 cannot connect thats the error i keep recieving <?php $host="bludgeonaccount.db.4688039.hostedresource.com"; // Host name $username="bludgeonaccount"; // Mysql username $password="Greater99"; // Mysql password $db_name="bludgeonaccount"; // Database name $tbl_name="user"; // Table name mysql_connect ("$host, $username, $password") or die ("cannot connect"); mysql_select_db ("$db_name")or die("cannot select DB"); $name=$_POST['username']; $pass=$_POST['password']; $pass_conf=$_POST['pass_conf']; $email=$_POST['email']; $ip=$_POST['ip']; if($name == false || $pass == false || $email ==false) { echo "Please fill in all the required fields."; }; if($pass != $pass_conf){ echo "Passwords do not match."; } else { mysql_connect ("$host, $username, $password") or die ("cannot connect"); mysql_select_db ("$db_name")or die("cannot select DB"); $sql = "INSERT INTO user (username,password,email,ip) VALUES ('$name','$pass','$email','$ip')"; $result = mysql_query($sql); echo "thank you for your registration to cndalliance.com"; } ?> -
CAN SOMEONE CHECK THIS CODE TELL ME WHAT I MISSED PLZ
duffman014 replied to duffman014's topic in PHP Coding Help
ok i fixed that now it looks as if i screwd up somewere on the database side wtih sql... does it look like i made an error up there... i double checked all of it it say its correct.. but i have no idea what to do now... -
CAN SOMEONE CHECK THIS CODE TELL ME WHAT I MISSED PLZ
duffman014 replied to duffman014's topic in PHP Coding Help
Still dont know whats wrong... i keep getting the error below... if any one has a good tutorial i could go look at that will show me how to make a safe login registration form/database WOULD BE GREATLY APPRECIATED Parse error: syntax error, unexpected ')' in D:\Hosting\4688039\html\login2\do_reg.php on line 28 <?php $host="bludgeonaccount.db.4688039.hostedresource.com"; // Host name $username="bludgeonaccount"; // Mysql username $password="Greater99"; // Mysql password $db_name="bludgeonaccount"; // Database name $tbl_name="user"; // Table name mysql_connect ("$host, $username, $password") or die ("cannot connect"); mysql_select_db ("$db_name")or die("cannot select DB"); $name=$_POST['username']; $pass=$_POST['password']; $pass_conf=$_POST['pass_conf']; $email=$_POST['email']; $ip=$_POST['ip']; if($name == false || $pass == false || $email ==false) { echo "Please fill in all the required fields."; }; if($pass != $pass_conf){ echo "Passwords do not match."; } else { mysql_connect ("$host, $username, $password") or die ("cannot connect"); mysql_select_db ("$db_name")or die("cannot select DB"); $sql = "INSERT INTO user (username,password,email,ip) VALUES ($name, $pass, $email, $ip"); $result = mysql_query($sql); echo "thank you for your registration to cndalliance.com"; } ?> -
CAN SOMEONE CHECK THIS CODE TELL ME WHAT I MISSED PLZ
duffman014 replied to duffman014's topic in PHP Coding Help
well i would have an answer for you but now all of a sudden i cant connect to my database... i have no idea what i messed up now.. i'll have my code up and error messages shorts...