
duffman014
Members-
Posts
20 -
Joined
-
Last visited
Never
Everything posted by duffman014
-
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... -
still very new... trying to figure all this out... i get an error on line 28 i dont know why... take a look tell me what i did do right thx... if someone has aim or something and wanna help me for quick questions i'd be very gratefull ... <?php $host="LOCAL"; // Host name $username="bludgeonaccount"; // Mysql username $password="RANDOM"; // Mysql password $db_name="bludgeonaccount"; // Database name $tbl_name="members"; // 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 $tbl_name(username, password, email)VALUES('$username','$password','$email')"; $result=mysql_query($sql)or die("MySQL ERROR: ".mysql_error()); echo "thank you for your registration to cndalliance.com"; }; ?>
-
ok i know what i did wrong.. COMPLETELY FORGOT TO ASK THE SERVER FOR THE INFORMATION BACK OOPS... thx for all your help
-
Ok i fixed some of the errors know i cant get it to out put ... here my output code... i just took out the last else statment and put this for an output page... actuall errors are coming up know... Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\Hosting\4688039\html\Login\addtomembers.php on line 26 while($rows=mysql_fetch_array($result)){ ?> <table width="400" border="1" cellspacing="0" cellpadding="3"> <tr> <td width="10%"><? echo $rows['id']; ?></td> <td width="30%"><? echo $rows['myusername']; ?></td> <td width="30%"><? echo $rows['mypassword']; ?></td> <td width="30%"><? echo $rows['firstname']; ?></td> <td width="30%"><? echo $rows['lastname']; ?></td> <td width="30%"><? echo $rows['email']; ?></td> </tr> </table> <?
-
http://www.cndalliance.com/login/reg.php here the site i'm trying it on ... it keeps kicking out to the error page instead of sucess???? still not sure why and thx for spotting that coma lol...
-
hey there ok lets start off here... Im still very new to this so please be patient with me... im trying to create a login registration... my problems are as follows... on my registration form i think i have the html correct it all looks right perhaps im not outputting the data corectly im not sure... second... on my php side... it wont input the data into my database... im pretty sure i have that correct to or maybe i've missed something all togeather... here my code please let me know what im doing wrong... gonna drive me crazy... thanks, <table width="300" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC"> <tr> <form name="regform" method="post" action="addtomembers.php"> <td> <table width="100%" border="0" cellpadding="3" cellspacing="1" bgcolor="#FFFFFF"> <tr> <td colspan="3"><strong>Member Registration </strong></td> </tr> <tr> <td width="78">Username:</td> <td width="294"><input name="myusername" type="text" id="myusername"></td> </tr> <tr> <td>Password:</td> <td width="294"><input name="mypassword" type="text" id="mypassword"></td> </tr> <tr> <td>Email:</td> <td width="294"><input name="email" type="text" id="email"></td> </tr> <tr> <td>First Name:</td> <td width="294"><input name="firstname" type="text" id="firstname"></td> </tr> <tr> <td>Last Name:</td> <td width="294"><input name="lastname" type="text" id="lastname"></td> </tr> <tr> <td> </td> <td> </td> <td width="294"><input type="submit" name="Submit" value="Submit"></td> </tr> </table> </td> </form> </tr> </table> ===-------------------------------------------------------------------------- here my php side of things[/img] <?php $host="randomt.db.2342342342342344688039.hostedresource.com"; // Host name $username="bludgeonaccount"; // Mysql username $password="randompassword"; // Mysql password $db_name="bludgeonaccount"; // Database name $tbl_name="members"; // 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 $myusername=$_POST['myusername']; $mypassword=$_POST['mypassword']; $firstname=$_POST['firstname']; $lastname=$_POST['lastname']; $email=$_POST['email']; // Insert data into mysql $sql="INSERT INTO $tbl_name(myusername, mypassword, firstname, lastname, email,)VALUES('$myusername','$mypassword','$firstname', '$lastname', '$email')"; $result=mysql_query($sql); // if successfully insert data into database, displays message "Successful". if($result){ echo "Successful"; echo "<BR>"; echo "<a href='insert.php'>Back to main page</a>"; } else { echo "ERROR"; } // close connection mysql_close(); ?>