[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y ] [Search | Free Show | Home]

PDO

This is a blue board which means that it's for everybody (Safe For Work content only). If you see any adult content, please report it.

Thread replies: 10
Thread images: 1

File: d9JkXvo.jpg (125KB, 1456x539px) Image search: [Google]
d9JkXvo.jpg
125KB, 1456x539px
okay /g/ spent 2 hours looking for the error, plz help


-- above this is an
 if ( empty( $_POST ) ) { 

and then html form

<?php
}
else {

require ("connect.php"); // le code n'execute pas si connect.php n'est pas disponible

$email = $_POST[ 'email' ]; //Récupération des valeurs du formulaire
$mdp = $_POST[ 'mdp' ];

$sql= $db->prepare("SELECT email,mdp FROM users WHERE email = :email and mdp = :mdp");
$sql->bindParam(":email", $email, PDO::PARAM_STR);
$sql->bindParam(":mdp", $mdp, PDO::PARAM_STR);
$sql->execute();

$count = $sql->fetch(PDO::FETCH_NUM);
if($count!=0){
session_start();
$_SESSION['loggedin'] = true;
$_SESSION['username'] = $email;
$_SESSION['mdp'] = $mdp;
$url = "http://127.0.0.1/Management/index.html";
echo'<script type="text/javascript" >
alert("Bienvenue ! ");
window.location.href="' . $url . '";
</script>';
}

else {
$url2 = "http://127.0.0.1/management/Connexion.html";
echo'<script type="text/javascript" >
alert(" Email ou Mot de passe incorrecte ! ");
window.location.href="' . $url2 . '";
</script>';
}
}

?>

>>
>>60067769
Look up what PDO::FETCH_NUM does. It doesn't do what you think
>>
>>60067914
>PDO::FETCH_NUM
i changed it with rowCount();
but it stills fucks up

it directly echo's the first alert and redirects me before i get to type that

if i delete that

it does the same but with the second echo

so it's ignoring the if and else statements

someone help please, this is due tomorrow
>>
>>60067993
Poo goes in the loo
>>
>>60068088
>t. can't even code
>>
@60068313
Your to dum too even make basic database transactions. Learn how Western toilets work and go from there.
>>
>>60068475
>cant properly reply
You're*

The code is in french, i am western.

but i guess you can't read code so
https://boards.4chan.org/pol
>>
>>60068533
Dumb reddit spacer
>>
>>60067769
your indentations are fucking cancer
I hope you are working on this project alone because if anyone sees this you are getting fired
>>
>>60069157
help me ?

i'm a 2nd year college student, i'm still learning
Thread posts: 10
Thread images: 1


[Boards: 3 / a / aco / adv / an / asp / b / bant / biz / c / can / cgl / ck / cm / co / cock / d / diy / e / fa / fap / fit / fitlit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mlpol / mo / mtv / mu / n / news / o / out / outsoc / p / po / pol / qa / qst / r / r9k / s / s4s / sci / soc / sp / spa / t / tg / toy / trash / trv / tv / u / v / vg / vint / vip / vp / vr / w / wg / wsg / wsr / x / y] [Search | Top | Home]

I'm aware that Imgur.com will stop allowing adult images since 15th of May. I'm taking actions to backup as much data as possible.
Read more on this topic here - https://archived.moe/talk/thread/1694/


If you need a post removed click on it's [Report] button and follow the instruction.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com.
If you like this website please support us by donating with Bitcoins at 16mKtbZiwW52BLkibtCr8jUg2KVUMTxVQ5
All trademarks and copyrights on this page are owned by their respective parties.
Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
This is a 4chan archive - all of the content originated from that site.
This means that RandomArchive shows their content, archived.
If you need information for a Poster - contact them.