Al de ftp-functies gezien op php.net?
Kleine Vragen Topic #2
Aarclay schreef:Ja. En zelf gegoogled alleen ik snap er niks van.Al de ftp-functies gezien op php.net?
Wat ik heb geprobeerd"
http://www.php.net/manual/en/function.ftp-nlist.php -> ik krijg alleen maar array()
http://www.php.net/manual/en/function.ftp-rawlist.php -> array(3) { [0]=> string(7) "domains" [1]=> string(4) "imap" [2]=> string(11) "public_html" }
toevoeging op 8 juni 2013, 12:56:09:
[COLOR= #0000BB]<?php
$ftp_server[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/ftp_connect"]ftp_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]xx.s2.one2xs.com[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$ftp_user[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/ftp_login"]ftp_login[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ftp_server[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]xxh[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]xxxxxn[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ftp_server[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$ftp_user[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$contents[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/ftp_nlist"]ftp_nlist[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ftp_server[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"."[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #FF8000]// output $contents[/COLOR]
[URL="http://www.php.net/var_dump"]var_dump[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$contents[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]2[/COLOR][COLOR= #007700]][[/COLOR][COLOR= #0000BB]11[/COLOR][COLOR= #007700]]);
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Kan niet met de FTP service verbinden.[/COLOR][COLOR= #007700];
}[/COLOR]
?> =>
string(0) ""
toevoeging op 8 juni 2013, 13:00:27:
$ftp_server = ftp_connect(xxx.s2.one2xs.com);
$ftp_user = ftp_login($ftp_server, xx, xxx);
if($ftp_server && $ftp_user) {
$buff = ftp_rawlist($ftp_server, /public_html);
var_dump($buff);
} else {
echo Kan niet met de FTP service verbinden.;
}
?>
=>
Spoiler tonen
array(8) { [0]=> string(75) "-rw-r--r-- 1 1274 brush 810 Jun 4 16:25 activatie.php" [1]=> string(67) "drwxr-xr-x 2 1274 brush 4096 Jun 8 12:24 admin" [2]=> string(71) "-rw-r--r-- 1 1274 brush 272 Jun 8 10:52 admin.php" [3]=> string(79) "-rw-r--r-- 1 1274 brush 236 Jun 8 10:55 db.connection.php" [4]=> string(71) "-rw-r--r-- 1 1274 brush 1454 Jun 4 16:53 index.php" [5]=> string(76) "-rw-r--r-- 1 1274 brush 664 Jun 4 15:09 pass.crypt.php" [6]=> string(75) "-rw-r--r-- 1 1274 brush 171 Jun 8 10:53 uitloggen.php" [7]=> string(74) "-rw-r--r-- 1 1274 brush 2224 Jun 4 16:43 vergeten.php" }
Whaa, mijn inlogsysteem wilt maar niet werken...
Hoe blijft zeggen dat de combinatie niet bekend is.
de tabel:
http://prntscr.com/18w0ho
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL] [COLOR= #DD0000]config.php[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"POST"[/COLOR][COLOR= #007700])
{[/COLOR]
[COLOR= #0000BB]$check_login[/COLOR][COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM leden WHERE username = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]" AND password = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/sha1"]sha1[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]])).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$check_login[/COLOR][COLOR= #007700]))
{[/COLOR]
[COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]login[/COLOR][COLOR= #007700]] =[/COLOR] true[COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000] Je bent ingelogd[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000] Deze combinatie is niet bekend[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
?>
<form action="#" method="post">
Gebruikersnaam: <input type="text" name="username"><br/>
Wachtwoord: <input type="password" name="password"><br/>
<input type="submit" value="login">
</form>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
?> Hoe blijft zeggen dat de combinatie niet bekend is.
de tabel:
http://prntscr.com/18w0ho
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL] [COLOR= #DD0000]config.php[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"POST"[/COLOR][COLOR= #007700])
{[/COLOR]
[COLOR= #0000BB]$check_login[/COLOR][COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM leden WHERE username = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]" AND password = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/sha1"]sha1[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]])).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$check_login[/COLOR][COLOR= #007700]))
{[/COLOR]
[COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]login[/COLOR][COLOR= #007700]] =[/COLOR] true[COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000] Je bent ingelogd[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000] Deze combinatie is niet bekend[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
?>
<form action="#" method="post">
Gebruikersnaam: <input type="text" name="username"><br/>
Wachtwoord: <input type="password" name="password"><br/>
<input type="submit" value="login">
</form>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
?> Sanderc schreef:Whaa, mijn inlogsysteem wilt maar niet werken...
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL] [COLOR= #DD0000]config.php[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"POST"[/COLOR][COLOR= #007700])
{[/COLOR]
[COLOR= #0000BB]$check_login[/COLOR][COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM leden WHERE username = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]" AND password = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/sha1"]sha1[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]])).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$check_login[/COLOR][COLOR= #007700]))
{[/COLOR]
[COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]login[/COLOR][COLOR= #007700]] =[/COLOR] true[COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000] Je bent ingelogd[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000] Deze combinatie is niet bekend[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
?>
<form action="#" method="post">
Gebruikersnaam: <input type="text" name="username"><br/>
Wachtwoord: <input type="password" name="password"><br/>
<input type="submit" value="login">
</form>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
?> Hoe blijft zeggen dat de combinatie niet bekend is.
de tabel:
http://prntscr.com/18w0ho
Dan ga je verder met debuggen. Wat staat er in de query die uitgevoerd wordt?
Dan weet je precies hoe je query eruit ziet, waarna je deze in phpMyAdmin kan uittesten.
Enne, mysql_real_escape_string() is niet echt nodig over een password hash.
[COLOR= #0000BB]<?php
$sql[/COLOR][COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM leden WHERE username = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]" AND password = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/sha1"]sha1[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]])).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sql[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// debugging[/COLOR]
[COLOR= #0000BB]$check_login[/COLOR][COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$check_login[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #FF8000]// gelukt[/COLOR]
[COLOR= #007700]}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[COLOR= #FF8000]//mislukt, mysql_error()[/COLOR]
[COLOR= #007700]}[/COLOR]
?> Dan weet je precies hoe je query eruit ziet, waarna je deze in phpMyAdmin kan uittesten.
Enne, mysql_real_escape_string() is niet echt nodig over een password hash.
Er staat dat ik iets select uit de tabel "leden" bij de username
Ik vind het gewoon echt niet;Dan gaat hij vaag doen...
Afbeelding niet beschikbaarDe bron kon niet worden geladen (i.imgur.com).Bron openen ↗
Ik vind het gewoon echt niet;
Spoiler tonen
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/require_once"]require_once[/URL] [COLOR= #DD0000]config.php[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/session_start"]session_start[/URL][COLOR= #007700]();[/COLOR]
[URL="http://www.php.net/if"]if[/URL] [COLOR= #007700]([/COLOR][COLOR= #0000BB]$_SERVER[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]REQUEST_METHOD[/COLOR][COLOR= #007700]] ==[/COLOR] [COLOR= #DD0000]"POST"[/COLOR][COLOR= #007700])
{[/COLOR]
[COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM leden WHERE username = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]" AND password = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/sha1"]sha1[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]])).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$sql[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #FF8000]// debugging[/COLOR]
[COLOR= #0000BB]$check_login[/COLOR][COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$sql[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$check_login[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000] Gelukt[/COLOR][COLOR= #007700];
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]();
}[/COLOR]
[COLOR= #0000BB]$check_login_sql[/COLOR][COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"SELECT * FROM leden WHERE username = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]]).[/COLOR][COLOR= #DD0000]" AND password = "[/COLOR][COLOR= #007700].[/COLOR][URL="http://www.php.net/mysql_real_escape_string"]mysql_real_escape_string[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/sha1"]sha1[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]])).[/COLOR][COLOR= #DD0000]""[/COLOR][COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$check_login[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$check_login_sql[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$check_login[/COLOR][COLOR= #007700]))
{[/COLOR]
[COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]login[/COLOR][COLOR= #007700]] =[/COLOR] true[COLOR= #007700];[/COLOR]
[COLOR= #0000BB]$_SESSION[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]user[/COLOR][COLOR= #007700]] =[/COLOR] [COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]];[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000] Je bent ingelogd[/COLOR][COLOR= #007700];
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL][COLOR= #DD0000] Deze combinatie is niet bekend[/COLOR][COLOR= #007700];
}
}[/COLOR]
[URL="http://www.php.net/else"]else[/URL]
[COLOR= #007700]{[/COLOR]
?>
<form action="#" method="post">
Gebruikersnaam: <input type="text" name="username"><br/>
Wachtwoord: <input type="password" name="password"><br/>
<input type="submit" value="login">
</form>
[COLOR= #0000BB]<?php[/COLOR]
[COLOR= #007700]}[/COLOR]
?>
Afbeelding niet beschikbaarDe bron kon niet worden geladen (i.imgur.com).Bron openen ↗Dan lijkt het mij erg logisch, je hash klopt niet, of beide gegevens kloppen niet.
PEBCAK-probleem denk ik eerder aan
Het is toch geen md5() hash die je hebt hé
?
PEBCAK-probleem denk ik eerder aan

Het is toch geen md5() hash die je hebt hé
?Aarclay schreef:NOpe het klopt, en je kan het zelf testen;Dan lijkt het mij erg logisch, je hash klopt niet, of beide gegevens kloppen niet.
PEBCAK-probleem denk ik eerder aan
Het is toch geen md5() hash die je hebt hé?
Hier maak je een account;
http://sander.freux.nl/aanmelden.php
en hier log je in;
http://sander.freux.nl/inloggen.php
Ik check op sha1, en slaag het ook op als sha1;
$password = mysql_real_escape_string(trim($_POST[password])); $aanmelden = "
INSERT INTO leden
(
username,
password,
email,
kladblok,
rang,
datum,
ip
)
VALUES
(
".$user.",
".sha1($password).",
".$email.",
Deze kladblok is leeg,
1,
".$date.",
".$ip."
)
"; Heb je toevallig een sterk password met een quote? Want mysql_real_escape_string() is voor een hash onnodig.
Ergens klopt het niet, echo eens de gemaakte hash na het aanmelden, en vergelijk die eens met de ingevulde hash bij het inloggen?
Ergens klopt het niet, echo eens de gemaakte hash na het aanmelden, en vergelijk die eens met de ingevulde hash bij het inloggen?
Oke, heb net een script van het internet gehaald als voorbeeld voor het FTP gebeuren. Nu wil ik natuurlijk me eigen script maken omdat het voor mij anders onoverzichtelijk is. Nu ben ik zo dom geweest om het voorbeeld script kwijt te raken
Ook kan ik het niet in mijn geschiedenis en op google vinden.
Gelukkig heb ik het tot zover kunnen krijgen:
Output:
activatie.phpadminadmin.phpdb.connection.phpindex.phppass.crypt.phpuitloggen.phpvergeten.php
Hoe kan ik nou de mappen en de files onderscheiden en hoe maak ik hier een link van aangezien alles aan elkaar is?
Code:
Ook kan ik het niet in mijn geschiedenis en op google vinden. Gelukkig heb ik het tot zover kunnen krijgen:
Output:
activatie.phpadminadmin.phpdb.connection.phpindex.phppass.crypt.phpuitloggen.phpvergeten.php
Hoe kan ik nou de mappen en de files onderscheiden en hoe maak ik hier een link van aangezien alles aan elkaar is?
Code:
[COLOR= #0000BB]<?php
$ftp_server[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/ftp_connect"]ftp_connect[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]x[/COLOR][COLOR= #007700]);[/COLOR]
[COLOR= #0000BB]$ftp_user[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/ftp_login"]ftp_login[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ftp_server[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]x[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]x[/COLOR][COLOR= #007700]);[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ftp_server[/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$ftp_user[/COLOR][COLOR= #007700]) {[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]path[/COLOR][COLOR= #007700]])) {[/COLOR]
[COLOR= #0000BB]$path[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]$_GET[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]path[/COLOR][COLOR= #007700]];
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[COLOR= #0000BB]$path[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]public_html/[/COLOR][COLOR= #007700];
}[/COLOR]
[COLOR= #0000BB]$parent[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/substr"]substr[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$path[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700],[/COLOR] [URL="http://www.php.net/strrpos"]strrpos[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$path[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #DD0000]"/"[/COLOR][COLOR= #007700]));[/COLOR]
[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/trim"]trim[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$parent[/COLOR][COLOR= #007700]) ==[/COLOR] [COLOR= #DD0000]""[/COLOR][COLOR= #007700]) {[/COLOR]
[COLOR= #0000BB]$parent[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]public_html/[/COLOR][COLOR= #007700];
}[/COLOR]
[COLOR= #0000BB]$lijst[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/ftp_nlist"]ftp_nlist[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ftp_server[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$path[/COLOR][COLOR= #007700]);[/COLOR]
?>
<a href="/admin/ftp.php?path=[COLOR= #0000BB]<?php[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$parent[/COLOR][COLOR= #007700];[/COLOR] ?>">...</a>
[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/for"]for[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$pages[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700];[/COLOR] [COLOR= #0000BB]$pages[/COLOR] [COLOR= #007700]<[/COLOR] [URL="http://www.php.net/count"]count[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$lijst[/COLOR][COLOR= #007700]);[/COLOR] [COLOR= #0000BB]$pages[/COLOR][COLOR= #007700]++) {[/COLOR]
[COLOR= #0000BB]$size[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/ftp_size"]ftp_size[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$ftp_server[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]$lijst[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$pages[/COLOR][COLOR= #007700]]);[/COLOR]
[COLOR= #0000BB]$naam[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/substr"]substr[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$lijst[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$pages[/COLOR][COLOR= #007700]],[/COLOR] [URL="http://www.php.net/strrpos"]strrpos[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$lijst[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$pages[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #DD0000]"/"[/COLOR][COLOR= #007700]),[/COLOR][URL="http://www.php.net/strlen"]strlen[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$lijst[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$pages[/COLOR][COLOR= #007700]]) -[/COLOR] [URL="http://www.php.net/strrpos"]strrpos[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$lijst[/COLOR][COLOR= #007700][[/COLOR][COLOR= #0000BB]$pages[/COLOR][COLOR= #007700]],[/COLOR] [COLOR= #DD0000]"/"[/COLOR][COLOR= #007700]));[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$naam[/COLOR][COLOR= #007700];
}
}[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
[URL="http://www.php.net/echo"]echo[/URL] [COLOR= #DD0000]Kan niet met de FTP service verbinden.[/COLOR][COLOR= #007700];
}[/COLOR]
?> Nee, ik heb gewoon als password "test", en ik heb de mysql_real_escape_string(); weggehaald, en dan is het nog steeds hetzelfde probleem.
Ik ben echt al een een halfuur mijn script aan het herlezen en herschrijven, maar ik vind de fout niet...
Ik ben echt al een een halfuur mijn script aan het herlezen en herschrijven, maar ik vind de fout niet...
Dylanh schreef:toevoeging op 8 juni 2013, 17:58:18:Oke, heb net een script van het internet gehaald als voorbeeld voor het FTP gebeuren. Nu wil ik natuurlijk me eigen script maken omdat het voor mij anders onoverzichtelijk is. Nu ben ik zo dom geweest om het voorbeeld script kwijt te rakenOok kan ik het niet in mijn geschiedenis en op google vinden.
Gelukkig heb ik het tot zover kunnen krijgen:
Output:
activatie.phpadminadmin.phpdb.connection.phpindex.phppass.crypt.phpuitloggen.phpvergeten.php
Hoe kan ik nou de mappen en de files onderscheiden en hoe maak ik hier een link van aangezien alles aan elkaar is?
Ligt eraan hoe je die output genereert?
Sanderc schreef:Ik ben echt al een een halfuur mijn script aan het herlezen en herschrijven, maar ik vind de fout niet...Nee, ik heb gewoon als password "test", en ik heb de mysql_real_escape_string(); weggehaald, en dan is het nog steeds hetzelfde probleem.
Zoals ik zei, kijk en vergelijk op beide plekken van in- en output.
Aarclay schreef:Zie edit.Gelukkig heb ik het tot zover kunnen krijgen:Eerdere citaten tonen
Dylanh schreef:Oke, heb net een script van het internet gehaald als voorbeeld voor het FTP gebeuren. Nu wil ik natuurlijk me eigen script maken omdat het voor mij anders onoverzichtelijk is. Nu ben ik zo dom geweest om het voorbeeld script kwijt te rakenOok kan ik het niet in mijn geschiedenis en op google vinden.
Output:
activatie.phpadminadmin.phpdb.connection.phpindex.phppass.crypt.phpuitloggen.phpvergeten.php
Hoe kan ik nou de mappen en de files onderscheiden en hoe maak ik hier een link van aangezien alles aan elkaar is?
Ligt eraan hoe je die output genereert?
toevoeging op 8 juni 2013, 17:58:18:Eerdere citaten tonen
Sanderc schreef:Nee, ik heb gewoon als password "test", en ik heb de mysql_real_escape_string(); weggehaald, en dan is het nog steeds hetzelfde probleem.
Ik ben echt al een een halfuur mijn script aan het herlezen en herschrijven, maar ik vind de fout niet...
Zoals ik zei, kijk en vergelijk op beide plekken van in- en output.
Aarclay schreef:Hoe bedoel je?Gelukkig heb ik het tot zover kunnen krijgen:Eerdere citaten tonen
Dylanh schreef:Oke, heb net een script van het internet gehaald als voorbeeld voor het FTP gebeuren. Nu wil ik natuurlijk me eigen script maken omdat het voor mij anders onoverzichtelijk is. Nu ben ik zo dom geweest om het voorbeeld script kwijt te rakenOok kan ik het niet in mijn geschiedenis en op google vinden.
Output:
activatie.phpadminadmin.phpdb.connection.phpindex.phppass.crypt.phpuitloggen.phpvergeten.php
Hoe kan ik nou de mappen en de files onderscheiden en hoe maak ik hier een link van aangezien alles aan elkaar is?
Ligt eraan hoe je die output genereert?
toevoeging op 8 juni 2013, 17:58:18:Eerdere citaten tonen
Sanderc schreef:Nee, ik heb gewoon als password "test", en ik heb de mysql_real_escape_string(); weggehaald, en dan is het nog steeds hetzelfde probleem.
Ik ben echt al een een halfuur mijn script aan het herlezen en herschrijven, maar ik vind de fout niet...
Zoals ik zei, kijk en vergelijk op beide plekken van in- en output.
Weet je de fout?
Ik zie de fout niet, maar kijk eens wat IN gaat, en kijk eens wat er UITkomt als men inlogt.