Help me out

hi there… im having problem with my database it not shows the any entries i sent to the database, my connection is fine showing no error during the data insertion… help me out pals i dont understand why it happening…

i have problem this time of java script when i use it form not working means it not submit and without the script it working fine…


<?php


$connection = mysql_connect("localhost","root","password") or die("error connect");
mysql_select_db("project");



if (isset($_POST['form_submit'])){

header("location: http://localhost/project/fixed.html");

$fname = $_POST['fname'];
$doc = $_POST['doc'];
$cite = $_POST['cit'];
$apday = $_POST['DV'];
$aptime = $_POST['time'];
$mail = $_POST['email'];
$mob = $_POST['mobi'];
$ser = $_POST['service'];

$sql = "
    insert into
        fix
    (name, doc, city, appday, apptime, email, mobile, services)
        values
    ('". mysql_real_escape_string($fname) ."'
    ,'".  mysql_real_escape_string($doc) ."'
	,'".  mysql_real_escape_string($cite) ."'
	,'".  mysql_real_escape_string($apday) ."'
	,'".  mysql_real_escape_string($aptime) ."'
	,'".  mysql_real_escape_string($mail) ."'
	,'".  mysql_real_escape_string($mob) ."'
	,'".  mysql_real_escape_string($ser) ."'
	
	)
    ";
    
mysql_query($sql) or die(mysql_error() . ' 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=utf-8" />
<title>Untitled Document</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--

a:link {
	color: #327685;
}
a:visited {
	color: #327685;
}
a:hover {
	color: #194954;
}
a:active {
	color: #327685;
}td img {display: block;}
-->
</style>
<script type="text/javascript">
<!-- Script For Navigation Bar
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_validateForm() { //v4.0
  if (document.getElementById){
    var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
    for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=document.getElementById(args[i]);
      if (val) { nm=val.name; if ((val=val.value)!="") {
        if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
          if (p<1 || p==(val.length-1)) errors+='- '+nm+' must contain an e-mail address.\
';
        } else if (test!='R') { num = parseFloat(val);
          if (isNaN(val)) errors+='- '+nm+' must contain a number.\
';
          if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
            min=test.substring(8,p); max=test.substring(p+1);
            if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.\
';
      } } } else if (test.charAt(0) == 'R') errors += '- '+nm+' is required.\
'; }
    } if (errors) alert('The following error(s) occurred:\
'+errors);
    document.MM_returnValue = (errors == '');
} }
//-->
</script>


