Jump to content

Filepaths not working


Nodral

Recommended Posts

Hi

 

I've a directory structure which is root/web/dir1/dir2/dir3/sitefiles.php and root/tmp/tempfile.jpg

 

Within sitefiles.php I have greated an image file and saved it successfully as tempfile.jpg.

 

However, when I then try to call it back and include it in an HTML output from another script within dir3, I get an error saying it can't be found.  I have used exactly the same file path and I'm completely stumped as to why it's falling over.  Any ideas?

 

 

Link to comment
https://forums.phpfreaks.com/topic/245487-filepaths-not-working/
Share on other sites

Create file - This works fine

 

$filename="/home/httpd/vhosts/xxxxxx.co.uk/tmp/line_all".$identify . $_SESSION['USERID'] . ".jpg";
include"graph.php";

 

graph.php creates the jpg and saves to $filename.

 

<table id="line"><tr><td id="border"></td><td id="top">It is recommended that you complete the questionnaire periodically to monitor if your Learning Style is changing over time.<br><br>
The chart below shows the development of Learning Styles over a period of time and should help you to adjust to any changes you have experienced</td><td id="border"></td></tr><tr><td id="border"></td><td id="bottom"><img src="<?php echo "/home/httpd/vhosts/xxxxxx.co.uk/tmp/line_all".$identify  . $_SESSION['USERID'] . ".jpg"; ?>" width="500" height="500"></td><td id="border"></td></tr><tr></table></p>

 

This is the output code, which cannot find the image flie which has saved successfully.

The file permissions get set to 777 in graph.php

Cheers for that

 

I've read the information in the manual, but this describes how to prepare to download a file, rather than insert into an HTML page.

 

I'm not the best with headers etc.

 

Can someone help me with how to use the readfile() function.

 

As in previous posts, I have some image files I have created and saved which I need to load into the page.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.