![]() |
PHP people... Quick question on why this no longer works...
This code used to work... Then my host upgraded my PHP and now it lo longer works... Pooh pooh!
Code:
if ($cmd == 'go' && ($url && $title && $blogs && $types))The variables $url, $title, $blogs and $types all are arrays. Again, this used to work yesterday.... Now it doesn't. PHP was 5.2.5 and is now 5.2.9. |
how is your blog network doing?
|
After their upgrade, did they get apache up and running properly?
A simple upgrade 'shouldnt' effect an already working script |
After upgrade everything else worked... except for this particular script. For some reason it doesn't return TRUE anymore. I believe it has something to do with the variables being arrays...
Blog network is going good. |
Did they enable safe mode when they upgraded?
|
they probably disabled register_globals :2 cents:
|
Ah... was a globals problem.
|
In case anyone is keyword searching, there actually is a backward-INcompatible change from PHP4.X to php5.X involving arrays.
In php5 If you don't explicitly declare a variable as an array and then later you try to use certain array functions on it (slice, splice, etc), it will not work. I learned this the hard way when I upgraded a dedicated box with a bunch of legacy php code on it. |
Quote:
|
Quote:
By the way.. If you ever want to source out your programming, I'd be interested in doing some of your stuff.. |
coding the phps
($url && $title && $blogs && $types)
that must be returning true why not maybe change to if($cmd == 'go' ){ if($url==true && $title==true && $blogs==true && $types==true){} } ? |
This thread makes my balls hurts.
If they are arrays you should first check to make sure that's indeed what they are. http://php.net/is_array Also, try using a switch instead of a null else or long ass if-elseif-else chain. http://php.net/switch I'm happy the code you posted here fails :error |
echo 'help me' . '<BR>' ;
echo 'help meeeeeeeeeeeeeeeeeeeeeeeeeeeeeee' ; |
Quote:
|
Quote:
|
Quote:
|
if ($_GET['cmd'] == 'go' && (($_GET['url'] && $_GET['title']) && ($_GET['blogs'] && $_GET['types'])))
Win. |
^ That's a fail, because it'd require the array to be passed via the url.
Unless you're assigning an array to $_GET, which in case would also be a fail. Plus you're still not checking to see if the variables are arrays. Wouldn't you want to do that before any processing occurs? |
I want to know what url, title, blogs, and types variable are part of so i can see the big picture. Wtf, does your script do.
|
Quote:
Quote:
Quote:
|
Quote:
|
This works. I'm not sure if it's proper for what you're doing or not, but maybe it helps.
Code:
$cmd=$_GET['cmd']; |
VooDoo, wtf you been up to lately man? good to see your still kickin.
|
Fucking geeks....
http://www.izzatz.com/images/geeks-tshirt-for-girls.jpg J/K I wish I knew php http://tornpaige.files.wordpress.com/2008/02/geek2.jpg |
Quote:
|
| All times are GMT -7. The time now is 02:39 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123