Click here to Skip to main content
15,907,392 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
XML
<form id="form1" name="form1" method="post" action="<? echo $PHP_SELF; ?> ">
<input type="submit" name="submit" id="submit" value="submit" />
<?php
$con = mysql_connect("localhost","root","");
if (!$con)
  {
  die('Could not connect: ' . mysql_error());
  }
mysql_select_db('import',$con) or die('could not select database') ;
$res=mysql_query("SELECT date FROM temp1 GROUP BY date HAVING COUNT(*)>1");
echo "<select name='select'>
<option value=''>--- Select ---</option> ";
while($row=mysql_fetch_assoc($res))
 {
echo "<option value=$row[date]>$row[date]</a></option>";
}
echo "</select>";
echo "</form>";
$result=mysql_query("SELECT id,date,mobno,state,type,telecaller FROM temp1 WHERE date='$select' ") or die(mysql_error());
"</form>";
echo"<table>";
echo"<tr> <th>id</th><th>date</th><th>mobno</th><th>state</th><th>type</th><th>telecaller</th>";
while($row=mysql_fetch_array($result))
{
    echo"<tr><td>";
    echo $row['id'];
     echo"<tr><td>";
    echo $row['date'];
     echo"<tr><td>";
    echo $row['mobno'];
     echo"<tr><td>";
    echo $row['state'];
     echo"<tr><td>";
    echo $row['type'];
     echo"<tr><td>";
    echo $row['telecaller'];
}
echo"</table>";
?>

I am getting the following error after clicking on submit button..
Access forbidden!

You don't have permission to access the requested object. It is either read-protected or not readable by the server.
Posted

1 solution

Try $_SERVER['PHP_SELF'] instead of $PHP_SELF in form action
 
Share this answer
 
Comments
project virus 13-Jul-12 4:56am    
no i am not getting output may be there is another error in coding
nirangad 13-Jul-12 5:02am    
Are you still getting "You don't have permission to access the requested object" error?
project virus 13-Jul-12 5:06am    
no.I am not getting this error.but I also not getting output
nirangad 13-Jul-12 5:09am    
Run the following query manually in phpmyadmin just to make sure it returns the expected results

SELECT date FROM temp1 GROUP BY date HAVING COUNT(*)>1
project virus 13-Jul-12 5:12am    
ya definitely it's working.but I want to fetch that data related with date

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900