have proplem with image path

Links for php scripts

Moderators: macek, egami, gesf

New php-forum User
New php-forum User
Posts: 4
Joined: Wed Dec 01, 2010 6:33 am

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.

mysql_connect("localhost", "root", "") or die ('could not connect to mysql server' . mysql_error());
mysql_select_db("pdf") or die("Could not select database");

//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'];
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');


Return to “PHP Scripts”

Who is online

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