Solved

What's wrong with my PHP include?

Posted on 2008-10-14
7
312 Views
Last Modified: 2011-10-19
Hello,

At present to get images displaying on my site (www.globexposure.net/index.php) - i need to hardcode their markup in the MySQL database where i hold associated text. You can see this by clicking on the 'Norwich' (SE England) marker [pushpin > arrow > home icon].
The marked-up images are placed in a hidden <div> as follows:

<div class="hidden-container">
<a href="/travel_pics/72/Jess and Kate as Devils.jpg" class="highslide" onclick="return hs.expand(this, { thumbnailId: 'thumb1' })"></a><a href="/travel_pics/72/Peena and Elaine.JPG" class="highslide" onclick="return hs.expand(this, { thumbnailId: 'thumb1' })"></a>
</div>

Because i intend to have many pictures i have written a little PHP script to automate this markup, however, it's not working properly. You can see this by clicking on the airplane icon, also in 'Norwich'.
The marked-up images are placed in a hidden <div> as follows:

<div class="hidden-container">
<?php include ('./includes/travel_pic_thumbnails.php'); ?>
</div>

I have attached the PHP include FYI.
I have already asked this question, but the Expert is not responding (hope its OK to ask again):
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_23812047.html


Many thanks for your help



travel-pic-thumbnails.php.txt
0
Comment
Question by:Daniish
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
  • 2
7 Comments
 
LVL 6

Expert Comment

by:TheAnarchist
ID: 22717664
What happens? Do you get any error messages? Does the include simply not show up?
0
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 22717823
if you use the index.php to deliver the literal content of the DIV, as you showed above, does it work?  And if so, is it just the include file that is not working?  If so, check that PHP includes are turned on for the web hosting company that is hosting your site, they are not always turned on by default.
0
 

Author Comment

by:Daniish
ID: 22732585
OK sorry for the delay...i have contacted my web hosting company and they have confirmed that PHP includes are turned on - so this is not the problem!

As for 'What happens?' - the airport marker only displays the 1/1 image. If you click on it you aren't given the option to browse Previous/Next - as you are when you click on the home icon, which utiliises images from the same folder (1/3 images)...

So what do you think?
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Expert Comment

by:TheAnarchist
ID: 22736706
That IS bizzare...

If you're pulling images from the same folder, the only thing I could think of would be that pointer (the thing that designates where you are up to when cycling through the files) is at the end of that directory and is not resetting.

Using this code, are you able to pull images from two different folders? That is, one of those bubbles has pictures from Folder A, and the other bubble has pictures from Folder B?

It has to be an issue with the pointer, I can't think of anything else it might be...
0
 
LVL 44

Expert Comment

by:scrathcyboy
ID: 22736747
Everything you describe is working in FF2 and mozilla file.  Is this just an IE bug?  If so, it is only one of thousands.  Remember that google maps doesn't always work right with PHP, google has a whole set of built-in assumptions as to who will be running their maps, and how and from what platform.  The expanindg balloon for the airport works fine.
0
 

Author Comment

by:Daniish
ID: 22738662
Scrathcyboy - there seems to be some confusion - i'm only trying to get this to work in FF2 (its a personal website that i'm not intending/wanting anyone else to view - so no need for IE stability at this time)!

> Everything you describe is working in FF2

No it's not. The airplane marker has a photo and when you click on it, it says it's a 1/1 image - which means that the PHP include isn't picking up the rest of the images from the respective folder.


TheAnarchist - what can i do to confirm that it's an issue with the pointer?

Can either of you suggest a possible workaround....e.g. could the PHP include be written in Javascript (would this offer better stability)?

0
 

Accepted Solution

by:
Daniish earned 0 total points
ID: 22754250
Thank you all for help.

In the end, Ray Paseur helped me to identify the actual issue:
http://www.experts-exchange.com/Web_Development/Web_Languages-Standards/PHP/Q_23823234.html
0

Featured Post

[Webinar] Code, Load, and Grow

Managing multiple websites, servers, applications, and security on a daily basis? Join us for a webinar on May 25th to learn how to simplify administration and management of virtual hosts for IT admins, create a secure environment, and deploy code more effectively and frequently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

751 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question