That file calls C functions inturn...
And returns the value.
Basically i try to wrap few functions through PHP...
Regards
Dheeraj Joshi
Calling java script in PHP
Collapse
X
-
-
People....... I forgot to tell you.
I am getting the alert box in PHP............ .....
Bingo.
Regards
Dheeraj JoshiLeave a comment:
-
-
yaa my bad Mark...
he need to add an echo before the quotes... I din't see that...
The corrected code will be...
and if $res is holding value one... the javascript will alert "blah blah"Code:<html> <body> <?php $res = `php myfile.php`; switch($res) { case 1: echo "<script language=\"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>Leave a comment:
-
As mentioned before, that won't work because you're not asking PHP to do anything with the string, it's the same as
which obviously will not output anything.Code:<?php "hi, my name is Mark";
Leave a comment:
-
Dear dheerajjoshim,
If you're getting $res as 1 then look at the code line#9
and change it toCode:case 1: "<scriptlanguage=javascript>
Code:case 1: "<script language=\"javascript\">
Leave a comment:
-
-
It'll return a string, I imagine. Do a var_dump() on your $res variable.Leave a comment:
-
Generally languages have a tendency to print not to return unless we say it so.
Regards
Dheeraj JoshiLeave a comment:
-
Leave a comment: