php-general Digest 23 Apr 2005 14:22:26 -0000 Issue 3414

Topics (messages 213708 through 213720):

Re: problem with the pager class not found
        213708 by: Richard Lynch

Re: [suspicious - maybe spam] [PHP] [suspicious - maybe spam] URL  encoding in 
XSL - Yes, a PHP question
        213709 by: Richard Lynch

Re: image maps in PHP
        213710 by: John Coppens
        213711 by: John Coppens

Re: Is it possible to save a file with UTF-8 encoding and no BOM using PHP?
        213712 by: Jon M.
        213713 by: Jon M.
        213714 by: Rasmus Lerdorf

Tesing Gzip files
        213715 by: Prathaban Mookiah

Re: Documentation for VAR
        213716 by: Satyam

about session
        213717 by: bitblackbug.sohu.com

paste part of mp3 to over an mp3
        213718 by: QT

�ظ�:Re: [PHP] about session
        213719 by: bitblackbug.sohu.com

Dynamic Generating reports to print
        213720 by: mbneto

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:
        [email protected]


----------------------------------------------------------------------
--- Begin Message ---
On Fri, April 22, 2005 6:23 pm, Matthew Weier O'Phinney said:
>> If it *does* match, then maybe your Pager.php file is messed up and the
>> class is missing a closing bracket, so your script thinks you're still
>> in
>> the middle of your class definition.
>
> I'm guessing this is probably *not* the case... it's a PEAR package, and
> if it's considered stable, this is *highly* unlikely. (Plus, if it's the
> stable version, then I'm running it on my production servers, and I
> *know* it's working fine!)

In that case, I'd be looking for some kind of conditional around the
require 'Pager.php' that is making it not actually get included at all...

Put print statements right before and after the require line and be sure.

-- 
Like Music?
http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
On Fri, April 22, 2005 3:33 pm, Brian Dunning said:
>> <?php
>>   $ItemLink = urlencode($ItemLink);
>> ?>
>
> Are you saying to embed that within the XSL? Will it process, and will
> the XSL variable be valid for PHP?

No.

I got NO IDEA how you would do this in XML.

Sorry, maybe ask on an XML list. :-^

-- 
Like Music?
http://l-i-e.com/artists.htm

--- End Message ---
--- Begin Message ---
On Fri, 22 Apr 2005 19:11:23 +0530
[EMAIL PROTECTED] (Dasmeet Singh) wrote:

> Actually I am not able to make image maps because of uneven state 
> boundaries..
> 
> Can you please suggest some tools... I haven't used any yet...

Did you check GIMP? It has an option to make HTML image maps. 
Check Filters|Web|ImageMap

John

> 
> Thanks
> 
> -
> Free Website Promotion - A Complete Guide
> http://hostwindow.info/web-hosting/9/free-website-promotion/1/
> 
> 
> Mike wrote:
> >>Hi!
> >>I need to create an image map on a country map, where people 
> >>can click on any state and get some info related to it.. In 
> >>such case the regular polygon/circle/rectengle image map wont 
> >>do bcoz of shapes of state..
> >>
> >>I guess this must be possible someway in PHP.. please tell me 
> >>if you have any idea how to go abt this..
> >>
> > 
> > Is the problem you're experiencing that the image map isn't being
> > built properly or are you passing information to it that does not
> > appear to be consistant.
> > 
> > If it's the former, then PHP has nothing to do with that. I'm sure
> > you can find some tools to generate image maps for you. There have
> > always been free ones with a minimum of effort. 
> > 
> > If you're having problem with PHP in the mix, can you describe the PHP
> > problem, provide some code, some sample output, etc.? 
> > 
> > I've used image maps in the past (though I try to stay away from
> > them) and you can create a link with virtually any polygon if you
> > have the patience to may out the plot points. You could easily create
> > a star with many, many points and have it be clickable - which would
> > indicate that most states would be a piece of cake. 
> > 
> > -M

--- End Message ---
--- Begin Message ---
On Fri, 22 Apr 2005 19:11:23 +0530
[EMAIL PROTECTED] (Dasmeet Singh) wrote:

> Actually I am not able to make image maps because of uneven state 
> boundaries..
> 
> Can you please suggest some tools... I haven't used any yet...

Did you check GIMP? It has an option to make HTML image maps. 
Check Filters|Web|ImageMap

John

> 
> Thanks
> 
> -
> Free Website Promotion - A Complete Guide
> http://hostwindow.info/web-hosting/9/free-website-promotion/1/
> 
> 
> Mike wrote:
> >>Hi!
> >>I need to create an image map on a country map, where people 
> >>can click on any state and get some info related to it.. In 
> >>such case the regular polygon/circle/rectengle image map wont 
> >>do bcoz of shapes of state..
> >>
> >>I guess this must be possible someway in PHP.. please tell me 
> >>if you have any idea how to go abt this..
> >>
> > 
> > Is the problem you're experiencing that the image map isn't being
> > built properly or are you passing information to it that does not
> > appear to be consistant.
> > 
> > If it's the former, then PHP has nothing to do with that. I'm sure
> > you can find some tools to generate image maps for you. There have
> > always been free ones with a minimum of effort. 
> > 
> > If you're having problem with PHP in the mix, can you describe the PHP
> > problem, provide some code, some sample output, etc.? 
> > 
> > I've used image maps in the past (though I try to stay away from
> > them) and you can create a link with virtually any polygon if you
> > have the patience to may out the plot points. You could easily create
> > a star with many, many points and have it be clickable - which would
> > indicate that most states would be a piece of cake. 
> > 
> > -M

--- End Message ---
--- Begin Message ---
"Richard Lynch" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> On Thu, April 21, 2005 5:07 pm, Jon M. said:
>> I am trying to have a file that I generated with PHP saved as UTF-8
>> without
>> the BOM (Byte Order Mark). Does PHP do anything like this? I am a 
>> beginner
>> with PHP, but very technically experienced otherwise. I'm talking about
>> the
>> FILE encoding here -just to be clear.
>>
>> e.g.  fopen("what_ever_file", "a+") now I want PHP save the file itself
>> with
>> UTF-8, NOT system default.
>>
>> I have searched for hours to find an answer, but have not found any info
>> on
>> the subject.
>>
>> Does PHP have any ability to create a text file saved in UTF-8 
>> encoding???
>
> Maybe I'm just being dumb, but I think if you UTF-8 encode your data, and
> http://php.net/fwrite it, you're gonna get what you want...
>
> Dunno about the Byte-Order-Mark part, but I guess you could strip it out
> of the UTF-8 encoded data before writing, if you wanted to.
>
> -- 
> Like Music?
> http://l-i-e.com/artists.htm


That was the first thing I tried, and it doesn't seem to work (it always 
saves in windows default encoding). Unless I missing something about what 
you can do with fwrite. Did you actually test that before you replied, and 
found that it would? If so, how? The Byte Order Mark is a part of the binary 
file that is written, how would one go about stripping it out??

BTW, note to PHP developers: If "fwrite" had a "encoding" parameter, e.g. 
"UTF-8", that would be REALLY handy. 

--- End Message ---
--- Begin Message ---
"Richard Lynch" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> On Thu, April 21, 2005 5:07 pm, Jon M. said:
>> I am trying to have a file that I generated with PHP saved as UTF-8
>> without
>> the BOM (Byte Order Mark). Does PHP do anything like this? I am a 
>> beginner
>> with PHP, but very technically experienced otherwise. I'm talking about
>> the
>> FILE encoding here -just to be clear.
>>
>> e.g.  fopen("what_ever_file", "a+") now I want PHP save the file itself
>> with
>> UTF-8, NOT system default.
>>
>> I have searched for hours to find an answer, but have not found any info
>> on
>> the subject.
>>
>> Does PHP have any ability to create a text file saved in UTF-8 
>> encoding???
>
> Maybe I'm just being dumb, but I think if you UTF-8 encode your data, and
> http://php.net/fwrite it, you're gonna get what you want...
>
> Dunno about the Byte-Order-Mark part, but I guess you could strip it out
> of the UTF-8 encoded data before writing, if you wanted to.
>
> -- 
> Like Music?
> http://l-i-e.com/artists.htm


