473,503 Members | 1,727 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HTTP 403 error upon submitting form

2 New Member
Good day.
I'm basically new to PHP programming, and I'm getting a grasp. I've been googling anywhere possible but I can't seem to have codes working for me. I have a code and when the form is submitted, it gives off an 'HTTP 403' error. Here's the code:

Expand|Select|Wrap|Line Numbers
  1. <form name="search" method="post" action="$PHP_SELF?">
  2. Seach for: <input type="text" name="find" /> in 
  3. <Select NAME="field">
  4. <Option VALUE="fname">First Name</option>
  5. <Option VALUE="lname">Last Name</option>
  6. <Option VALUE="info">Profile</option>
  7. </Select>
  8. <input type="hidden" name="searching" value="yes" />
  9. <input type="submit" name="search" value="Search" />
  10. </form>
  11.  
  12. <?
  13. if ($searching =="yes") 
  14. echo "<h2>Results</h2><p>"; 
  15.  
  16.  
  17. if ($find == "") 
  18. echo "<p>You forgot to enter a search term"; 
  19. exit; 
  20.  
  21.  
  22. mysql_connect("localhost", "root", "m1ch3ll3") or die(mysql_error()); 
  23. mysql_select_db("sample") or die(mysql_error()); 
  24.  
  25.  
  26. $find = strtoupper($find); 
  27. $find = strip_tags($find); 
  28. $find = trim ($find); 
  29.  
  30.  
  31. $data = mysql_query("SELECT * FROM users WHERE upper($field) LIKE'%$find%'"); 
  32.  
  33. //And we display the results 
  34. while($result = mysql_fetch_array( $data )) 
  35. echo $result['fname']; 
  36. echo " "; 
  37. echo $result['lname']; 
  38. echo "<br>"; 
  39. echo $result['info']; 
  40. echo "<br>"; 
  41. echo "<br>"; 
  42. ?>
hoping you could help me. thanks.
Nov 15 '08 #1
5 3258
pbmods
5,821 Recognized Expert Expert
Heya, kitsch.

A 403 usually means that you don't have correct file permissions set up for the file.

Are you running an Apache or IIS server?
Nov 16 '08 #2
kitsch
2 New Member
Heya, kitsch.

A 403 usually means that you don't have correct file permissions set up for the file.

Are you running an Apache or IIS server?


Hello.
I'm running Apache 2.2.
Nov 16 '08 #3
pbmods
5,821 Recognized Expert Expert
Hm. I gave your code another look-over. Let's try one thing first.

Change this line:
Expand|Select|Wrap|Line Numbers
  1. <form name="search" method="post" action="$PHP_SELF?">
to this:
Expand|Select|Wrap|Line Numbers
  1. <form name="search" method="post" action="<?php echo htmlentities($_SERVER['PHP_SELF']); ?>">
Nov 16 '08 #4
Markus
6,050 Recognized Expert Expert
Looks like you're using register_globals. Please note that this is feature is completely discared for PHP 6.

Markus.
Nov 16 '08 #5
pbmods
5,821 Recognized Expert Expert
You also might find this article to be of interest:
http://php.net/register_globals
Nov 16 '08 #6

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

Similar topics

4
3904
by: Aatu Koskensilta | last post by:
When processing HTML-files for various purposes, I run into a strange form action definition looking like "r/sx/*-http://somehow/somescript" In particular, the Yahoo search form uses a form...
2
2210
by: Greg T | last post by:
Hi, I have a rather long form that I don't want people submitting unless they are absolutely sure they are ready. I figured the easiest way to prevent an accidental form submission by way of...
5
1884
by: Don | last post by:
I have a need to submit a form, but don't need the user to click on a button. How do I do this? Is there some way, using JavaScript, to setup a <form> tag to do this? Thanks, Don ----==...
2
970
by: DC Gringo | last post by:
I'm getting the following error when running and if-then upon submitting a dropdownlist value. HELP?! Exception Details: System.FormatException: Input string was not in a correct format. Sub...
4
1247
by: roman | last post by:
Hi, I have a form which validates data before submitting, it catches the error, but still submits and can't seem to figure out why. Can someone look at my code and give me some ideas how to...
1
2128
by: monudjn | last post by:
Hi I am implementing ajax in portal. Using ajax i am able to updating the content of portlets asynchronously. However i am facing a problem The Problem: While submitting the form i am getting...
1
1421
by: JJ | last post by:
What's best practise in this situation: Upon submitting data input on a detailsview (bound to an objectdatasource), I need to check for a duplicate email address (in an sql database) and present...
3
2235
by: dancer | last post by:
I am using Framework 1.1.4322. Who can tell me why I'm getting this error? My code follows Compilation Error Description: An error occurred during the compilation of a resource required to...
2
1218
by: noumanislam | last post by:
Hello! this is Nouman. I am working on a form which takes input in text boxes compare those inputted values to a database table... this goes very well.. the problem comes when i want to show the...
0
7087
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7334
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6993
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5579
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3168
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3156
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1514
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.