Jump to content

cameeob2003

Members
  • Posts

    79
  • Joined

  • Last visited

    Never

Everything posted by cameeob2003

  1. The username change worked but when it gets to the lines: [code]// Checking if password match. $sql_pass_get = "SELECT encryptpass FROM users WHERE username='$user'"; $user_info = mysql_fetch_array(mysql_query($sql_pass_get)); $encryptpass = $user_info['encryptpass'];     if($encrytpass != md5($pass)){ $error = "Invalid Password. Try again.";[/code] I says that password is invalid even after I checked the password with mysql and it was correct.
  2. Replaced those lines and nothing was reported as an error. Im not quite sure if its my wording on the diff $variable lines or what that is breaking it somewere but i believe that all looks like it should process. So I am not sure what my problem with the script is.
  3. [code][code] // If the user is not found note that and end. if($usersfound < 1){ $error = "User ".$user." was not found in the database.";[/code] The above $error is what it keeps dipsplaying ^^ I know that that the user accounts Ive registered is there but it is not wanting to find it. Im not sure what ive done wrong. My mysql database is as follows: [code]CREATE TABLE `users` (   `userid` int(25) NOT NULL auto_increment,   `first_name` varchar(25) NOT NULL default '',   `last_name` varchar(25) NOT NULL default '',   `username` varchar(25) NOT NULL default '',   `password` varchar(20) NOT NULL default '',   `encryptpass` varchar(255) NOT NULL default '',   `email` varchar(255) NOT NULL default '',   `location` varchar(255) NOT NULL default '',   `steamid` varchar(15) NOT NULL default '',   `handle` varchar(25) NOT NULL default '',   `bio` text NOT NULL,   `photo` varchar(255) NOT NULL default 'nopic.jpg',   `team_name` varchar(32) NOT NULL default '',   `team_tag` varchar(17) NOT NULL default '',   `access` varchar(25) NOT NULL default '0',   `webs` varchar(255) NOT NULL default 'http://',   `sign_update` datetime NOT NULL default '0000-00-00 00:00:00',   PRIMARY KEY  (`userid`),   UNIQUE KEY `username` (`username`) ) TYPE=MyISAM AUTO_INCREMENT=1 ;[/code] and my code for the login.php is this: [code]<?php session_start(); header("Cache-control: private"); $user = $_POST['username']; $pass = $_POST['password']; include("db.php"); // Check to see if the user exists. $sql_user_check = "SELECT * FROM users WHERE username='$user'"; $result_name_check = mysql_query($sql_user_check); $usersfound = mysql_num_rows($result_name_check); // If the user is not found note that and end. if($usersfound < 1){ $error = "User ".$user." was not found in the database."; // If the user does exist continue with processing. }else{ // Checking if password match. $sql_pass_get = "SELECT * FROM users WHERE username='$user'"; $user_info = mysql_fetch_array(mysql_query($sql_pass_get)); $encryptpass = $user_info['encryptpass']; // If password does not match then end. if($encrytpass != md5($pass)){ $error = "Invalid Password. Try again."; // If the passwords do match, let in and go to the session variables. }else{ $_SESSION['userid'] = $user_info['userid']; $_SESSION['first_name'] = $user_info['first_name']; $_SESSION['last_name'] = $user_info['last_name']; $_SESSION['username'] = $user_info['username']; $_SESSION['password'] = $user_info['password']; $_SESSION['encryptpass'] = $user_info['encryptpass']; $_SESSION['email'] = $user_info['email']; $_SESSION['location'] = $user_info['location']; $_SESSION['steamid'] = $user_info['steamid']; $_SESSION['handle'] = $user_info['handle']; $_SESSION['bio'] = $user_info['bio']; $_SESSION['photo'] = $user_info['photo']; $_SESSION['team_name'] = $user_info['team_name']; $_SESSION['team_tag'] = $user_info['team_tag']; $_SESSION['access'] = $user_info['access']; $_SESSION['webs'] = $user_info['webs']; $_SESSION['priv_message'] = $user_info['priv_message']; } } if(!$_SESSION['username']){ if($error){ echo $error; include("index.php"); }else{ include("index2.php");   }     }else{ echo "<html><head><title>Welcomce Back</title></head>Welcome back ". $_SESSION['username'] .".<a href=index2.php>Click here</a> to proceed."; } ?>[/code][/code]
  4. Ok this is not like my last post but in a way is I cant find out which line in this script is causing me to get the error. There is no more to the script than what is seen here if anyone could help me that would be great. Parse error: parse error, unexpected $ login.php on line 61 [code] <?php session_start(); header("Cache-control: private"); $user = $_POST['username']; $pass = $_POST['password']; include("db.php"); // Check to see if the user exists. $sql_user_check = "SELECT * FROM users WHERE username='$user'"; $result_name_check = mysql_query($sql_user_check); $userfound = mysql_num_rows($result_name_check); // If the user is not found note that and end. if($userfound < 1){ $error = "User $user was not found in the database."; // If the user does exist continue with processing. }else{ // Checking if password match. $sql_pass_get = "SELECT * FROM users WHERE username='$user'"; $user_info = mysql_fetch_array(mysql_query($sql_pass_get)); $encryptpass = $user_info['encryptpass']; // If password does not match then end. if($encrytpass != md5($pass)){ $error = "Invalid Password. Try again."; // If the passwords do match, let in and go to the session variables. }else{ $_SESSION['userid'] = $user_info['userid']; $_SESSION['first_name'] = $user_info['first_name']; $_SESSION['last_name'] = $user_info['last_name']; $_SESSION['username'] = $user_info['username']; $_SESSION['password'] = $user_info['password']; $_SESSION['encryptpass'] = $user_info['encryptpass']; $_SESSION['email'] = $user_info['email']; $_SESSION['location'] = $user_info['location']; $_SESSION['steamid'] = $user_info['steamid']; $_SESSION['handle'] = $user_info['handle']; $_SESSION['bio'] = $user_info['bio']; $_SESSION['photo'] = $user_info['photo']; $_SESSION['team_name'] = $user_info['team_name']; $_SESSION['team_tag'] = $user_info['team_tag']; $_SESSION['access'] = $user_info['access']; $_SESSION['webs'] = $user_info['webs']; $_SESSION['priv_message'] = $user_info['priv_message']; } if(!$_SESSION['username']){ session_start(); header("Cache-control: private"); if(!$_SESSION['username']){ echo "<font id=UserPanelText />You are not logged in."; exit(); } include("index2.php"); ?>[/code]
  5. I updated the code a little bit tryed to get most of the things you guys told me to fix fixed yet im not sure I did correctly on the echo lines but im working on it. Well after I updated the code and tryed to make the improvements I still get the: [quote]Parse error: parse error, unexpected $ in /homepages/34/d154144477/htdocs/ventgaming/n2p/index.php on line 955[/quote] here is a link to the updated code (same link as before): [url=http://n2p.ventgaming.com/n2psitecode.txt]http://n2p.ventgaming.com/n2psitecode.txt[/url]
  6. Thx that worked. I have a question though > why is it that you have to take away the "=" in order for it to proccess the form? Why do the "=" cause errors?
  7. Here is the link to my full code: [url=http://n2p.ventgaming.com/n2psitecode.txt]http://n2p.ventgaming.com/n2psitecode.txt[/url] I appreciate all the support.
  8. The entire page wont fit into a forum post :(  . But I have determined the following is the code that is messing up my page: [code]<?php if($_GET['page'] == "register_parse"){ # include mysql connection script include("db.php"); # Grab the post variables from the PHP form $first_name = $_POST['first_name']; $last_name = $_POST['last_name']; $email_address = $_POST['email_address']; $username = $_POST['username']; $bio = $_POST['bio']; # Checking for anything that could cause errors $first_name = stripslashes($first_name); $last_name = stripslashes($last_name); $email_address = stripslashes($email_address); $username = stripslashes($username); $bio = stripslashes($bio); # Any errors in the posted fields? Lets check... if((!$first_name) || (!$last_name) || (!$email_address) || (!$username)){ echo '<font id=NewsText />You did not submit the following required information! <br/></font>'; } if(!$first_name){ echo '<font id=NewsText />First name is a required field. Please enter it below. <br/></font>'; } if(!$last_name){ echo '<font id=NewsText />Last name is a required field. Please enter it below. <br/></font>'; } if(!$email_address){ echo '<font id=NewsText />Email address is a required field. Please enter it below. <br/></font>'; } if(!$username){ echo '<font id=NewsText />Username is a required field. Please enter it below. <br/></font>'; } include("?page=register"); exit(); # does this username already exist in the database? lets check for that now... $sql_email_check = mysql_query("SELECT email FROM users WHERE email='$email'"); $sql_username_check = mysql_query("SELECT username FROM users username='$username'"); $email_check = mysql_num_rows($sql_email_check); $username_check = mysql_num_rows($sql_username_check); if(($email_check > 0) || ($username_check > 0)){ echo '<font id=NewsText />Please fix the following errors: <br/></font>'; if($email_check > 0){ echo '<font id=NewsText />Your email address has already been used by another member in our database. Please use a different Email address!<br/></font>'; unset($email_address); } if($username_check > 0){ echo '<font id=NewsText />The username you have selected has already been used by another member in our database. Please choose a different Username!<br/></font>'; unset($username); } include("?page=register"); // Show form again exit(); # everything checks out so far, so lets add the user! function makeRandomPassword(){ $salt = "abcdefghijklmnopqrstuvwxyz0123456789"; srand((double)microtime()*1000000);   $i = 0;   while ($i <= 7){   $num = rand() % 33; $tmp = substr($salt, $num, 1); $pass = $pass .$tmp; $i++; } return $pass; } $random_password = makeRandomPassword(); $db_password = md5($random_password); # Enter into database $info2 = htmlspecialchars($info); $sql = mysql_query("INSERT INTO users (first_name, last_name, email, username, password, encryptpass, bio, signup_date) VALUES('$first_name','$last_name','$email','$username','$db_password','$info2', now(),'$random_password')") or die (mysql_error()); if(!$sql){ echo '<font id=NewsText />There has been an error creating your account. Please contact the webmaster.</font>'; }else{ $userid = mysql_insert_id(); // Let's mial the user! $subject = "Your Membership at n2p.com"; $message = "Dear $first_name $last_name, You are now registered at our website, http://www.n2p.com! To activate your membership, please login here: http://www.n2p.com/index.php?=login_form Once you activate your membership, you will be able to login with the following information: Username: $username Password: $random_password Please keep this username and password in a location that is easily accessible by you. Thanks! Webmaster, n2p.com This is an automated response, please do not reply!"; mail($email_address, $subject, $message, "From: n2p.com<webmaster@n2p.com>\nX-Mailer: PHP/" . phpversion()); echo '<font id=NewsText />Your membership information has been mailed to $email_address ! Please check it and follow the directions!</font>'; } } ?>[/code] I went over the code in order to fix the problem yet im still getting the error. I think it would make sence i didn't end a strand right but what strand would that be. As I said im new to PHP but I gave it a look over to make sure that It wasnt some little missing end tag and there was nothing I had seen (although im realy tired and my eyes hurt). Anyway if someone could tell me what I have done wrong in this code that would be great. Thnx in advance.
  9. Anyone out there. Im realy in need of help to solve this problem. Any help is welcome.
  10. Here is the more of the code (full page is to long to post :(): [code] <?php if($_GET['page'] == "matches"){ session_start(); header("Cache-control: private"); $username = $_SESSION['username']; # Database connect script # You can edit the next four lines $db_host = 'your_host'; $db_user = 'username'; $db_pass = 'your_pass'; $db_name = 'your_db_name'; # Under here DONT TOUCH!!! $connection = mysql_pconnect("$db_host","$db_user","$db_pass") or die("Couldn't connect to server."); $db = mysql_select_db("$db_name", $connection) or die("Couldn't select database"); echo ' <table> <tr> <td bgcolor="#CCCCCC">ID</td> <td bgcolor="#CCCCCC">Team 1</td> <td bgcolor="#CCCCCC">___</td> <td bgcolor="#CCCCCC">Team 2</td> <td bgcolor="#CCCCCC" align="center" valign="middle">Match Highlights</td> <td bgcolor="#CCCCCC">Final Score</td> <td bgcolor="#CCCCCC">Date</td> </tr>'; $sql = "SELECT * FROM matches order by id"; $query = mysql_query($sql); while($row = mysql_fetch_array($query)) { $id = $row['id']; $team1 = $row['home_team']; $team2 = $row['away_team']; $team1_webs = $row['team1_web']; $team2_webs = $row['team2_web']; $score1 = $row['score_one']; $score2 = $row['score_two']; $date = $row['date_played'];   } echo ' <tr> <td bgcolor="#CCCCCC"><font id=dash>$id</font></td> <td bgcolor="#CCCCCC" width="10">___</td> <td bgcolor="#CCCCCC"> <a href="$team1_webs"><font id=ttext />$team1</font></a></td> <td bgcolor="#CCCCCC"><font id=dash />vs</font></td> <td bgcolor="#CCCCCC"><a href="$team2_webs"><font id=cttext />$team2</font></a></td> <td bgcolor="#CCCCCC" width="100" align="center" valign="center"><font id=dash /><a href="?page=matches=$id">view match highlights</font></a></td> <td bgcolor="#CCCCCC"><font id=ttext />$score1</font><font id=dash />-</font><font id=cttext />$score2</font></td> <td bgcolor="#CCCCCC"><font id=dash />$date</font></td> </tr>'; } ?> <?php if($_GET['page'] == "incomplete"){ session_start(); header("Cache-control: private"); $username = $_SESSION['username']; echo "<font id=NewsText />This page is not yet finished. We are working on the development<br/> of the rest of the site. Please contact you local webmaster for more info.<br/> </font>"; } ?>[/code]
  11. I am getting the following error: [quote]Parse error: parse error, unexpected $ in /index.php on line 986[/quote] here are the last lines of my code: [code]<?php if($_GET['page'] == "incomplete"){ session_start(); header("Cache-control: private"); $username = $_SESSION['username']; echo "<font id=NewsText />This page is not yet finished. We are working on the development<br/> of the rest of the site. Please contact you local webmaster for more info.<br/> </font>"; } ?> // <-- line 986[/code] Im not sure why it is saying this I have looked over it and tryed several different things but none successfull. Any help is great. Thnx
  12. I have my $_SESSION['member'] defined in my login script prior to me using that code. I did this to basicaly pre-load the users entire settings. If this doesnt work then how would I define this before calling for it.
  13. I want to display all the users in my database with the value of members greater than the default of 0. I already have the following code: [code]<?php $member = $_SESSION['member'] if($member > 0){ } ?>[/code] I just cant figure out how to get it to display only the users with a greater value than 0. I am kinda new to the entire php thing but learning so any help is appreciated.
  14. Im trying to execute the following and i keep getting the following error: [quote] MySQL said: Documentation #1064 - You have an error in your SQL syntax.  Check the manual that corresponds to your MySQL server version for the right syntax to use near '='nopic.jpg'", team_name varchar(32) NOT NULL default", team_ [/quote] here is the script im trying to execute [code]CREATE TABLE users ( userid int(25) NOT NULL auto_increment, first_name varchar(25) NOT NULL default", last_name varchar(25) NOT NULL default", username varchar(25) NOT NULL default", password varchar(255) NOT NULL default", encryptpass varchar(255) NOT NULL default", email varchar(255) NOT NULL default", location text NOT NULL, steamid varchar(15) NOT NULL default", handle varchar(25) NOT NULL default", bio text NOT NULL, photo varchar(255) NOT NULL default='nopic.jpg'", team_name varchar(32) NOT NULL default", team_tag varchar(15) NOT NULL default", access text NOT NULL default='0'", webs varchar(255) NOT NULL default='http://'", sign_update datetime NOT NULL default '0000-00-00 00:00:00', activated enum('0','1') default NULL,[/code]
  15. I was not sure if this is the place to post this question. If not please forgive me. I am looking for a way to have the backround image or in my case an image that is inside of the <div></div> paramiters that stays the same length as the text you display on it from the mysql database. Im not sure how to explain this except throught the following link. [url=http://www.VentGaming.com]http://www.VentGaming.com[/url] If you look at the news posts on the main page they are different sizes according to how much text you wish to display. I was wondering how they do this the same is witha forum system it encases the text in an the backround image as large as the text you wish to display sometimes a bit larger (for image as in my link ect...). Any help would be great or even a link as to how to do this. Thank you in advance. And again sorry if this was a incorrect post.
  16. I was wondering if including the login.php in the index.php file is safe im using example: [code]<?php if($_GET['page'] == "login"){ my processing form }; ?>[/code] then i am refrencing it through the following example: [code]<form name="form" action=?page=login> form </form>[/code] I hope that explains the basics I am using sessions to secure the site a bit but im not sure if I should use this method to login or not. I have a separet db.php file which i refrence to run all my sql querys. But im asking cuz i heard this can be a security risk.
  17. I was not sure if this is the place to post this question. If not please forgive me. I am looking for a way to have the backround image or in my case an image that is inside of the <div></div> paramiters that stays the same length as the text you display on it from the mysql database. Im not sure how to explain this except throught the following link. [url=http://www.VentGaming.com]http://www.VentGaming.com[/url] If you look at the news posts on the main page they are different sizes according to how much text you wish to display. I was wondering how they do this the same is witha forum system it encases the text in an the backround image as large as the text you wish to display sometimes a bit larger (for image as in my link ect...). Any help would be great or even a link as to how to do this. Thank you in advance. And again sorry if this was a incorrect post.
  18. It helps a bit on the organizing side but im more looking for what I would use to get the $access variable from the database. Im looking to see if I would use something like $access = $_SESSION['access'] to retrieve the users access information so that it only displays the admin area if they have $access == 1
  19. I was wondering were in the following script I would tell it to check a users access before displaying the admin buttons. this is the code im using to see if there access is correct to view the admin section [code]if($access == "1"){   echo 'text here'; }[/code] here is the code im trying to have find the users access before displaying the admin side of the pannel. [code]<? /* start the session */ session_start(); /* error handle, if first_name is blank, make them sign in */ if(empty($first_name)){ print "Please login below!"; include 'login_form.html'; }else{ /* heres our trusty db.php file again */ include 'db.php'; /* checking users access */ /* heres what prints at the top of the page, change as needed */ echo "Welcome, ". $_SEESION['first_name'] .". You are now in our exclusive 'Members Only' section. <br>The material in this section is availible to Members <u><b>only.</b></u><br>It's purpose is to let our valued Members have access to inside informaiton before it is made public. <br><b>Use of this area is strictly monitored. Unauthorized access will be prosecuted under the fullest extent of the law.</b><br><br>"; /* Roster List */ echo "<title>Members Section</title><br><br><br><h3><b>Roster:</b></h3>"; include 'login_success_roster.php'; /* Matches Section */ echo "<br><br><br><h3><b>Matches:</b></h3>"; include 'login_success_matches.php'; /* Media Section */ echo "<br><br><br><h3><b>Media:</b></h3>"; include 'login_success_media.php'; /* Sponsors Section */ echo "<br><br><br><h3><b>Sponsors:</b></h3>"; include 'login_success_sponsors.php'; /* ProShop Section */ echo "<br><br><br><h3><b>ProShop:</b></h3>"; include 'login_success_proshop.php'; /* Forums Section */ echo "<br><br><br><h3><b>Forums:</b></h3>"; include 'login_success_forums.php'; } if($access == "1"){ echo "<br><br><li><a href=roster_update_form.php>Edit Roster</a>"; } if($access == "1"){ echo "<br><br><li><a href=matches_update_form.php>Edit Matches</a>"; } if($access == "1"){ echo "<br><br><li><a href=media_update_form.php>Edit Media</a>"; } if($access == "1"){ echo "<br><br><li><a href=sponsor_update_form.php>Edit Sponsors</a>"; } if($access == "1"){ echo "<br><br><li><a href=proshop_update_form.php>Edit ProShop - Comming Soon</a>"; } if($access == "1"){ echo "<br><br><li><a href=forum_update_form.php>Edit Forum - Comming Soon</a>"; } echo "<br><br><br><b><a href=logout.php>Logout</a><br>"; print "<br><br><br><br>"; ?>[/code] I havent realy made any attempts at this yet but im realy not wanting to screw the entire coding up. Any help is very much accepted. Thnx!!!
  20. I was wondering what the: TYPE=MyISAM AUTO_INCREMENT=26 ; In something like: [code]CREATE TABLE `news` (   `id` int(11) NOT NULL auto_increment,   `picture` text NOT NULL,   `content` text NOT NULL,   `title` text NOT NULL,   PRIMARY KEY  (`id`) ) TYPE=MyISAM AUTO_INCREMENT=26;[/code] is doing. Im new to SQL so im just trying to get on my feet about it all.
  21. I did that also but now it just says that the last line of my code has errors no matter what. Even if the line is blank it says it has errors. Im not sure what would be casuing this to happen. I think that I didnt end the following code correct but its hard for me to say since im new to PHP. Here is what I curently have written: [code]<?php // Set global variables to easier names $n2puser = $_GET['n2puser']; $n2ppass = $_GET['n2ppass']; $n2ppass2 = $_GET['n2ppass2']; $email = $_GET['email']; $email2 = $_GET['email2']; $alias = $_GET['alias']; if((!$n2puser) || (!$n2ppass) || (!$n2ppass2) || (!$email) || (!email2) || (!alias)){     echo 'You did not submit the following required information! <br />';     if(!$n2puser){         echo "Username is a required field. Please enter it below.<br />";     }     if(!$n2ppass){         echo "Password is a required field. Please enter it below.<br />";     }     if(!$n2ppass2){         echo "Re-Type Password is a required field. Please enter it below.";     }     if(!$email){         echo "Email is a required field. Please enter it below.<br />";     }     if(!$email2){         echo "Re-Type Email is a required field. Please enter it below.<br />";     }     if(!$alias){         echo "Alias is a required field. Please enter it below.<br />";     }     include 'register.html';     exit(); } // Check for password match if($n2ppass!==$n2ppass2) {     echo "Passwords do not match";     exit(); } else { // Check for email match if($email!==$email2) {     echo "Email Addresses Do Not Match";     exit(); } else { # does this user already exist in the database? lets check for that now... $sql_email_check = mysql_query("SELECT email FROM users WHERE email='$email'"); $sql_username_check = mysql_query("SELECT username FROM users WHERE username='$n2puser'"); $email_check = mysql_num_rows($sql_email_check); $username_check = mysql_num_rows($sql_username_check); if(($email_check > 0) || ($username_check > 0)){      echo "Please fix the following errors: <br />";      if($email_check > 0){          echo "<strong>Your email address has already been used by another member in our database. Please use a different Email address!<br />";          unset($email_address);      }      if($username_check > 0){          echo "The username you have selected has already been used by another member in our database. Please choose a different Username!<br />";          unset($username);      }      include 'register.html'; // Show the form again!      exit(); }       // insert new password example $password = md5($n2ppass); $sql = "INSERT INTO $tbl_name (password) values ('$password')"; $add_all = "INSERT INTO $tbl_name (username,alias,email) values('$n2puser','$alias','$email')";     mysql_query($add_all) or die(mysql_error()); } ?>[/code]
  22. Your help worked and i got that error fixed but now i get this one: [code]Parse error: parse error, unexpected T_ELSE in /homepages/34/d154144477/htdocs/ventgaming/n2p/login/register.php on line 45[/code] Here is line 45: [code]<?php // Set global variables to easier names $n2puser = $_GET['n2puser']; $n2ppass = $_GET['n2ppass']; $n2ppass2 = $_GET['n2ppass2']; $email = $_GET['email']; $email2 = $_GET['email2']; $alias = $_GET['alias']; // Check for password match if($n2ppass!==$n2ppass2) {     echo "Passwords do not match";     exit(); } else { // Check for email match if($email!==$email2) {     echo "Email Addresses Do Not Match";     exit(); } else { // insert new password example $password = md5($n2ppass); $sql = "INSERT INTO $tbl_name (password) values ('$password')"; $add_all = "INSERT INTO $tbl_name (username,alias,email) values('$n2puser','$alias','$email')";     mysql_query($add_all) or die(mysql_error()); } else "<-- LINE 45" { ?>[/code] Im not sure what im supposed to put there because I remove the else and get an error. Any help would be greatly appreciated.
  23. I am trying to execute the following script when users register in order to add there information to the mysql data base: [code]<?php // Set global variables to easier names $n2puser = $_GET['n2puser']; $n2ppass = $_GET['n2ppass']; $n2ppass2 = $_GET['n2ppass2']; $email = $_GET['email']; $email2 = $_GET['email2']; $alias = $_GET['alias']; // Check for password match if($n2ppass!==$n2ppass2) {     echo "Passwords do not match";     exit(); } else { // Check for email match if($email!==$email2) {     echo "Email Addresses Do Not Match";     exit(); } else { // insert new password example $password = md5($n2ppass); $sql = "INSERT INTO $tbl_name (password) values ('$password')"; $add_all = 'INSERT INTO $tbl_name (username,alias,email) values('$n2puser','$alias','$email'');     mysql_query($add_all) or die(mysql_error()); } else { ?>[/code] but i get the following error: [!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]Parse error: parse error, unexpected T_VARIABLE in /homepages/34/d154144477/htdocs/ventgaming/n2p/login/register.php on line 42[/quote] I have gone over the code but cant figure out what im doing wrong. I am new to this so any help is great.
  24. I am trying to get the following to create a database in my mysql database. But when I try to execute it via PHPMYADMIN I get errors and not all of my tables are created I was wondering if anyone could help me correct this problem. I am new to the entire MySQL and PHP coding but trying to learn. [code]CREATE TABLE users ( id int NOT NULL auto_increment, username varchar(20) NOT NULL default ", userlevel varchar(15) NOT NULL default ", password varchar(32) binary NOT NULL default ", email char(255) NOT NULL default ", secretq char(255) NOT NULL default ", secreta char(255) NOT NULL default ", ip char(15) NOT NULL default ", handle char(17) NOT NULL default ", aboutuser char(255) NOT NULL default ", gamename char(30) NOT NULL default ", teamname char(30) NOT NULL default ", hardware char(255) NOT NULL default ", cookie char(32) binary NOT NULL default ", session char(32) binary NOT NULL deafualt ", PRIMARY KEY (id), UNIQUE KEY username (username) ); [/code]
  25. Would I just use [code]if (md5($str)) {     echo "My text";     exit;[/code] or would i use [code]if (md5($str) === '1f3870be274f6c49b3e31a0c6728957f') {     echo "Would you like a green or red apple?";     exit;[/code] also if I use the '1f3870be274f6c49b3e31a0c6728957f' what would that be doing?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.