[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4688: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4690: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4691: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4692: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3823)
Webmasterplein.net • Toon onderwerp - Fout in script.(Inloggen)
aan alle goede dingen komt een eind, webmasterplein.net 2003 - 2013
wij danken jullie voor al mooie momenten die dankzij dit forum ontstonden - Derk, Rutger en Stef

Fout in script.(Inloggen)

Je komt er niet helemaal uit bij het scripten? Übergoede functie geschreven? Alles met betrekking tot scripting, kun je hier terecht.

Fout in script.(Inloggen)

Berichtdoor Rik » 13 jun 2006 20:35

Hallo, ik zit met een probleem, ik zit nu al een paar dagen te kijken naar mijn inlogsysteem.
Hij werkt niet, maar ik kan er geen fout uit halen.
Het werkt met sessies, maar 't lijkt of de sessies niet aangemaakt worden.
Login.php wordt dus zomaar weer geinclude.
Mijn PHP op index.php, bovenaan staat nog session_start:

[code="php"]
<?php
if(isset($_GET['m'])){
$m = urldecode($_GET['m']);
print $m;
}
if(isset($_SESSION['user'])){
?>
Welkom op 't <a href="http://www.bloe.net">DreamCMS</a> Admin Control Panel.<br />
U kunt vanaf hier nieuwe pagina's maken, ze bewerken, en verwijderen.<br />
Links, in 't menu kunt u kiezen wat u wilt doen.
Als u problemen heeft met DreamCMS kunt u <a href="http://www.bloe.net">hier</a> terecht.
<?php
} else {
include('login.php');
}
?>[/code]
En dan natuurlijk ook login.php:
[code="php"]<?php
$login = $_GET['login'];
if(isset($login)){
if(($_POST['username'] == 'Bloe') AND ($_POST['password'] == '***')){
$_SESSION['user'] = $_POST['username'];
$message = urlencode('U bent met succes ingelogt!<br /><br />');
header('location: index.php?m=' . $message);
} else {
$message = urlencode('Uw wachtwoord en / of gebruikersnaam waren verkeerd, log a.u.b. opnieuw in.<br /><br />');
header('location: index.php?m=' . $message);
}
} else {
?>
<form method="post" action="login.php?login=true">
Gebruikersnaam: <input type="text" value="" name="username" /><br />
Wachtwoord: <input type="password" value="" name="password" /><br />
<input type="submit" name="submit" value="Login!" />
</form>
<?php
}
?>[/code]
Kunnen jullie er iets in ontdekken?
Alvast bedankt,

Bloe.
Avatar gebruiker
Rik
wmpr
 
Berichten: 1576
Geregistreerd: 11 jun 2005 17:59

Re: Fout in script.(Inloggen)

Berichtdoor KillerSponge » 13 jun 2006 20:43

Nou, zoals je al kunt zien ben je een echo vergeten af te sluiten ^^

Tip: gebruik een text-editor met php-syntaxis, zodat je dit soort fouten snel kan ontdekken. Smile
Blabla en andere onzin - http://killersponge.nl
Avatar gebruiker
KillerSponge
Beheerder
Beheerder
 
Berichten: 14456
Geregistreerd: 24 aug 2004 13:05

Re: Fout in script.(Inloggen)

Berichtdoor Rik » 14 jun 2006 06:06

Ik gerbuik nergens echo ofzo, alleen 1 keer print om een variabel te schrijven.
Dat stuk tekst staat buiten PHP.
En ik gebruik al Notepad2. Smile
Avatar gebruiker
Rik
wmpr
 
Berichten: 1576
Geregistreerd: 11 jun 2005 17:59

Re: Fout in script.(Inloggen)

Berichtdoor Derk » 15 jun 2006 09:54

session_start(); bovenaan je script zetten Wink
Afbeelding
Avatar gebruiker
Derk
Beheerder
Beheerder
 
