kayz100 Posted September 19, 2013 Share Posted September 19, 2013 Hi guys how do I get JavaScript and php doing wonders for me. I want to chnage the following php echo $myInfo; to something like this echo "<script> alert('Your input is correct');</script>"; I am failing to make any changes here please help. I actually want javascript to output the echo $myInfo but don't know how. Thanks a lot Link to comment https://forums.phpfreaks.com/topic/282290-php-echo-with-javascript-alert/ Share on other sites More sharing options...
AbraCadaver Posted September 19, 2013 Share Posted September 19, 2013 On 9/19/2013 at 6:45 PM, kayz100 said: Hi guys how do I get JavaScript and php doing wonders for me. I want to chnage the following php echo $myInfo; to something like this echo "<script> alert('Your input is correct');</script>"; I am failing to make any changes here please help. I actually want javascript to output the echo $myInfo but don't know how. Thanks a lot What about: echo "<script type='text/javascript'>alert('$myInfo');</script>"; Link to comment https://forums.phpfreaks.com/topic/282290-php-echo-with-javascript-alert/#findComment-1450290 Share on other sites More sharing options...
kayz100 Posted September 20, 2013 Author Share Posted September 20, 2013 Thanks guys but how do I get the php echo working together with alert message? For example using both php echo $myInfo; and echo "<script> alert('Your input is correct');</script>"; maybe something like this but not so good still a newbie echo "<script type='text/javascript'>alert('$myInfo' Your input is correct);</script>"; echo "<script> alert('Your input is correct');</script>"; now where do I put my alert message as well echo "<script type='text/javascript'>alert('$myInfo');</script>"; Link to comment https://forums.phpfreaks.com/topic/282290-php-echo-with-javascript-alert/#findComment-1450346 Share on other sites More sharing options...
AbraCadaver Posted September 20, 2013 Share Posted September 20, 2013 On 9/20/2013 at 3:44 AM, kayz100 said: Thanks guys but how do I get the php echo working together with alert message? For example using both php echo $myInfo; and echo "<script> alert('Your input is correct');</script>"; maybe something like this but not so good still a newbie echo "<script type='text/javascript'>alert('$myInfo' Your input is correct);</script>"; echo "<script> alert('Your input is correct');</script>"; now where do I put my alert message as well echo "<script type='text/javascript'>alert('$myInfo');</script>"; echo "<script type='text/javascript'>alert('$myInfo Your input is correct');</script>"; Link to comment https://forums.phpfreaks.com/topic/282290-php-echo-with-javascript-alert/#findComment-1450381 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.