Friday, 10 August 2012

How to take values associated with radio buttons & Check box in PHP

There is a big confusion in some freshers that how to take  values associated with radio button as well as check box in PHP. Here is the piece of code that helps to do so.

cricket <input type='radio' name='radio' id='radio1' value='cricket' />
football <input type='radio' name='radio' id='radio2' value='football' />
tennis <input type='radio' name='radio' id='radio3' value='tennis' />

Don't forget to add values attribute in input tag

Now lets look how to take values in php

<?php
    $val = $_POST['radio'];
    echo $val;
?>

this code will print the opted input radio.

similarly for check box

cricket <input type='checkbox' name='check[]' id='check1' value='cricket' />
football <input type='checkbox' name='check[]' id='check2' value='football' />
tennis <input type='checkbox' name='check[]' id='check3' value='tennis' />

here also we can have above piece of code. But if you choose cricket and football you will get it as an array
 so you can have

$var = implode(",",$_POST['check']);
echo $var

this will print cricket,football
 

New computer virus for hacking financial transactions.

kaspersky Labs detects a new virus which hacks financial transactions. This is a spy software which sends our activities in social networking sites and Emails.This virus is called as "Gauss" and it can attack basic computer functionality.  According to Kaspersky's invention the founder of new virus is same lab which made Stuxnet to attack Iran's Nuclear plan. Gauss virus has been affected by personal computers in the regions like Lebanon, Palestine etc..

Thursday, 9 August 2012

IBM Great Mind Challenge

IBM (International Business machine ) which was founded in 1896 conducting The Great Mind Challenge (TGMC) is an annual nationwide software development competition, created by the Academic Initiative of IBM, Now it is actively conducting in India.

College Students can join this competition, who form teams within their respective colleges. There are lot of prizes as well as fortunes for those who win the competition. TGMC has been awarded the Limca Book of Records for the largest competition for engineering students.

website to register: http://www-07.ibm.com/in/university/greatmind/tgmc.html

TGMC Archive: http://www-07.ibm.com/in/university/greatmind/tgmc_2010.html

Wednesday, 8 August 2012

refresh technique using javascript

Refresh using button click
<input type="button" value="Reload" onClick="document.location.reload(true)">

Refresh in particular time interval

<html>
<head>
<script type="text/JavaScript">
<!--
function refreshMe(timeoutPeriod) {
    setTimeout("location.reload(true);",refreshMe);
}
//   -->
</script>
</head>
<body onload="JavaScript:refreshMe(2000);">
</body>
</html>

by varying the timeout interval we can change the time interval between each refresh

careeradvent an innovative job site


careeradvent.com is one of the leading job site in Indian job market. The specialties of careeradvent are following
  • careeradvent registration is free and any type of job seeker get same service.
  • careeradvent connects job seeker, employer , consultancy, Educational and training Institutions
  • careeradvent helps consultancies, educational & Training institutes to conduction events like recruitment drives
  • careeradvent also offer consulting and expert advice for job seekers and freshers
  • careeradvent have strong privacy protecting policy
  • Any type of member can post job. But verified can access job seekers profile.
  • careeradvent have strong anti cheat policy
  • Only verified member can conduct and popularize their event through careeradvent
  • careeradvent have a research wing
click here to reach site 

Tuesday, 7 August 2012

Micorsoft is forced to change the Name "Metro UI"

Microsoft is forced to change the Metro UI name to some other. The new name is not decided yet.
the verge reported a news on that.

The Windows team is "working on a replacement term" according to the memo,
"and plans to land on that by the end of this week." Until then, employees have been advised to refer to
the Metro style user interface as the "Windows 8 style UI." The memo was distributed to
employees earlier this week, so we expect to hear official news about the Metro replacement by the weekend.

if they use metro anymore they should face legal allegation metro metro IG

Monday, 6 August 2012

Configure Outlook to make sure that mail have subject

If you send a mail with out proper subject name causes lot of problems. It may not get proper attention.
It may not get proper importance etc.. But in our day to day life we may forget to include some headings for our mail. We can configure our outlook for alerting, if we try to send a mail with out subject


1. Open your Outlook,
2. Press Alt+F11. This opens the Visual Basic Editor and open Project-Project 1 (left side). If this doesn’t open Project-Project 1 then Press Ctrl+R.
3. On the Left Pane, one can see "Microsoft Outlook Objects" or "Project1", expand this. Now one can see the "ThisOutLookSession".
4. Double click on "ThisOutLookSession". It will open up a Code Pane on the right hand side.
5. Copy and Paste the following code in the right pane (Code Pane) and save it

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Dim strSubject As String
strSubject = Item.Subject
If Len(Trim(strSubject)) = 0 Then
Prompt$ = "Subject is Empty. Are you sure you want to send the Mail?"
If MsgBox(Prompt$, vbYesNo + vbQuestion + vbMsgBoxSetForeground, "Check for Subject") = vbNo Then
Cancel = True
End If
End If
End Sub

6. After pasting click on file menu and the save the project1.
7. Now whenever you try to send a mail without subject, a pop-up will be raised to remind you of the blank subject.

Text Editors For web based applications


here is some beautiful text/html editors, that can be used for web based applications.

1.  TinyMCE
  View       Demo      Download

2. FCK Editor
   View   Demo   Download

3. NIC Edit
    View   Demo  Download


Eleven things for DEMO

1. Make UI more attractive
2. Use proper data, That means use data that is frequently used by our targeting client
3. Give user's name as our client names.
4. avoid all scope of application failure.
5. Run application several time before Demo
6. Write and prepare a script that we have to present in front of client
7. Use Local environment
8. Make sure that a reserved environment is ready(We can use this if some thing goes wrong)
9. Make sure that there must Internet connection
10. Understand about client who is listening your presentation, if they are technically strong they may review your code
11. Use all things standardized. (code, configuration etc..)

PHP code that displays database structure

 Here is the piece of code that displays database structure.
 

 
<?php
   
   mysql_connect("host_name","user","password") or die(mysql_error());
   mysql_select_db("database_name") or die(mysql_error());



   $result = mysql_query("SHOW TABLES;") or die(mysql_error());  

   while($row = mysql_fetch_array($result)){
  
 echo $row[0]; //print the table name
 
 $result2 = mysql_query("DESCRIBE ".$row[0].";") or die(mysql_error());
 //get details schema for each table

 
 echo "<table border='1' width='70%'>";
 echo "<tr><td>Field</td><td>Type</td><td>Null</td><td>Key</td>
<td>Default</td><td>Extra</td>";

 
 while($row2 = mysql_fetch_array($result2)){
   
  for($i=0; $i<6; $i++){ 
   if($row2[$i] == "" || $row2[$i] == NULL){
    $row2[$i] = " ";
   }
  }   
   
  echo "<tr>";

  echo "<td>".$row2[0]."</td><td>".$row2[1]."</td><td>".$row2[2]."</td>
<td>".$row2[3]."</td><td>".$row2[4]."</td><td>".$row2[5];

  echo "</tr>";
 }
 
 echo "</table>"; 
 echo "<br/>";
}

?>

generating random string in PHP

Hi here is the code which generate random string.

function rand_string( $length ) {
    $chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";   

    $size = strlen( $chars );
    for( $i = 0; $i < $length; $i++ ) {
        $str .= $chars[ rand( 0, $size - 1 ) ];
    }

    return $str;
}

Give $length as number of character required