By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,664 Members | 1,612 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,664 IT Pros & Developers. It's quick & easy.

help --- 403 You don't have permission

P: 1
help --- 403 You don't have permission
Im trying to get a basic search to work on my website, but i keep getting a forbidden error come up. Im using WAMP5 server on a vista machine. The error file from the apache side says:

(20024)The given path misformatted or contained invalid characters: Cannot map POST /test/%3C?=$PHP_SELF?%3E HTTP/1.1 to file, referer: http://localhost/test/searchscript.php

and this is the code im using.


__________________________________________________ ________________

[PHP]<?php
session_start();
include("header.php");?>


<form name="search" method="post" action="<?=$PHP_SELF?>">
Seach for: <input type="text" name="find" /> in
<Select NAME="field">
<Option VALUE="name">Name</option>
<Option VALUE="description">Description</option>
</Select>
<input type="hidden" name="searching" value="yes" />
<input type="submit" name="search" value="Search" />
</form>


<?
//This is only displayed if they have submitted the form
if ($searching =="yes")
{
echo "<h2>Results</h2><p>";
//If they did not enter a search term we give them an error
if ($find == "")
{
echo "<p>You forgot to enter a search term";
exit;
}
$con = makeConn();


// We preform a bit of filtering
$find = strtoupper($find);
$find = strip_tags($find);
$find = trim ($find);

//Now we search for our search term, in the field the user specified
$data = mysql_query("SELECT * FROM stock WHERE upper($field) LIKE'%$find%'");

//And we display the results
while($result = mysql_fetch_array( $data ))
{
echo $result['name'];
echo " ";
echo $result['description'];
echo "<br>";
echo "<br>";
}

//This counts the number or results - and if there wasn't any it gives them a little message explaining that
$anymatches=mysql_num_rows($data);
if ($anymatches == 0)
{
echo "Sorry, but we can not find an entry to match your query<br><br>";
}

//And we remind them what they searched for
echo "<b>Searched For:</b> " .$find;
}
?>

<?php include("footer.php");?>
[/PHP]

__________________________________________________ ________________

the output on the webpage :

Seach fortheres a text box here) in (pull down box)(submit button)
Results

"; //If they did not enter a search term we give them an error if ($find == "") { echo "

You forgot to enter a search term"; exit; } $con = makeConn(); // We preform a bit of filtering $find = strtoupper($find); $find = strip_tags($find); $find = trim ($find); //Now we search for our search term, in the field the user specified $data = mysql_query("SELECT * FROM stock WHERE upper($field) LIKE'%$find%'"); //And we display the results while($result = mysql_fetch_array( $data )) { echo $result['name']; echo " "; echo $result['description']; echo "
"; echo "
"; } //This counts the number or results - and if there wasn't any it gives them a little message explaining that $anymatches=mysql_num_rows($data); if ($anymatches == 0) { echo "Sorry, but we can not find an entry to match your query

"; } //And we remind them what they searched for echo "Searched For: " .$find; } ?>





I cant seem to fix it, any help will be greatly appreciated.
Feb 29 '08 #1
Share this Question
Share on Google+
1 Reply


hsriat
Expert 100+
P: 1,654
Line 6:[php]<form name="search" method="post" action="<?php echo $_SERVER['PHP_SELF'];?>">[/php]
Feb 29 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.