Simple PHP script - need help

OK, I’m building a site and have been doing all of my testing on a local XAMPP web server. Everything has been working fine, but when I uploaded my site to test on Dreamhost one of my PHP pages broke and I can’t figure out why. It’s a very simple thing and I’m assuming it has to do with the PHP Extra Web Security enabled for that domain.

What I’m doing is having a gallery page where the blown up image appears in an iframe. The page I’m loading into the iframe (image.php) is a simple php page that takes the variable $pic as the name of the image to load. It also takes the variable $pictext as a string to describe the image and $link as a condition to see if there is a larger size of the picture.

Now, what’s totally broken is that when I load the gallery there is nothing showing up on that iframe page. I have checked and it is loading the image.php into the iframe, it’s just not showing any image or text. I have tried loading the image.php as it’s own page (outside of the iframe) and it’s still broken. So, here is the code for the image.php page.

Gallery picture --snipped style definitions that have no bearing on this problem--

–OK, here is my php. The whole “if large” condition is just checking to see if there is a link to a larger image–

<?php if($link ==large){ $size = getimagesize('images/'.$pic.'_lrg.jpg'); echo 'Click the image for a larger view'; echo '
'; echo $pictext; }else{ echo '
'; echo '
'; echo $pictext; } ?>

Pretty simple page right? But when I call this page in it’s own window using “image.php?pic=test” I get nothing in the source where the pic variable should be echoed. It just comes out as . So, this is why I’m assuming it’s the extra web security setting. If so is there a new way I should passing variables? Or do I need to turn off extra security? Or am I missing something really stupid?

Many thanks in advance for any help you can provide. I didn’t want to include a link to our testing area since this seems like a simple enough problem, but if it’s necessary to fix the problem I will.

It looks like your script is relying on register_globals to be enabled. To get your variable from the query string, you must use the superglobal array variable $_GET. So $pic becomes $_GET[‘pic’] instead. You can consult this wiki page for more information.

si-blog | Keystone Websites
Save $97 on yearly plans with promo code [color=#CC0000]SCJESSEY97[/color]

Yeah, that did it. I’m self taught and not taught well enough :slight_smile:

Thanks for your help.