当我添加' session'代码,页面不起作用

时间:2016-11-08 10:40:43

标签: php

它的简单认证 但我不知道为什么会话中断页面, 当我点击提交 '页面connect.php是中断' '无法处理此请求' ' HTTP错误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>

1 个答案:

答案 0 :(得分:0)

如果括号,您忘记关闭其他人。