Forum Moderators: open

Message Too Old, No Replies

HTML Source Code appearing on one device

Visitor seeing source code on PHP form

         

typomaniac

12:53 am on Jun 1, 2022 (gmt 0)

10+ Year Member Top Contributors Of The Month



I hope I'm in a good department for this question but here goes. I was messaged that a person who used a form on our site was looking at source code when she submitted it.
She is using an Apple phone
The form is written in PHP (default for site)
The form processing is with Perl.
It appears to be an isolated case (as far as I know & hope) as others have used it with no issues. I checked, double checked, and triple checked the html and the css and everything appears to be in order.
On a side note, I'm running another form with the only differences being the processor being sent to although they are very identical other than sending to different table in MySql. If anyone has ever had this problem I would appreciate any input as to what to look for that might be causing this. I tried the form using both my pc and phone and had no issues.

Thanx for any input in advance.


[edited by: not2easy at 1:53 am (utc) on Jun 1, 2022]
[edit reason] Please see TOS [webmasterworld.com] [/edit]

engine

10:04 am on Jun 1, 2022 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



If it's not happened again, just a guess, but, perhaps the site didn't correctly load when the user came to the form.

typomaniac

2:12 pm on Jun 1, 2022 (gmt 0)

10+ Year Member Top Contributors Of The Month



I asked last night and the person submitted again and then screen shot what was on her phone and it was the html source code. Not happening to anyone else who has tried though. Has me shakin' my head.

lucy24

3:01 pm on Jun 1, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you haven't already, look at the site's access logs and its error logs--including any logs kept by php or perl separately--for the time surrounding the problem. Make sure there's nothing unexpected.

You said the visitor was using a phone. See whether all requests came in from the same IP or varying ones--especially likely if the visitor was actually in motion at the time, but also possible if their home or office is midway between two cell towers. All this may be a non-starter, but I've got a nebulous sense of the php saying “Oi! I’m not sending this material to an IP I’ve never seen before in my life.”

not2easy

3:12 pm on Jun 1, 2022 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Do they mention what browser they are using? Are they using extensions that might not render the code as expected? If the form was working it might be confusion with the doctype or file extension?

typomaniac

8:33 pm on Jun 1, 2022 (gmt 0)

10+ Year Member Top Contributors Of The Month



I haven't been able to connect with the person to ask about browser type or request ip or looked in any logs as of yet but I went through the file, line by line comparing with another file that processes in the exact same way but for a different destination I found that the one bringing up the source code had a content tag that read print"Content-Type:text/html charset=UTF-8\n\n" and the other one was just print"Content-Type:text/html\n\n" I removed the UTF-8 out of the one because UTF-8 is in the html of the response message meaning it was showing up twice. I'm hoping that fixes things. Will update for sure as soon as I make contact with the person.

topr8

8:52 pm on Jun 1, 2022 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



silly question maybe ... how come she was able to send the form if all she could see was source code ... the form shouldn't have worked in such a situation.

typomaniac

9:16 pm on Jun 1, 2022 (gmt 0)

10+ Year Member Top Contributors Of The Month



topr8, the form didn't go through. The person contacted through FB messenger and sent a screenshot. I'm waiting for a reply asking her to re-try since I changed the content type tag. I can't figure how out of 3 form processers, one of them had a utf-8 in the tag. Truth be known, I'm the one that wrote it so I blame nobody but myself if that is what caused it. Maybe I'll have to pay a visit to the apple campus lol.

phranque

10:40 pm on Jun 1, 2022 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



the first line was missing a semicolon and should have been:
Content-Type: text/html; charset=UTF-8


apparently (their version of) safari (or whichever browser they were using) on the iphone wasn't able to handle the syntax error.

typomaniac

11:16 pm on Jun 1, 2022 (gmt 0)

10+ Year Member Top Contributors Of The Month



There was a semi-colon in place--I just missed it when I copied it. On another note, I have the utf-8 meta tag in the head of the response statement in the script. Should I declare it also after the content tag? Should there be a semi-colon after it.

Or, will the charset=UTF-8 following the content tag apply to any html in the file?

phranque

11:36 pm on Jun 1, 2022 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



this thread pretty well covers the charset specification discussion:
Meta charset [webmasterworld.com]

typomaniac

7:24 am on Jun 2, 2022 (gmt 0)

10+ Year Member Top Contributors Of The Month



Thanks much for the link phranque--it was very enlightening. All in all, when I reverted to a basic content tag without the charset everything worked fine. Perhaps it was something going on between charset both in the content tag and also the meta tag in the html part of the script that apple just didn't like. I think it was last week when I entered that into the content tag when I was having a problem with passing emojis through the script. Main thing is, it works now. I've still yet to look at any error logs though and should but I'm too busy at this time trying to do a million things at once.