inherit
97216
0
Nov 26, 2024 13:53:14 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on Nov 27, 2009 8:29:22 GMT -8
I found a tut. on youtube for an image upload site.. and so far it is working fine
|
|
inherit
97216
0
Nov 26, 2024 13:53:14 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on Nov 28, 2009 10:03:09 GMT -8
Okay, now I need beta testers/code checkers.. Right now, I am stuck with and error. It's on line 38: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/a9263330/public_html/login.php on line 38
<?php session_start(); require("connect.php");
$post_username = $_POST['username']; $post_password = $_POST['password'];
if($post_username&&$post_password) {
if(strlen($post_username)>25 || strlen($post_password)>15) die("Username and password are too long. Try again."); } else { //convert password to md5 $post_password = md5($post_password); //query the db $login = sprintf("SELECT * FROM users WHERE username='%s' AND password='%s'", mysql_real_escape_string($post_username), mysql_real_escape_string($post_password)); $rowcount = mysql_num_rows(mysql_query($login)); $fieldarray = mysql_fetch_assoc(mysql_query($login)); $id = $filedarray['id']; echo $id;
if($rowcount == 1) { //log the user in $_SESSION['user']=$post_username; $_SESSION['id']=$id; echo $_SESSION['user'].", you have been logged in! <a href='index.php'>Return to the main page.</a>; } else { die("Incorrect login information. Try again."); } } else { die("Username and Password were not entered. Try again."); } ?>
This is stumping me.. I looked over the line, and there is no error whatsoever, that I can see, however.
If you want to be a beta tester, you will have to wait like a day.. till i get the registration and such done.
|
|
inherit
72731
0
Oct 6, 2012 2:03:55 GMT -8
ŠΗäMΘηΘ
4,135
February 2006
smwt
|
Post by ŠΗäMΘηΘ on Nov 28, 2009 12:03:53 GMT -8
echo $_SESSION['user'].", you have been logged in! <a href='index.php'>Return to the main page.</a>; On that line you are missing the double quote at the end. Also I would try some indentation, makes it much easier to read. Here try this out. I just did it real quick so hopefully its oaky. <?php session_start(); require("connect.php"); $post_username = $_POST['username']; $post_password = $_POST['password']; if($post_username&&$post_password){ if(strlen($post_username) > 25 || strlen($post_password) > 15) die("Username and password are too long. Try again."); }else{ //convert password to md5 $post_password = md5($post_password); //query the db $login = sprintf("SELECT * FROM users WHERE username='%s' AND password='%s'", mysql_real_escape_string($post_username), mysql_real_escape_string($post_password)); $rowcount = mysql_num_rows(mysql_query($login)); $fieldarray = mysql_fetch_assoc(mysql_query($login)); $id = $filedarray['id']; echo $id; if($rowcount == 1){ //log the user in $_SESSION['user']=$post_username; $_SESSION['id']=$id; echo $_SESSION['user'].", you have been logged in! <a href='index.php'>Return to the main page.</a>; }else{ die("Incorrect login information. Try again."); } }else{ die("Username and Password were not entered. Try again."); } ?>
|
|
inherit
97216
0
Nov 26, 2024 13:53:14 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on Nov 28, 2009 12:06:43 GMT -8
I had it indented, though, proboards likes to un-indent things. And thanks, lol, small stuff like that mess me up. EDIT: Still doesn't work.. imagepro.net84.net/ login with guest and password.
|
|
inherit
72731
0
Oct 6, 2012 2:03:55 GMT -8
ŠΗäMΘηΘ
4,135
February 2006
smwt
|
Post by ŠΗäMΘηΘ on Nov 28, 2009 12:08:44 GMT -8
ahh, I see. and no problem.
|
|
inherit
97216
0
Nov 26, 2024 13:53:14 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on Nov 28, 2009 12:13:35 GMT -8
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/a9263330/public_html/login.php on line 24 New error message
|
|
inherit
72731
0
Oct 6, 2012 2:03:55 GMT -8
ŠΗäMΘηΘ
4,135
February 2006
smwt
|
Post by ŠΗäMΘηΘ on Nov 28, 2009 12:26:48 GMT -8
<?php session_start(); $post_username = $_POST['username']; $post_password = $_POST['password']; if($post_username&&$post_password){ if(strlen($post_username) > 25 || strlen($post_password) > 15){ die("Username and password are too long. Try again."); }else{ //convert password to md5 $post_password = md5($post_password); //query the db $login = sprintf("SELECT * FROM users WHERE username='%s' AND password='%s'", mysql_real_escape_string($post_username), mysql_real_escape_string($post_password)); $rowcount = mysql_num_rows(mysql_query($login)); $fieldarray = mysql_fetch_assoc(mysql_query($login)); $id = $filedarray['id']; echo $id; if($rowcount == 1){ //log the user in $_SESSION['user']=$post_username; $_SESSION['id']=$id; echo $_SESSION['user'].", you have been logged in! <a href='index.php'>Return to the main page.</a>"; }else{ die("Incorrect login information. Try again."); } } }else{ die("Username and Password were not entered. Try again."); } ?> Looking over it again I see I missed a few more things. Try this now.
|
|
inherit
130228
0
Jul 11, 2024 19:19:59 GMT -8
Charles Stover
1,731
August 2008
gamechief
|
Post by Charles Stover on Nov 28, 2009 22:42:18 GMT -8
iChristmas, use a code editor that color-codes programs. EditPlus, for example, will color-code strings and thus make it easy to spot unescaped strings.
|
|
inherit
97216
0
Nov 26, 2024 13:53:14 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on Nov 29, 2009 11:51:30 GMT -8
Okay, I'll try that! I have Notepad++ but it doesn't help much..
EDIT: Is there a free alternative?
|
|
inherit
72731
0
Oct 6, 2012 2:03:55 GMT -8
ŠΗäMΘηΘ
4,135
February 2006
smwt
|
Post by ŠΗäMΘηΘ on Nov 29, 2009 12:24:27 GMT -8
(ha terrible quality. ) Notepad++ should do this. Take a look at the screenshot. The second block is missing its ending quote and thus everything after it changes color. EDIT: not sure but I think you can turn this off too, check the settings and make sure its turned on.
|
|
inherit
97216
0
Nov 26, 2024 13:53:14 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on Nov 29, 2009 13:34:19 GMT -8
Oh, that's on.. I just don't see small stuff like that..
|
|
inherit
72731
0
Oct 6, 2012 2:03:55 GMT -8
ŠΗäMΘηΘ
4,135
February 2006
smwt
|
Post by ŠΗäMΘηΘ on Nov 29, 2009 15:57:02 GMT -8
Perhaps that's a skill that you can build on then. Saves a lot of headache later on.
|
|
inherit
16846
0
Nov 19, 2012 15:20:20 GMT -8
Chris
3,036
December 2003
cddude
|
Post by Chris on Nov 29, 2009 17:08:47 GMT -8
Perhaps that's a skill that you can build on then. Saves a lot of headache later on. OR he could customize the colors to have a more noticeable difference. One of the two.
|
|
inherit
72731
0
Oct 6, 2012 2:03:55 GMT -8
ŠΗäMΘηΘ
4,135
February 2006
smwt
|
Post by ŠΗäMΘηΘ on Nov 29, 2009 17:28:28 GMT -8
Perhaps that's a skill that you can build on then. Saves a lot of headache later on. OR he could customize the colors to have a more noticeable difference. One of the two. ah, neat. Didn't realize you could do that. Thanks.
|
|
inherit
97216
0
Nov 26, 2024 13:53:14 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on Nov 29, 2009 18:14:58 GMT -8
Where do you do that?
|
|