Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


404 Error on PHP/MySQL Page

Posted on 2011-04-25
Medium Priority
Last Modified: 2012-05-11
Hi, all!

Have a rather complex PHP/MySQL page.  It uses a bit of JavaScript to display/hide fields according to user type, change values shown without re-submitting, format and validate input, etc.  It will submit fine, as long as I don't try to insert/update.  If that logic is called, I get a 404 "Not Found" error.  Never seen this before.  Either it won't submit at all (usually the "action" value in the form tag) or, if there is some kind of error, it displays the page with whatever error occurs.

The page flow is pretty standard.  If parameter indicates a new record, defaults for the field are set.  If not, I look for $_POST for the fields and use them.  If they are not there, I load from the database.

Following that logic, I test for insert/update being requested. (Was testing for the $_POST from the Save button, but when I started troubleshooting I switched that to a value from a field that I set with JavaScript.)

Don't think it's data access rights because other forms update OK and all use the same DB connection.  Might be memory limit or other setting of some kind on the server, but that's over my head.

Generally, has anyone seen this before?  It's new to me and I could use some help.  I can cut/paste some of the relevant code if you can point me to what may be relevant.


Question by:springthorpeSoftware
  • 2
  • 2
LVL 10

Accepted Solution

honestman31 earned 2000 total points
ID: 35463839
I think you need to debug your code ,
assuming your query is in $query
try after mysql query to do something like this

echo $query ;

Now you should get the query  copy it and paste it in phpmyadmin and see if you will get the result or not , based in your finding i can help you more
LVL 10

Expert Comment

ID: 35463883
one more point  , make sure in your form action you are submitting to the right script .
if you are submitting to the same script use its name and don't just leave it blank.

Author Comment

ID: 35464382

Let me be "honest" with you.  I'm a dumb #@!.  It was a 550 error, not a 404.  I guess when you look at something too long you just don't see it.

Anyway, research here at Experts Exchange for the correct (550) problem revealed that changing an IE setting to not "Show friendly HTTP error messages" allowed the echos I put in to debug to show on the screen.  (The form still didn't show.)  Then it was just a matter of tracking down where the error was occuring.

It was a mis-spelled function name for a call to the PHP include file that verified data just before the record was written.  Simple, stupid finger check.

Thanks for making me step back from it.  More importantly, thank you for responding so quickly.  Don't know what I'd do without the help you and other experts provide.


Author Closing Comment

ID: 35464386
Made me go back and look at problem again.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
It’s a season to be thankful, and we’re thankful for users like you who engage on site, solve technology problems, and network with others in the industry. What tech are we most thankful for? Keep reading.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question