Jump to content

Code help on Schedules List


AspireFSX.com

Recommended Posts

Hi

When we create a schedule with the FSX in-built flight plan utility, we submit the .PLN file to admin and this is stored in a folder on the webspace. Now, when a pilot goes to view the schedules, we check the flight number to see if there is a matching .PLN file for it.

If we have it, we put PLN File in the column on the right above Details etc.

I want to use the4 If ... Then to place a link to the file that the user can right-click and save to prevent them having to look for all the points in the plan but i can't stop the error message thqat an unexpected < has been found ...

if (file_exists($filename)) {

<a href="<?php echo url('/plns/'.AVA'.$padded_route.'.PLN');?>"PLN File</a><br />;

echo '<br />';

}

?>

That is the If ... Then - can anyone please educate me as to what is wrong with my piece of code ... i think it may be a mix of " and ' or that it is inside { } so may need to be written totally different ...

Outside of the { } it works fine.

Thank you for your help :)

Rgds,

Stuart Watson

Community Founder

http://aspirefsx.com

Link to comment
Share on other sites

Thank you Tom

It did indeed give me a proper path the the file, but sadly it seems that pjp is trying to run the file thru itslef, in so far as when I hover over it gives me http://aspirevirtualair.com/index.php/plns/AVA00008.PLN then the error on clicking that module plns does not exist which is the folder name where the plans are stored.

It is as if i need a special php command that says "this is a link to a downloadable file not something to be run thru the php itself"

Could you help me on that pls? or point me to a reference I can read?

Thank you,

Stuart

Link to comment
Share on other sites

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.

Loading...
×
×
  • Create New...