Jump to content

PHP Form results in raw HTML to be displayed


CaptMidnight

Recommended Posts

I have a generic question and have searched for something similar to this here and elsewhere.  I'm sure this is a very very simple problem, but I'm trying to work through someone elses code.

I have a script that validates a form.. no biggie.  If there exists an error in the form, then the page is redisplayed with an error note at the top with the error that is encountered (such as a missing or invalid e-mail address, etc.)  This works this way in IE, Opera and Firefox with no problems.

If the form IS VALID, the form is re-displayed with a confirmation note at the top confirming the successful insertion in the database, etc....But here's the kicker... It works only in IE.  Firefox and Opera show the raw HTML!

I spent most of all of today trying to debug this problem.

Any pointers or suggestions?

???
Link to comment
Share on other sites

Here's the code.  I found another example in a smaller script.  This one has no input changes that you can modify other than the "years".  Everything else is pre-populated content.  The only error content would come back from PayPal, so since I'm in their sandbox and using one of their credit card numbers, it's always valid.

Since the result is valid, it then displays the raw HTML code to non-IE browsers.  It DOES perform the renewal action and does the update in the database.

{code deleted -- problem resolved}

Ok, I figured it out.... Inside the script was a call to a PayPal function which called request_base.php (standard paypal include).  In there, was specified: header('Content-Type: text/plain');  I changed that to "html" and all is good.

Isn't it funny how IE will just make-it-work?  Hideous.
Thanks for all who looked at this post.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.