php-includes folder

I am not seeing my images that i put in my includes folder.

this is above my <!DOCTYPE HTML>
<?php include('includes/title.inc.php');
      include('includes/ci_images.inc.php'); ?>

Open in new window


this in my body of my text
    <div id="pictureWrapper">
    <img src="<?php echo $selectedImage; ?>" alt="ci images" class="picBorder" />
      <?php echo $imageSize[3]; ?>
	 <p id="caption"><?php echo $caption; ?></p></div><?php } ?>

Open in new window


my  include file:
<?php
$images =array(
array('file' =>'movieCover1a',
      'caption' =>'the cover of the movie'),
array('file' => 'fence1a',
      'caption' => 'new jersey shooting'),
array('file' => 'keith1a',
      'caption' => 'secene at the jedi'),
array('file' => 'FilmCamera',
      'caption' => 'our filmcamera'),
array('file' =>'movieCover1a',
      'caption' =>'the cover of the movie'),
array('file' => 'fence1a',
      'caption' => 'new jersey shooting'),
array('file' => 'keith1a',
      'caption' => 'secene at the jedi'),
array('file' => 'FilmCamera',
      'caption' => 'our filmcamera'),
	  );
$i = rand(0, count($images)-1);
$selectedImage = "images/{$images[$i]['file']}.jpg";
$caption = $images[$i]['caption'];
if(file_exists($selectedImage) && is_readable($selectedImage)){
	$imagesSize = getimagesize($selectedImage);
}
?>

Open in new window

imagekrazyAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Marco GasiFreelancerCommented:
What is your directories tree structured? Have you something like root/includes/images?
0
Chris StanyonWebDevCommented:
The images will be loaded from the images folder under where your HTML page is, not from the includes folder.
0
imagekrazyAuthor Commented:
Sorry I should made my self more clearer , I loaded the images in the image folder, and the structure on my live  server side is:  test folder within that images folder and includes folder and css folder

When I load it to local browser  i see  it, but when i load it to my live server I don't see the  right format.
0
Build an E-Commerce Site with Angular 5

Learn how to build an E-Commerce site with Angular 5, a JavaScript framework used by developers to build web, desktop, and mobile applications.

Marco GasiFreelancerCommented:
So you have

test
    |_images
    |_includes
    |_css

"I don't see the  right format": what are you meaning? Aren't them jpeg images?
0
Chris StanyonWebDevCommented:
Load up your page and have a look at the source of it. Are the image names being injected into your HTML document and you're just not seeing them (maybe a 404 error) or are the images names (and maybe captions) not showing up correctly.

We need to figure out whether this is a PHP error, a path issue or simply some missing files!!
0
imagekrazyAuthor Commented:
yes they are jpeg in the images folder

and yes the tree structure is test folder--> images, includes, css and of course the index.php
0
Chris StanyonWebDevCommented:
Something else to consider. Turn on error reporting in your PHP scripts

error_reporting(E_ALL);
ini_set('display_errors', 1);

Open in new window

I just spotted an error. In your include file you have this:

$imagesSize = getimagesize($selectedImage);

but in your HTML file you have:

<?php echo $imageSize[3]; ?>

Note the spelling : $imageSize | $imagesSize
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
imagekrazyAuthor Commented:
I loaded it ,no errors.. and the footer and menu include files worked.
0
Chris StanyonWebDevCommented:
Let's see a link to your live page
0
imagekrazyAuthor Commented:
Thank you , I corrected the misspelling, and it worked:)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.