Hi,
I have suddenly started to received http 406 not acceptable error.
This is my code:
[code=php]<?php
//update query here
if ($query) {
echo “<div align=center>Record Updated Successfully</div>”;
echo “<meta http-equiv=”Refresh” content=”3;url=index.php”>”;
} else {
echo “<div align=center>Error in updating. <br>MySql Said: “.mysql_error().”<br>sql:<br>$sql</div>”;
}
?>
I was told to specify the content type in my file although I have this
in my header,
[code]
<META http-equiv=Content-Type content=’text/html; charset=windows-1256′>
but still reciving this error whenever i click on update button to update a record in my db.
how can i resolve this ? ? The strange thing is that it works sometimes and sometimes doesn’t work at all. the Page hangs and give the http 406 error.
Any guide appreciate it.
Thanks
what is the 3; in the following line? Could that be your problem.There's nothing wrong there.
echo "<meta http-equiv="Refresh" content="[B]3;[/B]url=index.php">";[/QUOTE]
[code=php]<?
if (eregi("editable_profiles.php", $_SERVER['SCRIPT_NAME'])) {
Header("Location: index.php");
die();
}
?>
<table border="0" cellpadding="0" cellspacing="0" align="center" width="100%" class="tables">
<tr >
<td colspan="5" bgcolor=#FCDAE4 height=20 class=Header> <img src='..images/mesiar_73.gif'>
<b>Profile Management</b>
</td>
</tr>
</table>
<br>
<table border='0' align=center cellspacing='1' cellpadding='0' width='98%' >
<form method="POST" action="index.php?func=editable_profiles">
<tr>
<td valign="top" colspan="8" dir="ltr">
<input type="checkbox" name="all" onClick="checkAll('multi_ok[]',this)">Select All الكل<br>
</td>
</tr>
<tr bgcolor=#FCDAE4 class=HedinnerTxt height=25 >
<td align=center><b>Username </font></strong></td>
<td align=center><b>City</font></strong></td>
<td align=center><b>Occupation</font></strong></td>
<td align=center><b>About Me</font></strong></td>
<td align=center><b>About Other</font></strong></td>
<td align=center><b>Approve</font></strong></td>
<td align=center><b>Reject</font></strong></td>
</tr>
<?php
if (isset($_POST['take_action'])) {
if (isset($_POST['multi_ok']) && !isset($_POST['multi_delete'])) {
foreach ($_POST['multi_ok'] as $value) {
//$db_username = $_POST[db_username_.$value];
$fullname = $_POST[fullname_.$value];
$tell = $_POST[tell_.$value];
$mobileno = $_POST[mobileno_.$value];
$email = $_POST[email_.$value];
$nationality = $_POST[nationality_.$value];
$reside_city = $_POST[reside_city_.$value];
$reside_country = $_POST[reside_country_.$value];
$height = $_POST[height_.$value];
$weight = $_POST[weight_.$value];
$skin_color = $_POST[skin_color_.$value];
$eyes_color = $_POST[eyes_color_.$value];
$hair_color = $_POST[hair_color_.$value];
$hair_type = $_POST[hair_type_.$value];
$beauty_level = $_POST[beauty_level_.$value];
$education = $_POST[education_.$value];
$smoking = $_POST[smoking_.$value];
$health = $_POST[health_.$value];
$marital_status = $_POST[marital_status_.$value];
$income = $_POST[income_.$value];
$currency = $_POST[currency_.$value];
$occupation = $_POST[occupation_.$value];
$about_me = $_POST[about_me_.$value];
$about_others = $_POST[about_others_.$value];
$theage = $_POST[theage_.$value];
$sql="UPDATE users
SET fullname='$fullname',
tell='$tell',
mobileno='$mobileno',
email='$email',
nationality='$nationality',
reside_city='$reside_city',
reside_country='$reside_country',
height='$height',
weight='$weight',
skin_color='$skin_color',
eyes_color='$eyes_color',
hair_color='$hair_color',
hair_type='$hair_type',
education='$education',
smoking='$smoking',
health='$health',
marital_status='$marital_status',
income='$income',
currency='$currency',
occupation='$occupation',
about_me='$about_me',
about_others='$about_others',
theage='$theage',
editProfile ='1'
WHERE username ='$value'"; //
//$s_this_username = get_user_dbname_admin($value);
//echo "sql = <br>$sql<br><br>";
//echo "this = $value<br>";
//exit;
$query_11=@mysql_query($sql) or die(mysql_error());
$the_sql = "update users_temp
set editProfile='0'
where username ='$value'
";
$query_22=@mysql_query($the_sql) or die(mysql_error());
}
if ($query_11 && $query_22) {
foreach ($_POST['multi_ok'] as $value) {
unset($_SESSION['db_username']);
}
echo "<div align=center>Record Updated Successfully</div>";
echo "<meta http-equiv="Refresh" content="3;url=index.php?func=editable_profiles">";
} else {
echo "<div align=center>Error in updating. <br>MySql Said: ".mysql_error()."<br>sql:<br>$sql</div>";
}
} else if (!isset($_POST['multi_ok']) && isset($_POST['multi_delete'])) {
foreach ($_POST['multi_delete'] as $value) {
$del=@mysql_query("delete from users_temp where username = '$value'") or die(mysql_error());
}
if ($del) {
echo "<div>Rejected</div>";
echo "<meta http-equiv="Refresh" content="3;url=index.php?func=editable_profiles">";
} else {
echo "<div align=center>Error in updating. <br>MySql Said: ".mysql_error()."<br>sql:<br>$sql</div>";
}
} else {
echo "Please check a field to edit";
echo "<meta http-equiv="Refresh" content="1;url=index.php?func=editable_profiles">";
}
} else {
// how many rows to show per page
$rowsPerPage = 50;
// by default we show first page
$pageNum = 1;
// if $_GET['page'] defined, use it as page number
if(isset($_GET['page']))
{
$pageNum = $_GET['page'];
}
// counting the offset
$offset = ($pageNum - 1) * $rowsPerPage;
$query=mysql_query("select * from users_temp where editProfile='1' order by id desc LIMIT $offset, $rowsPerPage");
if (!$query) {
echo "Error in selecting pending profiles".mysql_error();
}
$num_rows=mysql_num_rows($query);
if ($num_rows <=0) {
echo "<div align=center>No Members at the moment</div>";
}
$count=0;
$self = $_SERVER['PHP_SELF']."?func=editable_profiles";
while ($row=mysql_fetch_array($query)) {
$count++;
$_SESSION['db_username'] = $row['username'];
$_SESSION['fullname'] = $row["fullname"];
$_SESSION['email'] = $row["email"];
$_SESSION['reside_city'] = $row["reside_city"];
$_SESSION['reside_country'] = $row["reside_country"];
$_SESSION['nationality'] = $row["nationality"];
if ($count%2==0)
$color="FEF2F4";
else
$color= "FFFBFC";
echo "
<tr bgcolor=$color>
<td class=UsrLoginTxt align=center valign=top><a href='index.php?func=editable_profile_details&db_username=".$_SESSION['db_username']."&id=$db_id' title='إضغط هنا لمشاهة تفاصيل العضو والموافقه عليه'>".$_SESSION['db_username']."</a></td>
<td class=UsrLoginTxt align=center valign=top><input type='text' name='reside_city_".$_SESSION['db_username']."' value='".$_SESSION['reside_city']."'></td>
<td class=UsrLoginTxt align=center valign=top><input type='text' name='occupation_".$_SESSION['db_username']."' value='".$_SESSION['occupation']."'></td>
<td class=UsrLoginTxt align=center><textarea cols='21' rows='6' name='about_me_".$_SESSION['db_username']."'>".$_SESSION['about_me']."</textarea></td>
<td class=UsrLoginTxt align=center><textarea cols='21' rows='6' name='about_others_".$_SESSION['db_username']."'>".$_SESSION['about_others']."</textarea></td>
<td class=UsrLoginTxt align=center>
<input type=checkbox class=inputbordr name='multi_ok[]' value='".$_SESSION['db_username']."'>
</td>
<td class=UsrLoginTxt align=center>
<input type=checkbox class=inputbordr name='multi_delete[]' value='".$_SESSION['db_username']."'>
<input type='hidden' class=inputbordr name='fullname_".$_SESSION['db_username']."' value='".$_SESSION['fullname']."'>
<input type='hidden' class=inputbordr name='email_".$_SESSION['db_username']."' value='".$_SESSION['email']."'>
<input type='hidden' class=inputbordr name='reside_country_".$_SESSION['db_username']."' value='".$_SESSION['reside_country']."'>
<input type='hidden' class=inputbordr name='nationality_".$_SESSION['db_username']."' value='".$_SESSION['nationality']."'>
</td>
</tr>
";
}
//print page navigation here
} //closing if isset
$action = $_GET['action'];
$id = $_GET['id'];
if ($action=="delete_profile") { //delete the profile
$query=mysql_query("delete from users_temp where editProfile='1' and id='$id'");
if ($query) {
echo "<div align=center>";
echo "<br><br>";
echo "Deleted Successfully";
echo "<meta http-equiv="Refresh" content="2;url=$self">";
echo "</div>";
} else
echo "Error in deleting members ".mysql_error();
}
?>
<tr>
<td align="center" colspan="6">
<input type="submit" class=inputbordr name="take_action" value="Execute" Onclick='return confirm("هل أنت متأكد تريد تنفيد العملية؟؟؟");' >
</td>
</tr>
</form>
</table>
<table border="0" cellpadding="0" cellspacing="0" align="center" width="100%">
<?
// print the page navigation link
echo "</table>";[/code]
[code=php]<?php
include_once("include/session.php");
include_once("header.php");
if ($_GET['func']=="editable_profiles") {
include("editprofile.php");
}
include_once("footer.php");
?>[/code]
[code=html]<META http-equiv=Content-Type content='text/html; charset=windows-1256'>[/code]
Is there a URL and browser combination that is reliably returning the 406?[/QUOTE]
0.1.9 — BETA 5.18