Archive for Uncategorized

sinq

click form

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<style type=”text/css”>

body{
background-color: white;
color:blue;
font: normal 80% Verdana;
margin-top: 3px;
margin-left: 3px;
padding: 0;
margin-right: 5px;
}

table{
background-color: #EFEFEF;
font-size: 14px;
font-family: Arial;
font-weight: bold;
font-size: 100%;
margin-bottom: 0.8em;
}
</style>

<script language=”JavaScript”>
function check()
{

if(document.info.username.value==”")
{
alert(“please enter your username”)
return false
}

if(document.info.password.value==”")
{
alert(“please enter your password”)
return false
}

if(document.info.email.value==”")
{
alert(“please enter your email”)
return false
}

if(document.info.name.value==”")
{
alert(“please enter your name”)
return false
}

if((document.info.gender[0].checked==false)&&(document.info.gender[1].checked==false))
{
alert(“please select your gender”)
return false
}

if((document.info.day[document.info.day.selectedIndex].value==”day”) &&
(document.info.month[document.info.month.selectedIndex].value==”month”)  &&
(document.info.year[document.info.year.selectedIndex].value==”year”))
{
alert(“select your date of birth”)
return false
}

if(document.info.residence.value==”")
{
alert(“please enter your residence number”)
return false
}

if(document.info.mobile.value==”")
{
alert(“please enter your mobile number”)
return false
}

if(document.info.resume.value==”")
{
alert(“please paste your resume”)
return false
}
return true
}

</script>
</head>
<body>

<?php
$month=array(1=>”january”,”february”,”march”,”april”,”may”,”june”,”july”,”agust”,”september”,”october”,”november”,”december”);
?>

<form action=”click.php” method=”post” name=”info” onSubmit=”return check()”>

<table align=”center” width=”777″ border=”2″ cellpadding=”5″ cellspacing=”5″>
<tr>
<td>
<table align=”center”>

<p><strong><lable for =”name”>Login Information:</label></strong>

<tr><td><p><lable for = “name”>username:</label></p></td>
<td><input name=”username” id=”username” type=”text”/></td></tr>

<tr><td><p><lable for = “name”>password:</label></p></td>
<td><input name=”password” id=”password” type=”password”/></td></tr>

<tr><td><p><lable for = “name”>email:</label></p></td>
<td><input name=”email” id=”email” type=”text” /></td></tr>

<tr><td><p><lable for = “name”>Name:</label></p></td>
<td><input name=”name” id=”name” type=”text”/></td></tr>

<tr><td><p><lable for = “name”>Gender:</label></p></td>
<td><input type=”radio” name=”gender” value=”male”>male &nbsp;&nbsp;</td>
<td><input type=”radio” name=”gender” value=”female”>female</td>
</tr>

<tr>
<td><p><lable for = “name”>Date of birth:</label></p></td>

<td><select name=”day” >
<option value=”day” selected>day</option>

<?php
for($i=1;$i<=31;$i++)
{
echo “<option value=\”$i\”>$i</option>”;
}
?>
</select>

<select name=”month”>
<option value=”month” selected>month</option>

<?php

for($i=1;$i<=12;$i++)
{
echo “<option value=\”$i\”>$month[$i]</option>”;
}
?>

</select>

<select name=”year”>
<option value=”year” selected>year</option>

<?php
for($i=1975;$i<=2007;$i++)
{
echo “<option value=\”$i\”>$i</option>”;
}
?>
</select></td>
</tr>
</table>

<!–<td><select name=”date” ><option label=”–date–” selected=”selected”>–date–</option>
<option label=”01″ value=”1″>01</option>
<option label=”02″ value=”2″>02</option>
<option label=”03″ value=”3″>03</option>
<option label=”04″ value=”4″>04</option>
<option label=”05″ value=”5″>05</option>
<option label=”06″ value=”6″>06</option>

<option label=”07″ value=”7″>07</option>
<option label=”08″ value=”8″>08</option>
<option label=”09″ value=”9″>09</option>
<option label=”10″ value=”10″>10</option>
<option label=”11″ value=”11″>11</option>
<option label=”12″ value=”12″>12</option>
<option label=”13″ value=”13″>13</option>
<option label=”14″ value=”14″>14</option>
<option label=”15″ value=”15″>15</option>

<option label=”16″ value=”16″>16</option>
<option label=”17″ value=”17″>17</option>
<option label=”18″ value=”18″>18</option>
<option label=”19″ value=”19″>19</option>
<option label=”20″ value=”20″>20</option>
<option label=”21″ value=”21″>21</option>
<option label=”22″ value=”22″>22</option>
<option label=”23″ value=”23″>23</option>
<option label=”24″ value=”24″>24</option>

<option label=”25″ value=”25″>25</option>
<option label=”26″ value=”26″>26</option>
<option label=”27″ value=”27″>27</option>
<option label=”28″ value=”28″>28</option>
<option label=”29″ value=”29″>29</option>
<option label=”30″ value=”30″>30</option>
<option label=”31″ value=”31″>31</option>
</select>&nbsp;

<select name=”month” ><option label=”–month–” selected=”selected”>–month–</option>

<option label=”January” value=”01″>January</option>
<option label=”February” value=”02″>February</option>
<option label=”March” value=”03″>March</option>
<option label=”April” value=”04″>April</option>
<option label=”May” value=”05″>May</option>
<option label=”June” value=”06″>June</option>
<option label=”July” value=”07″>July</option>
<option label=”August” value=”08″>August</option>
<option label=”September” value=”09″>September</option>

<option label=”October” value=”10″>October</option>
<option label=”November” value=”11″>November</option>
<option label=”December” value=”12″>December</option>
</select>&nbsp;

<select name=”year” ><option label=”–year–” selected=”selected”>–year–</option>

<option label=”1975″ value=”1975″>1975</option>
<option label=”1976″ value=”1976″>1976</option>
<option label=”1977″ value=”1977″>1977</option>
<option label=”1978″ value=”1978″>1978</option>

<option label=”1979″ value=”1979″>1979</option>
<option label=”1980″ value=”1980″>1980</option>
<option label=”1981″ value=”1981″>1981</option>
<option label=”1982″ value=”1982″>1982</option>
<option label=”1983″ value=”1983″>1983</option>
<option label=”1984″ value=”1984″>1984</option>
<option label=”1985″ value=”1985″>1985</option>
<option label=”1986″ value=”1986″>1986</option>
<option label=”1987″ value=”1987″>1987</option>

<option label=”1988″ value=”1988″>1988</option>
<option label=”1989″ value=”1989″>1989</option>
<option label=”1990″ value=”1990″>1990</option>
<option label=”1991″ value=”1991″>1991</option>
<option label=”1992″ value=”1992″>1992</option>
</select>
</td>
</tr>
</table>–>

<table align=”center”>
<p><strong><lable for =”name”>Contact Number:</label></strong></p>

<tr>
<td>Residence :&nbsp; &nbsp;<input name=”residence” type=”text”/></td></tr>

<tr><td>Mobile: &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<input name=”mobile” type=”text”/></td></tr>

<tr>
<td valign=”center”>Resume :&nbsp; &nbsp; &nbsp; &nbsp;<textarea cols=”40″ id=”resume” name=”resume” rows=”5″></textarea></td></tr>

<tr>
<td align=”right”><input type=”submit” id=”submit” value=”submit” style=”color:red; background-color:skyblue;”/>

</td></tr>
</table>

</td>
</tr>
</table>
</form>
</body>
</html>

<!–
<p><strong><lable for =”name”>Education:</label></strong></p>

<tr>
<th>Qualification</th>
<th>(if others)</th>
<th>Specialization</th>
<th>(if others)</th>
</tr>

<tr>
<td><select name=”degree” >
<option label=”–degree–” selected=”selected”>–degree–</option></select>&nbsp;
<td> <input name=”name” type=”text” /></td>
<td><select name=”specialization”>
<option label=”–specialization–” selected=”selected”>–specialization–</option></select>&nbsp;
<td> <input name=”name” type=”text” /></td>
</tr>
–>

emp validation

<html>
<head>
<title>Employee Details</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>

<script language=”javascript”>

function check()
{
if(document.emp_det.name.value==”")
{
alert(“please enter your name”)
return false
}
if((document.emp_det.day[document.emp_det.day.selectedIndex].value==”day”) &&
(document.emp_det.month[document.emp_det.month.selectedIndex].value==”month”)  &&
(document.emp_det.year[document.emp_det.year.selectedIndex].value==”year”))
{
alert(“select your date of birth”)
return false
}

if((document.emp_det.sex[0].checked==false)&&(document.emp_det.sex[1].checked==false))
{
alert(“please select your sex”)
return false
}

if(document.emp_det.address.value==”")
{
alert(“please enter your address”)
return false
}

if((document.emp_det.football.checked==false)&&(document.emp_det.volleyball.checked==false)&&(document.emp_det.cricket.checked==false))
{
alert(“please select your hobbies”)
return false
}
}
</script>

</head>

<body>
<?php
$month = array(1=>”january”,”february”,”march”,”april”,”may”,”june”,”july”,”augest”,”septemper”,”october”,”november”,”december”);
?>
<form action = “file:///D|/Program%20Files/EasyPHP1-8/www/selva/model/employee.php”  method = “POST” name=”emp_det” onSubmit=”return check()”>
<table border=”1″ align=”center”>

<TR>
<TD valign=”center”>
NAME:<input type=”text” name=”name” id=”name”>
</TD>
</TR>
<br/>

<TR>

<TD valign=”center”>
DOB:<select name=”day” >
<option value=”day” selected>day</option>

<?php
for($i=1;$i<=31;$i++)
{
echo “<option value=\”$i\”>$i</option>”;
}
?>
</select>

<select name=”month”>
<option value=”month” selected>month</option>

<?php
for($i=1;$i<=12;$i++)
{
echo “<option value=\”$i\”>$month[$i]</option>”;
}
?>

</select>

<select name=”year”>
<option value=”year” selected>year</option>

<?php
for($i=1975;$i<=2007;$i++)
{
echo “<option value=\”$i\”>$i</option>”;
}
?>
</select>

</TD>
</TR>
<br/>

<TR>
<TD valign=”center”>
SEX:<input type=”radio” name=”sex” value=”male”>male &nbsp;&nbsp;
<input type=”radio” name=”sex” value=”female”>female

</TD>

</TR>
<br/>

<TR>

<TD valign=”center”>
ADDRESS:<TEXTAREA cols=40 id=”address” name=”address” rows=3></TEXTAREA>
</TD>

</TR>
<br/>

<TR>

<TD valign=”center”>
HOBBIES:<input type=”checkbox” name=”football” value=”football”>FOOTBALL
<input type=”checkbox” name=”volleyball” value=”volleyball”>VOLLEYBALL
<input type=”checkbox” name=”cricket” value=”cricket”>CRICKET

</TD>
</TR>

<br/>

<TR>
<TD valign=”center”>
<input type = “submit”  value=”SUBMIT” id=”SUBMIT”>
</TD>
</TR>
</table>
</form>
</body>
</html>

online

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
</head>

<body>

http://www.i-fubar.com/random-string-generator.php

$query = “SELECT * FROM #__content WHERE state = 1 and sectionid=1 ORDER BY id DESC LIMIT 0,2″;

<!– joomla explode for1–>
——————————————————————————————————————————————

$ARRAY = explode(” “,$value->introtext,9);
$output =  $ARRAY[0].” “.$ARRAY[1].” “.$ARRAY[2].” “.$ARRAY[3].” “.$ARRAY[4].” “.$ARRAY[5].” “.$ARRAY[6].” “.$ARRAY[7];
//        print_r($ARRAY);
——————————————————————————————————————————————

<?php
$query = “SELECT * FROM #__content WHERE state = 1″;
$database->setQuery($query);
$row = $database->loadObjectList();

?>
<table width=”82%” border=”0″ cellspacing=”0″ cellpadding=”5″ align=”center”>
<?php
foreach($row as $value) {
$value = explode(” “,$value->introtext, 4);
$output = implode(” “,$value);
?>
<tr>
<td width=”31%”><img src=”<?php echo $template_path; ?>/images/news_gallery.jpg” width=”48″ height=”45″ /></td>
<td width=”69%” align=”left”><?php echo $output;  ?>
<h5><a href=”<?php echo $mosConfig_live_site;?>/index.php?option=com_content&task=section&id=1&Itemid=2″>more..</a></h5></td>
</tr>
<?php
}
?>
</table>

——————————————————————————————————————————————

<!– joomla explode for–>
<?php
$query = “SELECT * FROM #__content WHERE state = 1″;
$database->setQuery($query);
$row = $database->loadObjectList();

?>
<table width=”82%” border=”0″ cellspacing=”0″ cellpadding=”5″ align=”center”>
<?php
foreach($row as $value) {
$value = explode(” “,$value->introtext);
for($i=0; $i<10; $i++ ){
$output = $output.” “.$value[$i];
}
?>
<tr valign=”top”>
<td width=”31%”><img src=”<?php echo $template_path; ?>/images/news_gallery.jpg” width=”48″ height=”45″ /></td>
<td width=”69%” align=”left”><?php echo $output;  ?>
<h5><a href=”<?php echo $mosConfig_live_site;?>/index.php?option=com_content&task=section&id=1&Itemid=2″>more..</a></h5></td>
</tr>
<?php
}
?>
</table>

——————————————————————————————————————————————
<!– team photo joomla –>

<?php
$qry = “SELECT * FROM #__banner WHERE showBanner =1 ORDER BY bid DESC”;
$database->setQuery($qry);
$row = $database->loadObjectList();

$count = count($row);
$colspan = 4-($count%4)

?>

<div align=”center”>
<table border=”0″>

<?php
$tr=1;
$i =1;
foreach ($row as $value) { ?>
<?php
if($tr%4==1)
{
echo “<tr>”;
}?>

<td>
<img src=”<?php echo $mosConfig_live_site; ?>/images/banners/<?php echo $value->imageurl; ?>” border=”0″ />

<?php if($count==$i && $colspan > 0){ ?>

<?php echo  “<td colspan=$colspan>&nbsp;</td>” ?>

<?php } ?>

<?php
if($tr%4==0)
{
echo “</tr>”;
}
$tr++;
$i++;
}        ?>

</table>
</div>

<!– team photo –>
——————————————————————————————————————————————

joomla:

function saveBanner( $task ) {

global $database;

josSpoofCheck();

// insert query starts

$req_id = intval($_REQUEST['bid']);

$partner_name = $_POST['name'];
$url = $_POST['clickurl'];

//print_r($_REQUEST);

//die();

if(intval($_REQUEST['bid'])==0)
{

$fileup = $_FILES['imageupload']['name'];

$target_path = “../images/banners/”;
$target_path = $target_path . basename( $_FILES['imageupload']['name']);
move_uploaded_file($_FILES['imageupload']['tmp_name'], $target_path);

$sql = “INSERT INTO #__banner (name,clickurl,imageurl,showBanner,date) VALUES (‘$partner_name’,'$url’,'$fileup’,'1′,NOW())”;

}
else {

echo $sql  = “UPDATE  #__banner SET showBanner = ‘1′,checked_out  = ‘0′,name=’$partner_name’,clickurl=’$url’ WHERE bid=’$req_id’”;

}

$database->setQuery($sql);
$database->query();

//die();

//die($database->getQuery($sql));

//if(!$database->query())

//die($database->getQuery($sql));

//$database->getQuery($sql);

$msg = ‘Successfully saved’;

echo mosRedirect( ‘index2.php?option=com_banners’, $msg );

// insert query ends

}

——————————————————————————————————————————————

query check

<?php

$sql = “INSERT INTO #__banner (name,clickurl,imageurl,showBanner,date) VALUES (‘$partner_name’,'$url’,'$fileup’,'1′,NOW())”;

$database->setQuery($sql);

if($database->query())
{

$msg = ‘Successfully saved’;

echo mosRedirect( ‘index2.php?option=com_banners’, $msg );

}

else {

echo $sql;
}

?>

image find

<?php print_r($row->imageurl); ?>

<!–joomla–>
<?php

include_once(“../../configuration.php”);
include_once(“../../includes/database.php”);
$database = new database( $mosConfig_host, $mosConfig_user, $mosConfig_password, $mosConfig_db, $mosConfig_dbprefix, false );

global $database;

//for insert query:

$sql = “INSERT INTO #__stunts (title,image,description,addedTime) VALUES (‘”.addslashes($title).”‘,’$fileup’,'”.addslashes($desc).”‘,NOW())”;
$database->setQuery($sql);
$database->query();
//for select query:

$sql = “SELECT * from #__table name”;
$database->setQuery($sql);
$rows = $database->loadObjectList();
$num_rows = $database->loadResult();

foreach ($arr as $val) {

echo $val->title;
echo $val->image;
echo $val->description;
}
?>

<!–onload–>

<body onload=”document.addbookmark_form.submit.);”>
<form name=”addbookmark_form” action=”bookmarks.php” method=”post”>
<input type=”hidden” name=”_submitted” value=”1″><input type=”hidden” name=”action” value=”add”><input type=”hidden” name=”uid” value=”WHATEVER”>
</form>

<!–image and title description–>

<?php
if($num_rows==0)
{
echo “There is no Latest News”;
}

else
{
while($row = mysql_fetch_array($pace_news_result))
{
?>
<table width=”100%” border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td><a href=”news1.php?id=<?php echo $id ?>”><img src=”<?php echo “admincp/newsthumbs/”.$row['news_image1'];?>” width=”40″ height=”30″ border=”0″ /></a></td>
<td><a href=”news1.php?id=<?php echo $id ?>”><?php echo $row['news_title'];?></a></td>
</tr>
</table>
<?php
}

}
?>

<!–image upload–>
<?php

if(($_FILES['imageupload']['type']==”image/jpeg”) || ($_FILES['imageupload']['type']==”image/gif”) || ($_FILES['imageupload']['type']==”image/png”)) {

$title = $_POST['title'];
$description = $_POST['desc'];

$fileup = $_FILES['imageupload']['name'];
$target_path = “images/”;

$target_path = $target_path . basename( $_FILES['imageupload']['name']);

if(move_uploaded_file($_FILES['imageupload']['tmp_name'], $target_path)) {

$msg = “File successfully uploaded”;

} else{

}

}
else{
$msg = “OOPS…Sorry Dude!.. Image Files Onlly Accepted”;
}
?>

<!–image php link–>
<img id=”ucBrief_Repeater1_ctl00_imgBrief” class=”Brief” src=”images/<?php echo $output['art_image']; ?>” style=”border-width: 0px; height: 90px;” hspace=”0″>
<!–image php link–>

basic functions:

php

a

abs()                         -   Math.abs()
addcslashes()
addslashes
aggregate
array

array_change_key_case
array_chunk
array_combine
array_count_values
array_diff
array_diff_assoc
array_diff_key
array_fill
array_filter
array_flip
array_intersect
array_intersect_assoc
array_intersect_key
array_key_exists
array_keys
array_map
array_merge
array_multisort
array_pad
array_pop
array_push
array_rand
array_reduce
array_reverse
array_search
array_shift
array_slice
array_splice
array_sum
array_unique
array_unshift
array_values
array_walk

m

mail
max
md5
md5_file
min
mkdir
mktime
date parameters
floor
ceil
round

sort functions
————–

arsort  – associative reverse
asort   – associative sort
ksort   – sort by key
krsort  – sort by key in reverse
sort    – normal asort
rsort   – normal asort in reverse
usort
uksort

s

serialize
Session Handling Functions
set_magic_quotes_runtime
setcookie
sha1
sha1_file
shuffle
sleep
split
spliti
sprintf

str_ireplace
str_pad
str_repeat
str_replace
str_shuffle
str_split
str_word_count
strcasecmp
strchr
strcmp
strftime
strip_tags
stripos
stripslashes
stristr
strlen
strpos
strrchr
strrev
strripos
strrpos
strstr
strtok
strtolower
strtotime
strtoupper
strtr
strval
substr
substr_compare
substr_count
substr_replace

include
include_once
require
require_once
count

current
end
next
prev
reset
key
each

class
——
get_class
get_parent_class
is_subclass_of

htmlentities()
htmlspecialchar()
urlencode()
urldecode()
addslashes()
stripslashes()
serialise()
unserialise()
get_magic_quotes_gpc()
get_magic_quotes_runtime()
base64_encode()
base64_decode()
md5()
md5_file() 160 bit
sha1()      128 bit
sha1_file()
crc32()    32 bit
crypt()
is_writable()
is_resource()
is_subclass_of()
is_nan()
———————
Date & Time
————
strftime()
strtotime()
strptime()
checkdate()

Regular Expression
——————
php questions :

1. Types of errors in php :

php have 8 standard errors and 3 custom errors

E_NOTICE :
non fatel error. it occur when attempts to reference an undefined variable.

E_WARNING :
non fatel error. it occurs when parsing invalid data types to an internal php function

E_ERROR :
fatel error

E_PARSE :
fatel error. it is a syntax error

E_CORE_WARNING :

E_CORE_ERROR :

E_COMPILE_WARNING :

E_COMPILE_ERROR :

Custom errors:

E_USER_WARNING

E_USER_ERROR

E_USER_NOTICE

Internal error handling functions:

set_error_handler()

restore_error_handler()

error_reporting()

error_log()

trigger_error()

—————————————————————————

2. when session will expire and how to set

default session lifetime in php is 1440 sec(24 minutes)

we can change the value using the function

ini_set(’session.gc_maxlifetime’ , ‘2550′)

in php ini file

——————–

the session value is stored in the server tmp directory

ex.

xampplite/tmp

we can change the directory using the function

ini_set(’session.save_path’ , ‘\xampplite\ad’)

—————————————————————————-

3. how to find the difference between two dates

- assign two dates to two variables using strtotime function.
- pass this variables to one user defind function
- in that function split the two dates into two arrays using getdate() function
————————————————————————–

4. predefind classes in php

- dir
- exception

———————————————————————–

5. Difference between php4 and 5

php4
- zend engine one is used
- pass by value
- constructor name is the class name
- register global variables in ON
php5
- zend engine two is used
- pass by reference
- constructor starts with __construct()
- refister global variables is Off

———————————————————————–

6. how to increase the execution time in php

ini_set(‘max_execution_time’ , 60)
default execution time is 30 seconds

—————————————————————-

7. Expansion of LAMP

L – Linux
A – Appache
M – MySql
P – Php , Python , Perl , Ruby

————————————————————————

8. how to find the window size using javascript function

non ie browser

window.innerWidth
window.innerHeight
window.outerWidth
window.outerHeight

ie 6

document.documentElement.clientWidth;
document.documentElement.clientHeight;

ie 4

document.body.clientWidth;
document.body.clientHeight;

————————————————————————-

9. how to identify the browser

brow = navigator.appName;
if(brow == ‘Microsoft Internet Explorer’)
{
alert(“I am ” + brow);
}
else if(brow == ‘Netscape’)
{
alert(“I am ” + brow);
}

—————————————————————————

10. appache php configuration

php configuraion
—————-
move php5ts.dll from php directory to windows directory

Rename the c:\php\php.ini-dist to c:\php\php.ini, then make the following changes in the  c:\php\php.ini file:

(1) doc_root = “c:\webs\test” and
(2) extension_dir = “C:\php\ext”.
Note that you should use BACKSLASHES in the php.ini file.

Apache Configuration
——————–
In the file C:\Program Files\Apache Group\Apache2\conf\httpd.conf, change the             DocumentRoot entry to: DocumentRoot “C:/webs/test”. Note that you should use FORWARD         SLASHES in the http.conf file.

Also in the file C:\Program Files\Apache Group\Apache2\conf\httpd.conf, change the         Directory entry to: <Directory “C:/webs/test”>.Note that you should use FORWARD SLASHES     in the http.conf file.

Again in the C:\Program Files\Apache Group\Apache2\conf\httpd.conf file, add  the         following lines: hint: to find this position fast, search for “media types”

ScriptAlias /php/ “c:/php/”
AddType application/x-httpd-php .php .php5
Action application/x-httpd-php “/php/php-cgi.exe”
SetEnv PHPRC “C:/php”

Lastly, we need to make one last change to this C:\Program Files\Apache             Group\Apache2\conf\httpd.conf file. Find the “DirectoryIndex” entry and add “index.php”     to the end of the line as shown in this screenshot.

mysql configuration
——————-
First of all, check the c:\php directory and make sure that the files libmysql.dll and         php_mysql.dll are both there. If they are not there, check the c:\php\ext directory and     copy the files into c:\php

Then open up the file c:\php\php.ini in your editor and ADD the line                 extension=php_mysql.dll.

————————————————————————————————-

11. AJAX:

<form action=” https://www.paypal.com/cgi-bin/webscr” method=”post”>
<input type=”hidden” name=”cmd” value=”_xclick”>
<input type=”hidden” name=”business” value=” gene@masterspokenenglish.com”>
<input type=”hidden” name=”item_name” value=”DVD-1 Tonal Vowels”>
<input type=”hidden” name=”item_number” value=”MSE DVD-1″>
<input type=”hidden” name=”amount” value=”99.00″>
<input type=”hidden” name=”no_note” value=”1″>
<input type=”hidden” name=”currency_code” value=”USD”>
<input type=”image” src=” https://www.paypal.com/images/x-click-butcc.gif”
border=”0″ name=”submit” alt=”Make payments with PayPal – it’s fast, free
and secure!”>
</form>

<FORM METHOD=POST ACTION=”http://www.safepay.net/cgi-bin/shop/cart.cgi?”>
<INPUT TYPE=HIDDEN NAME=merchant VALUE=”bacastange”>
<INPUT TYPE=HIDDEN NAME=name     VALUE=”(P-1) Purple, blue & rose”>
<INPUT TYPE=HIDDEN NAME=sh         VALUE=”1″>
<INPUT TYPE=HIDDEN NAME=price    VALUE=”24.00″>
<INPUT TYPE=HIDDEN NAME=img      VALUE=”http://www.bacastange.com/images/pendants/p-1_24small.jpg”>
<INPUT TYPE=HIDDEN NAME=img2     VALUE=”http://www.bacastange.com/images/pendants/p-1_24.jpg”>
<input type=HIDDEN name=”custom1″  value=”1 inch x 1 inch purple, blue & rose – shipping and handling information” onlick=”javascript:ShowWin_1184393822437()” />

<INPUT TYPE=submit NAME=”add” VALUE=”Add to Cart”>
</FORM>

<!– ******************************************************************************************************************************************************************** –>

<ul type=”disc”>
<li><a href=”display.php?lLimit=50000&uLimit=100000″>$50,000  – $100,000</a></li>
<li><a href=”display.php?lLimit=100001&uLimit=105000″>$100,001 – $150,000</a></li>
<li><a href=”display.php?lLimit=105001&uLimit=200000″>$150,001 – $200,000</a></li>
<li><a href=”display.php?lLimit=200001&uLimit=300000″>$200,001 – $300,000</a></li>
<li><a href=”display.php?lLimit=300001&uLimit=400000″>$300,001 – $400,000</a></li>
<li><a href=”display.php?lLimit=400001&uLimit=500000″>$400,001 – $500,000</a></li>
<li><a href=”display.php?lLimit=500001&uLimit=700000″>$500,001 – $700,000</a></li>
<li><a href=”display.php?lLimit=700001&uLimit=999999″>$700,001 – $999,999</a></li>
<li><a href=”display.php?lLimit=1000000&uLimit=up”>$1,000,000 and up.</a></li>
</ul>
<!– ******************************************************************************************************************************************************************** –>
<?php

//echo $query=”SELECT * FROM zipweb WHERE price > “.$_REQUEST['lLimit'].” AND price < “.$_REQUEST['uLimit'];

$query=”SELECT * FROM zipweb WHERE price > “.$_REQUEST['lLimit'].” AND price < “.$_REQUEST['uLimit'];

//echo $query;

$result = mysql_query($query) OR die(“error in query”.mysql_error());

$i=0;
while($row=mysql_fetch_array($result))
{
$i++;
?>
<tr>
<td><div align=”right”><? echo $i;?></div></td>
<td>
<div align=”left”><a href=”flash.php?vid=<?php echo $row['zip_id']; ?>”><? echo $row['listing'];?></a></div>
</td>
<?php
}
?>
<!– ******************************************************************************************************************************************************************** –>

<?php
$vid=$_REQUEST['vid'];

$query=”SELECT * FROM zipweb where zip_id=$vid”;

?>

<!– ******************************************************************************************************************************************************************** –>

<?php

session_start();
””””””””””””””””

$res = mysql_query($qry);

// echo $_SESSION['id']=mysql_insert_id();
echo $_SESSION['id']=mysql_insert_id();

header(“location:video.php”);
}
?>
<!– ******************************************************************************************************************************************************************** –>

<?
session_start();
?>

<?php
include “database/config.php”;
include “database/opendb.php”;

// The Cofigration Details
$config['BASE_DIR']          =  ‘/var/www/zipwebtv.com/upload/flvvideo’;
$config['BASE_URL']          =  ‘http://www.zipwebtv.com/upload/flvvideo’;
$config['VDO_DIR']           =  $config['BASE_URL'].’/video’;
$config['FLVDO_DIR']         =  $config['BASE_URL'].’/upload/flvvideo’;
$config['ffmpeg']            =  ‘/usr/bin/ffmpeg’;
$config['vdodir']            =  ‘./upload/video’;
$config['flvdodir']          =  ‘./upload/flvvideo’;

if($_REQUEST['future']!=1){

/* Code for flv conversion and uploading */
$p   = $_FILES['video']['name'];
$pos = strrpos($p,”.”);
$ph  = strtolower(substr($p,$pos+1,strlen($p)-$pos));

$vid     = rand();
$vdoname = $vid.”.”.$ph;
$ff      = ‘./upload/video’.”/”.$vdoname;
if(move_uploaded_file($_FILES['video']['tmp_name'], $ff)){
$mov    =  new ffmpeg_movie($ff);
// the duration of the file
$duration=$mov->getDuration();

if(exec(“$config[ffmpeg] -i $config[vdodir]/$vdoname -ar 22050 -ab 32 -f flv $config[flvdodir]/”.$vid.”.flv”));

$qry = “UPDATE  zipweb set url=’”.$vid.”.flv’ where zip_id=”.$_SESSION['id'];

$res = mysql_query($qry);
}
/* End of code for flv uploading */
}
?>

<!– *************************************************select********************************************************************************************* –>
<!–   WHILE LOOP TR TD  team photo–>
<table width=”544″ border=”1″ cellspacing=”0″ cellpadding=”10″>
<tr>
<td class=”delete_head”>&nbsp;</td>
<td class=”delete_head”><img src=”images/deleteall.png” width=”110″ height=”26″ /></td>
<td width=”23″ class=”delete_head”>&nbsp;</td>
<td width=”219″ class=”delete_head”>&nbsp;</td>
</tr>
<?php
$sql=”select * from teamphoto order by id desc”;
$result=mysql_query($sql) or die(mysql_error());

$tr=1;

while($row=mysql_fetch_array($result,MYSQL_ASSOC))
{
if($tr%3==1)
{
echo “<tr>”;
}

?>
<td width=”20″ align=”center” valign=”top” class=”delete”><input type=”checkbox” name=”checkbox” value=”checkbox” /></td>
<td width=”202″ align=”center” class=”delete”><img src=”images/team_gallery1.jpg” width=”185″ height=”107″ /><br /><?php echo $row['team_name']; ?></td>
<?php
if($tr%3==0)
{
echo “</tr>”;
}
$tr++;
}
?>
</table>
<?php

echo ‘<img src=”images/’.$row['team_image'].’” width=”185″ height=”107″ />’;

echo “<br>”;
?>
<?php echo $row['team_name']; ?></td>

<!– ***************************************fetch_array**************************************************************************************************************** –>
HREF:

<?php
while($row = mysql_fetch_array($pace_news_result))
{
$id =  $row['news_id'];
echo  “<a class = \”a5menu\” style=\”text-decoration:none;\” href=\”news1.php?id=$id\”>”. “<p>” .$row['news_title'].”</p>”.”</a>”;
}
?>

<!– ******************************************************************************************************************************************************* –>

Admin Panel:

User Name :
Password :

<?php
session_start();
include(“config.php”);
include(“opendb.php”);
$msg = $_REQUEST['msg'];

//        print_r($_POST);

if(isset($_POST['Submit']))
{
$username    =    $_POST['username'];
$password    =    $_POST['password'];

///////////////////// CHECK USERNAME  AND STATUS//////////////

$sqlusername        =    “SELECT * FROM pace_admin WHERE admin=’$username’
and password=’$password’”;
$result                =    mysql_query($sqlusername);
$admin_num_row      =   mysql_num_rows($result);

if($admin_num_row==1)
{
header (“location: adminpage.php”);
}
else
{
$msg = “Invalid Username And Password “;
header(“location: index.php?msg=$msg”);
}

}

?>
<!– ********************************num_rows********************************************************************************* –>

NUM_ROWS:

<td valign=”top” class=”td-style03″>
<p>
<?php

if($news1_num_rows==0)

{
echo “There is no news”;
}

else
{
?>

<?php if($_REQUEST['id']!=”") { ?>

<?php echo “<p>”; echo “<div class=\”div0001\”>”. $row['news_title'].”</div>”.”<br>”.”<br>”.$row['news_description']; echo “</p>”; ?>

<?php } ?>

<?php if($_REQUEST['id']==”") { ?>
<?php echo “<p>”; echo $row_id['news_title'].”<br>”.”<br>”.$row['news_description']; echo “</p>”; ?>
<?php }

}  ?>

</p>
</td>

<!– *********************************************while******************************************************************** –>

num_rows:

<?php

if($news2_num_rows==0)
{
echo “There is no news”;
}

else
{

while($row = mysql_fetch_array($pace_news_result))
{

echo  “<p>”.$row['news_title'].”<br>”.$row['news_description'].”</p>”;

}

}

?>

<!– *******************************ahref********************************************************************************** –>

<?php
if($num_rows==0)
{
echo “There is no Latest News”;
}

else
{

while($row = mysql_fetch_array($pace_news_result))
{
$id =  $row['news_id'];
echo  “<a class = \”a5menu\” style=\”text-decoration:none;\” href=\”news1.php?id=$id\”>”. “<p>” .$row['news_title'].”</p>”.”</a>”;
}

}
?>

<!– ***************************************************************************************************************** –>

<tr>
<td align=”right” class=”td-style05″>
<?php if($news1_num_rows!=0) { ?>
<a href=”newsmore.php” class=”a2menu”>[_More]</a>
<?php } ?>
</td>
<td>&nbsp;</td>
</tr>

<!– Loop Techniquee…ahref……………………………………………………………………………………………………… –>
<?php
if($num_rows==0){
echo “There is no Latest News”;
}else{
while($row = mysql_fetch_array($pace_news_result))
{
$id =  $row['news_id'];
?>
<a class = “a5menu” style=”text-decoration:none;” href=”news1.php?id=<? php echo $id; ?>”> <p><?php echo  $row['news_title']; ?></p>
<?php }} ?>
<!– Loop Techniquee………………………………………………………………………………………………………… –>

<!–javascript –>
script language:

function check()
{
alert(“hai selva”)
}

cursor point to page:

document.wingform.important.focus()
return false
}

if((document.mathkit.findinfo[0].checked==false)&&
(document.mathkit.findinfo[1].checked==false)&&
(document.mathkit.findinfo[2].checked==false))
{
alert(“please find  your information”)
<<<document.mathkit.findinfo[0].focus()>
return false
}

<tr><td><img src=”images/cont_bg.gif”></td></tr>
<tr><td><img src=”images/cont_top.gif”></td></tr>
<td><img src=”images/footer.gif” width=”268″ height=”35″></td>
<tr><td><img src=”images/footer.gif” width=”268″ height=”35″></td></tr>
<tr><td><img src=”images/rechts_bg2.gif”></td></tr>
<tr><td><img src=”images/s_bg.gif”></td></tr>
<tr><td><img src=”images/navi_bg.gif”></td></tr>
<div align=”right”><tr><td><img src=”images/cont2_bg.gif” width=”393″ height=”289″></td></tr></div>

<?php

$degree = array(1=>”M.Tech”,”B.Tech”,”B.E”,”M.Sc”,”B.Sc”);

?>

<?php
$specialization=array(1=>”Information Tech”,”Computer Science”,”Computer Science”,”Computer Science”,”Computer Science”,”Computer Science”);

?>

<tr align=”center”>
<td><select name=”degree” >

<option label=”M.Tech” selected=”selected”>M.Tech</option>
<option label=”B.Tech” selected=”selected”>B.Tech</option>
<option label=”B.E” selected=”selected”>B.E</option>
<option label=”M.Sc” selected=”selected”>M.Sc</option>
<option label=”B.Sc” selected=”selected”>B.Sc</option>
</select>&nbsp;<td><input name=”name” type=”text” /></td>

<td><select name=”specialization”>
<option label=”Information Tech” selected=”selected”>Information Tech</option>
<option label=”Computer Science” selected=”selected”>Computer Science</option>
<option label=”Computer Science” selected=”selected”>Computer Science</option>
<option label=”Computer Science” selected=”selected”>Computer Science</option>
<option label=”Computer Science” selected=”selected”>Computer Science</option>
</select>&nbsp;<td><input name=”name” type=”text” /></td>
</tr>

<tr align=”center”>
<td><select name=”degree” >
<option value=”degree” selected>degree</option>

<?php
for($i=1;$i<=5;$i++)
{
echo “<option value=\”$i\”>$i</option>”;
}
?>
</select>&nbsp;<td><input name=”name” type=”text” /></td>

<select name=”specialization” >
<option value=”specialization” selected>specialization</option>

<?php
for($i=1;$i<=5;$i++)
{
echo “<option value=\”$i\”>$i</option>”;
}
?>
</select>&nbsp;<td><input name=”name” type=”text” /></td>

</tr>

<!–javascript –>
<script language = “Javascript”>
function check()
{

if((document.childmodel.area[0].checked==false)&&
(document.childmodel.area[1].checked==false)&&
(document.childmodel.area[2].checked==false))
{
alert(“please select your area of interest”)
document.childmodel.area.focus()
return false
}

if(document.childmodel.impques.value==”")
{
alert(“please enter your important question”)
document.childmodel.impques.focus()
return false
}

if(document.childmodel.bigfrust.value==”")
{
alert(“please enter your biggest frustration”)
document.childmodel.bigfrust.focus()
return false
}

if(document.childmodel.searchengine.value==”")
{
alert(“please enter your searchengine”)
document.childmodel.searchengine.focus()
return false
}

if((document.childmodel.findinfo[0].checked==false)&&
(document.childmodel.findinfo[1].checked==false)&&
(document.childmodel.findinfo[2].checked==false))
{
alert(“please select your find  information”)
document.childmodel.findinfo.focus()
return false
}

if(document.childmodel.newsletter.value==”")
{
alert(“please enter your execptation newsletter”)
document.childmodel.newsletter.focus()
return false
}

if(document.wingform.email.value==”")
{
alert(“please enter your email address”)
document.childmodel.email.focus()
return false
}

if(document.childmodel.age.value==”")
{
alert(“please enter your age”)
document.childmodel.age.focus()
return false
}

if((document.childmodel.gender[document.childmodel.gender.selectedIndex].value ==”gender”))
{
alert(“select your gender”)
document.childmodel.gender.focus()
return false
}

if(document.childmodel.state.value==”")
{
alert(“please enter your state”)
document.childmodel.state.focus()
return false
}

if(document.childmodel.phone.value==”")
{
alert(“please enter your phone”)
document.childmodel.phone.focus()
return false
}

return true
}

</script>

</body>
</html>

<a href=”javascript:history.go(-1)”>

$degree2 = $_POST['btech'];
$degree3 = $_POST['be'];
$degree4 = $_POST['msc'];
$degree5 = $_POST['bsc'];
$degree6 = $_POST['others'];

$specialization2=$_POST['com1puterscience'];
$specialization3=$_POST['com1puterscience'];
$specialization4=$_POST['com1puterscience'];
$specialization5=$_POST['com1puterscience'];
$specialization6=$_POST['others'];

<!–<option  value=”btech”>btech</option>
<option  value=”be”>be</option>
<option  value=”msc”>msc</option>
<option  value=”bsc”>bsc</option>
<option value=”others” >others</option>                <td><input name=”anydegree” type=”text”  disabled/></td>–>

<!–<option value=”computerscience”>computerscience</option>
<option value=”computerscience”>computerscience</option>
<option value=”computerscience”>computerscience</option>
<option value=”computerscience”>computerscience</option>
<option value=”others” >others</option>    <td><input name=”otherspecial” type=”text” disabled /></td>–>

$a = $_POST['mtech'];
$b=$_POST['informationtech'];
//$degree = $degree1.”-”.$degree2.”-”.$degree3.”-”.$degree4.”-”.$degree5.”-”.$degree6;

//$anydegree=$_POST['anydegree'];

//$specialization=$_POST['informationtech'];

//$specialization =$specialization1.”-”.$specialization2.”-”.$specialization3.”-”.$specialization4.”-”.$specialization5.”-”.$specialization6;

//$otherspecial=$_POST['otherspecial'];

echo “value “.$a.”<br/>”;
//echo “value “.$anydegree.”<br/>”;

echo “value “.$b.”<br/>”;
//echo “value “.$otherspecial.”<br/>”;
?>
</p><!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.01 Transitional//EN”>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″>
<!–<style type=”text/css”>
.t{font-size:bold; text-color:blue; font-family:arial; text-decoration:none; align:}
</style>–>

<script language=”javascript”>
function check()
{

if(document.ezynes.name.value==”")
{
alert(“please enter your name”)
return false
}

if(document.ezynes.email.value==”")
{
alert(“please enter your email”)
return false
}

if(document.ezynes.comments.value==”")
{
alert(“please enter your comments?”)
return false
}
return true
}

/*gener male female*/

if ( ( document.contact_form.gender[0].checked == false )
&& ( document.contact_form.gender[1].checked == false ) )
{
alert ( “Please choose your Gender: Male or Female” );
valid = false;
}

</script>

<?php
/**
* @version 1.0 $
* @package HelloWorld
* @copyright (C) 2005 Andrew Eddie
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
*/

/** ensure this file is being included by a parent file */
defined( ‘_VALID_MOS’ ) or die( ‘Direct Access to this location is not allowed.’ );
?>
<script>
function loadCheerleadersGames(){
document.getElementById(‘cheerGames’).innerHTML=’<img src=<?=$ajaxLoaderImage?> border=0 />’;
pid=”;
$.ajax({
type: “POST”,
url: “<?=$mosConfig_live_site?>/modules/mod_cheerleaders/games/game.php”,
data:     “pid=” + pid,
success: function(html){
$(“#cheerGames”).html(html);
}
});

}
</script>
<table width=”370″ border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr>
<td class=”content_header_td”>
<div class=”content_header_left”><img src=”<?=$mosConfig_live_site?>/components/com_cheerleader/images/headings_left.jpg” /></div>
<div class=”content_header_center”><img src=”<?=$mosConfig_live_site?>/components/com_cheerleader/images/games.png” width=”64″ height=”33″ /></div>

<div class=”content_header_right”><img src=”<?=$mosConfig_live_site?>/components/com_cheerleader/images/headings_right.jpg” /></div>                </td>
</tr>
<tr>
<td align=”center” bgcolor=”#474747″><img src=”<?=$mosConfig_live_site?>/components/com_cheerleader/images/left_under.jpg” /></td>
</tr>
<tr>
<td align=”center” class=”content_bg” id=”trborder”><div id=”cheerGames”>

<!–Games Starts–>
<script>loadCheerleadersGames()</script></div>

<!–Games Inner Ends–>
</td>
</tr>
<tr>
<td align=”center” valign=”middle” class=”content_button” id=”trborder”>
<a href=”addgames.html” rel=”lyteframe” title=”Games” rev=”width: 870px; height: 530px; scrolling: no; border: none;”>
<input type=”image” name=”Submit” value=”Submit” src=”<?=$mosConfig_live_site?>/components/com_cheerleader/images/addgames.jpg” /></a>                </td>
</tr>
<tr>
<td class=”content_bottombg” id=”trborder2″>&nbsp;</td>
</tr>
</table>

</head>
<body>

pagination steps

<?php
$conn = mysql_connect(“localhost”,”root”,”") or die(“Error”.mysql_error());
mysql_select_db(“project”,$conn);

//print_r($_POST);
$qry = “SELECT * FROM image_gallery ORDER BY image_id DESC”;
$rslt = mysql_query($qry);
$numrows = mysql_num_rows($rslt);

if($_REQUEST['pageNo']!=”) {
$pageno = $_REQUEST['pageNo'];
} else {
$pageno = 1;
}

$rows_per_page = 2;
$lastpage = ceil($numrows/$rows_per_page);
$limit = ‘LIMIT ‘ .($pageno – 1) * $rows_per_page .’,’ .$rows_per_page;
$sql = $qry.” “. $limit = ‘LIMIT ‘ .($pageno – 1) * $rows_per_page .’,’ .$rows_per_page;
$sql_photo = mysql_query($sql);

?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
</head>

<body>
<form id=”form1″ name=”form1″ method=”post” action=”">
<table width=”50%” border=”1″ cellspacing=”15″ cellpadding=”15″ align=”center”>
<tr>
<td colspan=”3″ align=”center”><h3><font color=”#003366″>PAGINATION</font></h3></td>
</tr>
<tr>
<td>
<?php
if ($pageno == 1){ ?> <img src=”images/left_arrow.jpg” width=”28″ height=”29″ /> <?php
}else {
$prevpage = $pageno-1;
?>

<a href=”pagination.php?pageNo=<?php echo $prevpage; ?>” width=”28″ height=”29″ /><< Previous</a>

<?php } ?>
</td>
<td>
<?php
while($row = mysql_fetch_array($sql_photo)){ ?>

<img src=”images/<?php echo $row['image_name']; ?>” />

<?php } ?>

</td>
<td>
<?php if ($pageno == $lastpage) { ?> <img src=”images/right_arrow.jpg” width=”28″ height=”29″ />

<?php
} else { $nextpage = $pageno+1; ?>
<a href=”pagination.php?pageNo=<?php echo $nextpage; ?>” width=”28″ height=”29″ />Next >></a>
<?php } ?>
</td>
</tr>
</table>
</form>
</body>
</html>

drop down days validation

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
<html>
<head>
<title>Untitled Document</title>
<script language=”javascript”>
function fCheck(val1){
if (val1 == “”){
alert(“Please select a value”);
return false
}else{
return true
}
}
</script>
</head>

<body>
<form action=”http://www.mcfc.co.uk” method=”post” onSubmit=”return fCheck(bnRoom.value);”>
<select name=”bnRoom”>
<option></option>
<option value=”MONDAY”>MONDAY</option>
<option value=”TUESDAY”>TUESDAY</option>
<option value=”MONDAY”>WEDNESDAY</option>
<option value=”THURSDAY”>THURSDAY</option>
<option value=”FRIDAY”>FRIDAY</option>
</select >
<input type=”submit” value=”click me!”>
</form>
</body>
</html>
</head>

<body>
</body>
</html>

random numbers

<?
function slotnumber()
{
srand(time());
for ($i=0; $i < 3; $i++)
{
$random = (rand()%3);
$slot[] = $random;
}
print(“<td width=\”33%\”><center>$slot[0]</td>”);
print(“<td width=\”33%\”><center>$slot[1]</td>”);
print(“<td width=\”33%\”><center>$slot[2]</td>”);
if($slot[0] == $slot[1] && $slot[0] == $slot[2])
{
print(“</td></tr>Winner! — Hit refresh on your browser to play again”);
exit;
}
}
?>
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
</head>

<body>

<div align=”center”><center>

<table border=”1″ width=”50%”>
<tr>
<?
slotnumber();
?>
</td>
</tr>
<tr>
<td width=”100%” colspan=”3″ bgcolor=”#008080″><form method=”POST”
action=”example13.php3″><div align=”center”><center><p><input type=”submit” value=”Spin!”></p>
</center></div>
</form>
</td>
</tr>
</table>
</center></div>

</body>
</html>

File uplaod

<?php
include(‘config.php’);
ob_start();

if(isset($_POST['Submit']) && $_FILES['imageupload']['size'] > 0)
{

$title = $_POST['title'];

$fileup = $_FILES['imageupload']['name'];

// Where the file is going to be placed
$target_path = “./images/”;

/* Add the original filename to our target path.
Result is “uploads/filename.extension” */
$target_path = $target_path . basename( $_FILES['imageupload']['name']);

$_FILES['imageupload']['tmp_name'];

$target_path = “./images/”;

$target_path = $target_path . basename( $_FILES['imageupload']['name']);

if(move_uploaded_file($_FILES['imageupload']['tmp_name'], $target_path)) {

//    echo “The file “.  basename( $_FILES['imageupload']['name']).” has been uploaded”;

} else{
echo “There was an error uploading the file, please try again!”;
}

$desc  = $_POST['desc'];

$query = “INSERT INTO article(art_title,art_image,art_desc,added_time) VALUES (‘$title’,'$fileup’,'$desc’,now() )”;

$result = mysql_query($query) or die(‘Error, query failed’);
}

?>

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=iso-8859-1″ />
<title>Untitled Document</title>
</head>

<body>
<?php $today = date(“F j, Y, g:i a”); ?><p><?php echo $today; ?></p>
<form action=”" method=”post” enctype=”multipart/form-data” name=”article” id=”article”>
<table width=”400″ border=”0″ cellspacing=”5″ cellpadding=”5″ id=”BriefContainer2″>
<tr>
<td colspan=”2″ id=”BriefContainerRight1″><strong>Add Article</strong></td>
</tr>
<tr>
<td id=”BriefContainerRight1″>Title</td>
<td><label>
<input name=”title” type=”text” id=”title” style=”font-family:Verdana; font-size:12px;” size=”20″ maxlength=”30″/>
</label></td>
</tr>
<tr>
<td id=”BriefContainerRight1″>Image</td>
<td><label>
<input name=”imageupload” type=”file” style=”font-family:Verdana; font-size:12px;” id=”imageupload” />
</label></td>
</tr>
<tr>
<td id=”BriefContainerRight1″>Description</td>
<td><label>
<textarea name=”desc” id=”desc” rows=”5″ cols=”25″ style=”font-family:Verdana; font-size:12px;”></textarea>
</label></td>
</tr>
<tr>
<td colspan=”2″ align=”right”><label>
<input type=”submit” name=”Submit” style=”font-family:Verdana; font-size:12px;” value=”Submit” />
</label></td>
</tr>
</table>
</form>
</body>
</html>

date today

<body>
<?php $today = date(“F j, Y, g:i a”); ?><p><?php echo $today; ?></p>

<p><? print(Date(“1 F d, Y”)); ?></p>
</body>

jump menu

<form id=”form1″ name=”form1″ method=”post” action=”">
<table width=”99%” border=”0″ cellspacing=”0″ cellpadding=”0″>
<tr><td>
<select name=”menu1″ onchange=”MM_jumpMenu(‘parent’,this,0)”>
<option value=”" <?php if($_REQUEST['th']==’np’){ echo “selected”;} ?>>National Parks</option>
<option value=”" <?php if($_REQUEST['th']==’ads’){ echo “selected”;} ?>>Adventure Sport</option>
<option value=”" <?php if($_REQUEST['th']==’wf’){ echo “selected”;} ?>>Waterfalls</option>
<option value=”" <?php if($_REQUEST['th']==’mt’){ echo “selected”;} ?>>Medical Tourism</option>
<option value=”" <?php if($_REQUEST['th']==’rs’){ echo “selected”;} ?>>Resorts</option>
<option value=”" <?php if($_REQUEST['th']==’bch’){ echo “selected”;} ?>>Beaches</option>
<option value=”" <?php if($_REQUEST['th']==’ws’){ echo “selected”;} ?>>Water Sports</option>
<option value=”" <?php if($_REQUEST['th']==’hm’){ echo “selected”;} ?>>Historical Monuments</option>
</select>
</td>
</tr>
</table>
</form>

« Previous entries