That was the first thing I tried, and it doesn't seem to work (it always 
saves in windows default encoding). Unless I missing something about what 
you can do with fwrite. Did you actually test that before you replied, and 
found that it would? If so, how? The Byte Order Mark is a part of the binary 
file that is written, how would one go about stripping it out??

BTW, note to PHP developers: If "fwrite" had a "encoding" parameter, e.g. 
"UTF-8", that would be REALLY handy. 

--- End Message ---
--- Begin Message --- Jon M. wrote:
"Richard Lynch" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED]

On Thu, April 21, 2005 5:07 pm, Jon M. said:

I am trying to have a file that I generated with PHP saved as UTF-8
without
the BOM (Byte Order Mark). Does PHP do anything like this? I am a beginner
with PHP, but very technically experienced otherwise. I'm talking about
the
FILE encoding here -just to be clear.


e.g.  fopen("what_ever_file", "a+") now I want PHP save the file itself
with
UTF-8, NOT system default.

I have searched for hours to find an answer, but have not found any info
on
the subject.

Does PHP have any ability to create a text file saved in UTF-8 encoding???

Maybe I'm just being dumb, but I think if you UTF-8 encode your data, and http://php.net/fwrite it, you're gonna get what you want...

Dunno about the Byte-Order-Mark part, but I guess you could strip it out
of the UTF-8 encoded data before writing, if you wanted to.

--
Like Music?
http://l-i-e.com/artists.htm



That was the first thing I tried, and it doesn't seem to work (it always saves in windows default encoding). Unless I missing something about what you can do with fwrite. Did you actually test that before you replied, and found that it would? If so, how? The Byte Order Mark is a part of the binary file that is written, how would one go about stripping it out??


BTW, note to PHP developers: If "fwrite" had a "encoding" parameter, e.g. "UTF-8", that would be REALLY handy.

Strings in PHP are binary-safe and character-encoding neutral. fwrite doesn't have a clue what it is writing, it just writes what is in memory.


I'd question why you would want to strip the BOM. Any modern system deals with the byte-order-mark correctly. But you can simply strip it manually if it is present in the first 2 bytes before your fwrite if you really need to get rid of it.

-Rasmus
--- End Message ---
--- Begin Message ---
Hello,

Is there a way to test if a .gz file is in a valid format. Functions like 
gzread, gzfile don't seem to care if the file is corrupt or not. 

gzeof also didn't work for me. I guess it is because it does not check for a 
valid .gz termination. Any ideas to go about doing this?

Thanks in advance.

Cheers,

Prathap

--- End Message ---
--- Begin Message ---
I was looking for formal documentation because I am doing a pre-processor 
for some PHP extensions and wanted to know the right and formal description 
for it.  Nevertheless, I think your examples below cover most cases, a help 
much appreciated.  Thanks

Satyam



