The Most Active and Friendliest
Affiliate Marketing Community Online!

“Propeller”/  Direct Affiliate

Parse error: syntax error

B

Bagi Zoltán

Guest
Hello everybody, i need a little help if you are my man. I keep on trying to create an if else relation in php, but all i get is a syntax error
Parse error: syntax error, unexpected '=' in

This is what i tried
PHP:
if ( $_SERVER["REQUEST_URI"] == $mosConfig_live_site/index.php?option=com_virtuemart&Itemid=26){
I think for some reason the script is unable to compare the two URLs, but have no idea why not.
Your help is highly appreciated!
Thanks anyhow
 
below is the correct version of your code fragment:

PHP:
if($_SERVER["REQUEST_URI"] == "$mosConfig_live_site/index.php?option=com_virtuemart&Itemid=26"){

... you need to add " to the start and " to the end of the value what you compare ...
 
complete debug block:


PHP:
if($_SERVER["REQUEST_URI"] == "$mosConfig_live_site/index.php?option=com_virtuemart&Itemid=26"){ print "hello 1"; }
else {print "hello 2";}
 
Misi, you are a magician, thank you very much i started to hack with parse_str ahhh...
Rep added:)
 
MI
Back