login code problems

Alles, was PHP betrifft, kann hier besprochen werden.

login code problems

Postby assainator » 28. August 2008 19:22

alright i made a nice login system (i tought) :(

but it gives me a lot of errors and i can't get them all out.

<form action="" method=post>
<br>
<input type="text" name="aword" size="20">
<br>
<br>
<input type="submit" name="do" value="Enter">
</form> <?php /* #20 */ ?>
<?php

include ('myincludefile.inc');

switch(@$_POST['do'])
{}
mysql_connect($host, $user, $pawr)
mysql_select_db($dbname)
or die ("sorry, could not connect to server, try again later");


$buser=($_POST['aname']);
$bword=($_POST['aword']);
<form method= post>
SELECT $buser WERE looginname
or die ("your username doesn't excist, maybe you need to <a href=register.php>register</a>.");
SELECT $bword WERE wordpass WERE $buser
or die ("you entered the wrong password, please try again");
?>
</form>
<?php
{
header("Location: mainpage.php")
}
?>


i get 2 errors very often:

unexpected T-string (can anyone tell me what this means???)
expected: { or } (but i can't find where i'm going wrong because it says it expects a } at the end of a line, while there is no tag open at that moment)

i know that there is a {} somewere with nothing inside, but php says it's good so i did it.

any help would be really great! :D
assainator
assainator
 
Posts: 6
Joined: 24. August 2008 18:54

Postby Nobbie » 28. August 2008 21:55

>any help would be really great!

Get you a PHP book for beginners or a tutorial - that code is not PHP, its a horrible mix of HTML, PHP and SQL.

There are not 2 errors, the whole script is completely nonsense.
Nobbie
 
Posts: 13171
Joined: 09. March 2008 13:04

Postby assainator » 30. August 2008 06:51

dude,
1. i have a book, but it only explains small parts.
2. it has a big script, but that to big and advance to "disassemble and use the smaller parts so i can understand)
3. and i know there are errors in there, but if i can't get them out because of the lack of experiance, i tought, i post here.

assainator

EDIT: well thanks for telling were NOT to go for help.

i posted it on another forum to, and there i get 2 ressponses in one day on how to do it better, with explanation why, and support to learn more.
assainator
 
Posts: 6
Joined: 24. August 2008 18:54


Return to PHP

Who is online

Users browsing this forum: No registered users and 13 guests

cron