Jump to content

PHP in Bootstrap div not working


HuuD

Recommended Posts

HI,

 

I hvae this code of php which shoes nothing in the div of bootstrap CSS, it shows empty div instead of text, any hints what I could be doing wrong.

<?php
if (isset($_SESSION['sesName']))
{/* THIS DIV IS CREATED IF THE SESSION EXISTS AND SHOULD SHOW THE USER NAME AND WELCOME MESSAGE BUT NOTHING HAPPENS
echo '<div class="row">
<div class="col-xs-10 col-xs-offset-1 col-sm-8 col-sm-offset-2 col-md-4 col-md-offset-4">
<div class="panel-body">
<form role="form">
<fieldset>
<div class="form-group">';
echo '<div class = "alert alert-success fade in">Welcome ' . $_Session['sesName'] . '"</div>';
'</div>
</fieldset>
</form>
</div>
</div>
</div>';
}
?>
<div class="row">
<div class="col-xs-10 col-xs-offset-1 col-sm-8 col-sm-offset-2 col-md-4 col-md-offset-4">
<div class="login-panel panel panel-default">
<div class="panel-heading">LOGIN</div>
<div class="panel-body">
<form role="form" method="POST" action="">
<fieldset>
<div class="form-group">
<input class="form-control" placeholder="E-mail" name="lemail" type="text" autofocus="">
</div>
<div class="form-group">
<input class="form-control" placeholder="Password" name="lpass" type="password" value="">
</div>
<div class="checkbox">
</div>
<input type ="submit" class="btn btn-primary" value="LOGIN"> <input type ="button" onclick="location.href='registration.php'" class="btn btn-primary" value="REGISTRATION">
</fieldset>
</form>
</div>
</div>
</div>
</div>
Link to comment
Share on other sites

you have also mis-capitalized SESSION in the php variable usage. php variable names are case-sensitive. $_SESSION is not the same as $_Session.

 

you would have been getting a php undefined variable error to help identify this problem. do you have your development system properly set up with php's error_reporting set to E_ALL and display_errors set to ON (preferably in the php.ini, so that you won't have to remember to set them) so that php will help you by reporting and displaying all the errors that it detects?

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.