Forum Moderators: coopster

Message Too Old, No Replies

Simple variable problems

         

bigglejones

8:16 am on Jul 8, 2005 (gmt 0)

10+ Year Member



I have switched servers, and now a script I had that worked on my old one does not work on the new one.

I am currently running 4.3.11

Problem 1:

Code:

<?
if(!$size) {
$size = "100x133";
}
if(!$day) {
$day = date("j");
}
if($day<10) {
$day = "0$day";
}
else {
$day = $day;
}
header("Location: thumbs/$size/tn$day.jpg");
?>

I have multiple folder sized setup, but 100x133 is obviously the default. But whenever I try viewing one of the other sizes, it always shows the default 100x133 image even though there is a 160x160 thumb.

Problem 2:

Code:

<?
if($ccbill) {
$url = "http://refer.example.net/cgi-bin/clicks.cgi?CA=927022&PA=" . $ccbill . "&HTML=http://www.example.com";
}
else {
$url = "http://www.example.com";
}
?>

I place the variable code (ccbill) at the end of this url: http://www.example.com/potd/index.php?ccbill=999999

...this a href should show up on all the links ( <a href="<? echo("$url");?>"> ):
[refer.example.net...]

...but it will not recognize the variable and always points to the default http://www.example.com (same as the problem with the thumbs above..only goes to the default)

any help would be awesome...I can explain further if needed. Thanks in advance

[edited by: coopster at 1:19 pm (utc) on July 8, 2005]
[edit reason] removed url per TOS [webmasterworld.com] [/edit]

buriedUnderGround

12:13 pm on Jul 8, 2005 (gmt 0)

10+ Year Member



I would suggest that you ask your new hosting provider if "register_globals" is set to OFF. This is very likely to be the cause of your problem.

ergophobe

5:11 pm on Jul 8, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You can check for the register globals setting quite easily without asking your provider just by creating a script with

phpinfo();

in it. That will output everythin you need to know.

bigglejones

8:57 pm on Jul 8, 2005 (gmt 0)

10+ Year Member



Thanks so much for the help..thats exactly what the problem was.

coopster

9:21 pm on Jul 8, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Nice catch folks.

Welcome to WebmasterWorld, bigglejones.