it ain’t even a string, it’s NULL because you assign a set of invalid characters. (strings are wrapped in ' (single quotation mark or apostrophe) or " (double quotation mark) not backticks (these are used in SQL).
but of course you can use PHP to print JS code…
Calling java script in PHP
Collapse
X
-
Its a string...
I am sorry..
So can i use java script in PHP?
Regards
Dheeraj JoshiLeave a comment:
-
-
$res is integer by the way.
So isnt there a technique to pop up a window in PHP code?
Regards
Dheeraj JoshiLeave a comment:
-
No, it should give "No choice". if you do var_dump($res); you’ll see why. besides, even if $res would be a string it still would match the default chioce.
how do you come to that conclusion?Leave a comment:
-
Calling java script in PHP
I have this code.
Technically it should pop up a window of alert.Code:<html> <body> <?php $res = `php myfile.php`; switch($res) { case 1: "<scriptlanguage=javascript> alert('Blah Blah') </script>"; break; case 2: echo "Choice 2"; break; case 3: echo "Choice 3"; break; default:echo "No choice"; break; } ?> </body> </html>
But it wont.
this will give value 1.Code:echo $res;
Whats wrong with it.?
Regards
Dheeraj JoshiTags: None
Leave a comment: