<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearch/1.1/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0' version='2.0'><channel><atom:id>tag:blogger.com,1999:blog-5047031466589166993</atom:id><lastBuildDate>Tue, 26 Mar 2013 19:10:50 +0000</lastBuildDate><category>Transition</category><category>Plugins</category><category>BookMark</category><category>Image</category><category>Caption</category><category>Foriegn</category><category>Progress</category><category>Adf.ly</category><category>Ajax</category><category>form</category><category>Web Development</category><category>upload file</category><category>Slideshow</category><category>Language</category><category>Function</category><category>contact</category><category>Scripts</category><category>Error</category><category>404</category><category>Jquery</category><category>Drop down</category><category>Page</category><category>Shake</category><category>Facebook</category><category>message box</category><category>Menu</category><category>Registeration</category><category>System</category><category>Zip</category><category>Css</category><category>Web Element</category><category>Create</category><category>Extension</category><category>WebDesign</category><category>YouTube</category><category>Theme</category><category>Log in</category><category>Templates</category><category>Drupal</category><category>Bar</category><category>Joomla</category><category>Database</category><category>search</category><category>Php</category><category>MySql</category><category>Upload</category><category>Rating</category><category>JavaScript</category><category>Html</category><title>CodeSlot</title><description></description><link>http://www.codeslot.info/</link><managingEditor>noreply@blogger.com (Phoenix Elmasry)</managingEditor><generator>Blogger</generator><openSearch:totalResults>52</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-6160860594189105527</guid><pubDate>Tue, 02 Oct 2012 12:28:00 +0000</pubDate><atom:updated>2012-10-02T14:28:29.666+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Facebook</category><title>Remove deactivated Profiles from your Facebook friend list</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-o28XV5Q3F6s/UGgIeNl09aI/AAAAAAAAB9c/zUxAtI61leU/s320/Facebook.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-o28XV5Q3F6s/UGgIeNl09aI/AAAAAAAAB9c/zUxAtI61leU/s320/Facebook.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style="color: blue;"&gt;Facebook&lt;/span&gt;
 might be the largest social network in action today, but it isn't 
without its flaws.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt; A lot of changes made by Facebook seem to cause 
problems for the users, especially the ones made in 2012. First, the Timeline,
 then the ticker and the ability of friends to add you to groups without
 permission. Then there's this problem regarding deactivated and deleted
 profiles in your friend list. Since the changes made, people started to
 notice old profiles (and new) that had been deactivated in their 
friends list. Now this isn't a problem, but it sure clutters up your 
list and inflates your number of friends. You can easily find and delete these profiles from your list and clear up things.
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
&lt;/div&gt;
&lt;a href="http://www.blogger.com/blogger.g?blogID=5047031466589166993" name="more"&gt;&lt;/a&gt;&lt;h3&gt;
&lt;span style="color: red;"&gt;
Detecting deactivated profiles&lt;/span&gt;&lt;/h3&gt;
&lt;div style="text-align: justify;"&gt;
So how do you know you have these "Ghost Profiles" in your account? Here
 is a simple test. Go to your profile, and note down the total number of
 'friends' you have. This will show you the total number of people in 
your friend list, including those who have deleted or deactivated their 
profiles. This is where the problem is, because it should only display 
the number of active profiles. Hence, Facebook's metrics are flawed, so 
to speak.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
Now, go to&amp;nbsp;&lt;a href="https://www.facebook.com/me/friends"&gt;https://www.facebook.com/me/friends&lt;/a&gt;,
 and (if possible), count the total number of profiles displayed there 
(This is where your school&amp;nbsp;arithmetic&amp;nbsp;lessons might come in useful :D). 
This number will most likely be lesser than the previous one. I, for 
one, have 361 friends in my list, but upon counting them, I came up with
 a count of 349, give or take a couple.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;img alt="Facebook friends" border="0" height="196" src="http://1.bp.blogspot.com/-SHXGsWltCmw/UGgEfVcuW5I/AAAAAAAAB8c/OZbPUA8IB8E/s400/friends.JPG" title="Facebook friends" width="400" /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="text-align: justify;"&gt;
Why does this happen? Suppose you had 100 friends, and Mr. X added you 
on Facebook. So your total count becomes 101. Sometime later, he decides
 he's better off without Facebook, so he deactivates his profile. Your 
count should get back to 100, but it doesn't. It'll be 101, with an 
added "Ghost Profile".&lt;/div&gt;
&lt;h3&gt;
Removing deactivated profiles&lt;/h3&gt;
&lt;div style="text-align: justify;"&gt;
You can easily remove the ghost profiles from your list manually. If you
 start searching on Facebook with a letter, Facebook will show you your 
friends that have that letter in their names. For examply, type in 'x' 
and you will see Mr. X there.&lt;/div&gt;
&lt;div style="text-align: justify;"&gt;
&lt;/div&gt;
You can recognize the de-activated profiles from the default silhouettes
 instead of profile pictures. You might also see silhouettes in your 
friend list. If those silhouettes are active profiles, then you will see
 a pop-up when hovering over them. Otherwise, they're just deactivated 
profiles that you can choose to delete. Click on them, and you'll get a 
message saying that the profile has been deactivated. There's an option 
to un-friend that profile. Go ahead if you want.&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;img alt="Active profiles" border="0" height="211" src="http://2.bp.blogspot.com/-QAVm-5ZEeoI/UGgHNb75Q6I/AAAAAAAAB9U/J_kM5m13X1c/s320/Capture.JPG" title="Active profiles" width="320" /&gt;&lt;/div&gt;
&lt;/div&gt;
</description><link>http://www.codeslot.info/2012/10/remove-deactivated-profiles-from-your.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-o28XV5Q3F6s/UGgIeNl09aI/AAAAAAAAB9c/zUxAtI61leU/s72-c/Facebook.jpg' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-4936652232577915146</guid><pubDate>Tue, 28 Aug 2012 02:13:00 +0000</pubDate><atom:updated>2012-08-28T04:13:47.127+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Bar</category><category domain='http://www.blogger.com/atom/ns#'>Php</category><category domain='http://www.blogger.com/atom/ns#'>Progress</category><category domain='http://www.blogger.com/atom/ns#'>form</category><category domain='http://www.blogger.com/atom/ns#'>Upload</category><title>A Simple PHP Upload Progress Bar</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-H2ucWaWz7-Q/UDwmqQfLRoI/AAAAAAAAAP4/Af3fv2Au_E0/s1600/upload.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="220" src="http://4.bp.blogspot.com/-H2ucWaWz7-Q/UDwmqQfLRoI/AAAAAAAAAP4/Af3fv2Au_E0/s320/upload.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;this is a simple upload file form that uses Apc.&lt;/b&gt;&lt;/div&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;b&gt; it has a lot of features like&lt;/b&gt;&lt;br /&gt;
&lt;ul style="color: blue;"&gt;
&lt;li&gt;Easy to modify with CSS&lt;/li&gt;
&lt;li&gt;Simple integration&lt;/li&gt;
&lt;li&gt;Uses jQuery for callbacks &lt;/li&gt;
&lt;li&gt;No flash&amp;nbsp;&lt;/li&gt;
&lt;/ul&gt;
&lt;b&gt;Source files&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #20124d;"&gt;
&lt;b&gt;Upload.php &lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="php" name="code"&gt;&amp;lt;?php 
//get unique id
$up_id = uniqid(); 
?&amp;gt;

&amp;lt;?php

//process the forms and upload the files
if ($_POST) {

//specify folder for file upload
$folder = "tmp/"; 

//specify redirect URL
$redirect = "upload.php?success";

//upload the file
move_uploaded_file($_FILES["file"]["tmp_name"], "$folder" . $_FILES["file"]["name"]);

//do whatever else needs to be done (insert information into database, etc...)

//redirect user
header('Location: '.$redirect); die;
}
//

?&amp;gt;

&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;
&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /&amp;gt;
&amp;lt;title&amp;gt;Upload your file&amp;lt;/title&amp;gt;

&amp;lt;!--Progress Bar and iframe Styling--&amp;gt;
&amp;lt;link href="style_progress.css" rel="stylesheet" type="text/css" /&amp;gt;

&amp;lt;!--Get jQuery--&amp;gt;
&amp;lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.js" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;

&amp;lt;!--display bar only if file is chosen--&amp;gt;
&amp;lt;script&amp;gt;

$(document).ready(function() { 
//

//show the progress bar only if a file field was clicked
var show_bar = 0;
    $('input[type="file"]').click(function(){
show_bar = 1;
    });

//show iframe on form submit
$("#form1").submit(function(){

if (show_bar === 1) { 
$('#upload_frame').show();
function set () {
                $('#upload_frame').attr('src','upload_frame.php?up_id=&amp;lt;?php echo $up_id; ?&amp;gt;');
}
setTimeout(set);
 }
    });
//

});

&amp;lt;/script&amp;gt;

&amp;lt;/head&amp;gt;

&amp;lt;body&amp;gt;
&amp;lt;h1&amp;gt;Upload your file &amp;lt;/h1&amp;gt;

&amp;lt;div&amp;gt;
  &amp;lt;?php if (isset($_GET['success'])) { ?&amp;gt;
  &amp;lt;span class="notice"&amp;gt;Your file has been uploaded.&amp;lt;/span&amp;gt;
  &amp;lt;?php } ?&amp;gt;
  &amp;lt;form action="" method="post" enctype="multipart/form-data" name="form1" id="form1"&amp;gt;
    Name&amp;lt;br /&amp;gt;
    &amp;lt;input name="name" type="text" id="name"/&amp;gt;
    &amp;lt;br /&amp;gt;
    &amp;lt;br /&amp;gt;
    Your email address &amp;lt;br /&amp;gt;
    &amp;lt;input name="email" type="text" id="email" size="35" /&amp;gt;
    &amp;lt;br /&amp;gt;
    &amp;lt;br /&amp;gt;
    Choose a file to upload&amp;lt;br /&amp;gt;

&amp;lt;!--APC hidden field--&amp;gt;
    &amp;lt;input type="hidden" name="APC_UPLOAD_PROGRESS" id="progress_key" value="&amp;lt;?php echo $up_id; ?&amp;gt;"/&amp;gt;
&amp;lt;!----&amp;gt;

    &amp;lt;input name="file" type="file" id="file" size="30"/&amp;gt;

&amp;lt;!--Include the iframe--&amp;gt;
    &amp;lt;br /&amp;gt;
    &amp;lt;iframe id="upload_frame" name="upload_frame" frameborder="0" border="0" src="" scrolling="no" scrollbar="no" &amp;gt; &amp;lt;/iframe&amp;gt;
    &amp;lt;br /&amp;gt;
&amp;lt;!----&amp;gt;

    &amp;lt;input name="Submit" type="submit" id="submit" value="Submit" /&amp;gt;
  &amp;lt;/form&amp;gt;
  &amp;lt;/div&amp;gt;

&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt; 
&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: #20124d;"&gt;
&lt;b&gt;upload_frame.php&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="php" name="code"&gt;&amp;lt;?php

$url = basename($_SERVER['SCRIPT_FILENAME']);

//Get file upload progress information.
if(isset($_GET['progress_key'])) {
    $status = apc_fetch('upload_'.$_GET['progress_key']);
    echo $status['current']/$status['total']*100;
    die;
}
//

?&amp;gt;

&amp;lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.0/jquery.js" type="text/javascript"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;link href="style_progress.css" rel="stylesheet" type="text/css" /&amp;gt;

&amp;lt;script&amp;gt;
$(document).ready(function() { 
//

    setInterval(function() 
        {
    $.get("&amp;lt;?php echo $url; ?&amp;gt;?progress_key=&amp;lt;?php echo $_GET['up_id']; ?&amp;gt;&amp;amp;randval="+ Math.random(), { 
        //get request to the current URL (upload_frame.php) which calls the code at the top of the page.  It checks the file's progress based on the file id "progress_key=" and returns the value with the function below:
    },
        function(data)    //return information back from jQuery's get request
            {
                $('#progress_container').fadeIn(100);    //fade in progress bar    
                $('#progress_bar').width(data +"%");    //set width of progress bar based on the $status value (set at the top of this page)
                $('#progress_completed').html(parseInt(data) +"%");    //display the % completed within the progress bar
 }
)},500);    //Interval is set at 500 milliseconds (the progress bar will refresh every .5 seconds)

});


&amp;lt;/script&amp;gt;

&amp;lt;body style="margin:0px"&amp;gt;
&amp;lt;!--Progress bar divs--&amp;gt;
&amp;lt;div id="progress_container"&amp;gt;
&amp;lt;div id="progress_bar"&amp;gt;
&amp;lt;div id="progress_completed"&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;!----&amp;gt;
&amp;lt;/body&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: #20124d;"&gt;
&lt;b&gt;Style_Progress.css&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="css" name="code"&gt;/*iframe*/
#upload_frame {
 border:0px;
 height:40px;
 width:400px;
 display:none;
}

#progress_container {
 width: 300px; 
 height: 30px; 
 border: 1px solid #CCCCCC; 
 background-color:#EBEBEB;
 display: block; 
 margin:5px 0px -15px 0px;
}

#progress_bar {
 position: relative; 
 height: 30px; 
 background-color: #F3631C; 
 width: 0%; 
 z-index:10; 
}

#progress_completed {
 font-size:16px; 
 z-index:40; 
 line-height:30px; 
 padding-left:4px; 
 color:#FFFFFF;
}&lt;/pre&gt;
&lt;br /&gt;
&lt;h2 style="color: red;"&gt;
Server Requirements&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong style="color: blue;"&gt;PHP 5.2 or greater &lt;/strong&gt;&lt;br /&gt;
      &lt;br /&gt;
    &lt;/li&gt;
&lt;li&gt;&lt;strong style="color: #660000;"&gt;APC &lt;/strong&gt;&lt;br /&gt;
      Make sure you have APC installed on your server. &lt;strong&gt;It won't work without it.&lt;/strong&gt; It's easy to install, so if you don't have root acces to your server, ask your hosting provider to take care of it for you. &lt;br /&gt;
      &lt;strong&gt;Installation instructions&lt;/strong&gt;: &lt;a href="http://2bits.com/articles/installing-php-apc-gnulinux-centos-5.html" target="_blank"&gt;Linux&lt;/a&gt; | &lt;a href="http://docs.moodle.org/en/Installing_APC_in_Windows#Installation_on_Windows_Server" target="_blank"&gt;Windows&lt;/a&gt;
      
&lt;br /&gt;
      &lt;br /&gt;
      &lt;strong&gt;Important: &lt;/strong&gt;Make sure to include &lt;strong&gt;apc.rfc1867 = on&lt;/strong&gt; in your php.ini file after APC is installed. Your php.ini file should be located at /etc/php.ini. &lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
</description><link>http://www.codeslot.info/2012/08/a-simple-php-upload-progress-bar.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-H2ucWaWz7-Q/UDwmqQfLRoI/AAAAAAAAAP4/Af3fv2Au_E0/s72-c/upload.png' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-307677440516503950</guid><pubDate>Sun, 26 Aug 2012 19:43:00 +0000</pubDate><atom:updated>2012-08-26T21:43:39.301+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>MySql</category><category domain='http://www.blogger.com/atom/ns#'>Php</category><category domain='http://www.blogger.com/atom/ns#'>form</category><category domain='http://www.blogger.com/atom/ns#'>search</category><title>create a search form with php and mysql</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-CbMMXvsp25Y/UDp4zhNUWSI/AAAAAAAAAPc/cAkTG7H2Kt4/s1600/img1.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="80" src="http://3.bp.blogspot.com/-CbMMXvsp25Y/UDp4zhNUWSI/AAAAAAAAAPc/cAkTG7H2Kt4/s320/img1.gif" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="color: blue; font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="color: blue; font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;Having a search feature on your site is very handy for helping users find exactly what they are looking for.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;Database Table&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;CREATE TABLE users (fname VARCHAR(30), lname VARCHAR(30)); 

 INSERT INTO users VALUES ( "Jim", "Jones"), ( "Peggy", "Smith" ),
