i created a very simple html code to connect with a php file as follows ,
<!DOCTYPE html>
<html>
<body>
<h1>Welcome to MGW Computer Diploma Institute</h1>
<p>Select user type : </p>
<form action="Co_ordinater.php"method="POST">
<input type="submit" name="Co_ordinater" value="CO_ORDINATER"><p>
</form >
<form action="Lecturer.php"method="POST">
<input type="submit" name="Lecturer" value="LECTURER"><p>
</form >
<form action="Student.php"method="POST">
<input type="submit" name="Student" value="STUDENT">
</form >
</body>
</html>
and the php file is as follows
[php]
<?php if(isset($_POST['Co_ordinater'])){ $con = mysql_connect("localhost","root",""); if (!$con){ die('Could not connect: ' . mysql_error()); } mysql_select_db("computer_diploma_institute", $con); $result = mysql_query("SELECT * FROM co_ordinaterview"); echo "LecId | LecName | LecTelNo | Rank | StId | StName | StTelNo | Batch | FollowingDiploma | ModuleCode | Title | CreditValue | DeptName | Co_Ordinater |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
" . $row['LecId'] . " | "; echo "" . $row['LecName'] . " | "; echo "" . $row['LecTelNo'] . " | "; echo "" . $row['Rank'] . " | "; echo "" . $row['StId'] . " | "; echo "" . $row['StName'] . " | "; echo "" . $row['StTelNo'] . " | "; echo "" . $row['Batch'] . " | "; echo "" . $row['FollowingDiploma'] . " | "; echo "" . $row['ModuleCode'] . " | "; echo "" . $row['Title'] . " | "; echo "" . $row['CreditValue'] . " | "; echo "" . $row['DeptName'] . " | "; echo "" . $row['Co_Ordinater'] . " | "; echo "
[/php]
When i run the php file it shows nothing.But if i remove
if(isset($_POST[‘Co_ordinater’])){} clause, it shows the content of the database table.When i run the html page and click thr co_ordinater button, Google chrome shows the php code…
Firefox shows a part of the php code.
:’(
please help me …
this is an urgent case :’( :’( :’( :’( :’(