Training in Web Technologies Blog

Searching Strings

Problem You want to search a string for a particular pattern or substring. Solution Use a regular expression with PHP’s ereg() function: <?php // define string $html = “I’m <b>tired</b> and so I <b>must</b>...

Identifying Duplicate Words in a String

into individual words, and then count the occurrences of each word: <?php // define string $str = “baa baa black sheep”; // trim the whitespace at the ends of the string $str = trim($str);...

What’s new in HTML 5

Most important thing about HTML 5 is that its now no longer part of SGML but its a language of its own. A number of new elements added as well as others removed or...

Swapping Out Text, Five Different Ways

It’s a common need in web apps: you click something and the text of the thing you just clicked changes. Perhaps something simple like a “Show” button that swaps to “Hide”, or “Expand Description”...

The Use of jQuery in Tutorials

I Write What I Do This blog is a reflection of things that I learn. I use jQuery a bunch. So when I translate things into a tutorial, I do it how I would...

jQuery – Get Content and Attributes

jQuery contains powerful methods for changing and manipulating HTML elements and attributes. jQuery DOM Manipulation One very important part of jQuery is the possibility to manipulate the DOM. jQuery comes with a bunch of...

jQuery – Chaining

With jQuery, you can chain together actions/methods. Chaining allows us to run multiple jQuery methods (on the same element) within a single statement. jQuery Method Chaining Until now we have been writing jQuery statements...

jQuery Callback Functions

A callback function is executed after the current effect is 100% finished. jQuery Callback Functions JavaScript statements are executed line by line. However, with effects, the next line of code can be run even...

jQuery Stop Animations

jQuery stop() Method The jQuery stop() method is used to stop an animation or effect before it is finished. The stop() method works for all jQuery effect functions, including sliding, fading and custom animations....

jQuery Effects – Animation

jQuery Animations – The animate() Method The jQuery animate() method is used to create custom animations. Syntax: $(selector).animate({params},speed,callback); The required params parameter defines the CSS properties to be animated. The optional speed parameter specifies...

jQuery Effects – Fading

jQuery Fading Methods With jQuery you can fade an element in and out of visibility. jQuery has the following fade methods: fadeIn() fadeOut() fadeToggle() fadeTo() jQuery fadeIn() Method The jQuery fadeIn() method is used...

jQuery hide() and show()

With jQuery, you can hide and show HTML elements with the hide() and show() methods: Example $(“#hide”).click(function(){ $(“p”).hide(); }); $(“#show”).click(function(){ $(“p”).show(); }); Syntax: $(selector).hide(speed,callback); $(selector).show(speed,callback); The optional speed parameter specifies the speed of the...

How do you create sub domains using PHP?

Wild card domains can be used. Sub domains can be created by first creating a sub directory in the /htdocs folder. E.g. /htdocs/mydomain. Then, the host file needs to be modified to define the...

What is CAPTCHA?

CAPTCHA is a test to determine if the user using the system (usually a web form) is a human. It identifies this by throwing challenges to users. Depending on the responses the identification can...

What is Type juggle in php?

Answer Type Juggling means dealing with a variable type. In PHP a variables type is determined by the context in which it is used. If an integer value is assigned to a variable, it...

PHP Script

How can we increase the execution time of a php script? Answer Default time allowed for the PHP scripts to execute is 30s defined in the php.ini file. The function used is set_time_limit(int seconds)....

the functions for IMAP

IMAP is used for communicate with mail servers. It has a number of functions. Few of them are listed below: Imap_alerts – Returns all the imap errors occurred Imap_body – Reads the message body...

PHP Error Type

What are the different types of errors in PHP? Answer Different types of errors are : E_ERROR: A fatal error that causes script termination E_WARNING: Run-time warning that does not cause script termination E_PARSE:...

PHP message

Explain the difference between $message and $$message? Answer $message is used to store variable data. $$message can be used to store variable of a variable. Data stored in $message is fixed while data stored...

PHP cookies

A cookie is used for identification purposes. It is more commonly used to identify a user in a session. It is a small file the application inserts on the users computer. With PHP one...

PHP Urlencode & Urldecode

What is urlencode and urldecode? Answer Urlencode can be used to encode a string that can be used in a url. It encodes the same way posted data from web page is encoded. It...

PHP Include & Require

What is the difference between include and require? Answer Require() and include() are the same with respect to handling failures. However, require() results in a fatal error and does not allow the processing of...

Joomla! Features

Completely database driven site engines News, products or services sections fully editable and manageable Topics sections can be added to by contributing authors Fully customizable layouts including left, center and right menu boxes Browser...

Joomla Interview Questions and Answers – 04

11. Can content items be in multiple sections or categories? No. 12. How to exit wrapper? To remove the wrapper, click on any of the links on the menu of the parent page. 13....

Joomla Interview Questions and Answers – 02

The best way for a candidate to be sure about passing the interview is to be prepared. There are a few questions that are standard for the interviewee to be asked. Here is some...