Below PHP function returns true if the email address given as parameter is valid, false otherwise.
PHP code:
{
if (preg_match(‘/^[a-z0-9&\'\.\-_\+]+@[a-z0-9\-]+\.([a-z0-9\-]+\.)*+[a-z]{2}/is’, $email))
{return true;}
else
{return false;}
}
Below PHP function returns true if the email address given as parameter is valid, false otherwise.
PHP code:
This CSS stylesheet sets default values for HTML5 tags.
CSS code:
html, body,
a, abbr, address, article, aside, audio
b, blockquote,
canvas, caption, cite, code,
dd, del, details, dfn, div, dl, dt,
em,
fieldset, figcaption, figure, footer, form,
h1, h2, h3, h4, h5, h6, header, hgroup,
i, iframe, img, ins,
kbd,
label, legend, li,
mark, menu, meter,
nav,
object, ol,
p, pre,
q,
samp, section, small, span, sub, summary, sup, strong,
table, tbody, td, tfoot, th, thead, time, tr,
ul,
var, video
{margin:0;
padding:0;
border:0;
outline:0;
font-weight:inherit;
font-style:inherit;
font-size:100%;
font-family:inherit;
vertical-align:baseline;}
body{line-height:1; color:black; background:white;}
:focus{outline:0;}
a{text-decoration:none;}
abbr[title], dfn[title]{border-bottom:1px dotted #000; cursor:help;}
article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary{display:block;}
blockquote:before, blockquote:after, q:before, q:after{content:"";}
blockquote, q{quotes:"" "";}
caption, th, td{text-align:left; font-weight:normal;}
del{text-decoration:line-through;}
hr{display:block; height:1px; border:0; border-top:1px solid #cccccc; margin:1em 0; padding:0;}
input, select{vertical-align:middle;}
ins{background-color:#cfcfcf; text-decoration:none;}
mark{background-color:#cfcfcf; font-style:italic; font-weight:bold;}
menu, ol, ul{list-style:none;}
table{border-collapse:collapse; border-spacing:0;}
/* HTML5 END CSS RESET */
Below JavaScript function returns true if the email address given as parameter is valid, false otherwise.
JavaScript code:
Here is a php function with which you can send an email with normal text or in html format.
PHP code:
sendEmail($email_to,$email_from,$subject,$message);
function sendEmail($email_to,$email_from,$subject,$message)
{
$headers = ‘MIME-Version: 1.0′ . "\r\n";
$headers .= ‘Content-type: text/html; charset=iso-8859-1′ . "\r\n";
$headers .= ‘From:’.$email_from."\r\n"
.‘Reply-To:’.$email_from;
mail($email_to, $subject, $message, $headers);
}
Here is an example on how to get data from XML files using PHP.
XML file example:
PHP code:
//We go through all nodes from the XML and test their names. Depending on their names we take necessary actions.
foreach ($XMLNode->childNodes as $currentNode)
{
if (strtolower($currentNode->nodeName) == ‘logo’)
{echo $currentNode->nodeValue.‘<br />’;} // Read a node value.
if (strtolower($currentNode->nodeName) == ‘title’)
{echo $currentNode->nodeValue.‘<br />’;}
if (strtolower($currentNode->nodeName) == ‘subtitle’)
{echo $currentNode->nodeValue.‘<br />’;}
if (strtolower($currentNode->nodeName) == ‘menu’)
{
foreach ($currentNode->childNodes as $menuItem)
{
// Test if node has children.
if (strtolower($menuItem->nodeName) == ‘item’ && $menuItem->hasChildNodes())
{
echo $menuItem->getAttribute(‘Name’).‘<br />’; // Read a node attribute.
foreach ($menuItem->childNodes as $submenuItem)
{
if (strtolower($submenuItem->nodeName) == ‘item’)
{
echo $submenuItem->getAttribute(‘Name’);
echo $submenuItem->getAttribute(‘DataPath’);
}
}
}
elseif (strtolower($menuItem->nodeName) == ‘item’)
{
echo $menuItem->getAttribute(‘Name’);
echo $menuItem->getAttribute(‘DataPath’);
}
}
}
}
Need an WordPress Theme for mobiles? Visit SMOOCI.COM
Smooci is a WordPress theme for mobile phones and devices. Use this WordPress plugin to display the theme when your WordPress site is visited on mobiles
Need an WordPress Theme for mobiles? Visit SMOOCI.COM
Smooci (WordPress on Mobiles) plugin can be used to display a diferent theme when your WordPress site is visited on mobile phones or devices.
The plugin detects the mobile device and displays the theme of your choice. If you encounter a mobile phone or device that doesn’t display the selected theme, please leave a comment to this post.

Here is a way you can call a server side script with AJAX, using POST method.
JavaScript code:
// HTTP request object.
function GetXmlHttpObject()
{
var xmlHttp = null;
try
{xmlHttp = new XMLHttpRequest();}
catch (e)
{
try
{xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");}
catch (e)
{xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");}
}
return xmlHttp;
}
function callServer()
{
xmlHttpVariable = new GetXmlHttpObject(); // Call HTTP request object.
var url = "url"; // Set the URL to the server-side script.
var variables = "var1=val1&var2=val2"; // Set the variables.
xmlHttpVariable.onreadystatechange = stateChangedVariable; // Call a function on state change.
xmlHttpVariable.open("POST",url,true); // Open the URL.
// Send the proper header information along with the request.
xmlHttpVariable.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlHttpVariable.setRequestHeader("Content-length", variables.length);
xmlHttpVariable.setRequestHeader("Connection", "close");
xmlHttpVariable.send(variables); // Send the variables.
}
function stateChangedVariable()
{
if (xmlHttpVariable.readyState == 4) // Values for readyState see below for explanations.
{
if (xmlHttpVariable.responseText.replace(/^\s+|\s+$/g, ”) == ‘return value’)
{// Action here.}
}
}
readyState values:
0 – Represents an “uninitialized” state in which an XMLHttt pRequesobject has been created, but not initialized.
1 – Represents a “sent” state in which code has called the XMLHttpRequest open() method and the XMLHttpRequest is ready to send a request to the server.
2 – Represents a “sent” state in which a request has been sent to the server with the send() method, but a response has not yet been received.
3 – Represents a “receiving” state in which the HTTP response headers have been received, but message body has not yet been completely received.
4 – Represents a “loaded” state in which the response has been completely received.
After several tests and favorable comments, I can officialy launch DOP Player WordPress Plugin 1.0.
Dop Player is intended for users that want an easy to use player to integrate in their blog.
Dop Player can be easily customized from an admin panel to match your template’s colors.
Warning
You have to copy the content from dop-player folder from the zip file. If you don’t you will see only a space where the player should be.
You have in the zip file:
- ZIP/dop-player/dop-player.php
- ZIP/dop-player/dop-player/dop-player-admin.php
- ZIP/dop-player/dop-player/dop-player.swf
In your plugin forlder you should have:
- WWW/wp-content/plugins/dop-player.php
- WWW/wp-content/plugins/dop-player/dop-player-admin.php
- WWW/wp-content/plugins/dop-player/dop-player.swf
You can download it from:
http://dop-p.com/wordpress/
http://wordpress.org/extend/plugins/dop-player/
An example