Board index   FAQ   Search  
Register  Login
Board index PHP PHP Scripts

have proplem with image path

Links for php scripts

Moderators: macek, egami, gesf

have proplem with image path

Postby HUNDU » Thu Oct 31, 2013 2:31 am

please, i have two web application inside htdoc fold, that TRUSTFUND AND TRUSTFUND2.
I want to access images in TRUSTFUND FROM TRUSTFUND2.
But it is not working.
Thanks.

<?php
mysql_connect("localhost", "root", "") or die ('could not connect to mysql server' . mysql_error());
mysql_select_db("pdf") or die("Could not select database");
$pin=$_GET['id'];


//echo $pin;

$query = mysql_query("SELECT * FROM pdf2 where id='2'") or die(mysql_error());
while($row = mysql_fetch_assoc($query))
{
//$file1='images2/ATRUSTFUND_ADEKOGBE STELLA OLOLADE-200490936118.pdf';
$file = 'localhost/trustfund2/images/'.$row['path'];
if(!$file){
echo "file";
}
$filename = $row['path'];
}

header('Content-type: application/pdf');
header('Content-Disposition: inline; filename='.$filename.'');
header('Content-Transfer-Encoding: binary');
header('Content-Length: '.filesize($file));
header('Accept-Ranges: bytes');

@readfile($file);
?>
HUNDU
New php-forum User
New php-forum User
 
Posts: 4
Joined: Wed Dec 01, 2010 6:33 am

Return to PHP Scripts

Who is online

Users browsing this forum: Google [Bot] and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron