Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem POSTing

Status
Not open for further replies.

RobBroekhuis

Technical User
Joined
Oct 15, 2001
Messages
1,971
Location
US
Much as I'd like to blame this one on my web hosting provider, I'm not sure what's going on. I have an admin utility PHP page that updates my MySQL database. Has always worked like a charm. Today, the admin page itself loads just fine (and accesses the database just fine), but as soon as I try to submit changes (or add a record) by POSTing from the page (and TO the page - it calls on itself), IE just sits there and never moves - and finally throws a "page cannot be displayed" error. Access to my database itself is not a problem - all my web pages that use the databases work (except the the ones where the user submits information using POST), and I can make modifications to my database using SSH and the mysql utility. Putting echo statements as the first line in my PHP script (i.e., before any database activity) doesn't change the behavior (so I think that no header information ever goes out). It seems to me that the problem is in the pre-processing of the POST information - but I'm just guessing. Any ideas how to troubleshoot this?
Rob


Rob
[flowerface]
 
did you make sure the form action matched the page address itself?

___________________________________
[morse]--... ...--[/morse], Eric.
 
Yes - the page has been working without a hitch for months now, and I've not made any changes recently. I do believe it's a problem on my hosting provider's end (1and1 - their main site appears to be down as well), but it's odd that only the POST functionality seems to have gone awry.
Just to check, I converted a different page configured with the POST method to GET. It didn't go with POST, but works just fine with GET. Go figure.


Rob
[flowerface]
 
Sounds like something in their server config.

___________________________________
[morse]--... ...--[/morse], Eric.
 
If you can modify that admin script, footprint it (print statements in various places) to see how far it gets.



You could also try telnetting to the script and inputting the POST data by hand to see where the script barfs:

Telnet to your server on port 80 and enter:

POST /yourscriptname.php HTTP/1.1
Host: Content-Type: application/x-Content-Length: [number of bytes]
[blank line]
[formfieldname1]=[value]&[formfieldname2]=[value].....

When you hit enter after your line of values, you will get back the raw HTTP stream. That may tell you a lot. The gotcha is knowing how many bytes of data you're sending -- I recommend that you format your POST-value string in a text editor to get it right and to get "[number of bytes]" right.




Want the best answers? Ask the best questions!

TANSTAAFL!!
 
Sleipnir,
Thanks for the suggestions. The problem resolved itself (so it must have been a server issue), but I have saved your procedure for manually posting for future troubleshooting purposes. As for the print statements - I had them in there, way at the top, but IE never got away from the previously loaded page, which makes me think that headers never got sent - i.e., the script never executed even as far as the first print statement.
Rob


Rob
[flowerface]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top