Vote like_dislike
placi2
-
placi2 -
placi2 -
je suis entrains de faire un vote de like_dislike
pour commencer a vote:
le client entre son Email et il doit clic sur l'image qu'il veut vote c.a.d qu'il y a trois image les client clic sur l'image qu'il veut voter puis l'image qu'il a clic dessus s'affiche mais se la ouil y a le probleme seul la premier image s'affiche meme si on clic sur les autres images.
merci pour votre aide
pour commencer a vote:
le client entre son Email et il doit clic sur l'image qu'il veut vote c.a.d qu'il y a trois image les client clic sur l'image qu'il veut voter puis l'image qu'il a clic dessus s'affiche mais se la ouil y a le probleme seul la premier image s'affiche meme si on clic sur les autres images.
merci pour votre aide
<?php session_start(); ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Like and dislike</title> <link href="css/style.css" rel="stylesheet" type="text/css" /> <link href="img/favicon.ico" rel="shortcut icon" type="image/x-icon"> <link href="css/bootstrap.css" rel="stylesheet" type="text/css" /> </head> <style> table {margin-left: 280px; width: 500px; background-color:#fff; } #prod{width:200px; } </style> <body> <script src="js/jquery.js"></script><!--drop down login--> <script src="js/bootstrap.js"></script> <script src="js/btn_action.js"></script> <h4> </h4> <?php include('database/config.php'); ?> <?php if(!isset($_SESSION['email'])){ ?> <span class="span4"> <table class="table table-bordered success" border="1" align="center" style="margin-top:40px; " > <th> Enter email address </th> <tr> <td> <form> <fieldset> <label>Email Address:</label> <input type="text" name="email" id="email" required="required" /> <table border="0"> <td id="prod" > <a href="javascript:void(0);" rel="nofollow noopener noreferrer" target="_blank" class="btn btn-large" style="float:left;"onClick="doLogin();"><i class="icon-thumbs-up icon-black"></i> Click to rate <i class="icon-thumbs-down icon-black"></i></a> <img src="images/rowenta__fer_voyage.jpg"> </td> <td id="prod"> <a href="javascript:void(0);" rel="nofollow noopener noreferrer" target="_blank" class="btn btn-large" style="float:left;"onClick="doLogin();"><i class="icon-thumbs-up icon-black"></i> Click to rate <i class="icon-thumbs-down icon-black"></i></a> <img src="images/th.jpg"> </td> <td id="prod"> <a href="javascript:void(0);" rel="nofollow noopener noreferrer" target="_blank" class="btn btn-large" style="float:left;"onClick="doLogin();"><i class="icon-thumbs-up icon-black"></i> Click to rate <i class="icon-thumbs-down icon-black"></i></a> <img src="images/promo-d.png"> </td> <td > <div class="login_div" id="login_div"></div> </td></table> </fieldset> </form> </td></tr></table> </span> <?php }else {?> <input type="hidden" name="email" id="email" value="<?php echo $_SESSION['email']; ?>" > <input name="lyk" id="lyk" type="hidden" value="0" > <?php include('database/config.php'); $like=mysql_query("SELECT * FROM lud where email='".$_SESSION['email']."'"); $num=mysql_num_rows($like); $row=mysql_fetch_array($like); ?> <span class="span4"> <table class="table table-bordered success" border="1" align="center" style="margin-top:40px; "> <th><a href="?try" rel="nofollow noopener noreferrer" target="_blank">Cancel</a> </th> <tr> <td>Do you like my product??</td> </tr> <tr> <td><img src="images/rowenta__fer_voyage.jpg"></td> </tr> <div class="fb-like" data-href="index.php" data-send="true" data-layout="box_count" data-width="100" data-show-faces="true" data-font="arial"></div> <tr> <td><?php $likes=mysql_query("SELECT * FROM lud where lyk=1"); $nums=mysql_num_rows($likes); echo $nums." people like this"; ?></td> </tr> <tr> <td><?php $l=mysql_query("SELECT * FROM lud where lyk=0"); $n=mysql_num_rows($l); echo $n." people hate this"; ?></td> </tr> <tr> <td> <?php if($row['lyk']=='1'){ ?> <span class="btn disabled btn-small" id="l" title="You like this" ><i class="icon-thumbs-up"></i> Liked</span> <?php }else{ ?> <a href="javascript:void(0);" rel="nofollow noopener noreferrer" target="_blank" id="like" class="btn btn-small" title="Likes" onClick="like();"><i class="icon-thumbs-up icon-black"></i> <span id="like_div">Like</span></a><span id="youlike"></span> <?php } if($row['lyk']=='0'){ ?> <span class="btn disabled btn-small" title="dislike" id="hide"><i class="icon-thumbs-down"></i> Disliked</span> <?php }else{ ?> <a href="javascript:void(0);" rel="nofollow noopener noreferrer" target="_blank" class="btn btn-small" title="Total Downloads" id="dislike" onClick="dislike();"><i class="icon-thumbs-down icon-black"></i> <span id="dislike_div">DisLike</span></a><span id="disyoulike"></span> <?php }?> <?php }?> <?php if(isset($_GET['try'])){ unset($_SESSION['email']); echo "<script>window.location='index.php'</script>"; } ?> </td> </tr> </table> <th style="margin-left:40px;"><a href="index.php" rel="nofollow noopener noreferrer" target="_blank">Return</a> </th> </span> </body> </html>
A voir également:
- Vote like_dislike
- Framadate modifier son vote - Guide
- Vote facebook - Guide
- Code vote kingpet ✓ - Forum Jeux vidéo
- Xxl 2020 vote 2017 video - Forum YouTube
- Recherche vidéo Replay de "Chateaux XXL" ✓ - Forum Cinéma / Télé
3 réponses
Salut,
Difficile de voir le problème sans le code js.
Peux tu nous montrer ce code et cibler un peu plus précisément le problème ?
Bonne journée,
Difficile de voir le problème sans le code js.
Peux tu nous montrer ce code et cibler un peu plus précisément le problème ?
Bonne journée,
j'ai trois produit et 3 boutton click to rate
chaque image a un boutton c.a.d si apres avoir entre l'Email je clic sur le boutton du produit que je veux voter....
voila les 3 boutton et les images
<td id="prod">
<a href="javascript:void(0);" rel="nofollow noopener noreferrer" target="_blank" class="btn btn-large" style="float:left;"onClick="doLogin();"><i class="icon-thumbs-up icon-black"></i> Click to rate <i class="icon-thumbs-down icon-black"></i></a>
<img src="images/rowenta__fer_voyage.jpg" >
</td>
<td id="prod">
<a href="javascript:void(0);" rel="nofollow noopener noreferrer" target="_blank" class="btn btn-large" style="float:left;"onClick="doLogin();"><i class="icon-thumbs-up icon-black"></i> Click to rate <i class="icon-thumbs-down icon-black"></i></a>
<img src="images/th.jpg">
</td>
<td id="prod">
<a href="javascript:void(0);" rel="nofollow noopener noreferrer" target="_blank" class="btn btn-large" style="float:left;"onClick="doLogin();"><i class="icon-thumbs-up icon-black"></i> Click to rate <i class="icon-thumbs-down icon-black"></i></a>
<img src="images/promo-d.png">
</td>
chaque image a un boutton c.a.d si apres avoir entre l'Email je clic sur le boutton du produit que je veux voter....
voila les 3 boutton et les images
<td id="prod">
<a href="javascript:void(0);" rel="nofollow noopener noreferrer" target="_blank" class="btn btn-large" style="float:left;"onClick="doLogin();"><i class="icon-thumbs-up icon-black"></i> Click to rate <i class="icon-thumbs-down icon-black"></i></a>
<img src="images/rowenta__fer_voyage.jpg" >
</td>
<td id="prod">
<a href="javascript:void(0);" rel="nofollow noopener noreferrer" target="_blank" class="btn btn-large" style="float:left;"onClick="doLogin();"><i class="icon-thumbs-up icon-black"></i> Click to rate <i class="icon-thumbs-down icon-black"></i></a>
<img src="images/th.jpg">
</td>
<td id="prod">
<a href="javascript:void(0);" rel="nofollow noopener noreferrer" target="_blank" class="btn btn-large" style="float:left;"onClick="doLogin();"><i class="icon-thumbs-up icon-black"></i> Click to rate <i class="icon-thumbs-down icon-black"></i></a>
<img src="images/promo-d.png">
</td>
function doLogin()
{
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var email = $("#email").val();
if(email == "")
{
$("#signup_status").html('<div class="info">Please enter your Email.</div>');
$("#email").focus();
}else if(reg.test(email) == false)
{
alert("enter valid email address");
$("#email").focus();
}else{
var dataString =
'email=' + email
+ '&page=signup';
$.ajax({
type: "POST",
url: "check.php",
data: dataString,
cache: false,
beforeSend: function()
{
$("#login_div").html('<div style="float:left; margin-left:10px;"><img src="images/loadings.gif" alt="Wait..." align="absmiddle" title="Loading...."/></div>');
},
success: function(response)
{
$("#login_div").hide().fadeIn('slow').html(response);
}
});
}
}
{
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var email = $("#email").val();
if(email == "")
{
$("#signup_status").html('<div class="info">Please enter your Email.</div>');
$("#email").focus();
}else if(reg.test(email) == false)
{
alert("enter valid email address");
$("#email").focus();
}else{
var dataString =
'email=' + email
+ '&page=signup';
$.ajax({
type: "POST",
url: "check.php",
data: dataString,
cache: false,
beforeSend: function()
{
$("#login_div").html('<div style="float:left; margin-left:10px;"><img src="images/loadings.gif" alt="Wait..." align="absmiddle" title="Loading...."/></div>');
},
success: function(response)
{
$("#login_div").hide().fadeIn('slow').html(response);
}
});
}
}
voici le code de la fonction doLogin()
function doLogin()
{
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var email = $("#email").val();
if(email == "")
{
$("#signup_status").html('<div class="info">Please enter your Email.</div>');
$("#email").focus();
}else if(reg.test(email) == false)
{
alert("enter valid email address");
$("#email").focus();
}else{
var dataString =
'email=' + email
+ '&page=signup';
$.ajax({
type: "POST",
url: "check.php",
data: dataString,
cache: false,
beforeSend: function()
{
$("#login_div").html('<div style="float:left; margin-left:10px;"><img src="images/loadings.gif" alt="Wait..." align="absmiddle" title="Loading...."/></div>');
},
success: function(response)
{
$("#login_div").hide().fadeIn('slow').html(response);
}
});
}
il y a pa d'erreur dans mon navigateur mais si vous pouvez me suger une autre solution je suis pres a l'adapte
function doLogin()
{
var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
var email = $("#email").val();
if(email == "")
{
$("#signup_status").html('<div class="info">Please enter your Email.</div>');
$("#email").focus();
}else if(reg.test(email) == false)
{
alert("enter valid email address");
$("#email").focus();
}else{
var dataString =
'email=' + email
+ '&page=signup';
$.ajax({
type: "POST",
url: "check.php",
data: dataString,
cache: false,
beforeSend: function()
{
$("#login_div").html('<div style="float:left; margin-left:10px;"><img src="images/loadings.gif" alt="Wait..." align="absmiddle" title="Loading...."/></div>');
},
success: function(response)
{
$("#login_div").hide().fadeIn('slow').html(response);
}
});
}
il y a pa d'erreur dans mon navigateur mais si vous pouvez me suger une autre solution je suis pres a l'adapte