Berichten: 12634
Geregistreerd: 27 nov 2003 19:50
Woonplaats: Houten

Re: Fout in script.(Inloggen)

Berichtdoor Rik » 15 jun 2006 16:13

Avatar gebruiker
Rik
wmpr
 
Berichten: 1576
Geregistreerd: 11 jun 2005 17:59

Re: Fout in script.(Inloggen)

Berichtdoor Robin » 16 jun 2006 20:59

Ik heb de fout gevonden:

Het ligt aan het login.php stukje:

[code="php"]
$login = $_GET['login'];
(...)
<input type="submit" name="submit" value="Login!" />
[/code]

Ten eerste, ik gebruik altijd $HTTP_POST_VARS["naam"] als ik wil weten of een button is aangeklikt, maar ik weet niet zeker of dit moet.
Ten tweede, $_GET['login'] bestaat niet, want de naam van de button is submit. Verander die in login, en het werkt.
Avatar gebruiker
Robin
wmpr
 
Berichten: 66
Geregistreerd: 29 sep 2005 20:30
Woonplaats: Amsterdam

Re: Fout in script.(Inloggen)

Berichtdoor Derk » 16 jun 2006 22:46

Afbeelding
Avatar gebruiker
Derk
Beheerder
Beheerder
 
Berichten: 12634
Geregistreerd: 27 nov 2003 19:50
Woonplaats: Houten

Re: Fout in script.(Inloggen)

Berichtdoor Rik » 17 jun 2006 05:51

Avatar gebruiker
Rik
wmpr
 
Berichten: 1576
Geregistreerd: 11 jun 2005 17:59

Re: Fout in script.(Inloggen)

Berichtdoor Robin » 17 jun 2006 12:57

Ik had Bloe's code in een bestandje gezet en uitgetest... Bij mij werkte het volgende:

[code="php"]
<?php
session_start();
if(isset($_GET['m']))
{
$m = urldecode($_GET['m']);
print $m;
}
if(isset($_SESSION['user']))
{
?>
Welkom op 't <a href="http://www.bloe.net">DreamCMS</a> Admin Control Panel.<br />
U kunt vanaf hier nieuwe pagina's maken, ze bewerken, en verwijderen.<br />
Links, in 't menu kunt u kiezen wat u wilt doen.
Als u problemen heeft met DreamCMS kunt u <a href="http://www.bloe.net">hier</a> terecht.
<?php
}
else
{
$login = $HTTP_POST_VARS['login'];
if(isset($login))
{
if(($_POST['username'] == 'Bloe') AND ($_POST['password'] == 'sjaak'))
{
$_SESSION['user'] = $_POST['username'];
$message = urlencode('U bent met succes ingelogt!<br /><br />');
header('location: test.php?m=' . $message);
}
else
{
$message = urlencode('Uw wachtwoord en / of gebruikersnaam waren verkeerd, log a.u.b. opnieuw in.<br /><br />');
header('location: test.php?m=' . $message);
}
}
else
{
?>
<form method="post" action="test.php">
Gebruikersnaam: <input type="text" value="" name="username" /><br />
Wachtwoord: <input type="password" value="" name="password" /><br />
<input type="submit" name="login" value="Login!" />
</form>
<?php
}
}
?>
[/code]
Avatar gebruiker
Robin
wmpr
 
Berichten: 66
Geregistreerd: 29 sep 2005 20:30
Woonplaats: Amsterdam

Re: Fout in script.(Inloggen)

Berichtdoor Rik » 17 jun 2006 14:06

Dat is fijn, maar raar dat mijn script niet werkte..
Maarja, dan ga ik dit maar even ook proberen, een soort van na te maken. (Je moet wel dingen leren, hè. Razz )
Bedankt! Smile
Avatar gebruiker
Rik
wmpr
 
Berichten: 1576
Geregistreerd: 11 jun 2005 17:59


Keer terug naar PHP, ASP, SQL



cron