Posts

Save HTML Content into Database

    Generally we have required to save HTML Content i.e. a HTML page or a Block of content into Database. But if we Directly save it to Database, Its throw error due to Special Character and Quotation in the Content.     So First we have to Convert it to database supported Value. We can do it by Decoding the html. In PHP we have a Function "htmlspecialchars" and for Decoding the Function is "htmlspecialchars_decode". So Here is the Code: Create a Form into a File i.e. "form.php". In this Example, we will get only one input on textarea. Code will be as Follow: ######################## Code for form.php ######################## <html> <head> <title> Form For HTML Element Save into Database. </title> </head> <body> <div style="width:250px;margin:0px auto;background:#666666;padding: 20px;"> <h4> Save HTML Content into Database </h4>

How to Connect Twitter to Facebook

Image
To Connect to Twitter to Facebook. Just open the Following Twitter link: https://twitter.com/settings/profile/ https://facebook.twitter.com/  Follow the step given there, Just a Easy step, you have to just Click Connect to Facebook.

How to Connect Facebook to Twitter

Image
To Connect to Facebook to Twitter, Just open the Following Facebook link: https://www.facebook.com/twitter/ Follow the step given there, Just a Easy step, you have to just Click Link to Twitter. 

How to Work with Select Box after POST Data in PHP

Everytime We create a form, we used Fields like Text-BOX, Select Box, Radio and Checkbox, Here we will understand a Function to POST data to be selected on database. PHP Code  <?php function isselected($value,$optionvalue)                         {                                  if ( $value == $optionvalue )                                                          {                                                                   return "selected='selected'";                                                          } else {                                                                return false;                                                           }                         } echo "<form method="POST">";             if(isset($_POST['selectbox']))                      {                                  $valueselected = $_POST['selectbox'];                       }             echo "&l

Plane Example in JQuery

Please Follow the Link for DEMO

A Program in Jquery for Excercise - Jquery

Image
A Program in Jquery for Pity - Jquery: Style to be Define (CSS): body { margin:0px; padding:0px;background:#cc0000; } .container { margin:0px auto; padding:10px; background:#0f0f0f; position:relative; min-height:100%; width:350px; text-align: center; } .container img { display:none; max-width:100%; } .container h3 { background: #cc0000; color: aqua; padding: 5px 5px; font-size: 35px; font-weight: normal; font-family: arial; } Script to be Define (.js file): /* A JQuery Program to run a Excercise */ function startpity() { $("#gamestatus").val('1'); } function stoppity() { $("#gamestatus").val('0'); } var runningtimer = 0; var starttimer = 0; var stoptimer = 0; function runthepity() { runningtimer++; var gamestatus = $("#gamestatus").val(); if( gamestatus ==1  ) { starttimer++; console.log('pity is run for '+starttim

A Program to Printing a Box from For loop.

A Program to Printing a Box from For loop. #################################### PHP Code #################################### <?php echo "<table cellspacing= '0' cellpadding= '0'><tr>"; for ($i=1;$i<=30;$i++) { echo "<td>"; for($j=1;$j<$i;$j++ ) { echo "*"; echo "<br/>"; } echo "</td>"; } for ($i=1;$i<=30;$i++) { echo "<td>"; for($j=30;$j>=$i;$j-- ) { echo "*"; echo "<br/>"; } echo "</td>"; } echo "<table><tr>"; ?> #################################### O/P of the Code #################################### * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *