Jump to content

Simple syntaxing issue with $_GET[variable]


phpchick

Recommended Posts

The code below works

        echo '<script language="javascript">'; 
echo 'top.location.href = "/breaking-news/bsnewsstorygoeshere/";'; 
        echo '</script>'; 

 

this also works

        echo '<script language="javascript">'; 
echo 'top.location.href = "http://anywebsite.com";';
        echo '</script>'; 

 

the problem, is I have a URL listed in a url variable that can be retreived via

 

$_GET['url']

 

my question is how to get that variable into the above code?

 

I've tried

 

 

        echo '<script language="javascript">'; 
echo "top.location.href = \"$_GET['url']\";";
        echo '</script>'; 

 

but that doesnt seem to work, can anyone advise?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.