Joke Collection Website - Public benefit messages - The information in php is published successfully and jumps out of the JS prompt box code.

The information in php is published successfully and jumps out of the JS prompt box code.

PHP pop-up JS prompt box sample code:

& lt? Server-side programming language (abbreviation of professional hypertext preprocessor)

header(“Content-type:text/html; charset = utf-8;” );

$ conn = MySQL _ connect(“localhost”、“root”、“root”);

If (! $ conn ){

Die ("Database connection error. MySQL _ error());

}

MySQL _ select _ db(“test“);

$ SQL =“insert? Become? Table (id, name) value (1,' chinawinxp') ";

$ int = MySQL _ query($ SQL);

//Information added or published successfully.

if($ int ){

$msg= "Information released successfully! “;

Echo? ("< script? type =‘text/JavaScript‘& gt);

Echo? ("alert" ("{$ msg}"); “);

//url jump

Echo? (“location . href =‘test . PHP‘; “);

Echo? (“& lt/script >);

}

& gt operation effect: