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.

More Web Design Blog Content

Website To Text

Introducing the Livewire Website to Text Application, a cutting-edge tool that transforms consumer engagement. Imagine having the ability to instantly connect with customers in a personalized way, bridging the gap between your website visitors and your company with ease. With this game-changing feature, you gain access to a plethora

Guardian Association Management Has A New Website

Pleased to introduce the new Guardian Association Management website. This is a clean minimalistic layout that funnels users directly into services and payments pages. Gainesville GAM came to us needing something up in a timely manner, clean, modern, and looked great on mobile. We were happy to oblige.

Would You Lock Out 20% Of Your Customers?

If you have a website that is not responsive, or that does not have a mobile version (at least), that’s exactly what you’re doing. Nowadays it’s not just an important add-on feature to your website, going mobile is essential to a fully adjusted online presence. Did you know

african american man using computer

How to Reset the SMC on Your Mac: A Step-by-Step Guide

How to Reset the SMC on Your Mac: A Step-by-Step Guide If your Mac is acting up—battery issues, overheating, or problems with sleep mode—it may be time to reset the System Management Controller (SMC). The SMC controls essential hardware functions like power management, battery charging, and thermal regulation.

Should you be wary of SEO firms?

Good Call Commander! You should absolutely be suspicious of SEO firms these days. The industry is unfortunately saturated with unscrupulous, downright devious companies that prey on  unsuspecting business owners attempting to better their rankings. They pump your site full of fluff and post thousands of links around their

CSS Evolution

Cascading Style Sheets, or CSS revolutionized the way the web was/is written. The next evolution has been the roll out of CSS3. With all kinds of new tricks, CSS3 promises to take web programming to the next level … and beyond. We generally hand code all of our