PHP - How To Make Images Popup With Php
Hey I 'm new to this but i got this code the links to images in my database and display them to the user but i want the images to pop-up out of the screen like this website : http://pinterest.com/ here when the small images are clicked displaying all the comments from users under it here is the code: and thanks
<?php include('models/user.php'); ob_start(); if(isset($_GET['cat'])){ $objCat = new dbConfig(); $sqlCat = $objCat->selectQuery("select * from categories WHERE cat_id = ".$_GET['cat']); $rowCat = mysql_fetch_array($sqlCat); $title = "Blabben - ".$rowCat['cat_name']; } elseif(isset($_GET['category'])){ $objCat = new dbConfig(); $sqlCat = $objCat->selectQuery("select * from categories WHERE cat_id = ".$_GET['category']); $rowCat = mysql_fetch_array($sqlCat); $title = "Blabben - ".$rowCat['cat_name']; } else { $title = "Blabben"; } ?> <?php define('INCLUDE_CHECK',1); require "timeline/functions.php"; require "timeline/connect.php"; // remove blabs older than 1 hour to prevent spam //mysql_query("DELETE FROM blabs WHERE blab_id>1 AND blab_date<SUBTIME(NOW(),'0 1:0:0')"); //fetch the timeline if(isset($_GET['top'])&&!isset($_GET['cat'])){ $q = mysql_query("SELECT * FROM blabs,users WHERE (blabs.user_id = users.user_id) AND (blabs.blab!='0') ORDER BY blabs.blab_id DESC LIMIT 50"); }elseif(isset($_GET['top'])&&isset($_GET['cat'])){ $q = mysql_query("SELECT * FROM blabs,users WHERE (blabs.user_id = users.user_id) AND (blabs.cat_id = ".$_GET['cat'].") AND (blabs.blab!='0') ORDER BY blabs.blab_id DESC LIMIT 50"); }elseif(!isset($_GET['top'])&&isset($_GET['cat'])){ $q = mysql_query("SELECT * FROM blabs,users WHERE (blabs.user_id = users.user_id) AND (blabs.cat_id = ".$_GET['cat'].") AND (blabs.blab!='0') ORDER BY blabs.blab_id DESC LIMIT 50"); } elseif(isset($_GET['points'])){ $q = mysql_query("SELECT * FROM blabs,users,follow WHERE follow.following = blabs.user_id AND blabs.user_id = users.user_id AND (follow.follower = ".$uinfo['user_id'].") AND blabs.blab!='0' ORDER BY users.points DESC LIMIT 50"); } //elseif(isset($_GET['cat'])){ //$q = mysql_query("SELECT * FROM blabs,users,follow WHERE follow.following = blabs.user_id AND blabs.user_id = users.user_id AND blabs.blab!='0' AND (follow.follower = ".$uinfo['user_id'].") AND blabs.cat_id = ".$_GET['cat']." ORDER BY blabs.blab_id DESC LIMIT 50"); //}elseif(isset($_GET['category'])){ //$q = mysql_query("SELECT * FROM blabs,users,follow WHERE follow.following = blabs.user_id AND blabs.user_id = users.user_id AND blabs.blab!='0' AND (follow.follower = ".$uinfo['user_id'].") AND blabs.cat_id = ".$_GET['category']." ORDER BY blabs.blab_id DESC LIMIT 50"); //} else{ $q = mysql_query("SELECT * FROM blabs,users,follow WHERE follow.following = blabs.user_id AND blabs.user_id = users.user_id AND (follow.follower = ".$uinfo['user_id'].") AND blabs.blab!='0' ORDER BY blabs.blab_id DESC LIMIT 50"); } $timeline=''; //$row1=mysql_fetch_assoc($q); //$bd = $row1['blab_date']; //$blab_date = relativeTime($bd,$precision=2); while($row=mysql_fetch_assoc($q)) { $timeline.=formatTweet($row['name'],$row['uname'],$row['state'],$row['picture'],$row['blab'],$row['blab_date'],$row['user_id'],$row['blab_id']); } // fetch the no blab $noblab = ''; //if(isset($_GET['cat'])){ //$blabcount = mysql_num_rows(mysql_query("SELECT * FROM blabs WHERE blab!=0 AND cat_id=".$_GET['cat'])); //} //elseif(isset($_GET['category'])){ //$blabcount = mysql_num_rows(mysql_query("SELECT * FROM blabs WHERE blab!=0 AND cat_id=".$_GET['category'])); //}else{ //$blabcount = mysql_num_rows(mysql_query("SELECT * FROM blabs where `blab`!='0'")); //} //if($blabcount<=0){ $noblab = "<div style='padding:20px 15px; text-align:center;' id='noblab'>No Blab Posted</div>"; } ?> <script> $(document).ready(function(){ $('#noblab').hide(); }); </script> <?php if(isset($_GET['verified'])&& $_GET['verified']=='1'){ ?> <script type="text/javascript"> showNotification({ message: "Congratulations! You have got 250 points for verifying your account", type: "success", autoClose: true, duration: 5 }); </script> <?php } ?> <?php if(isset($_GET['verified'])&& $_GET['verified']=='11'){ ?> <script type="text/javascript"> showNotification({ message: "Your account is already verified.", type: "error", autoClose: true, duration: 5 }); </script> <?php } ?> <?php if(isset($_GET['blab'])&& $_GET['blab']=='added'){ ?> <script type="text/javascript"> showNotification({ message: "Blab has been added successfully.", type: "success", autoClose: true, duration: 5 }); </script> <?php } ?> <?php if((isset($_GET['welcome'])&& $_GET['welcome']=='1')||($uinfo['verified']=='0')){ ?> <script type="text/javascript"> showNotification({ message: "<span style='color:#000;'><strong>Confirm your email address to access all of Blabben's features</strong>. A confirmation message was sent to <strong><?php echo $uinfo['email']; ?></strong><br /><span style='color:#000;'><a style='color:blue; text-decoration:underline; font-weight:normal;' href='models/resend.php'>Resend Confirmation Email</a> | <a style='color:blue; text-decoration:underline; font-weight:normal;' href='account'>Update Email Address</a></span></span>", type: "success", autoClose: false, duration: 5 }); </script> <?php } ?> <?php if(isset($_GET['blab'])&& $_GET['blab']=='deleted'){ ?> <script type="text/javascript"> showNotification({ message: "Blab has been deleted successfully.", type: "success", autoClose: true, duration: 5 }); </script> <?php } ?> <?php if(isset($_GET['b'])&& $_GET['b']=='err'){ ?> <script type="text/javascript"> showNotification({ message: "Sorry! You don't have enough points.", type: "error", autoClose: true, duration: 5 }); </script> <?php } ?> <?php if(isset($_GET['resent'])&& $_GET['resent']=='1'){ ?> <script type="text/javascript"> showNotification({ message: "Confirmation email has been resent on your Email.", type: "success", autoClose: true, duration: 5 }); </script> <?php } ?> <SCRIPT LANGUAGE="JavaScript"> <!-- Limit the number of characters per textarea --> <!-- Begin function textCounter(field,cntfield,maxlimit) { if (field.value.length > maxlimit) // if too long...trim it! field.value = field.value.substring(0, maxlimit); // otherwise, update 'characters left' counter else cntfield.value = maxlimit - field.value.length; } // End --> </script> <!--tabs--> <div id="tabs-con"> <div id="tabs1"> <!--id="nation"--> <div class="tab roundT"><a href="http://www.blabben.com">Blabbing</a><!--<span></span>--> </div> <div class="tab roundT"><a href="upload-picture.php">Upload Picture</a></div> <div class="tab roundT"><a <?php if(isset($_GET['cat'])){ ?>href="home?category=<?php echo $_GET['cat']; ?>" <?php } elseif(isset($_GET['category'])){ ?>href="home?category=<?php echo $_GET['category']; ?>"<?php }elseif(isset($_GET['tp'])){ ?>href="home?alltp"<?php }else{ ?>href="home?all"<?php } ?>> <?php if(isset($_GET['cat'])){ ?><?php echo $rowCat['cat_name']; ?> All Pictures<?php } elseif(isset($_GET['category'])){ ?><strong><?php echo $rowCat['cat_name']; ?> All Pictures</strong><?php } elseif(isset($_GET['alltp'])){ ?><strong>All Recent Pictures</strong><?php } elseif(isset($_GET['all'])){ ?><strong>All Recent Pictures</strong><?php }else{ ?>All Recent Pictures<?php } ?></a></div> <div class="tab roundT"><a <?php if(isset($_GET['cat'])){ ?> href="home?tp&cat=<?php echo $_GET['cat']; ?>" <?php }else{ ?>href="home?tp"<?php } ?>> <?php if(isset($_GET['cat'])){ ?><?php echo $rowCat['cat_name']; ?> Top Pictures<?php } elseif(isset($_GET['tp'])||isset($_GET['alltp'])){ ?><strong>Top Pictures</strong><?php } else{ ?>Blabben Top Pictures<?php } ?></a></div> </div> </div> <!--tabs end--> <!-- <div class="blabnation"> <ul class="user-dropdown"> <li <?php //if(!isset($_GET['nation'])){?>id="selected"<?php //}else{}?>><a href="home">Blab Friends</a></li> <li <?php //if(isset($_GET['nation'])){?>id="selected"<?php //}else{}?>><a href="home?nation">Blab Nation</a></li> </ul> </div> --> <!--content--> <div id="content" class="round1"> <?php if(!isset($_GET['top'])){ $objBP = new dbConfig(); $objBP1 = new dbConfig(); //echo $_GET['cat']; if(isset($_GET['cat'])&&!isset($_GET['tp'])){ $cate = "select * from blabs,users,categories,follow WHERE follow.following = blabs.user_id AND follow.follower = ".$uinfo['user_id']." AND blabs.cat_id = categories.cat_id AND blabs.user_id = users.user_id AND blabs.blab='0' AND blabs.cat_id = ".$_GET['cat']." ORDER BY blab_id DESC LIMIT 8"; $sqlBP = $objBP->selectQuery($cate); } elseif(isset($_GET['category'])){ $sqlBP = $objBP->selectQuery("select * from blabs,users,categories,follow WHERE follow.following = blabs.user_id AND blabs.cat_id = categories.cat_id AND follow.follower = ".$uinfo['user_id']." AND blabs.user_id = users.user_id AND blabs.blab='0' AND blabs.cat_id = ".$_GET['category']." ORDER BY blab_id DESC LIMIT 8"); } elseif(isset($_GET['all'])){ $sqlBP = $objBP->selectQuery("select * from blabs,users,categories,follow WHERE follow.following = blabs.user_id AND blabs.cat_id = categories.cat_id AND follow.follower = ".$uinfo['user_id']." AND blabs.user_id = users.user_id AND blabs.blab='0' ORDER BY blab_id DESC LIMIT 75"); } elseif(isset($_GET['tp'])&&!isset($_GET['cat'])){ $sqlBP = $objBP->selectQuery("select * from blabs,users,categories WHERE blabs.cat_id = categories.cat_id AND blabs.user_id = users.user_id AND blabs.blab='0' ORDER BY blabs.blab_id DESC LIMIT 75"); //$sqlBP = $objBP->selectQuery("select * from likes,blabs,users,categories WHERE likes.blab_id = blabs.blab_id AND blabs.cat_id = categories.cat_id AND likes.show='1' AND blabs.user_id = users.user_id AND blabs.blab='0' ORDER BY likes.liked DESC LIMIT 75"); } elseif(isset($_GET['tp'])&&isset($_GET['cat'])){ $t = "select * from blabs,users,categories WHERE blabs.cat_id = categories.cat_id AND blabs.user_id = users.user_id AND blabs.cat_id = ".$_GET['cat']." AND blabs.blab='0' ORDER BY blabs.blab_id DESC LIMIT 75"; $sqlBP = $objBP->selectQuery($t); } elseif(isset($_GET['alltp'])){ $sqlBP = $objBP->selectQuery("select * from likes,blabs,users,categories,follow WHERE follow.following = blabs.user_id AND (likes.blab_id = blabs.blab_id) AND (follow.follower = ".$uinfo['user_id'].") AND (blabs.cat_id = categories.cat_id) AND (likes.show='1') AND (blabs.user_id = users.user_id) AND (blabs.blab='0') ORDER BY likes.liked DESC"); } elseif(!isset($_GET['tp'])&&isset($_GET['cat'])) { $sqlBP = $objBP->selectQuery("select * from blabs,users,follow,categories WHERE (blabs.cat_id = categories.cat_id) AND (follow.following = blabs.user_id) AND (follow.follower = ".$uinfo['user_id'].") AND (blabs.user_id = users.user_id) AND (blabs.blab='0') AND (blabs.cat_id = ".$_GET['cat'].") ORDER BY blab_id DESC LIMIT 8"); } else { $sqlBP = $objBP->selectQuery("select * from blabs,users,follow,categories WHERE (blabs.cat_id = categories.cat_id) AND (follow.following = blabs.user_id) AND (follow.follower = ".$uinfo['user_id'].") AND (blabs.user_id = users.user_id) AND (blabs.blab='0') ORDER BY blab_id DESC LIMIT 8"); } ?> <script> function deleteblab(blab){ c = confirm("Are you sure you want to delete this?"); if(c==true){location.href = "models/picblab_mdl.php?bid="+blab+"&delete=blab"} } </script> <!--blab--> <div id="blabs-con"> <ul> <?php $c=1; while($rowblab = mysql_fetch_array($sqlBP)){ ?> <?php //count likes $objLike = new dbConfig(); $sqlLike = $objLike->selectQuery("select * from likes WHERE blab_id = ".$rowblab['blab_id']); $countLike = mysql_num_rows($sqlLike); //find if person liked $objLike1 = new dbConfig(); $sqlLike1 = $objLike1->selectQuery("select * from likes WHERE blab_id = ".$rowblab['blab_id']." AND user_id = ".$uinfo['user_id']); $countLike1 = mysql_num_rows($sqlLike1); //get comments $objBs = new dbConfig(); $sqlBs = $objBs->selectQuery("select * from comment WHERE blab_id = ".$rowblab['blab_id']); $countBs = mysql_num_rows($sqlBs); //get repics $objRe = new dbConfig(); $sqlRe = $objRe->selectQuery("select * from blabs WHERE reblab = ".$rowblab['blab_id']); $countRe = mysql_num_rows($sqlRe); ?> <li class="box"> <div class="blabs" fancybox> <!--fancybox srart--> <!-- Add mousewheel plugin (this is optional) --> <script src="../js/jquery-1.7.1.min.js" type="text/javascript"></script> <script type="text/javascript" src="js/jquery.mousewheel-3.0.6.pack.js"></script> <!-- Add fancyBox main JS and CSS files --> <script type="text/javascript" src="js/fancybox/jquery.fancybox.js"></script> <link rel="stylesheet" type="text/css" href="js/fancybox/jquery.fancybox.css" media="screen" /> <!--fancybox end--> <script type="text/javascript"> $(document).ready(function() { $(".fancybox").fancybox({ 'transitionIn' : 'elastic', 'transitionOut' : 'fade', 'width' : 615, 'height' : 'auto', 'type' : 'img' }); }); </script> <script> $(document).ready(function(){ //$('#commentwr<?php //echo $c; ?>').hide(); $('#commentbt<?php echo $c; ?>').click(function(){ //$('#commentwr<?php //echo $c; ?>').slideToggle('slow'); $('#comment<?php echo $c; ?>').focus(); }); }); </script> <?php if($_SESSION['UserInfo'][0]==$rowblab['user_id']) {?> <div class="delete1"><a href="javascript:;" onclick="deleteblab('<?php echo $rowblab['blab_id']; ?>')"><img src="images/delete.png" title="Delete this Picture" alt="Delete" /></a></div> <?php } ?> <div class="blabs-img fancybox"><!--blabs-img start--> <?php if($rowblab['blab_img']==NULL){ ?> <a class="fancybox" href="article.php?blab=<?php echo $rowblab['blab_id']; ?>"><img src="images/avatar.png" width="198" /></a> <?php } else { ?> <a class="fancybox" href="article.php?blab=<?php echo $rowblab['blab_id']; ?>"><img src="pictures/large/<?php echo $rowblab['blab_img']; ?>" width="198" /></a> <?php } ?> <div class="blab-text"><?php echo $rowblab['blab_caption']; ?></div> <div class="blab-text1"><?php echo $countLike; ?> likes</div> <div class="blab-text1"><?php echo $countBs; ?> blabs</div> <div class="blab-text1"><?php echo $countRe; ?> repics</div> </div><!-- blabs-img end--> <div class="like fancybox" ><img id="commentbt<?php echo $c; ?>" style="cursor:pointer;" src="images/Blab.jpg" width="61" height="18" /> <?php if($countLike1<=0){ ?> <a class="fancybox" href="models/likes_mdl.php?action=like&bid=<?php echo $rowblab['blab_id']; ?>&uid=<?php echo $rowblab['user_id']; ?>&page=home"><img src="images/Like.jpg" width="56" height="18" /></a> <?php }?> <?php if($rowblab['user_id']!=$uinfo['user_id']){ ?> <form style="float:right;" name="repic" id="repic" action="models/repic_mdl.php?action=repic" method="post"> <input name="uid" type="hidden" value="<?php echo $rowblab['user_id']; ?>" /> <input name="blab_img" type="hidden" value="<?php echo $rowblab['blab_img']; ?>" /> <input name="blab_id" type="hidden" value="<?php echo $rowblab['blab_id']; ?>" /> <input name="blab_caption" type="hidden" value="<?php echo $rowblab['blab_caption']; ?>" /> <input name="cat_id" type="hidden" value="<?php echo $rowblab['cat_id']; ?>" /> <input type="image" src="images/RePic.png" /> </form> <?php }?> </div> <div class="onto"> <?php if($rowblab['picture']==NULL) { ?> <span><img src="images/avatar.png" width="30" /></span> <?php } else { ?><img src="users_images/small/<?php echo $rowblab['picture']; ?>" width="30" /><?php } ?> <span><strong><a href="./<?php echo $rowblab['uname']; ?>"><?php echo $rowblab['name']; ?></a> @<?php echo $rowblab['uname']; ?></strong> onto <strong><a href="home?cat=<?php echo $rowblab['cat_id']; if(isset($_GET['tp'])){echo "&tp";} ?>"><?php echo $rowblab['cat_name']; ?></a></strong></span></div> <?php $objCom = new dbConfig(); //$coms = "select * from blabs,users,comment WHERE blabs.user_id = comment.user_id AND blabs.blab_id = comment.blab_id AND comment.blab_id = ".$rowblab['blab_id']." ORDER BY comment.com_id DESC LIMIT 2"; $sqlCom = $objCom->selectQuery("select * from comment WHERE blab_id = ".$rowblab['blab_id']." ORDER BY com_id DESC LIMIT 2"); $comCount = mysql_num_rows($sqlCom); if($comCount>=1){ while($comments = mysql_fetch_array($sqlCom)){ ?> <div class="onto1"> <?php $objComU = new dbConfig(); $sqlComU = $objComU->selectQuery("select * from users WHERE user_id = ".$comments['user_id']); $comU = mysql_fetch_array($sqlComU); if($comU['picture']==NULL) { ?> <span><img src="images/avatar.png" width="30" /></span> <?php } else { ?><img src="users_images/small/<?php echo $comU['picture']; ?>" width="30" /><?php } ?> <span><strong><a href="./<?php echo $comU['uname']; ?>"><?php echo $comU['name']; ?></a></strong> <?php echo $comments['comment']; ?></span></div> <?php }} if($countBs>=2){ ?> <div class="onto1" style="text-align:center"> <span><strong><a href="article.php?blab=<?php echo $rowblab['blab_id']; ?>">All <?php echo $countBs; ?> comments...</a></strong></span></div> <?php } ?> <div id="commentwr<?php echo $c; ?>" class="onto1 comments" style="text-align:center"> <span><strong><form action="models/comment_mdl.php?put=blab&uid=<?php echo $rowblab['user_id']; ?>" method="post" name="comment"><input name="blab_id" type="hidden" value="<?php echo $rowblab['blab_id']; ?>" /><textarea name="comment" id="comment<?php echo $c; ?>" placeholder="Blab It Up" maxlength="140" style="max-width:186px; min-width:186px; width:186px; height:24px;max-height:50px;" cols="" rows=""></textarea></strong></span><br /> <input name="" type="image" src="images/Blab.jpg" style="margin-top:6px;" /></form> </div> </div> </li> <?php $c++; } ?> </ul> <?php } ?> </div> <!--blabs end--> <?php if(!isset($_GET['all'])&&!isset($_GET['category'])&&!isset($_GET['alltp'])&&!isset($_GET['tp'])) {?> <!--content 2--> <div id="content2" style="margin-bottom:20px;"> <a id="timeline"></a> <!--content left--> <div id="left"> <!--tabs--> <div id="tabs-inside"> <div class="tab-inside roundT"><a href="home"><?php if(!isset($_GET['top'])&&!isset($_GET['points'])){ ?><strong>Blabbing</strong><?php } else {?>Blabbing<?php } ?></a></div> <div class="tab-inside roundT"> <?php if(isset($_GET['cat'])){ ?><a href="home?top&cat=<?php echo $_GET['cat']; ?>"><?php if(isset($_GET['top'])) {?><strong><?php echo $rowCat['cat_name']; ?> Top Blabs</strong><?php }else { ?><?php echo $rowCat['cat_name']; ?> Top Blabs</a><?php }}else {?><a href="home?top"><?php if(isset($_GET['top'])) {?><strong>Blabben Top Blabs</strong><?php }else { ?>Blabben Top Blabs</a><?php }} ?></div> <!--<div class="tab-inside roundT"><a href="home?points"><?php //if(isset($_GET['points'])){ ?><strong>Points</strong><?php //} else {?>Points<?php //} ?></a></div>--> </div> <!--tabs end--> <div id="leftcon"> <div style="text-align: center;"><?php echo $noblab; ?></div> <ul class="statuses"><?=$timeline?></ul> </div> </div> <!--conetne left end--> <!--content right--> <div id="right"> <!--tabs--> <div id="tabs"> <div class="tab1 roundT">My Blab Profile<span class="catname1"><?php if(isset($_GET['cat'])){ echo $rowCat['cat_name']; } elseif(isset($_GET['category'])){ echo $rowCat['cat_name']; } ?></span></div> </div> <!--tabs end--> <!--profile--> <div id="blab-profile"> <div id="profile"> <?php if($uinfo['picture']==NULL) { ?> <img src="images/avatar.png" width="50" /> <?php } else { ?><img src="users_images/large/<?php echo $uinfo['picture']; ?>" width="50" /><?php } ?><span> </span><?php echo $uinfo['name']; ?><br /> <a href="<?php echo $uinfo['uname']; ?>">View Profile page</a></div> <!--counts--> <div id="counts"> <div id="count-blabs1"> <?php $objBlab = new dbConfig(); $sqlBlab = $objBlab->selectQuery("select * from blabs WHERE user_id = ".$_SESSION['UserInfo'][0]); $countBlab = mysql_num_rows($sqlBlab); $objF = new dbConfig(); $sqlF = $objF->selectQuery("select * from follow WHERE follower = ".$_SESSION['UserInfo'][0]); $following = mysql_num_rows($sqlF); $objF1 = new dbConfig(); $sqlF1 = $objF1->selectQuery("select * from follow WHERE following = ".$_SESSION['UserInfo'][0]); $follower = mysql_num_rows($sqlF1); $objPoints = new dbConfig(); $sqlPoints = $objBlab->selectQuery("select * from users WHERE user_id = ".$_SESSION['UserInfo'][0]); $countPoints = mysql_fetch_array($sqlPoints); ?> <span><?php echo $countBlab; ?></span><br /> <a href="profile">BLABS</a></div> <div id="count-points1"><span><?php echo $countPoints['points']; ?></span><br /> <a href="profile">POINTS</a></div> </div> <!--counts end--> <!--counts--> <div id="counts"> <div id="count-follow1"><span><?php echo $following; ?></span><br /> <a href="profile?following">FOLLOWING</a></div> <div id="count-follower1"><span><?php echo $follower; ?></span><br /> <a href="profile?followers">FOLLOWERS</a></div> </div> <!--counts end--> <?php $objbid = new dbConfig(); $qb = "select * from blabs order by blab_id desc limit 1"; $sqlbid = $objbid->selectQuery($qb); $bid= mysql_fetch_array($sqlbid); $b_id = $bid['blab_id']+1; ?> <div id="blabit-up"> <form id="blabfrm" name="blabfrm" method="post"> <textarea name="blab" id="blab" placeholder="Blab It Up" class="validate[required] text-input" tabindex="1" rows="2" cols="40" onKeyDown="textCounter(document.blabfrm.blab,document.blabfrm.counterb,160)" onKeyUp="textCounter(document.blabfrm.blab,document.document.blabfrm.counterb,160)"><?php if(isset($_GET['cat'])){?>wrote onto <?php echo $rowCat['cat_name'].": "; ?><?php }elseif(isset($_GET['category'])) { ?>wrote onto <?php echo $rowCat['cat_name'].": "; }?></textarea> <input name="name" type="hidden" value="<?php echo $_SESSION['UserInfo'][1]; ?>" /> <input name="state" type="hidden" value="<?php echo $_SESSION['UserInfo'][6]; ?>" /> <input name="city" type="hidden" value="<?php echo $_SESSION['UserInfo'][5]; ?>" /> <input name="picture" type="hidden" value="<?php echo $_SESSION['UserInfo'][10]; ?>" /> <input name="uname" type="hidden" value="<?php echo $_SESSION['UserInfo'][4]; ?>" /> <input name="cat_id" type="hidden" value="<?php if(isset($_GET['cat'])) { echo $_GET['cat']; } elseif(isset($_GET['category'])) { echo $_GET['category']; } else { echo "35"; }?>" /> <input name="blab_id" type="hidden" value="<?php echo $b_id; ?>" /> <span class="catname"><?php if(isset($_GET['cat'])){ echo "<span style='text-transform: capitalize;'>".$rowCat['cat_name']."</span>"; }elseif(isset($_GET['category'])){ echo "<span style='text-transform: capitalize;'>".$rowCat['cat_name']."</span>"; } ?></span> <input name="counterb" class="counter" style="border:none; background:none;margin: 0; width: 50px;" disabled="disabled" value="160" type="text" /> <!--<span style="min-width:100px" class="counter">160</span>--> <input class="submitButton inact" name="submit" type="submit" value=" " disabled="disabled" /> <div class="clear"></div> </form> </div> </div> <!--blab of day--> <div id="tabs"> <div class="tab1 roundT" style="margin-top:10px;">Blab of the day</div> </div> <?php $objday = new dbConfig(); $sqlday = $objday->selectQuery("select * from trending WHERE trending_active = '1' ORDER BY trending_id DESC"); $bofdayn = mysql_num_rows($sqlday); if($bofdayn<=0){ ?> <div class="recent-comments" style="background: none repeat scroll 0 0 #FFFFFF; margin-left: 6px; width: 93%;"> <div class="pinned"><strong>No Blab</strong></div> </div> <?php } else { while($bofday = mysql_fetch_array($sqlday)){ ?> <div class="recent-comments" style="background: none repeat scroll 0 0 #FFFFFF; margin-left: 6px; width: 93%;"> <!-- onclick="document.getElementById('q').value='<?php //echo $bofday['trendings']; ?>'"--> <div class="pinned" style="padding-left:13px;"><a href="search?q=<?php echo $bofday['trendings']; ?>" id="bofday"><?php echo $bofday['trendings']; ?></a></div> </div> <?php }} ?> <!--blab of day end--> </div> <!--profile end--> </div> <!--conetne right end--> </div> <!--content 2 end--> <?php } ?> </div> <!--content end--> </div> <!--wrapper end--> <script src="js/masonry/jquery.masonry.min.js"></script> <script> $(function(){ var $container = $('#blabs-con'); $container.imagesLoaded(function(){ $container.masonry({ itemSelector : '.box', columnWidth : 0 }); }); }); </script> </body> </html> <?php $content = ob_get_contents(); ob_end_clean(); require_once("mainTemplate.php"); ?> Similar TutorialsThis topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=317523.0 I'm trying to make my text and images into clickable links. The images and text are in a database so its getting really tricky for me since I'm new to PHP. I've tried many different ways without success. Here is a snippet of the code I'm working with. As you can see, I'm also working with an image re-sizer. I would really like to make those images and text clickable links(i.e. Title). Any help is appreciated! if ($res) { while ($newArray = mysqli_fetch_array($res, MYSQLI_ASSOC)) { $detail = $newArray['id']; $photo = $newArray['photo']; $id = $newArray['title']; $price = $newArray['price']; list($width) = getimagesize($photo); // set the maximum width of the image here $maxWidth = 100; if ($width > $maxWidth) echo "<p><img alt=\"Image\" width=\"$maxWidth\" src=\"$photo\" />"; echo "Title:".$id." Price:".$price."<br/"; I have search the forum, but i cant find something thats about my problem.. :S Im trying to make a kind of a community website for my friends and others who want to be there.. (Its danish).. I got alot of stuff going in the codes, and now i want some kind of a popup to tell the user when they got a new msg, i trying alot of stuff but i cant find something that works with my codes.. ... I got 2 iframes in the background running to update user status and stuff, i want one of them to create a popup when a new msg is in for the Session user.. This is one of the update pages i got running.. <script> setTimeout("document.location.reload(true);", 60000); </script> <head> <link rel="stylesheet" type="text/css" href="style_blue.css"> </head> <? require_once('#####.php'); //database access require_once('#####.php'); // php functions session_start(); if (isset($_SESSION['user']) AND ($_SESSION['user'] <> '')) { $result = mysql_query("UPDATE users SET time = '".time()."' WHERE id = '$_SESSION[id]'"); } $result2 = mysql_query("SELECT id FROM msg WHERE to = '$_SESSION[id]' AND new = '1'"); $antal2 = ( mysql_num_rows($result2) ); if (($antal2 > '0')) { ## Here i need a code to create a popup telling the user that there is a new msg.. } ?> I really hope someone can help me... :S Btw.. i dont wanna use alert popup cuz then they will stack if a user goes out for a few hours but stays on website.. Okay so my news script is set to view only 10 pieces of news. But I want it so that it starts a new page once I have more than 10 pieces of news. Code: [Select] <?php require("functions.php"); include("dbconnect.php"); session_start(); head1(); body1(); new_temp(); sotw(); navbar(); $start = 0; $display = 10; $query = "SELECT * FROM news ORDER BY id DESC LIMIT $start, $display"; $result = mysql_query( $query ); if ($result) { while( $row = @mysql_fetch_array( $result, MYSQL_ASSOC ) ) { news_box( $row['news'], $row['title'], $row['user'], $row['date'], $row['id'] ); } mysql_free_result($result); } else { news_box( 'Could not retrieve news entries!', 'Error', 'Error', 'Error'); } footer(); mysql_close($link); ?> I tried a few things but they failed....miserably. I have this script from http://lampload.com/...,view.download/ (I am not using a database) I can upload images fine, I can view files, but I want to delete them. When I press the delete button, nothing happens
http://www.jayg.co.u...oad_gallery.php
<form>
<?php $dir = dirname(__FILENAME__)."/images/gallery" ; $files1 = scandir($dir); foreach($files1 as $file){ if(strlen($file) >=3){ $foil = strstr($file, 'jpg'); // As of PHP 5.3.0 $foil = $file; $pos = strpos($file, 'css'); if ($foil==true){ echo '<input type="checkbox" name="filenames[]" value="'.$foil.'" />'; echo "<img width='130' height='38' src='images/gallery/$file' /><br/>"; // for live host //echo "<img width='130' height='38' src='/ABOOK/SORTING/gallery-dynamic/images/gallery/ $file' /><br/>"; } } }?> <input type="submit" name="mysubmit2" value="Delete"> </form>
any ideas please?
thanks
i have a div with an iframe in it that when i click on a link it pops up but what i am trying to do is add ?old=$folderName to the link but when i do the popup is blank. so does anyone know something i can try. (i am using facebox to create the popup) Code: [Select] this is the link for the popup <a href='#Rename' rel='facebox'>Rename</a> this is with ?old=$folderName added this displays the blank popup <a href='#Rename?old=$folderName' rel='facebox'>Rename</a> this is the div with iframe Code: [Select] <div id="Rename" style="display:none"><iframe src="form.php?old=<?php echo $old=$_GET['old'] ?>" frameborder="0"> </iframe></div> Hi guys. I'm very new to PHP, and I'm trying to create a simple mail script. Mail a friend A user will click an image on the site which will open a pop up box. They input their name and the email of the friend that they want to send the current URL to. The email will send the current URL via email and display a confirmation message once it has sent successfully. The friend will receive an email with a link to the URL. The problem The email part works fine, it's the URL in the message that is the issue. When the user clicks the 'Email a friend' it opens a popup box - which is where the URL is being grabbed from and emailed. Is there a way to grab the URL from the page before the popup? Here is my (rather amateur) code. Also, feel free to let me know if I can make improvements to it if anything seems a bit strange! The popup link: <a onclick="window.open(this.href,'win2','width=400,height=350,menubar=yes,resizable=yes'); return false;" title="E-mail" href="mailform/form.html">Send to a friend</a> The popup form: <html> <body> <form method="post" action="code.php"> Friends Email: <input name="email" type="text" /><br /> Your Name: <input name="name" type="text" /><br /> <input type="submit" /> </form> </body> </html> The PHP code: <?php // Declaring Variables $email = $_REQUEST['email'] ; $name = $_REQUEST['name']; $geturl = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; $message = "Hello. $name has suggested a page for you to view on our website. Please click the following link: $geturl"; // Email Settings mail( $email, "Send page to a friend", $message, "From: Timaru District Council" ); header( "Location: http://www.c4clever.com/sandbox/mailform/sent.html" ); // Confirmation page (Change this to appropriate URL) ?> Feel free to test it out if you want to (http://www.c4clever.com/sandbox) Looking forward to replies, thanks in advance! Hi i am looking for a bit of help on a script i am trying to make. Basically i have a page when onload it opens a popup with a random website pulled from the database Code: [Select] <script language="JavaScript1.1"> <!-- function TheNewWin(url) { var popUp = window.open(url,'popup','height=700,width=700,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,left=0,top=200'); if (popUp == null || typeof(popUp)=='undefined') { var a = confirm('Please disable your pop-up blocker and click the "Open" link again.'); if (a){ window.location.href = 'popupwarn.php'; }else{ window.location.href = 'popupwarn.php'; } } else { popUp.focus(); } } //--> </script> <body onload="TheNewWin($website);"> After 10 seconds i have it refresh so the popup changes to a new website Code: [Select] header("refresh: 10; websiteviewcontrol.php?id=$website"); What i want to happen is before it changes the popup to a new website i want it to redirect to some website of my choice for example Facebook. So on the 8th second it would go to Facebook then after the 10 it would just reload and get the random website again. The problem im having is i cant get "Some Website" to open in the popup for a few seconds before the reload. This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=349353.0 I've got here a code.. So basically this code is for deleting.. i want to set a Confimation popup box With yes or no.. then' When the user click yes, it will redirect to the next page. and if its a no. it would be at the same page. Here's my code. Code: [Select] <form name="formnew" method="post" action="valdelsec.php"> <?php $host="localhost"; $username="root"; $password=""; $db_name="dbsection"; $tbl_name="sections"; mysql_connect("$host", "$username", "$password")or die("cannot connect"); mysql_select_db("$db_name")or die("cannot select DB"); $sql="SELECT * FROM $tbl_name"; $result=mysql_query($sql); $count=mysql_num_rows($result); echo '<select style="position:absolute; top:307px; left:302px; width: 254px; height: 21px; font-size:10px;" name="section" onChange="this.name">'; echo "<option size =30 selected>Select</option>"; if(mysql_num_rows($result)) { while($row = mysql_fetch_assoc($result)) { echo "<option>" .$row['Sname']. "</option>"; } echo "</select>"; } else { echo "<option>No Section Present</option></select>"; } ?> <div id="apDiv11"><input type="image" src="images/delete.png" name="Image9" width="170" height="35" border="0" ></div> </form>.. Hoping for your help.. thanks! I am looking for someone that would be willing to provide the code for a message box that will popup after a PHP file upload completes. It will simply display a message stating that the upload is complete. Thank you in advance for your assistance. Im having a problem in popup box.. i made a checkbox in a loop.. then after a success loop ive set a code for a popupbox. Code: [Select] echo '<script type="text/javascript"> {alert("Rejected!");} </script>'; But when a user checked 2 check boxes.. it would also popup a 2 popup box.. How can i make my code only popup once even if it selects multiple checkboxes? Trying to get popup window to work in php. Keep getting template parse errors. Here's the code I've been using in HTML: Code: [Select] echo ' <a onClick="window.open('annexplayerpop.shtm','popup','height=275,width=425,top=130,left=280,scrollbars=no')" target="popup"><img src="popupbutton-blue-bg.png" title="Popup MP3 Player" border="0" height="45" width="58"></a> '; This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=352864.0 Hi all, i was wondering how to make a box popup when a new message has appeared in my table i know its javascript for the box but im not sure on how to make popup when theres a new message, any ideas? This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=352201.0 $looponce = 1; foreach ($this->info as $k => $v) { if ( (($k == 'subject') && ($v['required'])) && (!$this->settings['customSubject'])) { for ($i = 0; $i <= 0; $i++) { $output[] = $this->display_errors('error_system_subject'); } } if ( (($k == 'name') && (!$v['required'])) || ((!array_key_exists("name", $this->info)) && ($looponce == 1)) ) { $output[] = $this->display_errors('error_system_name'); $looponce++; } } That is my loop that i check things in. What i'm more interested in is the name if statement. If currently checks for a name key in an array(below) and makes sure that it is set to required. If it's not set to required, print out a system error and die()'s. I'm looking for ways to remove the need for program errors and just change them to what is needed to run. What i know how to do is, get into the inner array, what i don't know is how to edit the data and put it back exactly as it was given to me. The inner array data can be put back in any order, but the outer array must be in exact order as it was given. above code $this->info = $formdata; $formdata = array( 'name' => array('name'=>"Full Name", 'required'=>false, 'type'=>'text'), # This needs to be required=>true, but i can't trust the user, which is why i have the error. 'telephone' => array('name'=>"Telephone", 'required'=>false, 'type'=>'phone'), ); Any help is greatly appreciated, also am i doing the foreach loop in the code above in an efficient manner or is there another way? Hi there, As the question says i tried several things but i can't work it out and my knowledge about php isn't that well. This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=317537.0 I need help with my webpage here, how do you get so if you are at http://www.blabla.com/account.php and then click on a photo, it will go to www.blabla.com/photo.php?id=1 but still be at account.php? Just like facebook shows their photos. I dont know how to think nor to get it work. Would appreciate some help! ThNXX 1n 4dv4nc3 // Machram! |