php-general Digest 17 Sep 2006 13:24:46 -0000 Issue 4352
Topics (messages 241867 through 241870):
Re: getting base domain and sub domains from url?
241867 by: Google Kreme
241868 by: tedd
Re: how to get page count when uploading files
241869 by: Jian Fu
Re: loadHTML/loadHTMLFile - DOM functions
241870 by: Leonidas Safran
Administrivia:
To subscribe to the digest, e-mail:
[EMAIL PROTECTED]
To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]
To post to the list, e-mail:
php-general@lists.php.net
----------------------------------------------------------------------
--- Begin Message ---
On 16 Sep 2006, at 16:26 , Kenneth Andresen wrote:
It gives the top level ones, but I can't seem to find the lower
specifications covering such as .co.uk .com.mx etc.
There is no lower 'specification' because each one is unique.
.mx is administered, for example, by www.nic.mx (I believe), so it is
their option to subdivide the .mx tld however they see fit. Each tld
gets to do this however it wants. Mexico chose .com.mx and .gob.mx
(the latter for government sites), for example, while the UK
chose .co.uk and .me.uk (the latter for personal pages), etc. Since
each one of these tlds is managed independently, it would be nearly
impossible to construct a list of the possible second level domains
for al the tlds. Sure, you might be able to get .mx and .uk info
fairly easily, but what about .cc or .cx or .fj? And as soon as you
do construct such a list, it will be out of date.
If you are trying to verify a valid email address or a valid domain,
there are better ways.
--
Why can't you be in a good mood? How hard is it to decide to be in a
good mood and be in a good mood once in a while?"
--- End Message ---
--- Begin Message ---
At 5:26 PM -0500 9/16/06, Kenneth Andresen wrote:
Thank you, Stut,
It gives the top level ones, but I can't seem to find the lower
specifications covering such as .co.uk .com.mx etc.
I am also starting to realize some countries may two levels of top
domains - in Norway for example you may get a .no domain, but there may
also be lower level top domains such as .mil.no.
You might check with ICANN -- I think they regulate all of that. But,
I believe that specific countries, once awarded their TLD, have
control over all sub domains.
That's my understanding.
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com
--- End Message ---
--- Begin Message ---
Oh, btw, I use PHP ftp function to upload the file, but there is no
information in $_FILES to tell me the total page for Word or PDF file.
Really appreciated your time and help!
Thank you very much! Jian
-----Original Message-----
From: Stefan van der Linden [mailto:[EMAIL PROTECTED]
Sent: 2006年9月17日 2:49
To: [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Subject: Re: [PHP] how to get page count when uploading files
>I really need help and after going through the help page, I don't know
where
>I can post my question.
>
>
>
>When I upload a file (word or pdf), how can I know the page counts of that
>file immediately?
>
>
>
>Thank you, Jian
There's no function in the PDF library to READ the file.
And about Word documents (.doc): Word calculates the amount of pages at
'parsetime'. Word documents are just RTF files, and they
don't describe the amount of pages in the files.
So it's really tricky to make a script that counts the pages in Word
documents, as you would have to make an RTF parser. :/
--- End Message ---
--- Begin Message ---
Hello Rob,
Thank you for your advices... :-)
> Is there a meta tag that specifies the encoding?
> When loading HTML that is also used to determine the encoding.
> I think I need to clarify the encoding issue:
> I'll bet when the document is loading, the encoding is being properly
> detected. When working with the elements however you are getting
> hung up on the UTF-8 factor....
> you probably do something like the following:
> $myelement = getElementById('someid');
> print $myelement->textContent;
> That right there will output the textual content in UTF-8
> (the garbled characters). It does not take into consideration the
> encoding used in the origional document. This is just how the xml
> functions work. Now...
> You really need to do something like:
> $text = $myelement->textContent;
> print iconv("UTF-8", <output encoding>, $text);
> If the encoding is in the meta tag, typically encountered as:
> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
> If you add the content to a dom node, you do not change the encoding
> since the functions all work on UTF-8. The document to which
> the content is being added however, must be set to use the desired
> encoding. I am assuming you are doing what I previously
> explained though.
I tried following:
I downloaded the ominous html page, coded it as UTF-8 (with text-editor option)
and added a metag-tag declaring utf-8 encoding:
<meta http-equiv = 'content-type' content = 'text/html; charset=UTF-8'>
I checked that the special characters were written correctly then (actually I
had to correct them).
Then I used the function:
$doc = new DomDocument('1.0', 'UTF-8');
The result is still the same, special chars are displayed wrong. Different
wrong than before :-) but still wrong... ("ä" is now "ä").
I tried analogy to do the same with "ISO-8859-1" but it's not getting better...
So, fazit, even converting the whole document in UTF-8 and adding UTF-8 charset
declaration to it, doesn't help me handling special chars...
And what about the img-tags which are converted into what ever invisible chars
(empty spaces looking at the source code)...?
Thank you very much for your help!
LS
--
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail
--- End Message ---