Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $npic= $_POST['picnum'];
- $id =$npic;
- //$id= 2;
- //$a = 1;
- $username = "root";
- $password = "";
- $host = "localhost";
- $database = "test";
- @mysql_connect($host, $username, $password) or die("Can not connect to database: ".mysql_error());
- @mysql_select_db($database) or die("Can not select the database: ".mysql_error());
- if(!isset($id) || empty($id)){
- die("Please select your image!");
- }else{
- $query = mysql_query("SELECT image FROM tbl_images ");
- $row = mysql_fetch_array($query);
- $content = $row[2];
- header("Content-type: image/jpg");
- echo $content;
- }
- ?>
Add Comment
Please, Sign In to add comment