( "Maggie", "Martin"),( "Tex", "Moncom" ) &lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;The Search Form&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="html" name="code"&gt;&amp;lt;h2&amp;gt;Search&amp;lt;/h2&amp;gt; 
 &amp;lt;form name="search" method="post" action="&amp;lt;?=$PHP_SELF?&amp;gt;"&amp;gt;
 Seach for: &amp;lt;input type="text" name="find" /&amp;gt; in 
 &amp;lt;Select NAME="field"&amp;gt;
 &amp;lt;Option VALUE="fname"&amp;gt;First Name&amp;lt;/option&amp;gt;
 &amp;lt;Option VALUE="lname"&amp;gt;Last Name&amp;lt;/option&amp;gt;
 &amp;lt;Option VALUE="info"&amp;gt;Profile&amp;lt;/option&amp;gt;
 &amp;lt;/Select&amp;gt;
 &amp;lt;input type="hidden" name="searching" value="yes" /&amp;gt;
 &amp;lt;input type="submit" name="search" value="Search" /&amp;gt;
 &amp;lt;/form&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
The above HTML code creates the form your users will use to search.  It 
provides a space to enter what they are looking for, and a drop down 
menu where they can choose what field they are searching (first name, 
last name or profile.)  The form sends the data back to itself using the
 PHP_SELF () function.  This code does not go inside the &amp;lt;?php and 
?&amp;gt; tags, but rather above or below them.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: blue;"&gt;
&lt;b&gt;The Search Code&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="php" name="code"&gt; &amp;lt;? 
 //This is only displayed if they have submitted the form 
 if ($searching =="yes") 
 { 
 echo "&amp;lt;h2&amp;gt;Results&amp;lt;/h2&amp;gt;&amp;lt;p&amp;gt;"; 
 
 //If they did not enter a search term we give them an error 
 if ($find == "") 
 { 
 echo "&amp;lt;p&amp;gt;You forgot to enter a search term"; 
 exit; 
 } 
 
 // Otherwise we connect to our Database 
 mysql_connect("mysql.yourhost.com", "user_name", "password") or die(mysql_error()); 
 mysql_select_db("database_name") or die(mysql_error()); 
 
 // We preform a bit of filtering 
 $find = strtoupper($find); 
 $find = strip_tags($find); 
 $find = trim ($find); 
 
 //Now we search for our search term, in the field the user specified 
 $data = mysql_query("SELECT * FROM users WHERE upper($field) LIKE'%$find%'"); 
 
 //And we display the results 
 while($result = mysql_fetch_array( $data )) 
 { 
 echo $result['fname']; 
 echo " "; 
 echo $result['lname']; 
 echo "&amp;lt;br&amp;gt;"; 
 echo $result['info']; 
 echo "&amp;lt;br&amp;gt;"; 
 echo "&amp;lt;br&amp;gt;"; 
 } 
 
 //This counts the number or results - and if there wasn't any it gives them a little message explaining that 
 $anymatches=mysql_num_rows($data); 
 if ($anymatches == 0) 
 { 
 echo "Sorry, but we can not find an entry to match your query&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;"; 
 } 
 
 //And we remind them what they searched for 
 echo "&amp;lt;b&amp;gt;Searched For:&amp;lt;/b&amp;gt; " .$find; 
 } 
 ?&amp;gt; &lt;/pre&gt;
&lt;br /&gt;
This is the code that actually does the searching, and can be placed 
either above or below the HTML form in the file depending on your 
preference.  Although it is explained in the comments, we will explain 
more about how this works on the next pages.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;
</description><link>http://www.codeslot.info/2012/08/create-search-form-with-php-and-mysql.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-CbMMXvsp25Y/UDp4zhNUWSI/AAAAAAAAAPc/cAkTG7H2Kt4/s72-c/img1.gif' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-1891985649708830028</guid><pubDate>Mon, 13 Aug 2012 03:58:00 +0000</pubDate><atom:updated>2012-08-13T05:58:40.362+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>YouTube</category><category domain='http://www.blogger.com/atom/ns#'>Scripts</category><title>Youtube Clone Script 2012</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-cAwk9-PKnP4/UCh6hTewVCI/AAAAAAAAAOw/edW-bq44j1c/s1600/you.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://1.bp.blogspot.com/-cAwk9-PKnP4/UCh6hTewVCI/AAAAAAAAAOw/edW-bq44j1c/s320/you.png" width="258" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: left;"&gt;
&lt;b&gt;&lt;span style="color: blue;"&gt;This is a clone script of YouTube.. &lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;b&gt;you can see live demo at &lt;a href="http://hiphopdestrada.ro/" target="_blank"&gt;http://hiphopdestrada.ro/&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;a href="http://rapidgator.net/file/31733193/Youtube_Clone.zip.html"&gt;&lt;img src="http://1.bp.blogspot.com/-wCMejY5NjgU/UCSBlbdOhUI/AAAAAAAAAMA/zcE6DRINykM/s1600/d3e_download_btn.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="color: red; text-align: center;"&gt;
&lt;b&gt;Another Download Mirror&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;a href="http://bitshare.com/?f=vkcc6l97"&gt;&lt;img src="http://1.bp.blogspot.com/-wCMejY5NjgU/UCSBlbdOhUI/AAAAAAAAAMA/zcE6DRINykM/s1600/d3e_download_btn.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://www.codeslot.info/2012/08/youtube-clone-script-2012.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-cAwk9-PKnP4/UCh6hTewVCI/AAAAAAAAAOw/edW-bq44j1c/s72-c/you.png' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-7010083047215119040</guid><pubDate>Sun, 12 Aug 2012 04:15:00 +0000</pubDate><atom:updated>2012-08-12T06:15:34.504+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>WebDesign</category><category domain='http://www.blogger.com/atom/ns#'>JavaScript</category><category domain='http://www.blogger.com/atom/ns#'>Jquery</category><title>Facebook like Expanding Textbox with Jquery.</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-VFSKfwQiINw/UCctCbME1fI/AAAAAAAAAOc/3TMkNnHK7Ow/s1600/Expanding_textbox.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="120" src="http://3.bp.blogspot.com/-VFSKfwQiINw/UCctCbME1fI/AAAAAAAAAOc/3TMkNnHK7Ow/s320/Expanding_textbox.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="color: blue; font-family: Times,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;How to implement Facebook like expanding textbox with Jquery.Take a look at this.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;Javascript Code&lt;/b&gt;&lt;/div&gt;
It works with Jquery latest version 1.4.2. &lt;i&gt;$('#content').focus(function(){}&lt;/i&gt; - &lt;i&gt;content&lt;/i&gt; is the ID of the &lt;i&gt;textbox&lt;/i&gt;. Using &lt;i&gt;$(this).animate()&lt;/i&gt; expanding textbox height and using &lt;i&gt;$("#button_block").slideDown()&lt;/i&gt; showing the update button.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="js" name="code"&gt;&amp;lt;script type="text/javascript" src="http://ajax.googleapis.com/
ajax/libs/jquery/1.4.2/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript"&amp;gt;
$(function()
{

$("#content").focus(function()
{
$(this).animate({"height": "85px",}, "fast" );
$("#button_block").slideDown("fast");
return false;
});

$("#cancel").click(function()
{
$("#content").animate({"height": "30px",}, "fast" );
$("#button_block").slideUp("fast");
return false;
});

});
&amp;lt;/script&amp;gt;

//HTML Code

&amp;lt;form method="post" action=""&amp;gt;
&amp;lt;textarea  id="content"&amp;gt;&amp;lt;/textarea&amp;gt;
&amp;lt;div id="button_block"&amp;gt;
&amp;lt;input type="submit" id="button" value=" Share "/&amp;gt;
&amp;lt;input type="submit" id='cancel' value=" cancel" /&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;/form&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: blue;"&gt;
&lt;b&gt;CSS Code&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="css" name="code"&gt;#content
{
width:450px; height:30px;
border:solid 2px #006699;
font-size:14px;
}
#button
{
background-color:#006699;
color:#ffffff;
font-size:13px;
font-weight:bold;
padding:4px;
}
#cancel
{
background-color:#dedede;
color:#000;
font-size:13px;
padding:4px;
margin-left:10px;
}
#button_block
{
display:none;
}&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</description><link>http://www.codeslot.info/2012/08/facebook-like-expanding-textbox-with.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-VFSKfwQiINw/UCctCbME1fI/AAAAAAAAAOc/3TMkNnHK7Ow/s72-c/Expanding_textbox.png' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-4464489288904155321</guid><pubDate>Fri, 10 Aug 2012 04:14:00 +0000</pubDate><atom:updated>2012-08-10T06:14:22.210+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Scripts</category><category domain='http://www.blogger.com/atom/ns#'>Rating</category><category domain='http://www.blogger.com/atom/ns#'>System</category><title>Max's AJAX Rating System</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-DKUscFVnTV0/UCSKCaoJKdI/AAAAAAAAAMo/KgHU2-acHcw/s1600/rate.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="150" src="http://3.bp.blogspot.com/-DKUscFVnTV0/UCSKCaoJKdI/AAAAAAAAAMo/KgHU2-acHcw/s320/rate.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
Max's AJAX Rating System is a simple, easy to install script which 
allows your visitors to rate any item on your page. &lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;You can put as many 
rating boxes on your page as you want. Vistors can rate only once. No 
database is required.&lt;br /&gt;
&lt;br /&gt;
&lt;span style="font-weight: bold;"&gt;Demo:&lt;/span&gt;&lt;br /&gt;
You can see a working demo of &lt;a href="http://www.ajaxf1.com/demo/ajaxrating/" target="_blank"&gt;AJAX Rating System&lt;/a&gt; as well.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;center&gt;
&lt;a href="http://www.ajaxf1.com/scripts/maxajaxrating.zip"&gt;&lt;img src="http://1.bp.blogspot.com/-wCMejY5NjgU/UCSBlbdOhUI/AAAAAAAAAMA/zcE6DRINykM/s1600/d3e_download_btn.jpg" /&gt;&lt;/a&gt;&lt;/center&gt;
&lt;/div&gt;</description><link>http://www.codeslot.info/2012/08/maxs-ajax-rating-system.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-DKUscFVnTV0/UCSKCaoJKdI/AAAAAAAAAMo/KgHU2-acHcw/s72-c/rate.png' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-6037829492223997992</guid><pubDate>Fri, 10 Aug 2012 03:53:00 +0000</pubDate><atom:updated>2012-08-10T05:53:10.643+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Plugins</category><category domain='http://www.blogger.com/atom/ns#'>Jquery</category><title>CodeCanyon - jQuery Message Bar</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-vHlAMLDYzMs/UCSEgENUiNI/AAAAAAAAAMU/GCA_EXDcIYc/s1600/message.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="162" src="http://2.bp.blogspot.com/-vHlAMLDYzMs/UCSEgENUiNI/AAAAAAAAAMU/GCA_EXDcIYc/s320/message.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
The jQuery Message Bar is a professional and elegant plugin that adds a message bar to your pages.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
You can see the &lt;a href="http://codecanyon.net/item/jquery-message-bar/full_screen_preview/694875"&gt; &lt;b&gt;DEMO HERE&lt;/b&gt; &lt;/a&gt;. Please click on the “Play in HD” button to see it in fullscreen. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;a href="http://rapidgator.net/file/31125301/jQuery_Message_Bar.rar.html"&gt;&lt;img src="http://1.bp.blogspot.com/-wCMejY5NjgU/UCSBlbdOhUI/AAAAAAAAAMA/zcE6DRINykM/s1600/d3e_download_btn.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
Another Download Link&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;a href="http://uploading.com/files/get/9596a8ee/jQuery%2BMessage%2BBar.rar"&gt;&lt;img src="http://1.bp.blogspot.com/-wCMejY5NjgU/UCSBlbdOhUI/AAAAAAAAAMA/zcE6DRINykM/s1600/d3e_download_btn.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
Another Download Link&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;a href="http://turbobit.net/kf6d6qv6lfcb.html"&gt;&lt;img src="http://1.bp.blogspot.com/-wCMejY5NjgU/UCSBlbdOhUI/AAAAAAAAAMA/zcE6DRINykM/s1600/d3e_download_btn.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;&lt;/div&gt;</description><link>http://www.codeslot.info/2012/08/codecanyon-jquery-message-bar.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-vHlAMLDYzMs/UCSEgENUiNI/AAAAAAAAAMU/GCA_EXDcIYc/s72-c/message.jpg' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-7740960136831670866</guid><pubDate>Fri, 10 Aug 2012 03:36:00 +0000</pubDate><atom:updated>2012-08-10T05:36:46.108+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Templates</category><category domain='http://www.blogger.com/atom/ns#'>Drupal</category><category domain='http://www.blogger.com/atom/ns#'>Theme</category><title>RockeTtheme - RT Hybrid Theme For Drupal 6 ,7</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-thF2_KYevXI/UCSBZm3OYJI/AAAAAAAAAL4/a3PqrG4SvB8/s1600/123.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-thF2_KYevXI/UCSBZm3OYJI/AAAAAAAAAL4/a3PqrG4SvB8/s320/123.jpg" width="314" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Hybrid is the February 2012 theme release, featuring a rich, vibrant 
and adaptable design. &lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;The theme is divided into several independent 
color zones, for a truly dynamic appearance. 
  
  &lt;br /&gt;
&lt;br /&gt;

    The design has 12 header styles, 12 footer styles, and 5 body color 
&amp;amp; accent styles, allowing for great diversity in stylistic 
possibility. Configure these via the Drupal Administrator. Hybrid's 
beautiful appearance rests on the powerful Drupal CMS and our other 
standard features such as the 960 Grid System and customizable block 
classes.&lt;br /&gt;
&lt;br /&gt;

  &lt;div style="color: red;"&gt;
    &lt;strong&gt;&lt;em&gt;Available for Drupal 6 and Drupal 7!&lt;/em&gt;&lt;/strong&gt;&lt;/div&gt;
&lt;div style="color: red;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-wCMejY5NjgU/UCSBlbdOhUI/AAAAAAAAAMA/zcE6DRINykM/s1600/d3e_download_btn.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-wCMejY5NjgU/UCSBlbdOhUI/AAAAAAAAAMA/zcE6DRINykM/s1600/d3e_download_btn.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;b&gt;&lt;a href="http://www.mirrorcreator.com/files/016G484C/RockeTtheme_-_Hybrid_Drupal_Theme.rar_links" target="_blank"&gt;Click Here&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: red;"&gt;
&lt;strong&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;&lt;/strong&gt;
  &lt;/div&gt;
&lt;/div&gt;</description><link>http://www.codeslot.info/2012/08/rockettheme-rt-hybrid-theme-for-drupal.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-thF2_KYevXI/UCSBZm3OYJI/AAAAAAAAAL4/a3PqrG4SvB8/s72-c/123.jpg' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-3698940820591564857</guid><pubDate>Thu, 09 Aug 2012 02:51:00 +0000</pubDate><atom:updated>2012-08-09T04:51:59.204+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Templates</category><category domain='http://www.blogger.com/atom/ns#'>Error</category><category domain='http://www.blogger.com/atom/ns#'>Web Element</category><category domain='http://www.blogger.com/atom/ns#'>Page</category><category domain='http://www.blogger.com/atom/ns#'>404</category><title>Colorful 404 Error Template</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-hBWyk4r9prY/UCMlLKGwsVI/AAAAAAAAALk/TbHB9bTEF9k/s1600/colorful-404-error-template-500.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://2.bp.blogspot.com/-hBWyk4r9prY/UCMlLKGwsVI/AAAAAAAAALk/TbHB9bTEF9k/s320/colorful-404-error-template-500.jpg" width="209" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;i style="color: red;"&gt;&lt;b&gt;Features&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
1. 3 Pre-Defined Colors&lt;br /&gt;
2. Grouped Layers&lt;br /&gt;
3. Labelled Layers&lt;br /&gt;
4. Fully Customizable&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;i style="color: blue;"&gt;&lt;b&gt;Graphics Files Included:&lt;/b&gt;&lt;/i&gt;&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
Layered PSD&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;div class="freebies_body"&gt;
&lt;i style="color: #274e13;"&gt;&lt;b&gt;Font used :&lt;/b&gt;&lt;/i&gt;&lt;span style="color: #274e13;"&gt; &lt;/span&gt;&amp;nbsp;&lt;/div&gt;
&lt;div class="freebies_body"&gt;
Calibri&lt;/div&gt;
&lt;div class="freebies_body"&gt;
&lt;/div&gt;
&lt;i style="color: #351c75;"&gt;&lt;b&gt;
The zip file contains :&lt;/b&gt;
&lt;/i&gt;&lt;br /&gt;
&amp;gt; .PSD file ; fully layered &amp;amp; editable.&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;b&gt;&lt;a href="http://www.mediafire.com/download.php?99boipr7yo3cymj" target="_blank"&gt;Click Here To Download&lt;/a&gt;&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;</description><link>http://www.codeslot.info/2012/08/colorful-404-error-template.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-hBWyk4r9prY/UCMlLKGwsVI/AAAAAAAAALk/TbHB9bTEF9k/s72-c/colorful-404-error-template-500.jpg' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-1965663955796361408</guid><pubDate>Mon, 06 Aug 2012 05:05:00 +0000</pubDate><atom:updated>2012-08-06T07:05:05.484+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>JavaScript</category><category domain='http://www.blogger.com/atom/ns#'>Php</category><category domain='http://www.blogger.com/atom/ns#'>Ajax</category><category domain='http://www.blogger.com/atom/ns#'>form</category><category domain='http://www.blogger.com/atom/ns#'>Html</category><category domain='http://www.blogger.com/atom/ns#'>Jquery</category><title>Submit Form without Refreshing Page with Jquery</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-JjXQd8jlhgA/UB9OMV8jRqI/AAAAAAAAALQ/__4hjpiAjCw/s1600/submitform.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="142" src="http://3.bp.blogspot.com/-JjXQd8jlhgA/UB9OMV8jRqI/AAAAAAAAALQ/__4hjpiAjCw/s320/submitform.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="bigInt"&gt;
This post helps you to submit your form without 
refreshing page.&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt; In this tutorial I will show you how simple it is to do
 using jQuery form plugin just five lines of JavaScript code, no need to
 post data string values via ajax. Explained collaboration with validate
 plugin for implementing form field validations.&lt;br /&gt;
&lt;/div&gt;
&lt;div class="bigInt"&gt;
&lt;/div&gt;
&lt;div class="bigInt"&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;JavaScript Code&lt;/b&gt;&lt;/div&gt;
&lt;i&gt;$("#form").ajaxForm()&lt;/i&gt;- &lt;i&gt;form&lt;/i&gt; is the ID name of the &lt;i&gt;FORM&lt;/i&gt; tag. While submitting FORM&lt;i&gt; ajaxForm()&lt;/i&gt; method posting data to submit.php without refreshing page. Result will show in &lt;i&gt;#preview&lt;/i&gt;.&amp;nbsp;&amp;nbsp;&lt;/div&gt;
&lt;div class="bigInt"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="bigInt"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class="js" name="code"&gt;&amp;lt;script type="text/javascript" src="http://ajax.googleapis.com/
ajax/libs/jquery/1.5/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="jquery.form.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript"&amp;gt;
$('document').ready(function()
{
$('#form').ajaxForm( {
target: '#preview',
success: function() {
$('#formbox').slideUp('fast');
}
});
});
&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: blue;"&gt;
&lt;b&gt;Contact.html&lt;/b&gt;&lt;/div&gt;
Simple HTML code. FORM contains three input fields&lt;i&gt; name&lt;/i&gt;,&lt;i&gt; email&lt;/i&gt; and&lt;i&gt; message&lt;/i&gt;.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;div id="preview"&amp;gt; &amp;lt;/div&amp;gt;
&amp;lt;div id="formbox"&amp;gt;
&amp;lt;form id="form" action="submit.php" method="post"&amp;gt;
Name
&amp;lt;input type="text" name="name" /&amp;gt;
Email
&amp;lt;input type="text" name="email" /&amp;gt;
Message
&amp;lt;textarea name="message"&amp;gt;&amp;lt;/textarea&amp;gt;
&amp;lt;input type="submit" value="Submit"&amp;gt;
&amp;lt;/form&amp;gt;
&amp;lt;/div&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: #0c343d;"&gt;
&lt;b&gt;Contacts&lt;/b&gt;&lt;/div&gt;
Table contains name, email, message and created data etc.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="sql" name="code"&gt;CREATE TABLE `contact` (
`id` int(11) AUTO_INCREMENT PRIMARY KEY,
`name` varchar(255) UNIQUE KEY,
`email` varchar(100),
`message` text UNIQUE KEY,
`created_date` int(11),
)&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: #660000;"&gt;
&lt;b&gt;submit.php&lt;/b&gt;&lt;/div&gt;
Contails simple PHP code. Inserting values into &lt;i&gt;contacts&lt;/i&gt; table.&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="php" name="code"&gt;&amp;lt;?php
include("db.php");
if($_SERVER["REQUEST_METHOD"] == "POST")
{
$name=mysql_real_escape_string($_POST['name']);
$email=mysql_real_escape_string($_POST['email']);
$message=mysql_real_escape_string($_POST['message']);
if(strlen($name)&amp;gt;0 &amp;amp;&amp;amp; strlen($email)&amp;gt;0 &amp;amp;&amp;amp; strlen($message)&amp;gt;0)
{
$time=time();
mysql_query("INSERT INTO contact (name,email,message,created_date) VALUES('$name','$email','$message','$time')");
echo "&amp;lt;h2&amp;gt;Thank You !&amp;lt;/h2&amp;gt;";
}
}
?&amp;gt;
&lt;/pre&gt;
&lt;div class="big" style="color: #4c1130;"&gt;
&lt;b&gt;Validate Plugin&lt;/b&gt;&lt;/div&gt;
Here the collaboration of jQuery validate and form plug-in.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="js" name="code"&gt;&amp;lt;script type="text/javascript" src="http://ajax.googleapis.com/
ajax/libs/jquery/1.5/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="jquery.form.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript" src="jquery.validate.js"&amp;gt;&amp;lt;/script&amp;gt;
&amp;lt;script type="text/javascript"&amp;gt;
$('document').ready(function()
{
$('#form').validate(
{
rules:
{
"name":{
required:true,
maxlength:40
},
"email":{
required:true,
email:true,
maxlength:100
},
"message":{
required:true
}},

messages:
{
"name":{
required:"This field is required"
},
"email":{
required:"This field is required",
email:"Please enter a valid email address"
},
"message":{
required:"This field is required"
}},

submitHandler: function(form){
$(form).ajaxSubmit({
target: '#preview',
success: function() {
$('#formbox').slideUp('fast');
}
});
}

})
});
&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: #351c75;"&gt;
&lt;b&gt;db.php&lt;/b&gt;&lt;/div&gt;
PHP database configuration file&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="php" name="code"&gt;&amp;lt;?php
$mysql_hostname = "Host name";
$mysql_user = "UserName";
$mysql_password = "Password";
$mysql_database = "Database Name";
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("Could not connect database");
mysql_select_db($mysql_database, $bd) or die("Could not select database");
?&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</description><link>http://www.codeslot.info/2012/08/submit-form-without-refreshing-page.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-JjXQd8jlhgA/UB9OMV8jRqI/AAAAAAAAALQ/__4hjpiAjCw/s72-c/submitform.png' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-649325975694891936</guid><pubDate>Mon, 06 Aug 2012 04:46:00 +0000</pubDate><atom:updated>2012-08-06T06:46:19.892+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Web Development</category><category domain='http://www.blogger.com/atom/ns#'>Html</category><category domain='http://www.blogger.com/atom/ns#'>Css</category><category domain='http://www.blogger.com/atom/ns#'>Jquery</category><title>Simple Drop Down Menu with Jquery and CSS</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-5eyuIDF867M/UB9KhmYSHKI/AAAAAAAAAK0/q57tfNjMKwY/s1600/dropdown.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="133" src="http://3.bp.blogspot.com/-5eyuIDF867M/UB9KhmYSHKI/AAAAAAAAAK0/q57tfNjMKwY/s320/dropdown.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
This post is very basic level Jquery and CSS implementation. &lt;/div&gt;
&lt;a name='more'&gt;&lt;/a&gt;I want to 
explain how to design simple drop down menu &amp;nbsp;with CSS, HTML and Jquery. 
This system helps you to minimise the menus list. Just take a quick look
 at this post very few lines of code, use it and enrich your web 
projects. &lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;HTML Code&lt;/b&gt;&lt;/div&gt;
Simple HTML code&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;div class="dropdown"&amp;gt;
&amp;lt;a class="account" &amp;gt;My Account&amp;lt;/a&amp;gt;

&amp;lt;div class="submenu"&amp;gt;
&amp;lt;ul class="root"&amp;gt;
&amp;lt;li &amp;gt;&amp;lt;a href="#Dashboard" &amp;gt;Dashboard&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li &amp;gt;&amp;lt;a href="#Profile" &amp;gt;Profile&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li &amp;gt;&amp;lt;a href="#settings"&amp;gt;Settings&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li &amp;gt;&amp;lt;a href="#feedback"&amp;gt;Send Feedback&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;

&amp;lt;/div&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-SVAabyb0q7g/UB9LDta9B0I/AAAAAAAAAK8/4j2fynX9eiA/s1600/htmlcode1.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="166" src="http://1.bp.blogspot.com/-SVAabyb0q7g/UB9LDta9B0I/AAAAAAAAAK8/4j2fynX9eiA/s320/htmlcode1.png" width="320" /&gt;&amp;nbsp;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; color: blue; text-align: left;"&gt;
&lt;b&gt;JavaScript&lt;/b&gt;&lt;/div&gt;
Contains javascipt code. &lt;i&gt;$(".account").click(function(){}&lt;/i&gt;- &lt;i&gt;account&lt;/i&gt; is the class name of the &lt;i&gt;My Account&lt;/i&gt; anchor tag. Using &lt;i&gt;$(this).attr('id')&lt;/i&gt; calling &lt;i&gt;id&lt;/i&gt; value of the anchor tag and based on condition showing &lt;i&gt;.submenu&lt;/i&gt; div box and the same time &lt;i&gt;$(this).attr('id', '1')&lt;/i&gt; adding id value too.&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: left;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="js" name="code"&gt;&amp;lt;script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js
"&amp;gt;&amp;lt;/script&amp;gt;;
&amp;lt;script type="text/javascript" &amp;gt;
$(document).ready(function()
{

$(".account").click(function()
{
var X=$(this).attr('id');
if(X==1)
{
$(".submenu").hide();
$(this).attr('id', '0');
}
else
{
$(".submenu").show();
$(this).attr('id', '1');
}

});

//Mouse click on sub menu
$(".submenu").mouseup(function()
{
return false
});

//Mouse click on my account link
$(".account").mouseup(function()
{
return false
});


//Document Click
$(document).mouseup(function()
{
$(".submenu").hide();
$(".account").attr('id', '');
});
});
&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
Document click on document &lt;i&gt;$(document).mouseup(function()&lt;/i&gt; hiding the &lt;i&gt;.submenu&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #0c343d;"&gt;
&lt;b&gt;CSS Code&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: #0c343d;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;pre class="css" name="code"&gt;.dropdown
{
color: #555;
margin: 3px -22px 0 0;
width: 143px;
position: relative;
height: 17px;
text-align:left;
}
.submenu
{
background: #fff;
position: absolute;
top: -12px;
left: -20px;
z-index: 100;
width: 135px;
display: none;
margin-left: 10px;
padding: 40px 0 5px;
border-radius: 6px;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.45);
}
.dropdown li a
{
color: #555555;
display: block;
font-family: arial;
font-weight: bold;
padding: 6px 15px;
cursor: pointer;
text-decoration:none;
}

.dropdown li a:hover
{
background:#155FB0;
color: #FFFFFF;
text-decoration: none;
}
a.account 
{
font-size: 11px;
line-height: 16px;
color: #555;
position: absolute;
z-index: 110;
display: block;
padding: 11px 0 0 20px;
height: 28px;
width: 121px;
margin: -11px 0 0 -10px;
text-decoration: none;
background: url(icons/arrow.png) 116px 17px no-repeat;
cursor:pointer;
}
.root
{
list-style:none;
margin:0px;
padding:0px;
font-size: 11px;
padding: 11px 0 0 0px;
border-top:1px solid #dedede;
}&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</description><link>http://www.codeslot.info/2012/08/simple-drop-down-menu-with-jquery-and.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-5eyuIDF867M/UB9KhmYSHKI/AAAAAAAAAK0/q57tfNjMKwY/s72-c/dropdown.png' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-8242321027748530051</guid><pubDate>Mon, 06 Aug 2012 04:32:00 +0000</pubDate><atom:updated>2012-08-06T06:32:35.828+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Slideshow</category><category domain='http://www.blogger.com/atom/ns#'>Plugins</category><category domain='http://www.blogger.com/atom/ns#'>Joomla</category><title>SJ ZOO Slideshow Pro For Joomla 2.5</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://i.imgur.com/y4a1S.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="176" src="http://i.imgur.com/y4a1S.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #0c343d; text-align: center;"&gt;
&lt;b&gt;SJ ZOO Slideshow Pro For Joomla 2.5&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;b&gt;&lt;/b&gt;&lt;/div&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;b&gt;&lt;a href="http://www.smartaddons.com/joomla/extensions/commercial-extensions/item/318-sj-zoo-slideshow-pro-joomla-module" target="_blank"&gt;Demo&lt;/a&gt; --- &lt;a href="http://www.mirrorcreator.com/files/ZRGQIA0Z/mod_sj_zoo_slideshowpro_UNZIPFIRST.rar_links" target="_blank"&gt;Download&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;</description><link>http://www.codeslot.info/2012/08/sj-zoo-slideshow-pro-for-joomla-25.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-9200233357307662674</guid><pubDate>Mon, 06 Aug 2012 04:28:00 +0000</pubDate><atom:updated>2012-08-06T06:28:30.386+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Templates</category><category domain='http://www.blogger.com/atom/ns#'>Joomla</category><title>RocketTheme Kirigami 1.1 Joomla 2.5 template</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://i.imgur.com/JB015.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="242" src="http://i.imgur.com/JB015.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;b style="color: red;"&gt;RocketTheme Kirigami 1.1 Joomla 2.5 template&lt;/b&gt;&lt;/div&gt;
&lt;div style="text-align: center;"&gt;
&lt;/div&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;b&gt;&lt;a href="http://demo.rockettheme.com/?template=kirigami" target="_blank"&gt;Live Demo&lt;/a&gt; -- &lt;a href="http://turbobit.net/j2lcev7w4v0f/rt_kirigami_v1.1_j25.7z.html" target="_blank"&gt;Download From Turbobit&lt;/a&gt; -- &lt;a href="http://rapidgator.net/file/30023083/rt_kirigami_v1.1_j25.7z.html" target="_blank"&gt;Download From Rapidgator&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;</description><link>http://www.codeslot.info/2012/08/rockettheme-kirigami-11-joomla-25.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-5484266365912176719</guid><pubDate>Mon, 06 Aug 2012 04:17:00 +0000</pubDate><atom:updated>2012-08-06T06:17:08.490+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Scripts</category><category domain='http://www.blogger.com/atom/ns#'>Adf.ly</category><title>Adf.ly Clone Script Version 1.12 by Amereca</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://i.imgur.com/SnNOH.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="139" src="http://i.imgur.com/SnNOH.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;b&gt;Adf.ly Clone Script Version 1.12 by Amereca&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: red;"&gt;
&lt;/div&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;b style="color: red;"&gt;&lt;a href="http://tinypaste.tinypaste.in/" target="_blank"&gt;Demo&lt;/a&gt; ---&amp;nbsp; &lt;a href="http://filetruth.com/?d=5013D5971" target="_blank"&gt;Download Here&lt;/a&gt;&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;</description><link>http://www.codeslot.info/2012/08/adfly-clone-script-version-112-by.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-360918869456757142</guid><pubDate>Fri, 15 Jun 2012 21:55:00 +0000</pubDate><atom:updated>2012-06-15T23:55:28.428+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>JavaScript</category><category domain='http://www.blogger.com/atom/ns#'>Shake</category><category domain='http://www.blogger.com/atom/ns#'>Page</category><title>Shake Internet Explorer Window</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-H10LImWxP5E/T9uuT3cSazI/AAAAAAAAAKk/TMxJ23447Eo/s1600/internet-explorer-support-logo.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://4.bp.blogspot.com/-H10LImWxP5E/T9uuT3cSazI/AAAAAAAAAKk/TMxJ23447Eo/s1600/internet-explorer-support-logo.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="color: blue; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;In this tutorial i will show you how to shake your internet explorer window.this is done using simple javascript code as follow.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;b style="color: red;"&gt;Remember :&lt;/b&gt; &lt;b style="color: #274e13;"&gt;This Only For Internet Explorer&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style="color: #660000;"&gt;Html And JavaScript Page&lt;/b&gt;&lt;br /&gt;
&lt;b style="color: #4c1130; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;Copy The Next code And Save It .Html And run with IE&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="js" name="code"&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;Shaking Internet Explorer&amp;lt;/title&amp;gt;
&amp;lt;meta http-equiv="Content-Language" content="en-us"&amp;gt;
&amp;lt;SCRIPT language=JavaScript&amp;gt;
&amp;lt;!-- Begin
function shake(n) {
if (parent.moveBy) {
for (i = 10; i &amp;gt; 0; i--) {
for (j = n; j &amp;gt; 0; j--) {

parent.moveBy(-i,0);
parent.moveBy(0,-i);
parent.moveBy(-i,0);
parent.moveBy(0,i);
parent.moveBy(i,0);
parent.moveBy(0,-i);
parent.moveBy(-i,0);
parent.moveBy(0,i);
parent.moveBy(i,0);
parent.moveBy(0,-i);
parent.moveBy(-i,0);
parent.moveBy(0,-i);
parent.moveBy(i,0);
parent.moveBy(0,i);
parent.moveBy(i,0);
parent.moveBy(0,i);
 } } } }
//  End --&amp;gt;
&amp;lt;!--
shake(1);
//--&amp;gt;
&amp;lt;/SCRIPT&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body &amp;gt;
&amp;lt;a href="www.codeslot.info"&amp;gt;Www.CodeSlot.Info&amp;lt;/a&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: red; text-align: center;"&gt;
&lt;b&gt;Cheers :)
&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;</description><link>http://www.codeslot.info/2012/06/shake-internet-explorer-window.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-H10LImWxP5E/T9uuT3cSazI/AAAAAAAAAKk/TMxJ23447Eo/s72-c/internet-explorer-support-logo.jpg' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-2681347300902674379</guid><pubDate>Fri, 15 Jun 2012 21:24:00 +0000</pubDate><atom:updated>2012-06-15T23:34:08.299+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>WebDesign</category><category domain='http://www.blogger.com/atom/ns#'>JavaScript</category><title>Adjust Page Background Color With MouseOver Effect</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-a0cRcIPu-Po/T9unuh4kDMI/AAAAAAAAAKY/wsgLBgeirTU/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="320" src="http://4.bp.blogspot.com/-a0cRcIPu-Po/T9unuh4kDMI/AAAAAAAAAKY/wsgLBgeirTU/s320/Untitled.png" width="193" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="color: blue; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: blue; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;This code allows the user to choose the favorite color of 
himself/herself and adjust it on the background&amp;nbsp; of the page by moving mouse
 and choosing the color.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style="color: red;"&gt;Html And JavaScript Page&amp;nbsp;&lt;/b&gt;&lt;br /&gt;
&lt;div style="color: #4c1130; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;This Page Contain Simple Anchor Tags With Mouseover Effect For Each Item that represents colors.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="js" name="code"&gt;&amp;lt;html&amp;gt;
&amp;lt;head&amp;gt;
&amp;lt;title&amp;gt;Testing Background Color&amp;lt;/title&amp;gt;
&amp;lt;/head&amp;gt;
&amp;lt;body&amp;gt;
&amp;lt;p&amp;gt;[&amp;lt;a href="/"
onmouseover="document.bgColor='green'"&amp;gt;Green&amp;lt;/a&amp;gt;]&amp;lt;br&amp;gt;
[&amp;lt;a href="/"
onmouseover="document.bgColor='greem'"&amp;gt;Bright Green&amp;lt;/a&amp;gt;]&amp;lt;br&amp;gt;
[&amp;lt;a href="/"
onmouseover="document.bgColor='seagreen'"&amp;gt;Sea Green&amp;lt;/a&amp;gt;]&amp;lt;br&amp;gt;
[&amp;lt;a href="/"
onmouseover="document.bgColor='red'"&amp;gt;Red&amp;lt;/a&amp;gt;]&amp;lt;BR&amp;gt;
[&amp;lt;a href="/"
onmouseover="document.bgColor='magenta'"&amp;gt;Magenta&amp;lt;/a&amp;gt;]&amp;lt;br&amp;gt;
[&amp;lt;a href="/"
onmouseover="document.bgColor='fusia'"&amp;gt;Fusia&amp;lt;/a&amp;gt;]&amp;lt;br&amp;gt;
[&amp;lt;a href="/"
onmouseover="document.bgColor='pink'"&amp;gt;Pink&amp;lt;/a&amp;gt;]&amp;lt;br&amp;gt;
[&amp;lt;a href="/"
onmouseover="document.bgColor='purple'"&amp;gt;Purple&amp;lt;/a&amp;gt;]&amp;lt;BR&amp;gt;
[&amp;lt;a href="/"
onmouseover="document.bgColor='navy'"&amp;gt;Navy&amp;lt;/a&amp;gt;]&amp;lt;br&amp;gt;
[&amp;lt;a href="/"
onmouseover="document.bgColor='blue'"&amp;gt;Blue&amp;lt;/a&amp;gt;]&amp;lt;br&amp;gt;
[&amp;lt;a href="/"
onmouseover="document.bgColor='royalblue'"&amp;gt;Royal Blue&amp;lt;/a&amp;gt;]&amp;lt;br&amp;gt;
[&amp;lt;a href="/"
onmouseover="document.bgColor='Skyblue'"&amp;gt;Sky Blue&amp;lt;/a&amp;gt;]&amp;lt;BR&amp;gt;
[&amp;lt;a href="/"
onmouseover="document.bgColor='yellow'"&amp;gt;Yellow&amp;lt;/a&amp;gt;]&amp;lt;br&amp;gt;
[&amp;lt;a href="/"
onmouseover="document.bgColor='brown'"&amp;gt;Brown&amp;lt;/a&amp;gt;]&amp;lt;br&amp;gt;
[&amp;lt;a href="/"
onmouseover="document.bgColor='almond'"&amp;gt;Almond&amp;lt;/a&amp;gt;]&amp;lt;br&amp;gt;
[&amp;lt;a href="/"
onmouseover="document.bgColor='white'"&amp;gt;White&amp;lt;/a&amp;gt;]&amp;lt;BR&amp;gt;
[&amp;lt;a href="/"
onmouseover="document.bgColor='black'"&amp;gt;Black&amp;lt;/a&amp;gt;]&amp;lt;br&amp;gt;
[&amp;lt;a href="/"
onmouseover="document.bgColor='coral'"&amp;gt;Coral&amp;lt;/a&amp;gt;]&amp;lt;br&amp;gt;
[&amp;lt;a href="/"
onmouseover="document.bgColor='olivedrab'"&amp;gt;Olive Drab&amp;lt;/a&amp;gt;]&amp;lt;br&amp;gt;
[&amp;lt;a href="/"
onmouseover="document.bgColor='orange'"&amp;gt;Orange&amp;lt;/a&amp;gt;]&amp;lt;br&amp;gt;
&amp;lt;hr color="#00FFFF"&amp;gt;
&amp;lt;font face="Tahoma"&amp;gt;&amp;lt;a target="_blank" href="http://www.codeslot.info"&amp;gt;
&amp;lt;span style="font-size: 8pt; text-decoration: none"&amp;gt;CodeSlot.info Free Web Tutorials&amp;lt;/span&amp;gt;&amp;lt;/a&amp;gt;
&amp;lt;/font&amp;gt;
&amp;lt;/body&amp;gt;
&amp;lt;/html&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;</description><link>http://www.codeslot.info/2012/06/adjust-page-background-color-with.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/-a0cRcIPu-Po/T9unuh4kDMI/AAAAAAAAAKY/wsgLBgeirTU/s72-c/Untitled.png' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-8290952030167383052</guid><pubDate>Fri, 15 Jun 2012 11:30:00 +0000</pubDate><atom:updated>2012-06-15T13:30:57.893+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>WebDesign</category><category domain='http://www.blogger.com/atom/ns#'>Php</category><category domain='http://www.blogger.com/atom/ns#'>Function</category><title>PHP Time Stamp Function.</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-DCoKITxzbZc/T9scHoSX5-I/AAAAAAAAAKM/5_XtHUvmisM/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="43" src="http://3.bp.blogspot.com/-DCoKITxzbZc/T9scHoSX5-I/AAAAAAAAAKM/5_XtHUvmisM/s320/Untitled.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: blue; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;I had developed a date time stamp function using PHP.It is very important for social media web applications. &lt;/b&gt;&lt;/div&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;b&gt;I hope it's useful for you.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;time_stamp.php&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: #20124d; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;Contains PHP code. You have to use the &lt;i&gt;time_stamp()&lt;/i&gt; function to display the date and time.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="php" name="code"&gt;&amp;lt;?php
function time_stamp($session_time)
{
$time_difference = time() - $session_time ;

$seconds = $time_difference ;
$minutes = round($time_difference / 60 );
$hours = round($time_difference / 3600 );
$days = round($time_difference / 86400 );
$weeks = round($time_difference / 604800 );
$months = round($time_difference / 2419200 );
$years = round($time_difference / 29030400 );
// Seconds
if($seconds &amp;lt;= 60)
{
echo "$seconds seconds ago";
}
//Minutes
else if($minutes &amp;lt;=60)
{

   if($minutes==1)
  {
   echo "one minute ago";
   }
   else
   {
    echo "$minutes minutes ago";
   }

}
//Hours
else if($hours &amp;lt;=24)
{

   if($hours==1)
  {
   echo "one hour ago";
  }
  else
  {
   echo "$hours hours ago";
  }

}
//Days
else if($days &amp;lt;= 7)
{

  if($days==1)
  {
   echo "one day ago";
  }
  else
  {
   echo "$days days ago";
   }

}
//Weeks
else if($weeks &amp;lt;= 4)
{

   if($weeks==1)
  {
   echo "one week ago";
   }
  else
  {
   echo "$weeks weeks ago";
  }

}
//Months
else if($months &amp;lt;=12)
{

   if($months==1)
  {
   echo "one month ago";
   }
  else
  {
   echo "$months months ago";
   }

}
//Years
else
{

   if($years==1)
   {
    echo "one year ago";
   }
   else
  {
    echo "$years years ago";
   }

}

}
$session_time ="1264326122";
//$session_time=time();
echo time_stamp($session_time);
?&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;b style="color: red;"&gt;Cheers :)&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;</description><link>http://www.codeslot.info/2012/06/php-time-stamp-function.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-DCoKITxzbZc/T9scHoSX5-I/AAAAAAAAAKM/5_XtHUvmisM/s72-c/Untitled.png' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-5816317835688571158</guid><pubDate>Tue, 12 Jun 2012 21:10:00 +0000</pubDate><atom:updated>2012-06-12T23:10:36.943+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>WebDesign</category><category domain='http://www.blogger.com/atom/ns#'>Php</category><category domain='http://www.blogger.com/atom/ns#'>form</category><title>PHP Login Script with Encryption.</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-vD1CeTULDcs/T9euQZM29MI/AAAAAAAAAJ4/RW5Gkh70jFM/s1600/phpencryption.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="94" src="http://3.bp.blogspot.com/-vD1CeTULDcs/T9euQZM29MI/AAAAAAAAAJ4/RW5Gkh70jFM/s320/phpencryption.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #20124d;"&gt;
&lt;b&gt;I&lt;/b&gt;&lt;b&gt;n this post I want to explain how to insert encrypted password while registration and accessing the same with login time.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;Database&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: blue;"&gt;
&lt;b&gt;MySQL admin table columns id, username, passcode. &lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="background-color: #d0e0e3;"&gt;
&lt;b&gt;CREATE TABLE &lt;span style="color: #cc0000;"&gt;admin&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;(&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="color: #cc0000;"&gt;id&lt;/span&gt; INT &lt;span style="color: blue;"&gt;PRIMARY KEY&lt;/span&gt; &lt;span style="color: #a64d79;"&gt;AUTO_INCREMENT&lt;/span&gt;,&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="color: #cc0000;"&gt;username&lt;/span&gt; VARCHAR(50) &lt;span style="color: blue;"&gt;UNIQU&lt;/span&gt;E,&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style="color: #cc0000;"&gt;passcode&lt;/span&gt;&amp;nbsp;VARCHAR(50)&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;); &lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;Encrypted Password&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: blue;"&gt;
&lt;b&gt;Here database table admin password:&lt;i&gt;test&lt;/i&gt; encrypted and storing like this&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-myu7qD1FK-I/T9evBIrnkMI/AAAAAAAAAKA/wnSiNe-FFTA/s1600/encrypt.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="51" src="http://2.bp.blogspot.com/-myu7qD1FK-I/T9evBIrnkMI/AAAAAAAAAKA/wnSiNe-FFTA/s320/encrypt.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="color: red;"&gt;
&amp;nbsp;&lt;b&gt;registration.php&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="color: blue;"&gt;
&lt;b&gt;Contains PHP and HTML code. Just inserting form values into database table &lt;i&gt;admin&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="php" name="code"&gt;&amp;lt;?php
include("db.php");
if($_SERVER["REQUEST_METHOD"] == "POST")
{
// username and password sent from Form
$username=mysql_real_escape_string($_POST['username']);
$password=mysql_real_escape_string($_POST['password']);
$password=md5($password); // Encrypted Password
$sql="Insert into admin(username,passcode) values('$username','$password');";
$result=mysql_query($sql);
echo "Registration Successfully";
}
?&amp;gt;
&amp;lt;form action="registration.php" method="post"&amp;gt;
&amp;lt;label&amp;gt;UserName :&amp;lt;/label&amp;gt;
&amp;lt;input type="text" name="username"/&amp;gt;&amp;lt;br /&amp;gt;


&amp;lt;label&amp;gt;Password :&amp;lt;/label&amp;gt;
&amp;lt;input type="password" name="password"/&amp;gt;&amp;lt;br/&amp;gt;
&amp;lt;input type="submit" value=" Registration "/&amp;gt;&amp;lt;br /&amp;gt;
&amp;lt;/form&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;login.php&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: blue;"&gt;
&lt;b&gt;Login Script accessing the encrypted password.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="php" name="code"&gt;&amp;lt;?php
include("db.php");
session_start();
if($_SERVER["REQUEST_METHOD"] == "POST")
{
// username and password sent from Form
$username=mysql_real_escape_string($_POST['username']);
$password=mysql_real_escape_string($_POST['password']);
$password=md5($password); // Encrypted Password
$sql="SELECT id FROM admin WHERE username='$username' and passcode='$password'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);

// If result matched $username and $password, table row must be 1 row
if($count==1)
{
header("location: welcome.php");
}
else
{
$error="Your Login Name or Password is invalid";
}
}
?&amp;gt;
&amp;lt;form action="login.php" method="post"&amp;gt;
&amp;lt;label&amp;gt;UserName :&amp;lt;/label&amp;gt;
&amp;lt;input type="text" name="username"/&amp;gt;&amp;lt;br /&amp;gt;
&amp;lt;label&amp;gt;Password :&amp;lt;/label&amp;gt;
&amp;lt;input type="password" name="password"/&amp;gt;&amp;lt;br/&amp;gt;
&amp;lt;input type="submit" value=" Login "/&amp;gt;&amp;lt;br /&amp;gt;
&amp;lt;/form&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;db.php&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: blue;"&gt;
&lt;b&gt;Database configuration file.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="php" name="code"&gt;&amp;lt;?php
$mysql_hostname = "hostname";
$mysql_user = "username";
$mysql_password = "password";
$mysql_database = "database";
$bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password)
or die("Opps some thing went wrong");
mysql_select_db($mysql_database, $bd) or die("Opps some thing went wrong");
?&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;b style="color: red;"&gt;You Are Ready Now&lt;/b&gt;&lt;/div&gt;</description><link>http://www.codeslot.info/2012/06/php-login-script-with-encryption.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-vD1CeTULDcs/T9euQZM29MI/AAAAAAAAAJ4/RW5Gkh70jFM/s72-c/phpencryption.png' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-3147014995292155028</guid><pubDate>Tue, 12 Jun 2012 20:53:00 +0000</pubDate><atom:updated>2012-06-12T22:53:43.708+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>MySql</category><category domain='http://www.blogger.com/atom/ns#'>Database</category><title>Delicious Database Design: create tables and relationships with SQL</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-Up0w7sOVR8s/T9ZTMP5ih1I/AAAAAAAAAJA/MOj7mlRLVgI/s1600/base_de_datos-acdsee.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://2.bp.blogspot.com/-Up0w7sOVR8s/T9ZTMP5ih1I/AAAAAAAAAJA/MOj7mlRLVgI/s1600/base_de_datos-acdsee.jpg" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-ejRUleRmL6I/T4sDwlhWErI/AAAAAAAAACE/-SZJCE-HoWQ/s1600/802a052hLZm.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;br /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: blue; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;In the &lt;a href="http://www.codeslot.info/2012/06/delicious-database-design-relationships.html"&gt;previous lesson&lt;/a&gt; we have seen how to design the &lt;i&gt;relationship-entities model&lt;/i&gt; for a  database to be used in a del.icio.us-like web site project. &lt;/b&gt;&lt;/div&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;b&gt;Our R-E model is:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-lubHInzu8D8/T9eooLpPTeI/AAAAAAAAAJk/8jxz5fnWyW8/s1600/sitelinks.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="228" src="http://2.bp.blogspot.com/-lubHInzu8D8/T9eooLpPTeI/AAAAAAAAAJk/8jxz5fnWyW8/s320/sitelinks.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style="color: #20124d; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;&amp;nbsp;Now we implement the database using SQL and phpMyAdmin. We crate a new 
database on phpMyAdmin and select the "SQL" tab. Copy and paste this SQL
 code into the form and click on execute button:&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="background-color: #45818e;"&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;CREATE TABLE USER&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;&amp;nbsp;(&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;user_id_pk INT NOT NULL AUTO_INCREMENT,&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;user_name VARCHAR(40),
email VARCHAR(40),&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;password VARCHAR(20),&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;user_date DATE,&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;PRIMARY KEY (user_id_pk)&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;&amp;nbsp;) TYPE=INNODB;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;CREATE TABLE SITE&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;(&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;site_id_pk INT NOT NULL AUTO_INCREMENT,&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;url VARCHAR(250),&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;description LONGTEXT,&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;share_data DATA,
PRIMARY KEY&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;) TYPE=INNODB;&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;CREATE TABLE SHARE&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;&amp;nbsp;(&amp;nbsp;&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;share_id_pk INT NOT NULL AUTO_INCREMENT,&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;user_id INT NOT NULL,&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;site_id INT NOT NULL,&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;submitted_by INT NOT NULL DEFAULT 0,&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;PRIMARY KEY (share_id_pk),&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;FOREIGN KEY (user_id) REFERENCES USER(user_id_pk) ON UPDATE CASCADE ON DELETE CASCADE,
FOREIGN KEY (site_id) REFERENCES SITE(site_id_pk) ON UPDATE CASCADE ON DELETE CASCADE&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: white;"&gt;
&lt;b&gt;&amp;nbsp;) TYPE=INNODB;

&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;b style="color: red;"&gt;Create Relationships&lt;/b&gt;&lt;br /&gt;
To create relationships between database's table (for example between &lt;i&gt;SHARE&lt;/i&gt; table and the other tables) you have to use the SQL code below:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: white;"&gt;
&lt;span style="background-color: #76a5af;"&gt;FOREIGN KEY (attribute_name_1) REFERENCES tableOfReference(attribute_name_2) &lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
where &lt;i&gt;attribute_name_1&lt;/i&gt; is the foreign key (generally, a field of type INTEGER)a and &lt;i&gt;attribute_name_2&lt;/i&gt; the primary key of the table of destination.&lt;br /&gt;
&lt;br /&gt;
To force the &lt;i&gt;referencial integrity&lt;/i&gt; between the data of database, you have to add this code:&lt;br /&gt;
&lt;br /&gt;
&lt;div class="code" style="background-color: #45818e; color: white;"&gt;
&lt;b&gt;ON UPDATE CASCADE ON DELETE CASCADE&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;&amp;nbsp;Our database is now ready&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;</description><link>http://www.codeslot.info/2012/06/delicious-database-design-create-tables.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-Up0w7sOVR8s/T9ZTMP5ih1I/AAAAAAAAAJA/MOj7mlRLVgI/s72-c/base_de_datos-acdsee.jpg' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-4143154862813988947</guid><pubDate>Mon, 11 Jun 2012 20:29:00 +0000</pubDate><atom:updated>2012-06-12T22:57:24.615+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>MySql</category><category domain='http://www.blogger.com/atom/ns#'>Database</category><title>Delicious Database Design: relationships</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-Up0w7sOVR8s/T9ZTMP5ih1I/AAAAAAAAAJA/MOj7mlRLVgI/s1600/base_de_datos-acdsee.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="240" src="http://2.bp.blogspot.com/-Up0w7sOVR8s/T9ZTMP5ih1I/AAAAAAAAAJA/MOj7mlRLVgI/s320/base_de_datos-acdsee.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;b style="color: red; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;This lesson explains how to project a typical relationships-entities 
model for a database to be used in our web projects. &lt;/b&gt;&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;b style="color: red; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;My approach is:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style="color: #20124d; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;1. Define database entities (tables)&lt;br /&gt;
2. Identify attributes for tables&lt;br /&gt;
3. Define relationships and cardinality between the instances (records) of tables.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b style="color: blue;"&gt;Step 1: define database entities&lt;/b&gt;&lt;br /&gt;
The first step when you project a database is to identify all entities (tables). For example if we want to project a simplified &lt;b&gt;del.icio.us&lt;/b&gt;-like web site, our database will have these entities:&lt;br /&gt;
&lt;b style="font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;&lt;br style="color: #660000;" /&gt;&lt;span style="color: #660000;"&gt;
1. - &lt;/span&gt;&lt;i style="color: #660000;"&gt;USER&lt;/i&gt;&lt;span style="color: #660000;"&gt; (to store data about users, email, password, nickname,...)&lt;/span&gt;&lt;br style="color: #660000;" /&gt;&lt;span style="color: #660000;"&gt;
2. - &lt;/span&gt;&lt;i style="color: #660000;"&gt;SITE&lt;/i&gt;&lt;span style="color: #660000;"&gt; (to store data about the sites added by the users)&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-iqeB1l6G1Hg/T9ZTpxwMMfI/AAAAAAAAAJI/F_6Os-vMJqo/s1600/usersite.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="98" src="http://1.bp.blogspot.com/-iqeB1l6G1Hg/T9ZTpxwMMfI/AAAAAAAAAJI/F_6Os-vMJqo/s320/usersite.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
These are only the main entities required from our project but, take a 
mind, that we will add other tables to store data about relationships 
between istances (records) of these tables in case of cardinality (M:M),
 &lt;i&gt;many to many&lt;/i&gt; (see &lt;b&gt;Step 3&lt;/b&gt;).&lt;br /&gt;
&lt;br /&gt;
&lt;b style="color: red;"&gt;Step 2: define attributes&lt;/b&gt;&lt;br /&gt;
The next step is to define attributes for the tables USER and SITE. In this semplified example we will have something like this:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #d9ead3;"&gt;
USER&lt;br /&gt;
-----------&lt;br /&gt;
user_id_pk (Primary Key)&lt;br /&gt;
user_name&lt;br /&gt;
email&lt;br /&gt;
password&lt;br /&gt;
user_data (user signup date)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SITE&lt;br /&gt;
-----------&lt;br /&gt;
site_id_pk (Primary Key)&lt;br /&gt;
url&lt;br /&gt;
description&lt;br /&gt;
share_user (total number of users that share a site)&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://4.bp.blogspot.com/-DNEFBAV_uv0/T9ZT_umoaCI/AAAAAAAAAJQ/8Qv08iZSEdE/s1600/usesitedata.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="136" src="http://4.bp.blogspot.com/-DNEFBAV_uv0/T9ZT_umoaCI/AAAAAAAAAJQ/8Qv08iZSEdE/s320/usesitedata.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b style="color: red;"&gt;Step 3: define database relationships&lt;/b&gt;&lt;br /&gt;
Our simple application &lt;b&gt;del.icio.us&lt;/b&gt;-like works in this way: an user add a site that can be shared by other users. The relationship's cardinality between &lt;i&gt;USER&lt;/i&gt; table and &lt;i&gt;SITE&lt;/i&gt; table is:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: #20124d;"&gt;
&lt;b&gt;USER &amp;gt; SITE (M:M) - Many to Many (an user can add many sites).&lt;br /&gt;
SITE &amp;gt; USER (M:M) - Many to Many (a site can be shared by many users).&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
In this case ( cardinality M:M) we have to add a new table (SHARE) that 
contains all possible combination between all instances of USER table 
and SITE table . In this new table, SHARE, to identify an user that 
share a site added by another user or by itself, we will add two Foreign
 Key:&lt;br /&gt;
&lt;br /&gt;
&lt;div style="background-color: #a2c4c9;"&gt;
SHARE&lt;br /&gt;
-----------&lt;br /&gt;
share_id_pk (Primary Key)&lt;br /&gt;
user_id (Foreign Key &amp;gt; USER)&lt;br /&gt;
site_id (Foreign Key &amp;gt;SITE)&lt;br /&gt;
submitted_by (boolean: flag only if the current user has submitted the site)&lt;/div&gt;
&lt;br /&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://2.bp.blogspot.com/-ZKVERpV0iew/T9ZUcK-TpfI/AAAAAAAAAJY/TDPb9NP2NgM/s1600/sitelinks.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="228" src="http://2.bp.blogspot.com/-ZKVERpV0iew/T9ZUcK-TpfI/AAAAAAAAAJY/TDPb9NP2NgM/s320/sitelinks.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;b&gt;Implement your database using SQL&lt;/b&gt;&lt;br /&gt;
Now, our database is ready to be implement with a DBMS (for example using MySQL). The &lt;a href="http://www.codeslot.info/2012/06/delicious-database-design-create-tables.html"&gt;next lesson will explains&lt;/a&gt; how to implement this database using SQL language.&lt;br /&gt;&lt;br /&gt;the next lesson is&lt;br /&gt;
&lt;br /&gt;
&lt;h3 class="post-title entry-title"&gt;
&lt;a href="http://www.codeslot.info/2012/06/delicious-database-design-create-tables.html"&gt;Delicious Database Design: create tables and relationships with SQL&lt;/a&gt;&lt;/h3&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</description><link>http://www.codeslot.info/2012/06/delicious-database-design-relationships.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/-Up0w7sOVR8s/T9ZTMP5ih1I/AAAAAAAAAJA/MOj7mlRLVgI/s72-c/base_de_datos-acdsee.jpg' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-5106294916090381168</guid><pubDate>Mon, 11 Jun 2012 19:00:00 +0000</pubDate><atom:updated>2012-06-11T21:00:44.161+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>Php</category><category domain='http://www.blogger.com/atom/ns#'>form</category><category domain='http://www.blogger.com/atom/ns#'>Zip</category><title>Creating ZIP File with PHP.</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-zQqO9GuY62o/T9Y931QaosI/AAAAAAAAAIA/7iANJWb1kM4/s1600/zip.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="121" src="http://3.bp.blogspot.com/-zQqO9GuY62o/T9Y931QaosI/AAAAAAAAAIA/7iANJWb1kM4/s320/zip.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: blue; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;This post helps you to create  a ZIP file using PHP, It is useful for e-commerce web projects&lt;/b&gt;&lt;/div&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;b&gt; like selling PDFs, Images and 
Docs etc,use can choose files and download it into compressed format.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;HTML Code&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: #274e13;"&gt;
&lt;b&gt;Form contains list of files with input type checkbox name &lt;i&gt;files[]&lt;/i&gt;.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;form name="zips" method="post"&amp;gt;

&amp;lt;input type="checkbox" name="files[]" value="flowers.jpg" /&amp;gt;
&amp;lt;img src="files/image.png" /&amp;gt;
flowers.jpg

&amp;lt;input type="checkbox" name="files[]" value="fun.jpg" /&amp;gt;
&amp;lt;img src="files/image.png" /&amp;gt;
fun.jpg

&amp;lt;input type="checkbox" name="files[]" value="codeslot.docx" /&amp;gt;
&amp;lt;img src="files/doc.png"   /&amp;gt;
CodeSlot.docx
........
&amp;lt;input type="submit" name="createpdf" value="Download as ZIP" /&amp;gt;&amp;amp;nbsp;
&amp;lt;input type="reset" name="reset"  value="Reset" /&amp;gt;
&amp;lt;/form&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;PHP Code&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: #274e13;"&gt;
&lt;b&gt;Contains PHP code covert the selected files into ZIP file format.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="php" name="code"&gt;&amp;lt;?php
$error = ""; //error holder
if(isset($_POST['createpdf']))
{
$post = $_POST;
$file_folder = "files/"; // folder to load files
if(extension_loaded('zip'))
{
// Checking ZIP extension is available
if(isset($post['files']) and count($post['files']) &amp;gt; 0)
{
// Checking files are selected
$zip = new ZipArchive(); // Load zip library
$zip_name = time().".zip"; // Zip name
if($zip-&amp;gt;open($zip_name, ZIPARCHIVE::CREATE)!==TRUE)
{
 // Opening zip file to load files
$error .= "* Sorry ZIP creation failed at this time";
}
foreach($post['files'] as $file)
{
$zip-&amp;gt;addFile($file_folder.$file); // Adding files into zip
}
$zip-&amp;gt;close();
if(file_exists($zip_name))
{
// push to download the zip
header('Content-type: application/zip');
header('Content-Disposition: attachment; filename="'.$zip_name.'"');
readfile($zip_name);
// remove zip file is exists in temp path
unlink($zip_name);
}

}
else
$error .= "* Please select file to zip ";
}
else
$error .= "* You dont have ZIP extension";
}
?&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</description><link>http://www.codeslot.info/2012/06/creating-zip-file-with-php.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-zQqO9GuY62o/T9Y931QaosI/AAAAAAAAAIA/7iANJWb1kM4/s72-c/zip.png' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-7630064351687320955</guid><pubDate>Fri, 08 Jun 2012 22:05:00 +0000</pubDate><atom:updated>2012-06-09T12:40:02.988+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>WebDesign</category><category domain='http://www.blogger.com/atom/ns#'>Image</category><category domain='http://www.blogger.com/atom/ns#'>Caption</category><category domain='http://www.blogger.com/atom/ns#'>Jquery</category><title>How to create an image caption with jQuery</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;/div&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-rwxpljhBFGA/T9J1YgsvwTI/AAAAAAAAAH0/YMKHxejpndo/s1600/Untitled.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" src="http://1.bp.blogspot.com/-rwxpljhBFGA/T9J1YgsvwTI/AAAAAAAAAH0/YMKHxejpndo/s1600/Untitled.png" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;This image caption is not a plugin – It merely allows you to understand how a jQuery image caption would be created.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style="color: blue;"&gt;








The HTML&lt;/h2&gt;
&lt;div style="color: #20124d;"&gt;
&lt;b&gt;The markup is very simple:&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;p class="caption"&amp;gt;
    &amp;lt;img src="images/image1.jpg" alt ="" /&amp;gt;
    &amp;lt;span&amp;gt;Rainbow and Tree&amp;lt;/span&amp;gt;
&amp;lt;/p&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: #20124d;"&gt;
&lt;b&gt;&lt;code&gt;As you can see, all that is needed is a paragraph tag with a class
 of "caption" that contains an image and a span tag. The span tag would 
be the caption information.&lt;br /&gt;
If you would like a heading within the caption, just enclose it within a &amp;lt;big&amp;gt; tag.&lt;/code&gt;&lt;/b&gt;&lt;/div&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;h2 style="color: blue;"&gt;







&lt;code&gt;The CSS&lt;/code&gt;&lt;/h2&gt;
&lt;pre class="css" name="code"&gt;div.clear {
 clear: both;
}
p.caption {
 display: block !important;
 position: relative !important;
}
p.caption img {
 position: absolute !important
}
p.caption span {
 background: #000;
 background: rgba(0,0,0,0.8);
 color: white !important;
 display: none;
 padding: 5px 10px !important;
 text-align: center;
 position: absolute !important;
 bottom: 0 !important;
 left: 0 !important;
}
p.caption span big {
 font-weight: bold;
}&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: #20124d;"&gt;
&lt;b&gt;&lt;code&gt;I've thrown quite a few !important's around to make sure other CSS
 selectors don't interfere with it. There isn't really anything 
interesting going on within the CSS. The span is set to display none 
because we only want it to display once we have hovered over the image. 
So for now, it is display: none.&lt;/code&gt;&lt;/b&gt;&lt;/div&gt;
&lt;code&gt;&lt;/code&gt;&lt;code&gt;&lt;/code&gt;&lt;br /&gt;
&lt;h2 style="color: blue;"&gt;






&lt;code&gt;The jQuery Javascript&lt;/code&gt;&lt;/h2&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;You Should Include The Jquery Library First&lt;/b&gt;&lt;/div&gt;
&lt;pre class="js" name="code"&gt;&amp;lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: #20124d;"&gt;
&lt;b&gt;Then Use This Script&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="js" name="code"&gt;&amp;lt;script type="text/javascript"&amp;gt;
$(window).load(function(){ 
// For each instance of p.caption
$("p.caption").each(function(){
$(this)
// Add the following CSS properties and values
.css({
// Height equal to the height of the image
"height" : $(this).children("img").height() + "px",
// Width equal to the width of the image
"width" : $(this).children("img").width() + "px"
})
// Select the child "span" of this p.caption
// Add the following CSS properties and values
.children("span").css(
// Width equal to p.caption
// But subtract 20px to callibrate for the padding
"width", $(this).width() - 20 + "px")
// find the &amp;lt;big&amp;gt; tag if it exists
// And then add the following div to break the line
.find("big").after('&amp;lt;div class="clear"&amp;gt;&amp;lt;/div&amp;gt;');
// When you hover over p.caption
$("p.caption").hover(function(){
// Fade in the child "span"
$(this).children("span").stop().fadeTo(400, 1);
}, function(){
// Once you mouse off, fade it out
$(this).children("span").stop().delay(600).fadeOut(400);
});
// End $(this)
});
});
&amp;lt;/script&amp;gt;&lt;/pre&gt;
&lt;div style="color: #20124d;"&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: #20124d;"&gt;
&lt;b&gt;It might look quite confusing but it's all very simple 
actually. What I've had to do is break up the code so that it is 
readable, otherwise it would all be on one line. Everything is done on a
 single $(this) statement.&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: #20124d;"&gt;
&lt;b&gt;The p.caption element's width and height are set to the same width 
and height as the image. That way there is a - {position: relative;} - 
wrapper and we can make the span tag act as a caption by sticking to the
 bottom of the image/wrapper.&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: #20124d;"&gt;
&lt;b&gt;Note: On the span tag - padding is definitely needed other wise the 
text sticks right up against the top and sides. This is the reason 
width: 100% could not be applied to it within the CSS, otherwise the 
span would start moving outside of the wrapper. Padding has been used on
 the span, but this is only because the total span-padding-width has 
been subtracted from the span's total width within the javascript.&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: #20124d;"&gt;
&lt;b&gt;//Set the span's width to the width of the image/p.caption, but subtract 20 - This 20 refers to the 10px padding on either side.&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: #20124d;"&gt;
&lt;b&gt;"width", $(this).width() - 20 + "px")&lt;/b&gt;&lt;/div&gt;
&lt;h2 style="color: red;"&gt;





Finally&lt;/h2&gt;
&lt;div style="color: #20124d;"&gt;
&lt;b&gt;So far, this image caption works with IE 7+, Opera 10, Webkit browsers and Firefox.&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: #20124d;"&gt;
&lt;b&gt;I hope you found this useful.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</description><link>http://www.codeslot.info/2012/06/how-to-create-image-caption-with-jquery.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-rwxpljhBFGA/T9J1YgsvwTI/AAAAAAAAAH0/YMKHxejpndo/s72-c/Untitled.png' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-6266602407960373161</guid><pubDate>Sat, 19 May 2012 20:42:00 +0000</pubDate><atom:updated>2012-05-19T22:42:26.140+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>WebDesign</category><category domain='http://www.blogger.com/atom/ns#'>Transition</category><category domain='http://www.blogger.com/atom/ns#'>Page</category><category domain='http://www.blogger.com/atom/ns#'>Html</category><category domain='http://www.blogger.com/atom/ns#'>Css</category><title>How To Make Page Transitions with CSS3</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/--emUqXMpKmw/T7gCToVdHWI/AAAAAAAAAHg/zsSjQ5vJzOw/s1600/demp.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="236" src="http://1.bp.blogspot.com/--emUqXMpKmw/T7gCToVdHWI/AAAAAAAAAHg/zsSjQ5vJzOw/s320/demp.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: blue; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;we've seen a lot of single page websites lying around the internet, most
 of them using JavaScript for some transitions effect.&lt;/b&gt;&lt;/div&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;b&gt; Well, now I'm 
gonna teach you how you can have your own, but instead I'll be using CSS
 Transitions and the :target property to do all the magic.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style="color: red;"&gt;






Markup&lt;/h3&gt;
&lt;div style="color: #20124d; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;The HTML will contain five main divisions: a header and the four 
content sections. Each of the content sections is going to have an ID 
and the class &lt;/b&gt;&lt;b&gt;panel. Moreover, we will add another division inside which will have the class &lt;/b&gt;&lt;b&gt;content. The first content section which is #home will only have the &lt;/b&gt;&lt;b&gt;content class and will not require an extra division:&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;!-- Home --&amp;gt;
&amp;lt;div id="home" class="content"&amp;gt;
 &amp;lt;h2&amp;gt;Home&amp;lt;/h2&amp;gt;
 &amp;lt;p&amp;gt;Some content&amp;lt;/p&amp;gt;
 &amp;lt;!-- ... --&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;!-- /Home --&amp;gt;

&amp;lt;!-- Portfolio --&amp;gt;
&amp;lt;div id="portfolio" class="panel"&amp;gt;
 &amp;lt;div class="content"&amp;gt;
  &amp;lt;h2&amp;gt;Portfolio&amp;lt;/h2&amp;gt;
  &amp;lt;p&amp;gt;Some content&amp;lt;/p&amp;gt;
  &amp;lt;!-- ... --&amp;gt;
 &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;!-- /Portfolio --&amp;gt;

&amp;lt;!-- About --&amp;gt;
&amp;lt;div id="about" class="panel"&amp;gt;
 &amp;lt;div class="content"&amp;gt;
  &amp;lt;h2&amp;gt;About&amp;lt;/h2&amp;gt;
  &amp;lt;p&amp;gt;Some content&amp;lt;/p&amp;gt;
  &amp;lt;!-- ... --&amp;gt;
 &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;!-- /About --&amp;gt;

&amp;lt;!-- Contact --&amp;gt;
&amp;lt;div id="contact" class="panel"&amp;gt;
 &amp;lt;div class="content"&amp;gt;
  &amp;lt;h2&amp;gt;Contact&amp;lt;/h2&amp;gt;
  &amp;lt;p&amp;gt;Some content&amp;lt;/p&amp;gt;
  &amp;lt;!-- ... --&amp;gt;
 &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;!-- /Contact --&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: #20124d; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;In the header we will have the main heading and the navigation:&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;!-- Header with Navigation --&amp;gt;
&amp;lt;div id="header"&amp;gt;
 &amp;lt;h1&amp;gt;Page Transitions with CSS3&amp;lt;/h1&amp;gt;
 &amp;lt;ul id="navigation"&amp;gt;
  &amp;lt;li&amp;gt;&amp;lt;a id="link-home" href="#home"&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;&amp;lt;a id="link-portfolio" href="#portfolio"&amp;gt;Portfolio&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;&amp;lt;a id="link-about" href="#about"&amp;gt;About Me&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
  &amp;lt;li&amp;gt;&amp;lt;a id="link-contact" href="#contact"&amp;gt;Contact&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
 &amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: #20124d; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;The reason for having such an “unordered” structure by adding the 
header to the end, is that we make the navigation “reachable” using the 
general sibling selector (~), so that we can color the respective items 
differently.&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: #20124d; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;Now, the main idea is to use the pseudo-class :target in order to add
 a transition to the current section. In this example, we will be 
sliding up and down our sections.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h3&gt;




&lt;span style="color: red;"&gt;CSS&lt;/span&gt;&lt;/h3&gt;
&lt;div style="color: #4c1130; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;First we will give style to our header and the navigation. We want to
 keep these on the same spot at all the time, even though everything 
else will be moving.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="css" name="code"&gt;#header{
 position: absolute;
 z-index: 2000;
 width: 235px;
 top: 50px;
}
#header h1{
 font-size: 30px;
 font-weight: 400;
 text-transform: uppercase;
 color: rgba(255,255,255,0.9);
 text-shadow: 0px 1px 1px rgba(0,0,0,0.3);
 padding: 20px;
 background: #000;
}
#navigation {
 margin-top: 20px;
 width: 235px;
 display:block;
 list-style:none;
 z-index:3;
}
#navigation a{
 color: #444;
 display: block;
 background: #fff;
 background: rgba(255,255,255,0.9);
 line-height: 50px;
 padding: 0px 20px;
 text-transform: uppercase;
 margin-bottom: 6px;
 box-shadow: 1px 1px 2px rgba(0,0,0,0.2);
 font-size: 14px;
}
#navigation a:hover {
 background: #ddd;
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: #0c343d; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;All the sections except #home have the &lt;/b&gt;&lt;b&gt;panel class. 
Here we will be using the transition whenever an element with this class
 gets “targeted”. The trick is to use a negative margin in the “normal” 
class and no margin at all in the :target pseudo-class. Adding a 
transitions will make the panel slide from the top whenever one is 
“selected”:&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="css" name="code"&gt;.panel{
 min-width: 100%;
 height: 98%;
 overflow-y: auto;
 overflow-x: hidden;
 margin-top: -150%;
 position: absolute;
 background: #000;
 box-shadow: 0px 4px 7px rgba(0,0,0,0.6);
 z-index: 2;
 -webkit-transition: all .8s ease-in-out;
 -moz-transition: all .8s ease-in-out;
 -o-transition: all .8s ease-in-out;
 transition: all .8s ease-in-out;
}
.panel:target{
 margin-top: 0%;
 background-color: #ffcb00;
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: #4c1130; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;Next, let’s style the &lt;/b&gt;&lt;b&gt;content class that all our sections have:&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="css" name="code"&gt;.content{
 right: 40px;
 left: 280px;
 top: 0px;
 position: absolute;
 padding-bottom: 30px;
}
.content h2{
 font-size: 110px;
 padding: 10px 0px 20px 0px;
 margin-top: 52px;
 color: #fff;
 color: rgba(255,255,255,0.9);
 text-shadow: 0px 1px 1px rgba(0,0,0,0.3);
}
.content p{
 font-size: 18px;
 padding: 10px;
 line-height: 24px;
 color: #fff;
 display: inline-block;
 background: black;
 padding: 10px;
 margin: 3px 0px;
}
&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: #4c1130; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;In order to change the color of the current item in the navigation, 
we’ll use the :target pseudo-class with the general sibling selector to 
“get to” the respective navigation item:&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: #0c343d; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: #0c343d; font-family: Georgia,&amp;quot;Times New Roman&amp;quot;,serif;"&gt;
&lt;b&gt;#home:target ~ #header #navigation #link-home,
#portfolio:target ~ #header #navigation #link-portfolio,
#about:target ~ #header #navigation #link-about,
#contact:target ~ #header #navigation #link-contact{
background: #000;
color: #fff;
&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;So The Final Full Code Will Be&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: red;"&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;&amp;nbsp;Markup
&lt;/b&gt;&lt;/div&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;!-- Home --&amp;gt;
&amp;lt;div id="home" class="content"&amp;gt;
 &amp;lt;h2&amp;gt;Home&amp;lt;/h2&amp;gt;
 &amp;lt;p&amp;gt;Some content&amp;lt;/p&amp;gt;
 &amp;lt;!-- ... --&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;!-- /Home --&amp;gt;