<script type="text/javascript" language="javascript">
<!-- Script For Calender
function HTML(p){
 if(!p){
  /*default*/
  p='A action align alt B background Base bgcolor BIG BLINK BODY border bordercolor bordercolordark bordercolorlight Br cellpadding cellspacing checked color cols colspan compact content dir DIV enctype face FONT FORM H1 H2 H3 H4 H5 H6 HEAD height Hr href hspace HTML I id Img Input lang language leftmargin LI marginheight marginwidth maxlength Meta method name NOSCRIPT noshade nowrap OL onblur onchange onclick onfocus onload onmouseout onmouseover onreset onselect onsubmit onunload OPTION P PRE profile readonly rows rowspan SCRIPT SELECT size SMALL SPAN src start STRIKE STYLE style SUB SUP TABLE target TD TEXTAREA TH TITLE title topmargin TR TT type U UL valign value vspace width wrap'
 };
 String.prototype.write=function(){
  document.write(this);
  return this 
 };
 String.prototype.alert=function(){
  window.alert(this);
  return this 
 };
 String.prototype.status=function(){
  window.status=this;
  return this 
 };
 var x=[
 function(W){var q=String.fromCharCode(34);return ' x='+q+((typeof(W)!='undefined')?W:'x')+q}/*attr*/,
 function(W){return '<x'+((typeof(W)!='undefined')?W:'')+' />'}/*tag*/,
 function(W){return '<x'+((typeof(W)!='undefined')?W:'')+'>'+this+'</'+'x>'}/*container*/,
 function(W){var o='<x'+((typeof(W)!='undefined')?W:'')+' />';return o+this.join(o)}/*tags*/,
 function(W){var o='<x'+((typeof(W)!='undefined')?W:'')+'>';var c='</'+'x>';return o+this.join(c+o)+c}/*containers*/
 ];
 var j=[];
 var f=0;
 var a=p.split(' ');
 var t,u,l;
 for(var i=0;i<a.length;i++){
  t=a[i];
  u=t.toUpperCase();
  l=t.toLowerCase();
  if(t==l){
   /*attr*/
   j[f]='window.'+u+'='+x[0]  
  }
  else if(t==u){
   /*container;containers*/
   j[f]='String.prototype.'+u+'='+x[2]+';Array.prototype.'+u+'='+x[4]  
  }
  else{
   /*tag;tags*/
   j[f]='window.'+u+'='+x[1]+';Array.prototype.'+u+'='+x[3]  
  };
  /*specific*/
  j[f]=j[f].replace(/x/g,l);
  f++ 
 };
 window.status='HTML() bookmarklet library: Copyright (c) 2002-'+(new Date()).getFullYear()+', by Richard Edwards. ['+f+' tag/attrs added] ';
 /*implement!*/
 eval(j.join(';'))
};
HTML();
</script>
<script type="text/javascript" language="javascript">
function init(){m='January February March April May June July August September October November December'.split(' ');wd='Su M Tu W Th Fr Sa'.split(' ');lom=[31,28,31,30,31,30,31,31,30,31,30,31];sz=25;js='javascript';fn=[function(F){},function(F){DATE=new Date(F.date.value);if(isNaN(DATE.valueOf())){DATE=new Date()};M=DATE.getMonth();D=DATE.getDate();Y=DATE.getFullYear();lom[1]=28;if((Y&#37;/**/4==0)&&((Y%/**/100>0)||(Y%/**/400==0))){lom[1]++}},function(F){if(D>lom[M]){D=lom[M]};F.date.value=(M<9?'0':'')+(1.0+M)+'/'+(D<10?'0':'')+D+'/'+Y;dv.value=F.date.value;if(opener.Page){opener.document.forms[0][dv.name].value=F.date.value}},function(){F=this.form;fn[1](F);M=this.selectedIndex;fn[2](F);fn[0](F)},function(){F=this.form;fn[1](F);D=this.value;fn[2](F);fn[0](F)},function(){F=this.form;fn[1](F);Y=this.value;fn[2](F);fn[0](F)},function(F){fn[1](F);var f=new Date(Y,M,1);var x=1-(f.getDay());for(var i=0;i<49;i++){F.d[i].value=(i<7?wd[i]:'');F.d[i].onclick=this;};for(var i=1;i<=lom[M];i++){w=Math.floor((i-1)/7);n=7+i-x;F.d[n].value=i;F.d[n].onclick=fn[4];if(i==D){F.d[7+i-x].focus()}};for(var i=0;i<F.m.length;i++){F.m[i].selected=(i==M)};F.m.onchange=fn[3];F.y.value=Y;F.y.onchange=fn[5];F.y.onblur=fn[5];fn[2](F)}];fn[0]=fn[6]};init();function popCal(datevalue){if(!datevalue){dv={name:'Today',value:(new Date())}}else{dv=datevalue};var c=ALIGN('center')+HEIGHT(sz);var h=(m.OPTION().SELECT(NAME('m'))+INPUT(TYPE('text')+SIZE(4)+NAME('y'))+INPUT(TYPE('hidden')+NAME('date')+VALUE(dv.value))).TD(COLSPAN(7)+c);var b=INPUT(TYPE('button')+NAME('d')+STYLE('width:'+sz+';height:'+sz)+WIDTH(sz)+c);var r=[b,b,b,b,b,b,b].TD(WIDTH(sz*7)+c);h=[h,r,r,r,r,r,r,r].TR(c).TABLE(BORDER('0')+CELLSPACING('0')+CELLPADDING('0')+c).FORM(NAME('frm')+ACTION(js+'://'));h+=(init+';init();dv=opener.dv;fn[0](document.forms.frm);').SCRIPT(LANGUAGE(js)+TYPE('text/'+js));window.open('','cal'+(new Date()).valueOf(),'height='+sz*9+',width='+sz*8).document.write(h)};

</script>

</script>

<script type="text/javascript" language="javascript">

 function validate_form ( )
{
    valid = true;

    if ( document.tstest.DV.value == "" )
    {
        alert ( "Please fill 'Your Name'" );
        valid = false;
    }
	
	 return valid;
}

</script>



</head>

<body class="oneColFixCtrHdr">

<div id="container">
  <div id="header"><img src="images/header.jpg" alt="" width="1000" height="179" />
    <!-- end #header -->
  </div>
  <div id="nav"><table border="0" cellpadding="0" cellspacing="0" width="1000">
      <!-- fwtable fwsrc="Untitled" fwpage="Page 1" fwbase="nav.gif" fwstyle="Dreamweaver" fwdocid = "70985465" fwnested="0" -->
      <tr>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="63" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="71" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="133" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="80" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="84" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="569" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="1" height="1" border="0" id="undefined_2" /></td>
      </tr>
      <tr>
        <td><img name="nav_r1_c1" src="images/nav_r1_c1.gif" width="63" height="38" border="0" id="nav_r1_c1" alt="" /></td>
        <td><a href="index.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav_r1_c2','','images/nav_r1_c2_f2.gif',1);"><img name="nav_r1_c2" src="images/nav_r1_c2.gif" width="71" height="38" border="0" id="nav_r1_c2" alt="" /></a></td>
        <td><a href="finddoctor.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav_r1_c3','','images/nav_r1_c3_f2.gif',1);"><img name="nav_r1_c3" src="images/nav_r1_c3.gif" width="133" height="38" border="0" id="nav_r1_c3" alt="" /></a></td>
        <td><a href="contactus.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav_r1_c4','','images/nav_r1_c4_f2.gif',1);"><img name="nav_r1_c4" src="images/nav_r1_c4.gif" width="80" height="38" border="0" id="nav_r1_c4" alt="" /></a></td>
        <td><a href="aboutus.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav_r1_c5','','images/nav_r1_c5_f2.gif',1);"><img name="nav_r1_c5" src="images/nav_r1_c5.gif" width="84" height="38" border="0" id="nav_r1_c5" alt="" /></a></td>
        <td><img name="nav_r1_c6" src="images/nav_r1_c6.gif" width="569" height="38" border="0" id="nav_r1_c6" alt="" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="1" height="38" border="0" id="undefined_2" /></td>
      </tr>
    </table></div>
  <div id="mainContent">
    <div id="app_form">
      <table width="519" border="0" align="center">
  <tr>
    <td><form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post" name="appointment" onsubmit="MM_validateForm('mobi','','RisNum');MM_validateForm('eadd','','RisEmail');return document.MM_returnValue">
    Name: <br /><input name="fname" type="text" onblur="MM_validateForm('eadd','','RisEmail','mobi','','RisNum');return document.MM_returnValue" width="400" />
    <br /></center><br />Email:<br /> <input name="email" type="text" id="eadd" onblur="MM_validateForm('eadd','','RisEmail');return document.MM_returnValue" width="400" />
    <br /><br />Mobile:<br /> <input name="mobi" type="text" id="mobi" width="400" />
    <br /><br />
    
    Doctor:<br /> <select name="doc"  >
  <option value="Primary Care Doctor">Primary Care Doctor</option>
  <option value="Dentist">Dentist</option>
  <option value="Eye Doctor">Eye Doctor</option>
  <option value="Ear-Nose-Throat Doctor">Ear-Nose-Throat Doctor</option>
  <option value="Cardiologist">Cardiologist</option>
  <option value="Physical Thrapist">Physical Thrapist</option>
  <option value="Psychiatrist">Psychiatrist</option>
  </select>
<br /><br />
City:<br /> <select name="cit">
  <option value="Khairpur">Khairpur</option>
  <option value="Sukkur">Sukkur</option>
  
</select>
<br /><br />
Appointment Day:<br /><script type="text/javascript" language="javascript">
(INPUT(NAME("DV")+READONLY())+INPUT(TYPE("button")+VALUE("Calender")+ONCLICK("popCal(this.form.DV)"))).FORM().write();
</script></CENTER><br><br><br>
<br /><br />
Appointment Time:<br /><select name = "time">
  <option value=" 9:00am-10:00am"> 9:00am-10:00am</option>
  <option value="10:00am-11:00am">10:00am-11:00am</option>
  <option value="11:00am-12:00am">11:00am-12:00am</option>
  <option value="12:00am-1:00am"> 12:00am-1:00am</option>
  <option value=" 2:00am-3:00am">  2:00am-3:00am</option>
  <option value=" 3:00am-4:00am">  3:00am-4:00am</option>
  <option value=" 4:00am-5:00am">  4:00am-5:00am</option>
</select>
<br /><br />
Please describe the medical services you require:<br />
<input name="service" type="text" width="400" height="80" />
</center>
<br />
<input type="hidden" name="action" value="add">
<input type="submit" value="submit" />
<input type="hidden" name="form_submit" value="1" />
    </form>    </td>
  </tr>
</table>
</div>
</div>
  <div id="footer">
    <div class="footer_nav"><a href="aboutus.html">Abour Us</a>  -  <a href="contactus.html">Contact Us</a>  -  <a href="Faq.html">Faq's</a>  -  <a href="tou.html">Terms Of Use</a></div>
    <div class="copyright_text">&#65533; 2010 Copyright Shah Abdul Latif University. All rights reserved.</div>
    
  <!-- end #footer --></div>
<!-- end #container --></div>
</body>
</html>

thanks again bro…

thanks a lot spikez bro its working fine now…

i want ask one thing more that how should i increase the width of combobox??

use a little bit of css:


<style>
select {
    width: 200px; 
}
</style>

Hi its47 and welcome to SitePoint.

You need to do some basic debugging at each stage of the process.
First move your mysql_connect and mysql_select_db out into another file and us an include() to access them - otherwise you would be connecting on each page and each form action etc.

Then you need to check it the form is submitting:
You are looking for:


if (isset($_POST['submit'])){


but looking at your form element


<input type="submit" value="submit" />

you are missing the name=“submit” attribute so the if clause will always be false.


<input type="submit" value="submit" name="submit" />

You might find it better to add a hidden field and check for that being submitted to remove confusion later.

Next up, never EVER use $_POST values directly in your query. You are leaving yourself wide open to getting your database deleted/copied/messed around with.


$fname = $_POST['fname'];
$doc = $_POST['doc'];

$sql = "
    insert into
        fix
    (name, doctor)
        values
    ('". mysql_real_escape_string($fname) ."'
    ,'".  mysql_real_escape_string($doc) ."')
    ";
    
mysql_query($sql) or die(mysql_error() . ' Query= '. $sql);


The or die(mysql_error() . ’ Query= '. $sql); part tells you if the query fails and why.

Try and put this all together and it should work.

So your final codes should be

conn.php


<?php

mysql_connect("localhost", "root", "password");
mysql_select_db("online_appointment_system");

?>

form page


<?php

include('conn.php');

if (isset($_POST['form_submit'])){

$fname = $_POST['fname'];
$doc = $_POST['doc'];

$sql = "
    insert into
        fix
    (name, doctor)
        values
    ('". mysql_real_escape_string($fname) ."'
    ,'".  mysql_real_escape_string($doc) ."')
    ";
    
mysql_query($sql) or die(mysql_error() . ' 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=utf-8" />
<title>Untitled Document</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--

a:link {
	color: #327685;
}
a:visited {
	color: #327685;
}
a:hover {
	color: #194954;
}
a:active {
	color: #327685;
}td img {display: block;}
-->
</style>
<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body class="oneColFixCtrHdr" onload="MM_preloadImages('images/nav_r1_c2_f2.gif','images/nav_r1_c4_f2.gif','images/nav_r1_c6_f2.gif','images/nav_r1_c8_f2.gif','images/nav_r1_c9_f2.gif')">

<div id="container">
  <div id="header"><img src="images/header.jpg" alt="" width="1000" height="179" />
    <!-- end #header -->
  </div>
  <div id="nav">
    <table border="0" cellpadding="0" cellspacing="0" width="1000">
      <!-- fwtable fwsrc="nav.png" fwpage="Page 1" fwbase="nav.gif" fwstyle="Dreamweaver" fwdocid = "387631167" fwnested="0" -->
      <tr>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="62" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="71" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="4" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="91" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="5" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="88" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="4" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="76" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="89" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="510" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="1" height="1" border="0" id="undefined_2" /></td>
      </tr>
      <tr>
        <td><img name="nav_r1_c1" src="images/nav_r1_c1.gif" width="62" height="38" border="0" id="nav_r1_c1" alt="" /></td>
        <td><a href="home.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav_r1_c2','','images/nav_r1_c2_f2.gif',1);"><img name="nav_r1_c2" src="images/nav_r1_c2.gif" width="71" height="38" border="0" id="nav_r1_c2" alt="" /></a></td>
        <td><img name="nav_r1_c3" src="images/nav_r1_c3.gif" width="4" height="38" border="0" id="nav_r1_c3" alt="" /></td>
        <td><a href="finddoctor.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav_r1_c4','','images/nav_r1_c4_f2.gif',1);"><img name="nav_r1_c4" src="images/nav_r1_c4.gif" width="91" height="38" border="0" id="nav_r1_c4" alt="" /></a></td>
        <td><img name="nav_r1_c5" src="images/nav_r1_c5.gif" width="5" height="38" border="0" id="nav_r1_c5" alt="" /></td>
        <td><a href="feedback.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav_r1_c6','','images/nav_r1_c6_f2.gif',1);"><img name="nav_r1_c6" src="images/nav_r1_c6.gif" width="88" height="38" border="0" id="nav_r1_c6" alt="" /></a></td>
        <td><img name="nav_r1_c7" src="images/nav_r1_c7.gif" width="4" height="38" border="0" id="nav_r1_c7" alt="" /></td>
        <td><a href="contact.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav_r1_c8','','images/nav_r1_c8_f2.gif',1);"><img name="nav_r1_c8" src="images/nav_r1_c8.gif" width="76" height="38" border="0" id="nav_r1_c8" alt="" /></a></td>
        <td><a href="aboutus.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav_r1_c9','','images/nav_r1_c9_f2.gif',1);"><img name="nav_r1_c9" src="images/nav_r1_c9.gif" width="89" height="38" border="0" id="nav_r1_c9" alt="" /></a></td>
        <td><img name="nav_r1_c10" src="images/nav_r1_c10.gif" width="510" height="38" border="0" id="nav_r1_c10" alt="" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="1" height="38" border="0" id="undefined_2" /></td>
      </tr>
    </table>
  </div>
  <div id="mainContent">
    <div id="app_form"><table width="400" border="0">
  <tr>
    <td><form name="appointment" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    Name: <input name="fname" type="text" /></center><br />Email: <input name="email" type="text" /><br />Mobile: <input name="mobile" type="text" /><br />
    
    Doctor: <select name="doc">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select>
<br />
City: <select>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select>
<br />
Appointment Day:<select>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select><br />
Appointment Time:<select>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select>
<br />
<input type="hidden" name="action" value="add">
<input type="submit" value="submit" />
<input type="hidden" name="form_submit" value="1" />
    </form>
    </td>
  </tr>
</table>
</div>
</div>
  <div id="footer">
    <div class="footer_nav"><a href="aboutus.html">Abour Us</a>  -  <a href="contactus.html">Contact Us</a>  -  <a href="pp.html">Privacy Policy</a>  -  <a href="tou.html">Terms Of Use</a></div>
    <div class="copyright_text">&#169; 2010 Copyright Shah Abdul Latif University. All rights reserved.</div>
    
  <!-- end #footer --></div>
<!-- end #container --></div>
</body>
</html>

here is the coding:




<?php

if (isset($_POST['submit'])){

mysql_connect("localhost", "root", "password");



mysql_select_db("online_appointment_system");



mysql_query("INSERT INTO fix (name, doctor) VALUES ('$_POST[fname]', '$_POST[doc]'"); 


}
?>


<!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=utf-8" />
<title>Untitled Document</title>
<link href="styles.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--

a:link {
	color: #327685;
}
a:visited {
	color: #327685;
}
a:hover {
	color: #194954;
}
a:active {
	color: #327685;
}td img {display: block;}
-->
</style>
<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>

<body class="oneColFixCtrHdr" onload="MM_preloadImages('images/nav_r1_c2_f2.gif','images/nav_r1_c4_f2.gif','images/nav_r1_c6_f2.gif','images/nav_r1_c8_f2.gif','images/nav_r1_c9_f2.gif')">

<div id="container">
  <div id="header"><img src="images/header.jpg" alt="" width="1000" height="179" />
    <!-- end #header -->
  </div>
  <div id="nav">
    <table border="0" cellpadding="0" cellspacing="0" width="1000">
      <!-- fwtable fwsrc="nav.png" fwpage="Page 1" fwbase="nav.gif" fwstyle="Dreamweaver" fwdocid = "387631167" fwnested="0" -->
      <tr>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="62" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="71" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="4" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="91" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="5" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="88" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="4" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="76" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="89" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="510" height="1" border="0" id="undefined_2" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="1" height="1" border="0" id="undefined_2" /></td>
      </tr>
      <tr>
        <td><img name="nav_r1_c1" src="images/nav_r1_c1.gif" width="62" height="38" border="0" id="nav_r1_c1" alt="" /></td>
        <td><a href="home.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav_r1_c2','','images/nav_r1_c2_f2.gif',1);"><img name="nav_r1_c2" src="images/nav_r1_c2.gif" width="71" height="38" border="0" id="nav_r1_c2" alt="" /></a></td>
        <td><img name="nav_r1_c3" src="images/nav_r1_c3.gif" width="4" height="38" border="0" id="nav_r1_c3" alt="" /></td>
        <td><a href="finddoctor.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav_r1_c4','','images/nav_r1_c4_f2.gif',1);"><img name="nav_r1_c4" src="images/nav_r1_c4.gif" width="91" height="38" border="0" id="nav_r1_c4" alt="" /></a></td>
        <td><img name="nav_r1_c5" src="images/nav_r1_c5.gif" width="5" height="38" border="0" id="nav_r1_c5" alt="" /></td>
        <td><a href="feedback.php" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav_r1_c6','','images/nav_r1_c6_f2.gif',1);"><img name="nav_r1_c6" src="images/nav_r1_c6.gif" width="88" height="38" border="0" id="nav_r1_c6" alt="" /></a></td>
        <td><img name="nav_r1_c7" src="images/nav_r1_c7.gif" width="4" height="38" border="0" id="nav_r1_c7" alt="" /></td>
        <td><a href="contact.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav_r1_c8','','images/nav_r1_c8_f2.gif',1);"><img name="nav_r1_c8" src="images/nav_r1_c8.gif" width="76" height="38" border="0" id="nav_r1_c8" alt="" /></a></td>
        <td><a href="aboutus.html" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('nav_r1_c9','','images/nav_r1_c9_f2.gif',1);"><img name="nav_r1_c9" src="images/nav_r1_c9.gif" width="89" height="38" border="0" id="nav_r1_c9" alt="" /></a></td>
        <td><img name="nav_r1_c10" src="images/nav_r1_c10.gif" width="510" height="38" border="0" id="nav_r1_c10" alt="" /></td>
        <td><img src="images/spacer.gif" alt="" name="undefined_2" width="1" height="38" border="0" id="undefined_2" /></td>
      </tr>
    </table>
  </div>
  <div id="mainContent">
    <div id="app_form"><table width="400" border="0">
  <tr>
    <td><form name="appointment" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    Name: <input name="fname" type="text" /></center><br />Email: <input name="email" type="text" /><br />Mobile: <input name="mobile" type="text" /><br />
    
    Doctor: <select name="doc">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select>
<br />
City: <select>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select>
<br />
Appointment Day:<select>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select><br />
Appointment Time:<select>
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="mercedes">Mercedes</option>
  <option value="audi">Audi</option>
</select>
<br />
<input type="hidden" name="action" value="add">
<input type="submit" value="submit" />
    </form>
    </td>
  </tr>
</table>
</div>
</div>
  <div id="footer">
    <div class="footer_nav"><a href="aboutus.html">Abour Us</a>  -  <a href="contactus.html">Contact Us</a>  -  <a href="pp.html">Privacy Policy</a>  -  <a href="tou.html">Terms Of Use</a></div>
    <div class="copyright_text">© 2010 Copyright Shah Abdul Latif University. All rights reserved.</div>
    
  <!-- end #footer --></div>
<!-- end #container --></div>
</body>
</html>

Post your code! No one can help you unless we can see what’s going on :stuck_out_tongue: