Jump to content

ascii letters out of nowhere


duncanwil

Recommended Posts

Dear All,

I'm on chapter 3 and trying to apply what I know!

I have put together my first ever serious php driven page and whilst it's still a work in progress (eg, final colour scheme, CSS etc still to do and so on) I am basically happy with the include/require elements of it: much better than frames by the look of it.

However, out of the blue, there are two ascii type characters appearing on the final page (both in localhost and on the web) and whilst I can see them on the page and in the code when I do ViewSource, they don't appear in my editor.

I need to get rid of them ... can someone take a look at [url=http://www.oxbow.org.uk/PHP_test/index.php]this page[/url] and explain how to delete those two pesky characters at the top of the menu section near the top left of the page? Please!

Many thanks in advance and I'm sure I'll be back as I learn and try to apply more php.

Duncan
Link to comment
Share on other sites

When looking at it in my Firefox its not only two chars that's the problem  :o - see the attached screenshot.
In IE7 it's only the two signs you describe,

post some code used to store and render this part then - or if it's static, what html editor are you using ? The source in IE is full of spaces in this code part

[attachment deleted by admin]
Link to comment
Share on other sites

Thanks Alpine ... that's frightening. I have to confess that I have maintained an html based web site for years now and have only ever worried at IE, for obvious reasons. What Firefox is showing is appalling. I'll take a look with it now to see if I can replicate what you have found.

Those spaces do not appear in the html/php editors I am using but they do appear in notepad when doing view/source ... as you have found.

I'm afraid I don't understand what you meant by "post some code used to store and render this part then - or if it's static, what html editor are you using " exept that I am using the AceHTML and PHP Designer 2007 html/php editors.

Thanks again and any fruther insights will be appreciated.

Duncan
Link to comment
Share on other sites

What i ment was: are you generating the problematic html -part dynamicly (with php and possibly stored in mysql ?) or is it hard coded html ?
The PHP designer is ok (great), i use it myself. Try to fully rewrite the html part in php designer (dont cut'n paste from the buggy code as the invisible "creatures" will follow)

And a little advice, don't code just for IE - you'll shoot your self in the leg one day (like this day...). Use Firefox or Opera browsers when coding and testing, then go to IE to check compability as you walk along from one step to the next.
Link to comment
Share on other sites

Thanks Alpine,

I tend to do my own html coding as I've been doing it for years now and whilst I'm never at the cutting edge and can be really lazy sometimes, I am confident enough with it.

That rendering of my code for the menu came as a shock, therefore, as it's just hard coded but called in using a require statement!

Part of my laziness is not coding for Firefox and Opera and have to confess that I don't really know how to do that! After all, now that you've shown me the Firfox nightmare, I don't know how to solve it!

Any ideas on how to get rid of those two odd characters?
Link to comment
Share on other sites

To fix it, review (and possibly rewrite) the relevant code between [color=red]"buggy two chars"<!--menutable-->[/color] and [color=red]<!--end menutable-->[/color]

As this is no longer a php related question (i understand it's pure html only), i suggest you to move on to the html section of the forum
Link to comment
Share on other sites

Thanks esukf, the menu table is a require file and until I read that it might help to save it as a unicode file, it would not show/load the menu table at all and neither would the header and footer files: the page comprises four areas:

header
menu on the left
footer and
a main area to the right of the menu

All of this comes in a four cell table and it's my desire to use it as a template for the rest of the site.

As far as I know, uploading as an ascii file could destroy everything again ... your advice here would be more than welcome.

Thanks for your help, too, Alpine and I'll take a look at the html myself and see if I can make any progress with that.

Duncan
Link to comment
Share on other sites

All the include files that makes up your single page should be using the same file encoding.

You currently have two different file encodings on the same web page, ANSI/ASCII and UTF-16 Little Endian.

If you open the other files in notepad then save as, see what encoding they are. It's more than likely they are just ANSI. Save the UTF-16 menu file the same as the others.

Here is a good article about character sets and unicode [url=http://joelonsoftware.com/articles/Unicode.html]http://joelonsoftware.com/articles/Unicode.html[/url]
Link to comment
Share on other sites

Thanks again esukf.

I can now see what you can see but of course I had no idea that they were in different encoding set ups. However, they were so I did what you said and tried to save them all in the same encoding system. I tried saving them all in unicode but it didn't like that as no includes were included. I then put them all to ANSI and whilst that got the includes included it still didn't include the images (My partner didn't like my page anyway so I did a complete redesign that included some images. Oh woe! Maybe it's an extension of the encoding problem but the images won't show when included in the php page. Of course, all images show up normally when I open up the html files containing the images in my browser.). I then set all encodings to UTF-8 and still no joy. More than that, the footer border round the footer that should be black turned gray under UTF-8.

The page is [url=http://www.duncanwil.co.uk/PHP_test//index.php]here[/url]  still.

I know that learning a new language is frustrating but really, these hidden things are just a bit sneaky don't you think?


Duncan
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.