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
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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.