i using Notepad++
Berichten: 311
ik heb net wat bekeken op youtube en het overgetypt en alles werkt goed bij hem, ik heb hetzelfde gedaan maar nu heb ik een fout.
Parse error: syntax error, unexpected T_VARIABLE in /home/a4459302/public_html/register.php on line 13
en die zit in register.php, maar hier onder staan alle pagina`s mischien dat iemand het gratis de fouten eruit wil halen.
Login.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
|
<?php
session_start();
include('mysql.pgp');
if (isset ($_post['sumbit'])) {
$username = mysql_real_escape_string($_POST['username']);
$password = mysql_real_escape_string(sha1 ($_POST['password']));
if (!empty ($username) && !empty ($password)) {
$sql = mysql_query ("SELECT * FROM users
WHERE username='".$username."' AND
user_password='".$password."' LIMIT 1");
if (mysql_num_rows ($sql) > 0) {
$_SESSION['loggedin'] = true;
$_SESSION['username'] = $username;
echo 'You are now logged in!';
} else {
echo 'You username and/of password is incorrect!';
}
} else {
echo 'You must enter a username and a password!';
}
} else {
echo '<form action="login.php" method="POST">
Username: <input type="text" name="username" />
Password: <input type="password" name="password" />
<input type="sumbit" name="sumbit" value"login" />
</form>';
}
?>
|
|
|
Register.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
<?php
include('mysql.php');
if(isset ($_POST['sumbit'])) {
$username = mysql_real_escape_string($_POST['username']);
$password = mysql_real_escape_string(sha1($_POST['password']));
if (!empty ($username) && !empty ($password)) {
$sql = mysql_query ("INSERT INTO users (
user_id,username,user_password,user_regdate)
VALUES (
'0','"$username."','".$password."','".time()."')
");
echo 'You are now registered!';
} else {
echo 'You must enter a username and a password!';
}
} else {
echo '<form action="register.php" method="post"?
Gebruiksernaam: <input type="text" name="username" />
wachtwoord: <input type="password" name="password" />
<input type="sumbit" name="sumbit" value="Register!" />
</form>';
?>
|
|
|
logout.php
1
2
3
4
5
6
7
8
9
10
11
12
13
|
<?php
session_start();
if ($_SESSION['loggedin'] == true) {
unset($_SESSION);
session_destroy();
}
echo 'You are now logged out!';
?>
|
|
|
members.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
<?php
session_start();
if ($_SESSION['loggedin'] == true) {
echo 'Welkom, '.$_session["username"]. ', to the member`s only page!';
} else {
echo 'You are not allowed to view this page!';
}
echo '<form action="logout.php" method="POST">
<input type="sumbit" name"sumbit" value="Logout" />
</form';
?>
|
|
|
mysql.php
1
2
3
4
5
6
7
8
9
10
11
12
|
<?php
$host = '******'; //mysql host name
$user = '******'; //mysql username
$pass = '******'; //mysql password
$db = '******'; //mysql databse name
'$connect'= @mysql_connect ($host,$user,$pass) ar die ('error connecting to database!'(;
$select = @mysql_select_db($db,$connect) or die ('eroor selecting database!');
?>
|
|
|
Gr. marco en alvast bedankt
Joshua: Ik snap dat je snel hulp wilt maar om dit effectief te doen moet je alles de volgende keer even goed zetten, juiste categorie, juiste tag en een juiste topictitel. Misschien is het even handig de regels door te lezen.
Laatst gewijzigd door Joshua op 2011-08-23 09:43:27
23-08-2011 03:55
Dit topic is 209 keer bekeken door 37 verschillende leden
Reacties op: "Fout in register script"
1
Reageer op: "Fout in register script"
1