$name=$POST['name']
if ($name==""){
$query="select*from user";
}else{
$query="select*from user where name LIKE'%$name%'";
$result=mysql_query($query);
while ($row=mysql_fetch_row($result)) {
echo"IC=$row [0]
";
echo"name=$row[1]
";
echo"phone=$row[2]
";
echo "status=$row [3]
";
echo delete data
delete data.php
$IC=$_GET['IC']
if ($IC==""){
echo "error";
}else{
$dblink=mysql_connect("localhost","root","1234");
mysql_select_db ("registration",$dblink);
$query="delete from table where IC=$IC";
mysql_query ($query);
echo"delete success";
insert
$query="insert into user values ('$IC','$name','$address','$phone',)"
PHP
$name=$_POST['name'];
$prgm=$_POST['pgm'];
$pgmcd=$_POST['pmgcd'];
$hobby=$_POST['hobby'];
$sex=$_POST['sex'];
$smt=$_POST['smt'];
if($sex==male){
echo "
Hello! Mr ".$name." from ".$pgmcd." semester ".$smt.".
";
echo "
Your hobby is ".$hobby."!
";
echo "
Thanks with your collaborate!!!
";
}
else{
echo "
Hello! Ms ".$name." from ".$pgmcd." semester ".$smt.".
";
echo "
Your hobby is ".$hobby."!
";
echo "
Thanks with your collaborate!!!
";
}
?>
HTML
STUDENTS' HOBBY INVESTIGATION
According the student health growing, and knowing more about students.
The management of university want to investigate the students' hobby!
Please file up the form to support our investigation! Thank you!
NAME
MATRIC NO.
STUDENT ID/POSTPORT NO.
Gender
Male
Female
PROGRAM
PROGRAM CODE
SEMESTER
NATIONAL
HOBBY
Music
Sport
Handcraft
No comments:
Post a Comment