Hi,
I want to make a site where the user can "adopt" an image and have their own URL for each image, but the image would change varying on how many "clicks" they are given (which I already made, so that the number of "clicks" gets added by one every time some one visits.)
There were no error given, but it doesn't display my image
I want the link in the end become /image.php?id=1 (or something similar)
This is my source code:
If you can, could you make the change adaptive to mine so it looks like it's been altered, so I could see what my mistakes are. Thanks! :)
I want to make a site where the user can "adopt" an image and have their own URL for each image, but the image would change varying on how many "clicks" they are given (which I already made, so that the number of "clicks" gets added by one every time some one visits.)
There were no error given, but it doesn't display my image
I want the link in the end become /image.php?id=1 (or something similar)
This is my source code:
Code:
<?php
include 'config.php';
$id = $_GET['id'];
if($id != "" && $id != "0"){
if(is_numeric($id)){
if(abs($id) != $id) {
}
$query="SELECT * FROM owned_adopts WHERE aid='$id'";
$result=@mysql_query($query);
$num=@mysql_numrows($result);
//Loop out code
$i=0;
while ($i < 1) {
$oid=@mysql_result($result,$i,"oid");
$clicks=@mysql_result($result,$i,"clicks");
$i++;
}
$query="SELECT * FROM adopts WHERE nid='$oid'";
$result=@mysql_query($query);
$num=@mysql_numrows($result);
//Loop out code
$i=0;
while ($i < 1) {
$begin=@mysql_result($result,$i,"begin");
$image=@mysql_result($result,$i,"image");
$mclicks=@mysql_result($result,$i,"mclicks");
$i++;
}
if($nid == $oid){
if($mclicks > $clicks){
}
else if($mclicks < $clicks){
header("Content-type: image/PNG");
echo $image;
}
else if($mclicks == $clicks){
}
else { }
}
else { }
exit();
}
else { }
}
else { }
?>
Comment