Random image script problems

software development

#1

Hi,

I just switched to Dreamhost from another service. I am having luck with most of my scripts and web apps, but one little script is giving me some problems.

It is a random image script, rid.php, you call the script with the image tag, the script then randomly selects an image from its location directory and displays it. This was working perfectly at the previous host, but I cannot get it to work here. When it is placed inside a page and called it does not display, see my test page set up here, (as you can see the image is not loading)
http://paintbox.org/includes/random.php

But if the script is called directly it does work
http://paintbox.org/includes/main_images/rid.php?pic=random1

You can see the script is here
http://paintbox.org/includes/script.html

and here is the site and working example from the developer
http://www.bezveze.com/skripte/rid/

I am thinking that there may be some differences in the way php is set up or handled. I am wondering if there is something in php5 that may be hindering this.

Any advice is welcome.

Thanks


#2

The link you provided seems to be working fine for me. That being said, you may want to check if you are using PHP4 or PHP5. If your domain is set to run as PHP5, you will need to change this line of the script:if (isset($HTTP_GET_VARS["pic"])){header ("Location: $slika");}to this:if (isset($_GET["pic"])){header ("Location: $slika");}
si-blog
Max discount on any plan with promocode SCJESSEYTOTAL


#3

after I posted the links I realized I put the wrong domain. I have updated the links.

That said, the links that did work were on a php4 setup and the ones that do not are on php5.

I will give your suggestions a try. Post back momentarily.

Thanks


#4

Fantastic.

I changed out the line and it now works perfectly.

Thanks


#5

That’s awesome. The DreamHost Wiki has more on this issue in case you encounter similar problems later on.

si-blog
Max discount on any plan with promocode SCJESSEYTOTAL