problem with many buttons [message #182805] |
Mon, 16 September 2013 06:25 |
Avnesh Shakya
Messages: 2 Registered: September 2013
Karma:
|
Junior Member |
|
|
hi,
I have a problem, I have created lot of blogs in my site, and i put those as button, so when i click on button(e.i. blog name), then it should be redirect on other page like. Now I am on page like localhost/blog/blogName.php, here I have all blog buttons, after clicking on a particular button, it should go on localhost/blog/commentShow.php?id=blogName, here blogName is a name of blog that button contains.
I am doing in page localhost/blog/blogName.php
<?php
$blogIds = 0;
$sql = "SELECT * FROM user_blogs";
$result = mysqli_query($con, $sql);
while($row = mysqli_fetch_array($result))
{
echo "<ul class='ulBullet horLine'>";
echo "<li>".$row['description']."</li>";
$bgname = 'bgname'.$blogIds;
echo "<li><button id=$bgname onclick = return(blogId($this))>".$row['blogs_name']."</button></li>";
$next = "SELECT * FROM users WHERE user_id=$row[user_id]";
$result12 = mysqli_query($con, $next);
$row12 = mysqli_fetch_array($result12);
echo "<li style=''><button class=''>".$row12['usename']."</button></li>";
echo '</ul>';
$blogIds++;
}
?>
in last, i added
<?php
echo "<script type='text/javascript'>function blogId($bgid) { top..location.href = './blogComment.php?id=$bgid'; };</script>";
?>
it is going on that page but not contaid this value...
please help me, what's wrong with me...
thanks and regards,
Avnesh Shakya
|
|
|