PDA

View Full Version : confused with this php script



jakey,,
14-02-2014, 10:49 PM
Okay i am very puzzled here ... when i go on my page http://www.habbopfm.co.uk/#/content/scam and click view scam profile ...

it keeps bringing up jaylifa's scam profile instead of seperate one's for .dependant and jaylifa, asif it's a static id ... yet my code below should work.


<?php
error_reporting(0);
require_once( $_SERVER['DOCUMENT_ROOT'] . "/staff/_inc/glob.php" );
$q = $db->query( "SELECT * FROM `scam_list` ORDER BY `id` DESC" );
?>

<p>These are the people who have have scammed in the casino royale on habbo.com</p>
<center>
<?php

while( $items = $db->assoc( $q ) )
{
$url = "_frontend/{$items['id']}-";
$url = "staff/_frontend/view.php?id={$items['id']}";
echo "<div style=\"margin-left: 5%; float:left; width:25%; text-align:center;\"><center>";
echo "<img class=\"tooltip\" title=\"I am{$items['name']}, i scammed {$items['quantity']}<br>off the user {$items['victim']}. This got me removed by {$items['removedby']} at the casino royale.\" src=\"http://www.habbo.com/habbo-imaging/avatarimage?user={$items['name']}&action=std&direction=3&head_direction=3&gesture=sad&size=m&actio
\" />";

echo "<br />";
echo "<span class=\"habboname\">{$items['name']}</span>";
echo "<br/><a id=\"scamprofile\" class=\"fancybox.ajax\" href=\"#\">View full Scam Profile</a>";

echo "</center></div>";

}
?>

<script type="text/javascript">
jQuery(document).ready(function() {
jQuery("#scamprofile").fancybox({
maxWidth : 400,
maxHeight : 400,
fitToView : false,
width : '60%',
height : '60%',
autoSize : true,
closeClick : false,
href : '<?php echo $url ; ?>',
scrolling : 'no'
});
});
</script>

</center>
<div style="clear:both;"></div>

Does anyone have any ideas why this is just making it pull up http://www.habbopfm.co.uk/staff/_frontend/view.php?id=3 and not seperate ones for each profile?

Blinger
15-02-2014, 03:55 AM
Because it is echoing a static code. Go to http://www.habbopfm.co.uk/content/scam.php#scamprofile and view the source, it says href : 'staff/_frontend/view.php?id=3 . You need to make it so that isn't static. I am a simple man, so I would have something like you do with your Rare Values script where when you click on the picture it loads the next page.

edit:

something like this - this is untested and all I've done is add a hyperlink to the image of the Habbo. Also maybe it's worth finishing the picture URL off, not just end it with "&actio".




echo "<div style=\"margin-left: 5%; float:left; width:25%; text-align:center;\"><center>";

echo "<a href=\"$url\"><img class=\"tooltip\" title=\"I am{$items['name']}, i scammed {$items['quantity']}<br>off the user {$items['victim']}. This got me removed by {$items['removedby']} at the casino royale.\" src=\"http://www.habbo.com/habbo-imaging/avatarimage?user={$items['name']}&action=std&direction=3&head_direction=3&gesture=sad&size=m&actio\" /></a>";

Okay, it doesn't display the formatting for me. Sorry.

Want to hide these adverts? Register an account for free!