0
<?php
mysql_connect("x","y","z!") or die("Could not connect");
mysql_select_db("x") or die("Could not connect");

$output = '';
// Collect 
if(isset($_POST['search'])) {
    $searchq = $_POST['search'];

    $query = mysql_query("SELECT * FROM uni_slider WHERE slider_name LIKE '%$searchq%' OR slider_image LIKE '%$searchq%' OR slider_price LIKE '%$searchq%'") or die("Could not search");
    $count = mysql_num_rows($query);
    if($count == 0){
        $output = 'There was no such results';
    }else{
        while($row = mysql_fetch_array($query)) {
                $name = $row['slider_name'];
                $image = $row['slider_image'];
                $price = $row['slider_price'];


                $output .= '<div class="output">'?><img src="/upload/<?php echo $row['slider_image'];?>"><?php <br/> '.$name.' <br/> '.$price.' <font color="#2ecc71">$</font><br/></div>;
        }
    }
}
?>

This is my code, now the output part doesnt work. If I make the code like this

$output .= '<div class="output> '.$image.' <br/> '.$name.' <br/> '.$price.' <font color="#2ecc71">$</font><br/></div>';

It only shows me the image file name, not the image.

I've tried `"> but it gives me erros, any help ? Thanks


Quahogz
  • 1
  • 3

1 Answers1

-1

Extremely simple, you forgot the close output It should be <div class="output"> then change the /upload/ to a symbolic link inside the web root directory, you cannot just put /something as apache will not be able to process it. if you say ln -s /upload uploadlink that could work if you have shell access

Forbs
  • 1,256
  • 1
  • 7
  • 9
  • Yes but that is not my question. How do I make it to show the actual image not the image file name. – Quahogz Oct 31 '17 at 22:42
  • I get "26183_banner2.jpg" not the actual image – Quahogz Oct 31 '17 at 22:43
  • Well because you had layered issues, it wouldn't have worked. Now the next issue is you are trying to go to the upload directory from a `/`, you can't do that in webservers. You need to make a symbolic link inside the directory and then link it. Do you have access to the shell? – Forbs Oct 31 '17 at 22:44
  • Yes I do have access – Quahogz Oct 31 '17 at 22:48