Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $db = mysqli_connect("localhost","terrahexp","","terrahexp");
- $sql = "SELECT * FROM pics ORDER BY `Random` LIMIT 1;";
- $sth = $db->query($sql);
- $result=mysqli_fetch_array($sth);
- echo "<!DOCTYPE html>";
- echo "<head>";
- echo "<title>".$result['ID']."</title>";
- echo "</head>";
- echo "<html>";
- echo '<link rel="icon" href="icon1.ico" type="image/x-icon"/>';
- echo '<link rel="shortcut icon" href="icon1.ico" type="image/x-icon"/>';
- echo "<body>";
- echo '<img src="data:image/jpeg;base64,'.base64_encode( $result['Data'] ).'"/>';
- echo "</body>";
- echo "</html>";
- $sql = "UPDATE pics SET `Random`=RAND()*1000 WHERE `ID`='".$result['ID']."';";
- $sth = $db->query($sql);
- die();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement