cancel
Showing results for 
Search instead for 
Did you mean: 

Web building issues

Community Veteran
Posts: 1,236
Registered: ‎02-08-2007

Web building issues

I am building a site and need to create a simple option to toggle between two images at the bottom of a page. I am using php to do this. Could someone help me as what I am doing works perfectly in Netscape/Mozilla but IE completely ignores the bookmark in the URL. I read on another forum that the way I am formating the URL is correct:
example.com/testpage.php?img=example#bottom
It works fine in Netscape but IE ignores the "#bottom" and just jumpes to the top of the page.
8 REPLIES
Community Veteran
Posts: 1,576
Thanks: 3
Registered: ‎13-04-2007

Re: Web building issues

This is more complex than you may think. First we dont know exactly what you are doing does the user press a button or is it based on username.
Secondly are you using a style sheet?
You could use something like this
<?
$img="example.gif";
header ('content-type: image/gif');
readfile($img);
?>
Display image here
<img src="example.php" >
There is a 1px bug in IE which gives the problem see http://www.pmob.co.uk/temp/onepxgap.htm
All so using CSS can throw it into confusion like setting the bottom margin to big and it then hides the picture.
You could create a bookmark and try using that to  position the picture.
Give us more detail.
Community Veteran
Posts: 1,236
Registered: ‎02-08-2007

Re: Web building issues

You are right. It is a lot more complicated than I thought. I have now discovered a bigger problem whereby the images are not displayed at all on a Linux server. (I asume this is due to permissions but have no idea how to fix it). The images are displyed when served by my Windows testing server (Apache 2) but not on my Linux server (also Apache 2) nor when tested on what will be the final server. This is obviously a bigger problem than the original.
I will do something I probably shouldnt and post the address to the page where it is currenly under construction as this will give you a clear idea of what I am trying to do.
Windows server:
http://www.seanbranagh.ie:75/thebelfry/roomhire/?img=meeting_room
Linux server:
http://www.seanbranagh.ie/thebelfry/roomhire/?img=meeting_room
Community Veteran
Posts: 1,576
Thanks: 3
Registered: ‎13-04-2007

Re: Web building issues

A very quick look on one page the properties for the big pictures are img/.jpg on the other they are img/kitchen.jpg that was saving your source code and putting it into Frontpage.
You really need to use AJAX as you refresh the whole page when you click which isnt good. The other way is to use layer and set the properties on the images to swap images or hide unhide layers which have the big picture in it..
What software are you using to create it so I can maybe tell you what to do? If you are using Frontpage look at behaviors for the link on the small images and there is a script for swap images
Community Veteran
Posts: 1,236
Registered: ‎02-08-2007

Re: Web building issues

Quote from: samuria
A very quick look on one page the properties for the big pictures are img/.jpg on the other they are img/kitchen.jpg that was saving your source code and putting it into Frontpage.

I noticed that with the source. That is because the Linux server is not executing the php but the Windows server is. The Linux server runs php fine for other things which is why I am baffled. The actual code on the page looks like this <img border="0" src="img/<?=$img;?>.jpg"> and has worked fine for me on another site in the past on Plus Net's ccgi server although I do not use that now.
I am using Dreamweaver 8 and would be interested in a better way to do this although still curious about why this does not work.
For the moment I am just going to change it to 1 static image as the site has to be online tommorrow and I have other bits to finish off.
Thanks for any help.
john
Newbie
Posts: 7
Registered: ‎30-07-2007

Re: Web building issues

Is Register Globals enabled on both servers?
http://uk3.php.net/register_globals
Try using <?=$_GET["img"];?> instead.
Community Veteran
Posts: 1,236
Registered: ‎02-08-2007

Re: Web building issues

Quote from: JohnMo
Try using <?=$_GET["img"];?> instead.

That worked perfect. Thankyou. Now just need to resolve the original problem whereby IE ignores the bookmark in the URL and jumps back to the top of the page despite Netscape working perfectly.
Community Veteran
Posts: 1,576
Thanks: 3
Registered: ‎13-04-2007

Re: Web building issues

There is a lot better way of doing this when yours works it refreshes the whole page which is a pain. I have worked it out for you see
http://www.crewetown.co.uk/pictest.htm 
to see it working it uses layers and when you click on the picture it hides one lay and makes the one below visible so it doesn't refresh the whole page very simple to set up. If you look at the page and view source and then save it to you hd open it and change the picture names(or copy the pictures) you should see it working then add it to your page.
I essence you create 4 layers 2 for the 2 big image which are on top of each other and 2 more for the small pictures. On the properties of the small picture you set the behaviors so on mouseclick one layer is hidden and the other becomes visible.
I would get the new dreamweaver as there is a lot of new stuff in it and you can now view it live without opening a browser. You can get a 30 day trail free from adobe
Community Veteran
Posts: 1,236
Registered: ‎02-08-2007

Re: Web building issues

Thanks for taking the time to do this. I have saved the page. It is definitely a lot better. I will leave it until later in the week, maybe tommorrow to change it as I am currently finishing up the last bits of the site. I have to email the people concerned to make sure they are happy so it can go online tommorrow evening as planned.
I will report back when I have changed that page. The site will be at its own address by then which is www.thebelfrynewcastle.com
As for new stuff in Dreamweaver I am still trying to get my head round the existing features after using it for years! I personally prefer not to use a live preview within the software. I always have my second monitor and my laptop displaying the page I am currently working on (One using Netscape and the other IE) being served from my Winows server onto which the page is being built directly. That way as I save little bits I just refresh the pages to see the result in both browsers. It allows me to spot straight away if something does not behave the same in the different browsers.