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

Adding a Fee in Woocommerce

This piggybacks off of a solution I found elsewhere. We modified it to add a single fee for products based on the taxonomy. It comes in handy to categories products and then apply this rule to that category. function action_woocommerce_checkout_calculate_fees( $cart ) { // Initialize $quantity = 0;

Florida Auctioneers Has A New Website

Proud to present the new and improved Florida Auctioneers Association Website! This was a lengthy project but the final website is well worth it. Really more of a web portal, the system is chock full of features and runs smooth and fast. The site features: Membership program Member

Messaging When Switching From iPhone to Droid

Sneaky little issue pops up when you move away from iphone. Other iphone users that previously texted you won’t be able to text you the same way once you switch. This is because when you both were using iphones, the messaging system was not the typical SMS, but

Sitemaps

Back in the day a simple website could get away with an on-page sitemap. Just a simple list of pages somewhere on the site. Not so much anymore. Sitemaps – at least the ones we intend for search engines to look at – are all internal. We use

Photography Services

At Livewire we have not had photography services in the past, leaving it up to clients to procure their own services for website pictures. Over time, this has become an inconvenience. Mainly, waiting for images holds up the design process. We are so glad we found Kimber Greenwood