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

Review: Google Chrome – StayFocusd ★★★★★

We. Love. This. Chrome extension. Warning: It’s brutal. Stayfocusd is essentially a task manager, not as in manage what task is next, but keeps you focused on your tasks at hand. It blocks websites that waste your time and keep you distracted through a time limit feature. You

Howe Development Has a New Website

Website is complete on Howe Development. Now for phase 2 – integrating a simply, custom CMS so they can update content on parts of the site. No need for wordpress – we can easily do a custom solution for those cases where a client only needs to control

Gainesville Web Development

What a market. Gainesville has it all, especially its share of web developers. With new blood coming into the market – funnelled into and out of Gainesville via the University – our little town has an abundance of web developers looking to make a name for themselves. And we wish

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

Search Engine Optimization

More important than ever and we’re at the leading edge. One of our best success stories is Rose Petals Nursery. We’ve been doing optimization for them for some time now with some great results. We’re dominating from top to bottom. Just check out this high level, competitive keyword: Old Garden

Recover From A Negative SEO Attack

Nothing can be quite as irritating or as damaging as an unscrupulous competitor or determined unhappy client that is willing to go to any length to harm your business. It doesn’t take much for some people to launch an all out assault on your business, endangering everything you’ve