1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
| <?php
require 'includes/connect_db.php';
if(isset($_POST['go'])){
if(!empty($_POST['recherche'])){
}else{
$erreurr = "Veuillez remplire ce champs !";
}
}
if(isset($_POST['connexionok'])){
if(!empty($_POST['pseudo']) && !empty($_POST['mdp'])){
}else{
$erreurc = "Veuillez remplire tout les champs !";
}
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Index</title>
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<div id="connexion" class="popup_block">
<h2>Connexion</h2>
<?php if(!isset($erreurc)){ ?><p>Bienvenue sur </p> <?php }else{ echo "<span style='color:red;'>".$erreurc."</span>"; }?>
<form method="POST">
<input type="text" placeholder="Pseudo" name="pseudo"><br/>
<input type="password" placeholder="**********" name="mdp">
<input type="hidden" name="connexionok">
</form>
</div>
<div id="content">
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</div>
<div id="menu">
<span style="position:fixed;right:5px;top:2.5%;color:white;"><a href="#?w=500" rel="connexion" class="poplight">Connexion</a></span>
<span style="position:fixed;left:32.5%;top:1.2%"><form method="POST">
<input type="text" name="recherche" class="recherche" value="<?php if(isset($erreurr)){ echo $erreurr; }?>" placeholder="Video, Chaine, Tags ...">
<input type="hidden" name="go" ></form></span>
<?php if(isset($_SESSION['pseudo'])){ ?><span></span> <?php } ?>
</div>
<!--END POPUP-->
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
//When you click on a link with class of poplight and the href starts with a #
$('a.poplight[href^=#]').click(function() {
var popID = $(this).attr('rel'); //Get Popup Name
var popURL = $(this).attr('href'); //Get Popup href to define size
//Pull Query & Variables from href URL
var query= popURL.split('?');
var dim= query[1].split('&');
var popWidth = dim[0].split('=')[1]; //Gets the first query string value
//Fade in the Popup and add close button
$('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend('<a href="#" class="close"><img src="images/close_pop.png" class="btn_close" title="Close Window" alt="Close" /></a>');
//Define margin for center alignment (vertical + horizontal) - we add 80 to the height/width to accomodate for the padding + border width defined in the css
var popMargTop = ($('#' + popID).height() + 80) / 2;
var popMargLeft = ($('#' + popID).width() + 80) / 2;
//Apply Margin to Popup
$('#' + popID).css({
'margin-top' : -popMargTop,
'margin-left' : -popMargLeft
});
//Fade in Background
$('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
$('#fade').css({'filter' : 'alpha(opacity=80)'}).fadeIn(); //Fade in the fade layer
return false;
});
//Close Popups and Fade Layer
$('a.close, #fade').live('click', function() { //When clicking on the close or fade layer...
$('#fade , .popup_block').fadeOut(function() {
$('#fade, a.close').remove();
}); //fade them both out
return false;
});
});
</script>
</body>
</html> |
Partager