"Jochem Maas" <[EMAIL PROTECTED]> wrote in message 
news:[EMAIL PROTECTED]
> Richard Davey wrote:
>> Hello Satyam,
>>
>> Friday, April 22, 2005, 3:59:38 PM, you wrote:
>>
>> S> I've been going through the manual and haven't found 'var'
>> S> documented anywhere, as far as I found, it is just used, and that's
>> S> it. It seems it first appears when it talks about Classes, and it
>> S> is just used in the examples as if everyone knew what var is
>> S> supposed to do.
>>
>> It's a "constant initializer" - which is both an accurate and
>> misleading title at the same time :) It will initialise a variable to
>> be constant through-out your entire class (meaning any method can
>> access it) but unlike true PHP constants (those created with define)
>> the value of the variable can be manipulated from just about anywhere.
>
>
> indeed in php you can do the following instead:
>
> <?
>
> error_reporting( E_ALL & E_STRICT );
> class Test
> {
>     // this first var (commented out) should (I thought) act as if defined
>     // 'public' - it doesn't given a parse error with php -l, but does 
> when run.
>     // I haven't run into this problem in 1.5 years of writing php5...
>     // I must be having a brain freeze :-/
>     //$myVar;
>
>     // publically accessible instances variables
>     public $myVar1; // not initialized with a value
>     public $myVar2 = "2"; // initialized with a value
>
>     // an instance variable thats only available
>     // from within _all_ methods of this object.
>     // .. methods could be defined in subclasses or parent-classes
>     protected $myVar3 = "3";
>
>     // an instance variable that is only available to the
>     // methods defined in _this_ class
>     private $myVar4 = "4";
>
>     // a variable with class scope (all instances see the same value),
>     // publically accessible
>     static $myVar5 = "5";
>     static public $myVar6 = "6";
>
>     // a variable with class scope (all instances see the same value),
>     // thats only available from within _all_ methods of this object.
>     static protected $myVar7 = "7";
>
>     // a variable with class scope (all instances see the same value),
>     // thats only available from methods defined in _this_ class
>     static private $myVar8 = "8";
>
>     public function get4() { return $this->myVar4; }
>     public function get8() { return self::$myVar8; }
> }
>
> // basic usage examples:
>
> var_dump( ($t = new Test), $t->myVar2, $t->get4(), Test::$myVar6, 
> $t->get8() );
>
> ?>
>
> I can thoroughly recommend php5's much improved object model,
> try other variations of calls to the defined 'myVar's, also try doing
> with sublcasses, see what does/doesn't work, have fun :-)
>
>>
>> It is of course PHP4 only and is depreciated in PHP5.
>>
>> Best regards,
>>
>> Richard Davey 

--- End Message ---
--- Begin Message ---
hi,everyone.
can someone tell me the differences between the $_SESSION['time'] and session_register.
thanks


�����ʼ��������ȶ�����ȫ�ɿ�����
����Ϊ�㵲ס�����ʼ���

--- End Message ---
--- Begin Message ---
Dear Sirs,

Do you know any classes to paste some part of mp3 to over another mp3?

Best Regards

--- End Message ---
--- Begin Message ---
Dear Devraj,
    thank you!
that 's say I must session_register at fitst ,and use $_SESSION['time'] at secoend?
and How can i get the value of the form's element? 
just use $time ?


now I have a form named form1 in file1.php , whose active="file1.php",in  form1,it have a text input .
how can i get the text input's value when the submit button 's clicked?


From: Devraj Mukherjee 
To: [EMAIL PROTECTED] 
Subject: Re: [PHP] about session
Sent: Sat Apr 23 18:19:14 CST 2005

> 
> $_SESSION['time'] accesses or sets the value of the session variable
> time once its has been registered by session_register.
> 
> In short, you should use session_register to regiter the variable before
> you use it.
> 
> Devraj
> 
> [EMAIL PROTECTED] wrote:
> > hi,everyone.
> > can someone tell me the differences between the $_SESSION['time'] and session_register.
> > thanks
> > 
> > ------------------------------------------------------------------------
> > 
> > 
> > 
> 
> 
> -- 
> Devraj Mukherjee ([EMAIL PROTECTED])
> Eternity Technologies Pty. Ltd. ACN 107 600 975
> P O Box 5949 Wagga Wagga NSW 2650 Australia
> Voice: +61-2-69717131 / Fax: +61-2-69251039
> http://www.eternitytechnologies.com/
> 
> 


�����ʼ��������ȶ�����ȫ�ɿ�����
����Ϊ�㵲ס�����ʼ���

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

I'd like to generate reports (with tabular data) to print from php. 
Now I am using a mixed solution where I save the data in a reports
database and I have a delphi app installed pooling the db for pending
reports and print it.

My plan is move away from the current solution but I am still confused
of how am I going to get control of the layout of the report. 
Generate a PDF ? Use CSS ?

Some of the "trick" parts are, for instance, to have the same header
in all pages of the same report, if I have tabular data greater than
the height of the page continue in the next page etc.

Any tips (or code) ?

thanks.

--- End Message ---

Reply via email to