&amp;lt;!-- Portfolio --&amp;gt;
&amp;lt;div id="portfolio" class="panel"&amp;gt;
 &amp;lt;div class="content"&amp;gt;
  &amp;lt;h2&amp;gt;Portfolio&amp;lt;/h2&amp;gt;
  &amp;lt;p&amp;gt;Some content&amp;lt;/p&amp;gt;
  &amp;lt;!-- ... --&amp;gt;
 &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;!-- /Portfolio --&amp;gt;

&amp;lt;!-- About --&amp;gt;
&amp;lt;div id="about" class="panel"&amp;gt;
 &amp;lt;div class="content"&amp;gt;
  &amp;lt;h2&amp;gt;About&amp;lt;/h2&amp;gt;
  &amp;lt;p&amp;gt;Some content&amp;lt;/p&amp;gt;
  &amp;lt;!-- ... --&amp;gt;
 &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;!-- /About --&amp;gt;

&amp;lt;!-- Contact --&amp;gt;
&amp;lt;div id="contact" class="panel"&amp;gt;
 &amp;lt;div class="content"&amp;gt;
  &amp;lt;h2&amp;gt;Contact&amp;lt;/h2&amp;gt;
  &amp;lt;p&amp;gt;Some content&amp;lt;/p&amp;gt;
  &amp;lt;!-- ... --&amp;gt;
 &amp;lt;/div&amp;gt;
&amp;lt;/div&amp;gt;
&amp;lt;!-- /Contact --&amp;gt;
&amp;lt;!-- Header with Navigation --&amp;gt;
&amp;lt;div id="header"&amp;gt;
&amp;lt;h1&amp;gt;Page Transitions with CSS3&amp;lt;/h1&amp;gt;
&amp;lt;ul id="navigation"&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;a id="link-home" href="#home"&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;a id="link-portfolio" href="#portfolio"&amp;gt;Portfolio&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;a id="link-about" href="#about"&amp;gt;About Me&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;li&amp;gt;&amp;lt;a id="link-contact" href="#contact"&amp;gt;Contact&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;
&amp;lt;/ul&amp;gt;
&amp;lt;/div&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;Css&lt;/b&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="css" name="code"&gt;#header{
 position: absolute;
 z-index: 2000;
 width: 235px;
 top: 50px;
}
#header h1{
 font-size: 30px;
 font-weight: 400;
 text-transform: uppercase;
 color: rgba(255,255,255,0.9);
 text-shadow: 0px 1px 1px rgba(0,0,0,0.3);
 padding: 20px;
 background: #000;
}
#navigation {
 margin-top: 20px;
 width: 235px;
 display:block;
 list-style:none;
 z-index:3;
}
#navigation a{
 color: #444;
 display: block;
 background: #fff;
 background: rgba(255,255,255,0.9);
 line-height: 50px;
 padding: 0px 20px;
 text-transform: uppercase;
 margin-bottom: 6px;
 box-shadow: 1px 1px 2px rgba(0,0,0,0.2);
 font-size: 14px;
}
#navigation a:hover {
 background: #ddd;
}
.panel{
 min-width: 100%;
 height: 98%;
 overflow-y: auto;
 overflow-x: hidden;
 margin-top: -150%;
 position: absolute;
 background: #000;
 box-shadow: 0px 4px 7px rgba(0,0,0,0.6);
 z-index: 2;
 -webkit-transition: all .8s ease-in-out;
 -moz-transition: all .8s ease-in-out;
 -o-transition: all .8s ease-in-out;
 transition: all .8s ease-in-out;
}
.panel:target{
 margin-top: 0%;
 background-color: #ffcb00;
}
.content{
 right: 40px;
 left: 280px;
 top: 0px;
 position: absolute;
 padding-bottom: 30px;
}
.content h2{
 font-size: 110px;
 padding: 10px 0px 20px 0px;
 margin-top: 52px;
 color: #fff;
 color: rgba(255,255,255,0.9);
 text-shadow: 0px 1px 1px rgba(0,0,0,0.3);
}
.content p{
 font-size: 18px;
 padding: 10px;
 line-height: 24px;
 color: #fff;
 display: inline-block;
 background: black;
 padding: 10px;
 margin: 3px 0px;
}

&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="text-align: center;"&gt;
&lt;b style="color: #20124d;"&gt;Have Fun :)&lt;/b&gt;&lt;/div&gt;
&lt;/div&gt;</description><link>http://www.codeslot.info/2012/05/how-to-make-page-transitions-with-css3.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/--emUqXMpKmw/T7gCToVdHWI/AAAAAAAAAHg/zsSjQ5vJzOw/s72-c/demp.png' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-8063581310868528934</guid><pubDate>Fri, 11 May 2012 17:29:00 +0000</pubDate><atom:updated>2012-05-11T19:39:51.527+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>WebDesign</category><category domain='http://www.blogger.com/atom/ns#'>Registeration</category><category domain='http://www.blogger.com/atom/ns#'>Php</category><category domain='http://www.blogger.com/atom/ns#'>form</category><category domain='http://www.blogger.com/atom/ns#'>Jquery</category><title>Creating A Registration Form with jQuery Like FaceBook</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://1.bp.blogspot.com/-hbT3V7sXuOI/T61Hq5uxARI/AAAAAAAAAHM/j9_uCVHA1rI/s1600/fb.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="258" src="http://1.bp.blogspot.com/-hbT3V7sXuOI/T61Hq5uxARI/AAAAAAAAAHM/j9_uCVHA1rI/s320/fb.png" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style="color: blue;"&gt;
&lt;b&gt;Facebook is a showcase of great UI design. And as it has  become a 
major part of our lives, it has also raised the bar for web development,
 pushing developers to meet higher expectations.&lt;/b&gt;&lt;/div&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;This however has a good side – it challenges web developers and 
designers to better themselves and constantly improve their work.&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;In this tutorial, we are going to learn from the best, and create a facebook-like sign up form.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;h3 style="color: #274e13;"&gt;









The HTML&lt;/h3&gt;
&lt;div style="color: #660000;"&gt;
&lt;b&gt;We start off by laying down the XHTML backbone&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="xml" name="code"&gt;&amp;lt;html&amp;gt;&amp;lt;body&amp;gt;
&amp;lt;div id="div-regForm"&amp;gt;
&amp;lt;div class="form-title"&amp;gt;Sign Up&amp;lt;/div&amp;gt;
&amp;lt;div class="form-sub-title"&amp;gt;It's free and anyone can join&amp;lt;/div&amp;gt;
&amp;lt;form id="regForm" action="submit.php" method="post"&amp;gt;
&amp;lt;table&amp;gt;
&amp;lt;tbody&amp;gt;
&amp;lt;tr&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;label for="fname"&amp;gt;First Name:&amp;lt;/label&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;div class="input-container"&amp;gt;
&amp;lt;input name="fname" id="fname" type="text" /&amp;gt;
&amp;lt;/div&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;label for="lname"&amp;gt;Last Name:&amp;lt;/label&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;div class="input-container"&amp;gt;
&amp;lt;input name="lname" id="lname" type="text"&amp;gt;
&amp;lt;/div&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;label for="email"&amp;gt;Your Email:&amp;lt;/label&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;div class="input-container"&amp;gt;
&amp;lt;input name="email" id="email" type="text" &amp;gt;
&amp;lt;/div&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;label for="pass"&amp;gt;New Password:&amp;lt;/label&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;div class="input-container"&amp;gt;
&amp;lt;input name="pass" id="pass" type="password"&amp;gt;
&amp;lt;/div&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;label for="sex-select"&amp;gt;I am:&amp;lt;/label&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;div class="input-container"&amp;gt;
&amp;lt;select name="sex-select" id="sex-select"&amp;gt;
&amp;lt;option value="0"&amp;gt;Select Sex:&amp;lt;/option&amp;gt;
&amp;lt;option value="1"&amp;gt;Female&amp;lt;/option&amp;gt;
&amp;lt;option value="2"&amp;gt;Male&amp;lt;/option&amp;gt;
&amp;lt;/select&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;label&amp;gt;Birthday:&amp;lt;/label&amp;gt;&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;div class="input-container"&amp;gt;
&amp;lt;select name="month"&amp;gt;
&amp;lt;option value="0"&amp;gt;Month:&amp;lt;/option&amp;gt;
&amp;lt;?=generate_options(1,12,'callback_month')?&amp;gt;
&amp;lt;/select&amp;gt;
&amp;lt;select name="day"&amp;gt;
&amp;lt;option value="0"&amp;gt;Day:&amp;lt;/option&amp;gt;
&amp;lt;?=generate_options(1,31)?&amp;gt;
&amp;lt;/select&amp;gt;&amp;lt;select name="year"&amp;gt;
&amp;lt;option value="0"&amp;gt;Year:&amp;lt;/option&amp;gt;
&amp;lt;?=generate_options(date('Y'),1900)?&amp;gt;
&amp;lt;/select&amp;gt;&amp;lt;/div&amp;gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;&amp;amp;nbsp;&amp;lt;/td&amp;gt;
&amp;lt;td&amp;gt;&amp;lt;input type="submit" class="greenButton" value="Sign Up" /&amp;gt;
&amp;lt;img id="loading" src="img/ajax-loader.gif" alt="working.." /&amp;gt;
&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;/tbody&amp;gt;
&amp;lt;/table&amp;gt;&amp;lt;/form&amp;gt;&amp;lt;div id="error"&amp;gt;
&amp;amp;nbsp;&amp;lt;/div&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
We begin by creating a div container for the form, to which we assign the id &lt;b style="color: #20124d;"&gt;div-regForm&lt;/b&gt;. In it we are going to position the various form components.&lt;br /&gt;
Later we create the headings of the form, properly styled with CSS, as you’ll see later.&lt;br /&gt;
Then we have the form itself. A note here would be to remember that 
the form does not actually get submitted by its own – its all done via 
AJAX, which means that it doesn’t really matter what you are going to 
put in the &lt;b&gt;method&lt;/b&gt; and &lt;b&gt;action&lt;/b&gt; attributes.&lt;br /&gt;
Inside the form, we position a table, which will allow us to easily 
create a grid layout for the form labels and fields. There’s been a 
debate on using tables in this manner since div layout came to fashion, 
but mind you that &lt;b&gt;facebook itself&lt;/b&gt; is using the same technique, which automatically wins it for me.&lt;br /&gt;
Every input field has a respective &lt;b&gt;label&lt;/b&gt; element serving as a, you guessed it – a field label. We are even using the &lt;b&gt;for&lt;/b&gt; attribute, which means that by clicking the label, you select the textbox on the right.&lt;br /&gt;
Next comes a select box and after this we have 3 very interesting 
lines, that I’ve highlighted for you. We use a neat little PHP function 
to generate all the &lt;b&gt;option&lt;/b&gt; elements that go into the select boxes comprising the selection of a birth date. We will talk about this in a minute.&lt;br /&gt;
Later we have the Sign Up button, and a little gif, which is hidden 
by default and shown only when AJAX requests are in progress.&lt;br /&gt;
The last div element is our error container, also hidden by default.&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style="color: blue;"&gt;








The CSS&lt;/h3&gt;
&lt;div style="color: #660000;"&gt;
&lt;b&gt;In order to convert our plain HTML coding into something eye-catching and facebook-likey, we need some serious styling.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="css" name="code"&gt;/* Page styles */

body,h1,h2,h3,p,td,quote,small,form,input,ul,li,ol,label{
 margin:0px;
 padding:0px;
}

body{
 margin-top:20px;
 font-family:Arial, Helvetica, sans-serif;
 color:#51555C;
 height:100%;

 font-size:11px;
}

/* Form styles */

input,select{
 padding:3px;
 color:#333333;

 border:1px solid #96A6C5;
 margin-top:2px;
 width:200px;
 font-size:11px;
}

select{
 width:auto;
 padding:2px;
}

.formline{
 padding:3px;
}

label{
 font-size:11px;
 text-align:right;
}

table{
 width:300px;
}

td{
 font-size:11px;
}

.input-container{
 padding:1px;
}

#div-regForm,.registered{
 border:3px solid #eeeeee;
 padding:15px;

 background:url(img/bg.jpg) repeat-x #cbd4e4;
 color:#203360;

 margin:30px auto 40px auto;
 width:400px;
}

.form-title,
.form-sub-title{
 font-size:20px;

 font-family:"Lucida Grande",Tahoma,Verdana,Arial,sans-serif;
 font-size:20px;
 font-weight:bold;
}

.form-sub-title{
 font-weight:normal;
 padding:6px 0 15px 0;
}

.greenButton{
 width:auto;
 margin:10px 0 0 2px;
 padding:3px 4px 3px 4px;
 color:white;
 background-color:#589d39;
 outline:none;
 border:1px solid #006600;
 font-weight:bold;
}

.greenButton:active{
 background-color:#006600;
 padding:4px 3px 2px 5px;
}

#loading{
 left:10px;
 position:relative;
 top:3px;
 visibility:hidden;
}

#error{
 background-color:#ffebe8;
 border:1px solid #dd3c10;
 padding:7px 3px;
 text-align:center;
 margin-top:10px;
 visibility:hidden;
}
&lt;/pre&gt;
&lt;br /&gt;
Lines 1-6 are where we &lt;b&gt;reset&lt;/b&gt; some of the XHTML elements, to ensure that they appear the same in all browsers.&lt;br /&gt;
We continue with styling the &lt;b&gt;body&lt;/b&gt; section and start styling the form elements.&lt;br /&gt;
The first elements we style are &lt;b&gt;input&lt;/b&gt; and &lt;b&gt;select&lt;/b&gt;.
 Select shares most of its styling with input, but also differs in width
 and padding, so we put an additional set of styles to cover them.&lt;br /&gt;
Its mostly widths and paddings down to line 81, where we style our sign up button. We have styles for both the &lt;b&gt;normal&lt;/b&gt;, non-pressed state, and the &lt;b&gt;active&lt;/b&gt;,
 pressed state. What the active state does, is that it moves the text 
label of the button to the bottom – right with one pixel, while 
darkening the background, which gives the illusion of the button being 
pressed.&lt;br /&gt;
The last two styles are &lt;b&gt;#loading&lt;/b&gt; and &lt;b&gt;#error&lt;/b&gt;, which select the respective elements by their ID’s and hide them with &lt;b&gt;visibility:hidden&lt;/b&gt; by default. We will only show them with jQuery when it is appropriate.&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style="color: blue;"&gt;







The PHP code&lt;/h3&gt;
&lt;div style="color: #660000;"&gt;
&lt;b&gt;Remember, when a few minutes ago I mentioned about the &lt;/b&gt;&lt;b&gt;generate_options PHP function?Here it is&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="php" name="code"&gt;function generate_options($from,$to,$callback=false)
{
 $reverse=false;

 if($from&amp;gt;$to)
 {
  $tmp=$from;
  $from=$to;
  $to=$tmp;

  $reverse=true;
 }

 $return_string=array();
 for($i=$from;$i&amp;lt;=$to;$i++)
 {
 $return_string[]='
 &amp;lt;option value="'.$i.'"&amp;gt;'.($callback?$callback($i):$i).'&amp;lt;/option&amp;gt;';
 }

 if($reverse)
 {
  $return_string=array_reverse($return_string);
 }

 return join('',$return_string);
}

function callback_month($month)
{
 return date('M',mktime(0,0,0,$month,1));
}

/* and here is how we use it (taken from our XHTML code above):
generate_options(1,31);    // generate days
generate_options(date('Y'),1900); // generate years, in reverse
generate_options(1,12,'callback_month');  // generate months
*/
&lt;/pre&gt;
&lt;br /&gt;
The first thing you notice in our &lt;b&gt;generate_options&lt;/b&gt; function are the parameters &lt;b&gt;$from&lt;/b&gt; and &lt;b&gt;$to&lt;/b&gt; for the range of options to be generated (days, months and years in our case), and an optional parameter &lt;b&gt;$callback&lt;/b&gt;, which is a callback function (more on that in a moment).&lt;br /&gt;
Inside the function, we define &lt;b&gt;$reverse&lt;/b&gt; as false. If we use the function in the following manner: &lt;b&gt;generate_options(1,31)&lt;/b&gt;,
 we are just generating a series of option elements and outputting them 
in the same order. If we switch the positions of the parameters the 
output is in reverse order.&lt;br /&gt;
This is exactly what we do in &lt;b&gt;line 5&lt;/b&gt;. We check if the range of &lt;b&gt;$from&lt;/b&gt; and &lt;b&gt;$to&lt;/b&gt; is reversed and setting &lt;b&gt;$reverse&lt;/b&gt; to &lt;b&gt;true&lt;/b&gt;.
 But in the same time, we are exchanging their values, so that we use 
the same for construct as in our normal generation.&amp;nbsp; If we haven’t done 
this we would have had to write another for to do this job.&lt;br /&gt;
Next we fill an array called &lt;b&gt;$return_string&lt;/b&gt; with the generated options, reversing it if necessary and outputting it as string by joining the array elements.&lt;br /&gt;
Remember the &lt;b&gt;$callback&lt;/b&gt; I talked about earlier? Here comes its part. On line 18 we check if&amp;nbsp; a $callback was supplied – as in &lt;b&gt;generate_options(1,12,’callback_month’)&lt;/b&gt;, and if it was, we execute the function and supplying the current &lt;b&gt;$i&lt;/b&gt; counter’s value. In practice, it is the same as if we were doing &lt;b&gt;callback_month($i)&lt;/b&gt;.&lt;br /&gt;
Later we have the &lt;b&gt;callback_month&lt;/b&gt; function, which we use as a callback in the month generation. It basically takes an integer parameter (our &lt;b&gt;$i&lt;/b&gt; above), and returns the month name as string.&lt;br /&gt;
&lt;br /&gt;
&lt;h3 style="color: blue;"&gt;






The jQuery source&lt;/h3&gt;
Ok, now that we have completed the form’s looks, we need to be able 
to send the data over to the PHP backend where it is processed. For this
 purpose, we are using jQuery, which you can include in page by putting 
these lines of code in your page’s head section:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="js" name="code"&gt;&amp;lt;script type="text/javascript"
src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"&amp;gt;
&amp;lt;/script&amp;gt;
&lt;/pre&gt;
&lt;br /&gt;
&lt;div style="color: #660000;"&gt;
&lt;b&gt;The library is automatically included from Google’s CDN. After that you can use jQuery’s ajax method.&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: #660000;"&gt;
&lt;b&gt;Here is the code located in &lt;/b&gt;&lt;b&gt;script.js.&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="js" name="code"&gt;$(document).ready(function(){

 // UPDATE: commented out because the submit() method was added below instead
 //$('.greenButton').click(function(){
 // register();

 //});

 $('#regForm').submit(function(e) {

  register();
  e.preventDefault();

 });

});

function register()
{
 hideshow('loading',1);
 error(0);

 $.ajax({
  type: "POST",
  url: "submit.php",
  data: $('#regForm').serialize(),
  dataType: "json",
  success: function(msg){

   if(parseInt(msg.status)==1)
   {
    window.location=msg.txt;
   }
   else if(parseInt(msg.status)==0)
   {
    error(1,msg.txt);
   }

   hideshow('loading',0);
  }
 });

}

function hideshow(el,act)
{
 if(act) $('#'+el).css('visibility','visible');
 else $('#'+el).css('visibility','hidden');
}

function error(act,txt)
{
 hideshow('error',act);
 if(txt) $('#error').html(txt);
}
&lt;/pre&gt;
&lt;br /&gt;
The first lines of code in &lt;b&gt;$(document).ready&lt;/b&gt; get executed after the page has loaded and bind our &lt;b&gt;register()&lt;/b&gt; function with the form’s onsubmit event utilizing the &lt;b&gt;preventDefault()&lt;/b&gt; method in order to stop the form from being submitted.&lt;br /&gt;
And here is the simplicity of the &lt;b&gt;$.ajax&lt;/b&gt; method (line 23) – in a few lines of code we send to &lt;b&gt;submit.php&lt;/b&gt; by &lt;b&gt;POST&lt;/b&gt; all of &lt;b&gt;regForm&lt;/b&gt;‘s fields (&lt;b&gt;regForm&lt;/b&gt;
 is the ID of our registration form). We receive a response in JSON 
format (for more on that later) which gets processed by the function 
given in &lt;b&gt;success&lt;/b&gt;. In this example (lines 30-37) we 
process the returned object and decide whether to show an error, or 
redirect to a registered-user-only page.&lt;br /&gt;
Later we have the &lt;b&gt;hideshow()&lt;/b&gt; function which hides or shows an element on the page (for example the rotating gif animation on our form) and the &lt;b&gt;error&lt;/b&gt; function which manages the displaying of errors on the form.&lt;br /&gt;
But how do we decide whether the information in the form is correct, and where to redirect the user if it is?&lt;br /&gt;
&lt;div style="color: blue;"&gt;
&lt;b&gt;This is done in &lt;/b&gt;&lt;b&gt;submit.php:&lt;/b&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;pre class="php" name="code"&gt;// we check if everything is filled in

if(strlen($_POST['fname'])==0 || strlen($_POST['lname'])==0 || strlen($_POST['email'])==0 || strlen($_POST['pass'])==0)
{
 die('{status:0,txt:"All the fields are required"}');
}

// is the sex selected?

if(!(int)$_POST['sex-select'])
{
 die('{status:0,txt:"You have to select your sex"}');
}

// is the birthday selected?

if(!(int)$_POST['day'] || !(int)$_POST['month'] || !(int)$_POST['year'])
{
 die('{status:0,txt:"You have to fill in your birthday"}');
}

// is the email valid?

if(!(preg_match("/^[\.A-z0-9_\-\+]+[@][A-z0-9_\-]+([.][A-z0-9_\-]+)+[A-z]{1,4}$/", $_POST['email'])))
 die('{status:0,txt:"You haven\'t provided a valid email"}');

echo '{status:1,txt:"registered.html"}';
&lt;/pre&gt;
&lt;br /&gt;
Here we check some of the most typical error situations. Every 
message, that we output, has to be formatted as a javascript object with
 &lt;b&gt;status&lt;/b&gt; and &lt;b&gt;txt&lt;/b&gt; properties. They are accessible in our AJAX as &lt;b&gt;msg.txt&lt;/b&gt; and &lt;b&gt;msg.status&lt;/b&gt;. The main idea here is that errors return a &lt;b&gt;status&lt;/b&gt;
 with a value of 0 and a successful registration returns a status 1, 
with txt being a URL of a resource accessible only for registered users.&lt;br /&gt;
&lt;b&gt;*Note&lt;/b&gt; that you’ll have to add code for inserting new
 database records, creating sessions and a few more error checks on your
 own, depending on your needs.&lt;br /&gt;
And with that our form is finished.&lt;/div&gt;</description><link>http://www.codeslot.info/2012/05/creating-registration-form-with-jquery.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/-hbT3V7sXuOI/T61Hq5uxARI/AAAAAAAAAHM/j9_uCVHA1rI/s72-c/fb.png' height='72' width='72'/><thr:total>0</thr:total></item><item><guid isPermaLink='false'>tag:blogger.com,1999:blog-5047031466589166993.post-6998749968006921111</guid><pubDate>Tue, 01 May 2012 20:23:00 +0000</pubDate><atom:updated>2012-05-01T22:33:37.501+02:00</atom:updated><category domain='http://www.blogger.com/atom/ns#'>MySql</category><category domain='http://www.blogger.com/atom/ns#'>Php</category><category domain='http://www.blogger.com/atom/ns#'>Create</category><category domain='http://www.blogger.com/atom/ns#'>Database</category><title>connect and create mysql database with php</title><description>&lt;div dir="ltr" style="text-align: left;" trbidi="on"&gt;
&lt;div class="separator" style="clear: both; text-align: center;"&gt;
&lt;a href="http://3.bp.blogspot.com/-yPiIKWyEIiA/T5rWvkKvXkI/AAAAAAAAAEw/-hxg7-yDmF8/s1600/Logo-mysql.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"&gt;&lt;img border="0" height="233" src="http://3.bp.blogspot.com/-yPiIKWyEIiA/T5rWvkKvXkI/AAAAAAAAAEw/-hxg7-yDmF8/s320/Logo-mysql.jpg" width="320" /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style="color: red;"&gt;
&lt;b&gt;this is a simple tutorial of how to connect and create mysql database with php.&lt;/b&gt;&lt;/div&gt;
&lt;a name='more'&gt;&lt;/a&gt;&lt;b&gt; it's a very good tutorial for beginners.&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style="color: blue;"&gt;







Create a Connection to a MySQL Database&lt;/h2&gt;
Before you can access data in a database, you must create a connection to 
the database.&lt;br /&gt;
In PHP, this is done with the mysql_connect() function.&lt;br /&gt;
&lt;h3 style="color: blue;"&gt;







Syntax&lt;/h3&gt;
&lt;h3 style="color: blue;"&gt;

&lt;span style="color: #20124d; font-weight: normal;"&gt;mysql_connect(servername,username,password); &lt;/span&gt;&lt;/h3&gt;
&lt;blockquote class="tr_bq" style="color: #20124d;"&gt;
&lt;div class="code notranslate"&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/blockquote&gt;
&lt;h3 style="color: blue;"&gt;







Example&lt;/h3&gt;
In the following example we store the connection in a variable ($con) for later use in the 
script. The "die" part will be executed if the connection fails:&lt;br /&gt;
&lt;pre class="php" name="code"&gt;&amp;lt;?php
$con = mysql_connect("localhost","hassan","abc123");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

// some code
?&amp;gt; 
&lt;/pre&gt;
&lt;br /&gt;
&lt;h2 style="color: blue;"&gt;






Closing a Connection&lt;/h2&gt;
The connection will be closed automatically when the script ends. To close the 
connection before, use the mysql_close() function:&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="php" name="code"&gt;&amp;lt;?php
$con = mysql_connect("localhost","hassan","abc123");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

// some code

mysql_close($con);
?&amp;gt; 

&lt;/pre&gt;
&lt;h2 style="color: red;"&gt;





Create a Database&lt;/h2&gt;
The CREATE DATABASE statement is used to create a database in MySQL.&lt;br /&gt;
&lt;h3 style="color: red;"&gt;





Syntax&lt;/h3&gt;
&lt;h3 style="color: red;"&gt;

&lt;span style="color: #20124d; font-weight: normal;"&gt;CREATE DATABASE database_name &lt;/span&gt;&lt;/h3&gt;
To get PHP to execute the statement above we must use the mysql_query() function. This function is used to 
send a query or command to a MySQL connection.&lt;br /&gt;
&lt;h3 style="color: red;"&gt;





Example&lt;/h3&gt;
The following example creates a database called "my_db":&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="php" name="code"&gt;&amp;lt;?php
$con = mysql_connect("localhost","hassan","abc123");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

if (mysql_query("CREATE DATABASE my_db",$con))
  {
  echo "Database created";
  }
else
  {
  echo "Error creating database: " . mysql_error();
  }

mysql_close($con);
?&amp;gt; 
&lt;/pre&gt;
&lt;br /&gt;
&lt;h2 style="color: red;"&gt;




Create a Table&lt;/h2&gt;
The CREATE TABLE statement is used to create a table in MySQL.&lt;br /&gt;
&lt;h3 style="color: red;"&gt;




Syntax&lt;/h3&gt;
&lt;h3&gt;




&lt;span style="font-size: small;"&gt;&lt;span style="font-weight: normal;"&gt;CREATE TABLE table_name&lt;/span&gt;&lt;i style="font-weight: normal;"&gt;&lt;br /&gt;
&lt;/i&gt;&lt;span style="font-weight: normal;"&gt;(&lt;/span&gt;&lt;br style="font-weight: normal;" /&gt;&lt;span style="font-weight: normal;"&gt;
column_name1 data_type,&lt;/span&gt;&lt;i style="font-weight: normal;"&gt;&lt;br /&gt;
&lt;/i&gt;&lt;span style="font-weight: normal;"&gt;column_name2 data_type,&lt;/span&gt;&lt;i style="font-weight: normal;"&gt;&lt;br /&gt;
&lt;/i&gt;&lt;span style="font-weight: normal;"&gt;column_name3 data_type,&lt;/span&gt;&lt;i style="font-weight: normal;"&gt;&lt;br /&gt;
....&lt;/i&gt;&lt;br style="font-weight: normal;" /&gt;&lt;span style="font-weight: normal;"&gt;
)&amp;nbsp;

&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;
We must add the CREATE TABLE statement to the mysql_query() function to 
execute the command.&lt;br /&gt;
&lt;h3 style="color: red;"&gt;




Example&lt;/h3&gt;
The following example creates a table named "Persons", with 
three columns. The column names will be "FirstName", "LastName" and 
"Age":&lt;br /&gt;
&lt;br /&gt;
&lt;pre class="php" name="code"&gt;&amp;lt;?php
$con = mysql_connect("localhost","hassan","abc123");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }

// Create database
if (mysql_query("CREATE DATABASE my_db",$con))
  {
  echo "Database created";
  }
else
  {
  echo "Error creating database: " . mysql_error();
  }

// Create table
mysql_select_db("my_db", $con);
$sql = "CREATE TABLE Persons
(
FirstName varchar(15),
LastName varchar(15),
Age int
)";

// Execute query
mysql_query($sql,$con);

mysql_close($con);
?&amp;gt; 
&lt;/pre&gt;
&lt;br /&gt;
&lt;b&gt;Important:&lt;/b&gt; A database must be selected before a table can be created. 
The database is selected with the mysql_select_db() function.&lt;br /&gt;
&lt;b&gt;Note:&lt;/b&gt; When you create a database field of type varchar, you must 
specify the maximum length 
of the field, e.g. varchar(15).&lt;br /&gt;
&lt;br /&gt;
&lt;h2 style="color: red;"&gt;



Primary Keys and Auto Increment Fields&lt;/h2&gt;
Each table should have a  
primary key field.&lt;br /&gt;
A primary key is used to uniquely identify the rows in a table. Each primary 
key value must be unique within the table. Furthermore, the primary key field 
cannot be null because the database engine requires a value to locate the 
record.&lt;br /&gt;
The following example sets the personID field as the primary key 
field. The primary key field is often an ID number, and is often used 
with the AUTO_INCREMENT setting. AUTO_INCREMENT automatically increases 
the value of the field 
by 1 each time a new 
record is added. To ensure that the primary key field cannot be null, we
 must add the NOT NULL 
setting to the field.&lt;br /&gt;
&lt;h3 style="color: red;"&gt;



Example&lt;/h3&gt;
&lt;pre class="php" name="code"&gt;$sql = "CREATE TABLE Persons 
(
personID int NOT NULL AUTO_INCREMENT,
PRIMARY KEY(personID),
FirstName varchar(15),
LastName varchar(15),
Age int
)";

mysql_query($sql,$con); 
&lt;/pre&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;</description><link>http://www.codeslot.info/2012/05/connect-and-create-mysql-database-with.html</link><author>noreply@blogger.com (Phoenix Elmasry)</author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/-yPiIKWyEIiA/T5rWvkKvXkI/AAAAAAAAAEw/-hxg7-yDmF8/s72-c/Logo-mysql.jpg' height='72' width='72'/><thr:total>0</thr:total></item></channel></rss>