
e4games
Members-
Content Count
102 -
Joined
-
Last visited
Content Type
Profiles
Forums
Calendar
Everything posted by e4games
-
my revised code is on the first post...I editted it..like I said in my post.
-
I changed the code at the top...and it still gets the same error D: I also tried it with the semicolons only after the lines with the curly braces it them, but it still gets the same errorAnd it says no where that you need to put curly braces around PHP with HTML with it, especially not at the beginning of anything
-
I can't find a error with this code...can you guys help me? <?phpmysql_connect("Host Name", "username", "pass") or die(mysql_error()); mysql_select_db("DB name") or die(mysql_error()); $query=mysql_query ("SELECT * FROM users");echo "<tr><td colspan='2' bgcolor='darkyellow'>.::. Users .::.</td><tr/><tr><td colspan='2'>";while "($row = mysql_query ($query) ) ";{echo "<tr><td> {$row['ID']}";echo "</td></tr>";echo "<tr><td> {$row['username']}";echo "</td></tr>";}echo "</table>"";?> The code is suppos
-
Don't bother even posting if your not going to say anything to make it better. EX- "The design was a bit ugly." then what would you recommend for colors.
-
I made a fan site of pokemon, Its only about 5 days old and I was wondering if u guys think if its horrible or at least ok....My Pokemon Fansite
-
I tried changing it to what you said phpnoob, still doesn't work...I also added a error string, and there is still only a blank screen...
-
Oh o.O, well I fixed it and it still doesn't work...and its called Users..
-
I've looked threw the database and there was only 1 table called users, anyways I changed a few other things and it seems to work (didn't even touch the database)Anyways I still don't know what to do with the login issue, I'm gonna post it in the first post becuase I don't think its the way I'm coding the link to get to it, I think it might be the code for the login.... (cause I've have problems with this happening and it was the login code not the hyperlink code)
-
But I do have a table called "users"........I just checked the login and for some reason when you press the "login" button, the URL doesn't do anything, but I did it the same way that I did it with the register, and that works...
-
So...I tryed a different code for register and it still gets a error....help please! <?phpmysql_connect("MYSQL hostname", "username", "pass") or die(mysql_error()); mysql_select_db("database name") or die(mysql_error()); //Checks if there is a login cookieif(isset($_COOKIE['user']))//if there is, it logs you in and directes you to the members page{ $username = $_COOKIE['user']; $pass = $_COOKIE['Key_my_site'];$check = mysql_query("SELECT * FROM users WHERE username = '$username'")or die(mysql_error());while($info = mysql_fetch_array( $check )) {if ($pass != $info['password']) {}else{header
-
So I know if you set (when they register) is you do something like $username, it will display the viewing persons username. But how do I make it so that it only displays one username. Like when someone posts something for it to display that username to everyone. Or do it like a avatar when u pick a avatar to make sure that it only displays that users avatar not who ever is viewing it.
-
Ok, so know when you register it submits the information into the database, but instead of putting it in what you typed it puts in random characters. If you go to login using the random characters that it set as your password it still doesn't let you login. Here are my register and login codes. <?php require_once 'db.php'; $page_mode = $_POST['page_mode']; # empty variable defaults to '' (or null) if ($page_mode === 'register') { $username = mysql_real_escape_string(trim($_POST['username'])); $password = $_POST['password']; if ($password !== $_POST['conf_password']) $error_string .=
-
<?phprequire_once 'db.php';$page_mode = isset($_POST['page_mode']) ? $_POST['page_mode'] : '';$error_string = '';if ($page_mode == 'register'){ $username = trim($_POST['username']); // trim to remove whitespace $password = $_POST['password']; $conf_password = $_POST['conf_password']; if ($error_string == '') { $result = db_query("SELECT id FROM users WHERE username='" . mysql_real_escape_string($username) . "'"); if (mysql_num_rows($result) > 0) $error_string .= 'That username is already registerd.<br>'; else { $username = mysql_real_escape_string($username); // protect ag
-
<?php$con = mysql_connect('FTP_Hostname', 'username', 'password');mysql_select_db('Database_Name',);function db_query($sql){ return mysql_query($sql, $GLOBALS['con']);}?>
-
I don't think so. All I have to do is this$error_string .= 'Error message here.';
-
So I used the Database code that justsomeguy made and on my website, when you go to register it says that you did but then when I go to the database it says its empty. What's wrong and how should I fix it?
-
This is my websiteand I can't get the navigation bar to be left of the content..it just goes above it..how do you get it to go on the same lines as your content but its easy to tell that there apartAnother question- how do you I get the tables to be a solid black line?
-
So for the code login.php I used the on "justsomeguy" did but I have some questions on how to make the login code so it says username other then email..Main Code <?phpsession_start();require_once 'db.php';$page_mode = isset($_POST['page_mode']) ? $_POST['page_mode'] : '';$error_string = '';if ($page_mode == 'login'){ $email = $_POST['email']; $password = $_POST['password']; if (trim($email) == '' || trim($password) == '') $error_string .= 'Please enter your email address and password.<br>'; else { $result = db_query("SELECT id, name, password FROM users WHERE email='" . mysql_re