I am trying to use some php (SellerDeck 2016) to check if a file exists on the server
We manage the site content from an import feed that does not have images so we plan to load images manually to a folder and name them using the product reference and the section name
Then ask the code to check if they exist, if they do display them and if not we will either leave blank or add a default image.
But first I need to get the php working.
I have tried various adaptations of the code and always seem to get an error
"Parse error: parse error in main on line #"
Tried it with absolute, relative and full URLs
Also with single and double quotes round the image variable
As you can see at the moment, to keep it simple, I am just looking for a result to the if statement - the image display should not be an issue.
Must be something simple here that I am missing.
Thank you in advance....
We manage the site content from an import feed that does not have images so we plan to load images manually to a folder and name them using the product reference and the section name
Then ask the code to check if they exist, if they do display them and if not we will either leave blank or add a default image.
But first I need to get the php working.
I have tried various adaptations of the code and always seem to get an error
"Parse error: parse error in main on line #"
Tried it with absolute, relative and full URLs
Also with single and double quotes round the image variable
Code:
<actinic:block php="true" > $manufimage = "http://www.sellerdeck-upgrade.truska.co.uk/acatalog/manuf-logos/<actinic:variable name="SectionName" />.png" encoding="perl" />" ; echo $manufimage ; if (file_exists($manufimage)) { echo "File Exists" ; } else { echo "File Does NOT Exist" ; } </actinic:block>
Must be something simple here that I am missing.
Thank you in advance....
Comment