Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PHP question - how to detect if file exists?


Aldar

Recommended Posts

Hi! This my first post :)

 

I searched for contribution to display more (and arbitrary) product images in product_info.php. It seems all these contributions altering database (or coding extra static HTML for each product, which seems too complex way for me).

 

My idea is add some PHP code in product_info.php. This code must look for product picture, for example product_id_1, product_id_2, product_id_3 etc and display them IF such image file exists.

 

Since I'm starting PHP programmer (but experinced application developer :)), I don't know how to detect in PHP if some particular file exists?

 

Thanks, Aldar

Link to comment
Share on other sites

You woud use

if (file_exists ( $imagename )

Although if you are planning on using oscommerce, you need to come to grips with contributions. Installing the MoPics contribution will give you code that is much more versatile than what your are atempting to do.

 

Jack

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

You woud use
if (file_exists ( $imagename )

Although if you are planning on using oscommerce, you need to come to grips with contributions. Installing the MoPics contribution will give you code that is much more versatile than what your are atempting to do.

 

Jack

 

Thanks, Jack!

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
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

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