473,657 Members | 2,481 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 3274
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_global s. 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
3913
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 action attribute which looks like this. What's the meaning of the "r/sx/*-"-prefix?
2
2215
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 hitting of the enter key was to simply not have a submit button, instead going for a regular anchor which calls a javascript confirmation box and then submits the form.
5
1901
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 ----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==---- http://www.newsfeeds.com The #1 Newsgroup Service in the World! >100,000 Newsgroups ---= East/West-Coast Server Farms - Total Privacy via Encryption =---
2
975
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 RunReport_OnClick(sender As Object, e As System.EventArgs) If ddlCommunities.SelectedItem.Value <> 0 Then _sqlStmt = _sqlStmt & " AND tblSurvey1.clnGUID =
4
1250
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 make it work? I need to be able to submit by clicking on button and also by pressing on the Enter key. Here are my results
1
2145
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 javascript error " Object expected". These errors i am getting after implementing ajax. Also this error is shown only the first time i trying to submit. Next time this error won't come. This may be because the ajax update the content dynamically and if...
1
1427
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 the error message (if the email already exists) on the detailsview. The data is strored in the sql table via a stored procedure which returns a negative number without adding the record, in case of duplicate entries. The question is:
3
2246
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 service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30456: 'Text' is not a member of 'System.Web.UI.WebControls.CheckBoxList'.
2
1221
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 textbox value on the next successful redirect page.. how do i carry those values to next page.... :s
0
8394
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8825
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8503
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6164
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5632
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4304
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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 we have to send another system
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.