HERE YOU CAN FREE DOWNLOADS JAVA,JSP,SERVLET,STRUTS,SPRING,HIBERNATE,J2EE PROJECTS AND SAMPLE SOURCE CODES ABSOLUTELY FREE AND ACADEMIC PROJECTS DOWNLODS FREE !!!!
Another way for running this example is to download this example, Extract it and put the extracted folder in the GWT directory. Place this extracted folder in the samples directory of the GWT toolkit. Just double click on the cmd SimpleXML-shell.cmd to view the output of the program.
$host = "localhost";
$user = "root";
$password = "root";
$database = "komal";
$connection = mysql_connect($host,$user,$password)
or die("Could not connect: ".mysql_error());
mysql_select_db($database,$connection)
or die("Error in selecting the database:".mysql_error());
$array = array(1,2,3,4);
foreach ($array as $value){
$sql="Select * from stu where id =".$value;
$sql_result=mysql_query($sql,$connection)
or exit("Sql Error".mysql_error());
$sql_num=mysql_num_rows($sql_result);
echo "
$text = "\t\tThese are a few words :) ... "; $trimmed = ltrim($text); // $trimmed = "These are a few words :) ... " $trimmed = ltrim($text," \t."); // $trimmed = "These are a few words :) ... " $clean = ltrim($binary,"\0x00..\0x1F"); // trim the ASCII control characters at the beginning of $binary // (from 0 to 31 inclusive)
?>
Right - rtrim() function
$text = "\t\tThese are a few words :) ... "; $trimmed = rtrim($text); // $trimmed = "\t\tThese are a few words :) ..." $trimmed = rtrim($text," \t."); // $trimmed = "\t\tThese are a few words :)" $clean = rtrim($binary,"\0x00..\0x1F"); // trim the ASCII control characters at the end of $binary // (from 0 to 31 inclusive)
#
# *** Set time stamp.Check for month requested(value from request form)
# *** If no value has been set then make it for current month
#
if(!$year){$year=2000; }
if(!$req_month || $req_month=="none")
{
$dt_and_tm=time();
}
else
{
$dt_and_tm=mktime(0,0,0,$req_month,1,$year);
}
#
# *** Find out the month number from the time stamp we just created
# *** Find out the day of the week from the same(0 to 6 for Sunday to
# *** Saturday) add "1" so that it becomes 1 to 7
#
$month=date("n",$dt_and_tm);
$week_day=date("w",$dt_and_tm)+1;
#
# *** Set number days in requested month
#
if($month==1 || $month==3 || $month==5 || $month==7 || $month==8 || $month==10 ||
$month==12)
{
$no_of_days=31;
}
elseif($month==4 || $month==6 || $month==9 || $month==11)
{
$no_of_days=30;
}
#
# *** If the month requested is Feb. Check whether it is Leap Year
#
elseif($month==2)
{
if(date("L",$dt_and_tm))
{ $no_of_days=29 ;}
else
{$no_of_days=28;}
}
$month_full=date("F",$dt_and_tm);
#
# ******* HTML code goes from here
# ******* First row in HTML table displays month and year
# ******* Second row is allotted for week days
# ******* Table contains six more rows (total 42 table cells)
#
?>
$year" ; ?>
Sun
face="Arial , Times New Roman " size=2 color="#ffffff">Mon
face="Arial , Times New Roman " size=2 color="#ffffff">Tue
face="Arial , Times New Roman " size=2 color="#ffffff">Wed
face="Arial , Times New Roman " size=2 color="#ffffff">Thu
face="Arial , Times New Roman " size=2 color="#ffffff">Fri
Sat
#
# *** We need to start form week day and print total number of days
# *** in this month.For that we need to find out the last cell.
# *** While looping end current row and start new row for each 7 cells
#
$last_cell=$week_day+$no_of_days;
for($i=1;$i<=42;$i++)
{
if($i==$week_day){$day=1;}
if($i<$week_day || $i>=$last_cell)
{
A couple of functions that convert an IP address into its color code
and not-color-code. Useful when viewing an apache log with a mysql result grouped by IP
/*this function converts $ipaddr into a color string*/
function IP2Color($ipaddr) {