Javascript called by PHP

Interesting little snippet.

What is going on here? Livewire gives you the low down.

 

 if($num_rowvs == 0){
 echo '<script>// <![CDATA[
alert("This is an alert message. I'm alerting you that you are totally awesome!");
// ]]></script>'; }

 

First, we’re creating a simple if statement in PHP.  Not entirely necessary, but prbobably the most common setup. Next we’re simply echoing the javascript alert – make sure to get your apostrophes and commas straight.

And that is it. Close out the tags and you have successfully called a javascript alert from inside PHP. Congrats.

New Mobile SIte

Head on over to livewiregeeks on your mobile device It’s our new mobile site based on Chalis iwebapp – a powerful framework that works well across

Read More »

Database Projects

We are database junkies. Simply put, you can’t beet the flexibility and scalability that databases offer us in the web design world. We prefer using

Read More »

WordPress Email Issues

Every now and again we run into issues with WordPress where the email functionality has stopped working. This is usually the result of corrupted core

Read More »