mardi 8 novembre 2016

when i add 'session' code, the page is not working

it's simple authentification but i don't know why session interrupt the page, when i click on submit 'the page connect.php is interrupt' 'Unable to process this request' 'HTTP ERROR 500'

$login = $_POST['login'];
$pwd = $_POST['pwd'];   

    $portfolio = new vendor\Model\portfolio();
    $list_portfolio = $portfolio->select_portfolio_by_mail($mail,$pwd);
    $result = mysql_fetch_array($list_portfolio[2],MYSQL_ASSOC);
    session_start();
    $_SESSION['nom'] = $result['nom'];
    $_SESSION['prenom'] = $result['prenom'];

index.php

<?php 
session_start();
if (isset($_SESSION['nom']))
{ 
echo $contenu_fr; 
}
elseif (!isset ($_SESSION['nom']))
 { ?>

<form method="POST" action="<?php echo $url_front.'/control/connect.php' ?>" id="contactForm">
<div class="row">
<div class="col-md-6 col-sm-6 col-xs-12 form-group">
                                    <input type="text" name="login" class="form-control" placeholder="E-mail" value="" id="name" required/>
 </div>
  </div>
 <div class="row">
<div class="col-md-6 col-sm-6 col-xs-12 form-group">
 <input type="password" name="pwd" class="form-control" placeholder="Mot de passe"
 value="" id="email" required/>
 </div>
 </div>

<div class="row right">
<div class="col-md-12  col-sm-12  col-xs-2 foot">
 <input type="submit" value="LOG IN" id="submit"/>
</div>
 </div>
</form>




Aucun commentaire:

Enregistrer un commentaire