How to call the variables in php in script?-php Tutorial

Source: Internet
Author: User
In script, how can I call the variables in php? the following shows how to call the variables in php in script: & lt ;? Php & nbsp; $ strbbbwww.163.com ;? & Gt; & lt; script & gt; function () {window. location. href & quot; $ strbbb & quot;} & lt; how to call the variables in php in scrip script, as shown below:
How to call the variables in php in script is as follows:

$ Strbbb = 'www .163.com ';
?>

Script
Function () {window. location. href = "$ strbbb ";}
Script

I could have been on the 163 website, but my website is $ strbbb. how can I change this? I am not a computer professional. I don't know much about this. please advise me.

------ Solution --------------------
Cannot be called! One client and one server!

But yes.
$ Strbbb = 'www .163.com ';

Echo "script"
Function () {window. location. href = \ "". $ strbbb ."\";}
Script ";

?>
I don't know!


------ Solution --------------------
$ Strbbb = 'www .163.com ';
?>

Script
Var aa =" ";
Alert (aa );
Script
------ Solution --------------------
$ Strbbb = 'www .163.com ';
?>

Script
Function () {window. location. href =" ";}
Script
------ Solution --------------------
PHP code
  
------ Solution --------------------
I don't know whether the above code has been tested!
Let alone others.
JScript code
Script var a = function () {window. location. href = "www.163.com";} a (); script
------ Solution --------------------
$ Strbbb = 'www .163.com ';
?>

Script
Function () {window. location. href =" ";}
Script

------ Solution --------------------
$ Strbbb = 'www .163.com ';
?>

Script
Window. onload = function () {window. location. href =" ";}
Script
------ Solution --------------------
If [http: //] is missing, you will be redirected to the "www.163.com" directory of your current website, which should be modified as follows:
$ Strbbb = 'http: // www.163.com ';
?>

Script
Window. onload = function () {window. location. href =" ";}
Script
------ Solution --------------------
Cannot handle this
Var location =' ';
If (location. indexOf (': //') =-1 ){
Location = 'http: // '+ location;
}
In this way, no jump will be made.
Change
Script
Function func (){
Window. location. href =' ';
}
Func ();
Script
To correct $ strbbb, you can
$ Strbbb = 'http: // www.163.com '; // It can also be www.163.com
?>
. Why use javascript?
------ Solution --------------------

Script
Var str =" ";
Script

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.