Jump to content

Recommended Posts

I'm stuck on this code:
 <div class="gallery"><?php $images = glob(FOLDER A); foreach ($images as $i) { printf("<img src='FOLDER A...'>"); } ?></div>

https://code-boxx.com/simple-php-image-gallery/

What needs to be replaced in "FOLDER A" do I need forward slashes? ("/")

 

Tutorial here:

 

https://code-boxx.com/simple-php-image-gallery/

When people are using tutorials to try and create PHP based features, there are pitfalls, the potential for misunderstandings and the possibility of error.

We need to see what your actual code is.  The only exception is in the case of passwords, keys etc.  Those should be replaced.   So we would need to see your code and the actual path you used in your code.

The operating system, hosting location etc, is also important information in many cases.

It sounds like you have error turned off at present, and for development, errors need to be turned on, so you can see what they are.  It looks like your code has one or more errors in it, and that is why you are getting a blank page, but if errors are turned off, you can't see what the error message is.

First, your two includes at the top and bottom of the page are not within correct PHP tags. Need a ? before the starting PHP.

The DIV in your code is in the HTML source, but there is nothing within it. That would seem to indicate that there was no content in the $images array. I'm guessing that the path you provided to the glob function is not correct. Where is the 'photography' folder in relation to where the php file is being executed?

 

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.