php-general Digest 12 Aug 2013 11:36:06 -0000 Issue 8330

Topics (messages 321837 through 321840):

[PHP-GENERAL] gibberish output when using the loadHTMLFile() function.
        321837 by: atar

gibberish output when using the loadHTMLFile() function.
        321838 by: atar
        321840 by: Maciek Sokolewicz

sessions working? not working?
        321839 by: Clifford Shuker

Administrivia:

To subscribe to the digest, e-mail:
        php-general-digest-subscr...@lists.php.net

To unsubscribe from the digest, e-mail:
        php-general-digest-unsubscr...@lists.php.net

To post to the list, e-mail:
        php-gene...@lists.php.net


----------------------------------------------------------------------
--- Begin Message ---
Hi there!!

When I'm trying to load an external html document with the loadHTMLFile()
function and then I use the saveHTML() function to output its content,
some text in the external html document which is written in hebrew is
displayed in a gibberish format. is anyone here has an idea how to solve
this problem?

NOTE: the document itself is encoded in utf-8 character set.

Thanks in advance!!

atar.

--- End Message ---
--- Begin Message ---
Hi there!!

When I'm trying to load an external html document with the loadHTMLFile() function and then I use the saveHTML() function to output its content, some text in the external html document which is written in hebrew is displayed in a gibberish format. is anyone here has an idea how to solve this problem?

NOTE: the document itself is encoded in utf-8 character set.

Thanks in advance!!

atar.

--- End Message ---
--- Begin Message ---
On 12-8-2013 2:54, atar wrote:
Hi there!!

When I'm trying to load an external html document with the
loadHTMLFile() function and then I use the saveHTML() function to output
its content, some text in the external html document which is written in
hebrew is displayed in a gibberish format. is anyone here has an idea
how to solve this problem?

NOTE: the document itself is encoded in utf-8 character set.

Thanks in advance!!

atar.

First of all, stop triple-posting to each list. Choose one address, and stick to it.

As for your question; the character set needs to be announced as well as set. So to display in UTF-8, you need to:
1. make sure the document is actually encoded using the UTF-8 charset
2. make sure the browser recieves an HTTP header which tells it the content is in UTF-8: header('Content-type: text/html; charset=utf-8') 3. make sure the document itself states its encoding is UTF-8 (usually done using a <meta http-equiv="Content-Type" content="text/html; charset=utf8"/>

If your output conforms to all three of these, it will work. It probably does not conform to it however.
- Tul
- Tul

--- End Message ---
--- Begin Message ---
Hi List,

 

Hi have the following (below) session code at the top of each page..  The
'print_r' (development feature only) confirms that on one particular page I
do log out as the session var = (). but, on testing that page via the URL I
still get to see the page and all its contents - session var() -..  the page
has the following  'session_start, DOCTYPE Info then <html><head>containing
meta info & title</head><body>containing style/tables/content/</body></html>
// end of page.  I have copied the same page without the html content (i.e.
a blank page) and I get to fully log out.. when this page is tested in the
URL my warning comes up 'you need to login to see this page' which is what I
want but, I've tried numerous avenues to reconcile my problem to no avail..
I'm a novice so any help would be appreciated..   

 

<?php

session_start();

error_reporting (E_ALL ^ E_NOTICE);

$userid = $_SESSION['userid'];

$username = $_SESSION['username'];

print_r($_SESSION);

?>


--- End Message ---

Reply via email to