php-general Digest 27 Mar 2002 13:15:24 -0000 Issue 1251

Topics (messages 90299 through 90357):

Re: which php book 2 buy ?
        90299 by: Vail, Warren

(null)
        90300 by: Vlad Kulchitski
        90303 by: eric.coleman.zaireweb.com
        90305 by: Miguel Cruz
        90307 by: Vlad Kulchitski
        90309 by: Miguel Cruz

rdf utf-8 to sql mysql latin1
        90301 by: David D

Re: [Session] (it seems to be a bug in PHP 4.1.2)
        90302 by: Rasmus Lerdorf

Re: Code Bulk
        90304 by: Gerard Samuel
        90317 by: Steve Clay

Building Libraries
        90306 by: Alexandre Soares

design pattern
        90308 by: Kancha .

Any PHP equivalent of Macromedia ColdFusion's location tag?
        90310 by: webapprentice
        90311 by: Jason Murray
        90314 by: webapprentice
        90315 by: Rasmus Lerdorf
        90318 by: webapprentice
        90319 by: Jason Murray
        90320 by: Rasmus Lerdorf
        90321 by: Justin French

ID NUMBER HELP
        90312 by: Omland Christopher m
        90313 by: Demitrious S. Kelly

PDFlib error - pdf_color or pdf_setrgbcolor
        90316 by: Wayne Bastow

How to get user full name using PHP function?
        90322 by: gaukia 345
        90323 by: Jason Wong
        90330 by: Miguel Cruz
        90347 by: gaukia 345

Does this seem odd?  File Upload Permissions
        90324 by: David McInnis
        90325 by: Demitrious S. Kelly
        90326 by: Rasmus Lerdorf
        90327 by: Demitrious S. Kelly
        90328 by: Rasmus Lerdorf
        90329 by: Demitrious S. Kelly
        90331 by: David McInnis
        90336 by: Jason Wong

Getting QUALITY text on an image
        90332 by: Michael A. Peters
        90334 by: Miguel Cruz
        90337 by: Rasmus Lerdorf
        90340 by: heinisch.creaction.de
        90345 by: Michael A. Peters
        90351 by: Michael A. Peters

Trans_sid
        90333 by: Richard Baskett
        90346 by: liljim

Re: Loading Images
        90335 by: Oliver Heinisch

I am new
        90338 by: Hironoshin Tanaka
        90343 by: S.Murali Krishna

imap and POP3?
        90339 by: Jason Caldwell
        90341 by: Jason Wong

Create table
        90342 by: Uma Shankari T.
        90344 by: Jason Wong

PHP-Compiling roxen and apache
        90348 by: Lothar Frank

xslt_set_sax_handlers
        90349 by: Alexey N.Kolomoets

Re: Using EditPlus with PHP
        90350 by: Sijan Khadka

Re: PHP, DB, images, ODBC
        90352 by: Cirstoiu Aurel Sorin

how to close an http connection BUT carry on processing
        90353 by: Peter Clarke

Comparrison
        90354 by: Ron
        90355 by: Edward van Bilderbeek - Bean IT
        90356 by: Adrian Ciutureanu

Loop non-fixed sized array
        90357 by: Julio Nobrega Trabalhando

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 ---
Great photo ....  :-}

Any reviews on the book yet?

Warren Vail
Tools, Metrics & Quality Processes
(415) 667-7814
Pager (877) 774-9891
215 Fremont 02-658


-----Original Message-----
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 26, 2002 3:29 PM
To: Scott St. John
Cc: Ralph Friedman; [EMAIL PROTECTED]
Subject: Re: [PHP] Re: which php book 2 buy ?


It is, the picture should prove that.

On Tue, 26 Mar 2002, Scott St. John wrote:

> I didn't think Programming PHP was out yet?
>
>
> On Tue, 26 Mar 2002, Rasmus Lerdorf wrote:
>
> > Or, of course, if you want to be cool like Carl:
> >
> >     http://lerdorf.com/buy/
> >
> > ;)
> >
> > -Rasmus
> >
> > On Tue, 26 Mar 2002, Ralph Friedman wrote:
> >
> > > In article <[EMAIL PROTECTED]>, Septic Flesh
wrote:
> > > > I wanna buy a book from amazon . . .but don't know which one..
> > > > Do you know where I will find examples of shopping carts ? (which
book ?)
> > > >
> > >
> > > "Creating Dynamic Web Pages Using PHP and MySQL" by David Tansley.
> > >
> > > --
> > > Rgds
> > > Ralph
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> >
> >
>
> --
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Hi can anyone help me, I am getting this error when I try
to start session:

Warning: Cannot send session cookie - headers already sent by (output
started at /var/www/kulchitski/btl/btl.php:2) in
/var/www/kulchitski/btl/_talkroom_edit.php on line 39

I didn't start session before, in fact I never use session here
except this step. Can anyone suggest anything?

Thanks,
Vlad
--- End Message ---
--- Begin Message ---
That would mean that you have some type of output to the browser, i.e. blank
line, or some text, before you are calling your session/cookie
----- Original Message -----
From: "Vlad Kulchitski" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, March 26, 2002 8:17 PM
Subject: [PHP]


Hi can anyone help me, I am getting this error when I try
to start session:

Warning: Cannot send session cookie - headers already sent by (output
started at /var/www/kulchitski/btl/btl.php:2) in
/var/www/kulchitski/btl/_talkroom_edit.php on line 39

I didn't start session before, in fact I never use session here
except this step. Can anyone suggest anything?

Thanks,
Vlad

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--- End Message ---
--- Begin Message ---
On Tue, 26 Mar 2002, Vlad Kulchitski wrote:
> Hi can anyone help me, I am getting this error when I try
> to start session:
> 
> Warning: Cannot send session cookie - headers already sent by (output
> started at /var/www/kulchitski/btl/btl.php:2) in
> /var/www/kulchitski/btl/_talkroom_edit.php on line 39
> 
> I didn't start session before, in fact I never use session here
> except this step. Can anyone suggest anything?

1) Read the list and the archive. This comes up at least once per day, 
including on days when I know I saw you post to the list.

2) It means that you generated output prior to a session_register or 
session_start call. Make sure you don't print anything and don't have any 
space outside of <?php tags prior to those calls.

3) Read the list and the archive. This comes up at least once per day,    
including on days when I know I saw you post to the list.

4) Read the list and the archive. This comes up at least once per day,    
including on days when I know I saw you post to the list.

miguel

--- End Message ---
--- Begin Message ---
OK, hope you don't mind I follow up a question, and it will be up to you to answer or 
not, this is very general and important to me.

My whole project main template is FILE.PHP, the content is changed based on the values 
sent via QUERY_STRING. SO:

Below is the approximate outline: (basically the content is loaded from smaller 
scripts, but main does language switching, loading menu in appropriate language and so 
on.

FILE.PHP
 _about.php
 _one.php
 _two.php

So my question is, is it better to use separate .PHP file for every part of the page 
and load template design requirements (like 'header' and 'footer') via REQUIRE() so 
there's no conflict with sessions for instance? Because the code is already BIG:

http://www.kulchitski.com/btl/source.php

So anyway, for who are experienced the question goes, is it better to use separate 
file for every script? Or do like I do use one main and then include('content'php') 
based on the value passed in the string.

With my current session problem I don't thnk I can overcome the problem with current 
design structure, I need to use different file for ADMIN because the template is 
already formed before it included the file with the script that tries to create a 
session.

Anyway, this certainly makes it clearer - thank you guys.
Vlad


-----Original Message-----
From: Miguel Cruz [mailto:[EMAIL PROTECTED]] 
Sent: 26  2002 . 20:41
To: Vlad Kulchitski
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] 

On Tue, 26 Mar 2002, Vlad Kulchitski wrote:
> Hi can anyone help me, I am getting this error when I try
> to start session:
> 
> Warning: Cannot send session cookie - headers already sent by (output
> started at /var/www/kulchitski/btl/btl.php:2) in
> /var/www/kulchitski/btl/_talkroom_edit.php on line 39
> 
> I didn't start session before, in fact I never use session here
> except this step. Can anyone suggest anything?

1) Read the list and the archive. This comes up at least once per day, 
including on days when I know I saw you post to the list.

2) It means that you generated output prior to a session_register or 
session_start call. Make sure you don't print anything and don't have any 
space outside of <?php tags prior to those calls.

3) Read the list and the archive. This comes up at least once per day,    
including on days when I know I saw you post to the list.

4) Read the list and the archive. This comes up at least once per day,    
including on days when I know I saw you post to the list.

miguel

--- End Message ---
--- Begin Message ---
I don't know if this helps, but you may find life becomes simpler if you 
keep all your session variables in one array. Then you can 
session_register that at the very top of your code and cover all bases at 
once.

miguel

On Tue, 26 Mar 2002, Vlad Kulchitski wrote:

> OK, hope you don't mind I follow up a question, and it will be up to you to answer 
>or not, this is very general and important to me.
> 
> My whole project main template is FILE.PHP, the content is changed based on the 
>values sent via QUERY_STRING. SO:
> 
> Below is the approximate outline: (basically the content is loaded from smaller 
>scripts, but main does language switching, loading menu in appropriate language and 
>so on.
> 
> FILE.PHP
>  _about.php
>  _one.php
>  _two.php
> 
> So my question is, is it better to use separate .PHP file for every part of the page 
>and load template design requirements (like 'header' and 'footer') via REQUIRE() so 
>there's no conflict with sessions for instance? Because the code is already BIG:
> 
> http://www.kulchitski.com/btl/source.php
> 
> So anyway, for who are experienced the question goes, is it better to use separate 
>file for every script? Or do like I do use one main and then include('content'php') 
>based on the value passed in the string.
> 
> With my current session problem I don't thnk I can overcome the problem with current 
>design structure, I need to use different file for ADMIN because the template is 
>already formed before it included the file with the script that tries to create a 
>session.
> 
> Anyway, this certainly makes it clearer - thank you guys.
> Vlad
> 
> 
> -----Original Message-----
> From: Miguel Cruz [mailto:[EMAIL PROTECTED]] 
> Sent: 26  2002 . 20:41
> To: Vlad Kulchitski
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] 
> 
> On Tue, 26 Mar 2002, Vlad Kulchitski wrote:
> > Hi can anyone help me, I am getting this error when I try
> > to start session:
> > 
> > Warning: Cannot send session cookie - headers already sent by (output
> > started at /var/www/kulchitski/btl/btl.php:2) in
> > /var/www/kulchitski/btl/_talkroom_edit.php on line 39
> > 
> > I didn't start session before, in fact I never use session here
> > except this step. Can anyone suggest anything?
> 
> 1) Read the list and the archive. This comes up at least once per day, 
> including on days when I know I saw you post to the list.
> 
> 2) It means that you generated output prior to a session_register or 
> session_start call. Make sure you don't print anything and don't have any 
> space outside of <?php tags prior to those calls.
> 
> 3) Read the list and the archive. This comes up at least once per day,    
> including on days when I know I saw you post to the list.
> 
> 4) Read the list and the archive. This comes up at least once per day,    
> including on days when I know I saw you post to the list.
> 
> miguel
> 
> 

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

My purpose is to transform an rdf utf-8 file into sql for mysql.
Data are both in french/english, in french there are stange caractere that
doesnt render well (...)

What the output had to be ?
Mysql only support latin1 ?

I m lost in all that encodage !

Help me

I dont know how to parametrer the php parser I make.

// create parser
$xp = xml_parser_create("UTF-8");
// set element handler
xml_set_element_handler($xp, "elementBegin", "elementEnd");
xml_set_character_data_handler($xp, "characterData");
xml_parser_set_option($xp, XML_OPTION_CASE_FOLDING, TRUE);
xml_parser_set_option($xp, XML_OPTION_SKIP_WHITE, TRUE);
xml_parser_set_option($xp, XML_OPTION_TARGET_ENCODING, 'UTF-8');

Have I to decode / encode

//    if (!($xml = utf8_encode($xml))) {
//    echo 'ERROR'."\n";
//    }

Thanks for all.



--- End Message ---
--- Begin Message ---
Just to clarify, that is a Windows-specific bug.  Non-Windows works just
fine.

On Tue, 26 Mar 2002, Chris wrote:

> On 26 Mar 2002 at 20:42, Evan wrote:
> > I have PHP 4.1.2 (the latest, I downloaded it a week ago).
>
> PHP 4.1.2 has several bugs.
> One of them is that Apache and sessions variables do not work.
>
> It is best not to upgrade to 4.1.2!
>
> see the bug report on session variables & following discussion and
> suggestions to solve it
>
> http://bugs.php.net/bug.php?id=16102
>
>
> Chris
>
> --
>  !            please check my email address                   !
>  !    only my email [EMAIL PROTECTED] works           !
>  !    email [EMAIL PROTECTED] is a black hole since januari 2002 !
>
> Chris Hayes - Droef 35 - Wageningen
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
That is an excellent example.
And just for the hell of it, Ill leave the lines that aren't in the 
function as is, just for the hell of it.
Thanks.

Philip Hallstrom wrote:
> Why not just take that file and remove anything that isn't a function (so
> nothing actually executes) and then do something like:
> 
> print microtime();
> include "thatfile.php";
> print microtime();
> 
> and see how long it took to parse 3000 lines... one more line isn't going
> to make that much difference.
> 
> On Tue, 26 Mar 2002, Gerard Samuel wrote:
> 
> 
>>Actually, the file in question is 3000 lines long, 99% in functions.
>>Im trying to tell him that he may not see any speed ups in code execution.
>>As long as I know Im right, its just the peace of mind when I go to bed
>>tonight :)
>>
>>
>>Martin Towell wrote:
>>
>>>any speed difference will be miniscule/negligible - is speed, to the
>>>microsecond, important in this situation?
>>>
>>>-----Original Message-----
>>>From: Gerard Samuel [mailto:[EMAIL PROTECTED]]
>>>Sent: Wednesday, March 27, 2002 11:23 AM
>>>To: PHP
>>>Subject:  Code Bulk
>>>
>>>
>>>Im in a debate with someone else.
>>>Basically were debating code bulk.
>>>
>>>This is just an example ->
>>>
>>><?php
>>>if (isset($run_this_code)) {
>>>     echo $this->run_this_code;
>>>}
>>>echo 'Finished';
>>>?>
>>>
>>>Now, if I understand php correctly, the whole script gets parsed, but
>>>since $run_this code isn't set, $this->run_this_code doesn't get
>>>echoed/executed.  What this other person is telling me that its more
>>>effiecient for *him* to have ->
>>>
>>><?php
>>>echo 'Finished';
>>>?>
>>>
>>>instead.
>>>
>>>The script is a general purpose script.  Its not built for one person.
>>>Some may use $run_this_code and some may not.  So in taking out that bit
>>>of code, all it does is save the parser, what fraction of a fraction of
>>>a second??
>>>Im just looking for ammunition so I could go and shoot this guy down... :)
>>>
>>>Thanks for listening
>>>
>>>
>>
>>
>>
>>--
>>PHP General Mailing List (http://www.php.net/)
>>To unsubscribe, visit: http://www.php.net/unsub.php
>>
> 
> 
> 


--- End Message ---
--- Begin Message ---
GS> <?php
GS> echo 'Finished';
?>>

I can do one better:

... ?>Finished<?php ...

Seriously, I think he's right to think parsing 3000 lines with *every*
call will be less than ideal.  He should use include() conditionally
to grab only the necessary code, but only to an extent.  Then you
start adding your server's filesystem performance into the equation,
but if the server's decent it should have those cached or something -
It should at least be able to pull them faster than PHP could
interpret them.

Short answer: less to interpret = less time

Steve
-- 
[EMAIL PROTECTED] ** http://mrclay.org

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


        This is my first participation in this group, so my question is I
write a function in c, but I need use this function and more joined in a
library make using the command ar rc alexlib.a x.o, but this procedure show
a error when I use this in my browser, please anyone can help me.

thanks

example

file x.c

int function addvalue ( int *a )
{
 *a = *a + 1;
 return (a);
}


gcc -c x.c
ar rc alexlib.a x.o


php


<?
 phpinclude ("alexlib.a");
 $a = 1;
 $b = addvalue ( $a );
 print ( "Value = 4b ");
?>



--- End Message ---
--- Begin Message ---
can anybody point me to tutorial, articles on
implementing design patterns using PHP ??

__________________________________________________
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards
http://movies.yahoo.com/
--- End Message ---
--- Begin Message ---
Is there any PHP function that works like ColdFusion's location tag?
After a certain execution, I wish to leave the current PHP page entirely and go to 
another page.  Is this possible?

I'm scouring the help stuff and am still digging for answers.

Thanks.

--- End Message ---
--- Begin Message ---
> Is there any PHP function that works like ColdFusion's location tag?
> After a certain execution, I wish to leave the current PHP 
> page entirely and go to another page.  Is this possible?

That's a HTTP Header, so you want to use the ... Header() command.

A Location header is what does the redirection.

<?php Header("Location: http://url.of.site/path/to/file.html";); ?>

J
--- End Message ---
--- Begin Message ---
Hi,
Thanks for the reply.  I saw this as well in the mailing list archives, but
everyone is saying you cannot output ANYTHING before calling header.

Unfortunately, I'm calling this at the end of a process, so it won't work.
It tells me I've already sent out header information.

I've basically created a single PHP page with a form.  When the form is
submitted, it submits to itself.  It checks if the form is submitted, and
then goes to mail the contents to someone.  After mailing, I want to go to a
Thank You page.  I want to get away from this PHP page, because I don't want
a person refreshing the page and causing the PHP page to submit again.

Thus, is there something else I can do?  Or am I just not seeing this?

Thanks,
Stephen




----- Original Message -----
From: "James" <[EMAIL PROTECTED]>
To: "webapprentice" <[EMAIL PROTECTED]>
Sent: Tuesday, March 26, 2002 10:20 PM
Subject: Re: [PHP] Any PHP equivalent of Macromedia ColdFusion's location
tag?


> header("Location: http://www.google.com";);
> replace that url with the page you want it to go to
>
>

--- End Message ---
--- Begin Message ---
So use a Javascript meta-refresh

On Wed, 27 Mar 2002, webapprentice wrote:

> Hi,
> Thanks for the reply.  I saw this as well in the mailing list archives, but
> everyone is saying you cannot output ANYTHING before calling header.
>
> Unfortunately, I'm calling this at the end of a process, so it won't work.
> It tells me I've already sent out header information.
>
> I've basically created a single PHP page with a form.  When the form is
> submitted, it submits to itself.  It checks if the form is submitted, and
> then goes to mail the contents to someone.  After mailing, I want to go to a
> Thank You page.  I want to get away from this PHP page, because I don't want
> a person refreshing the page and causing the PHP page to submit again.
>
> Thus, is there something else I can do?  Or am I just not seeing this?
>
> Thanks,
> Stephen
>
>
>
>
> ----- Original Message -----
> From: "James" <[EMAIL PROTECTED]>
> To: "webapprentice" <[EMAIL PROTECTED]>
> Sent: Tuesday, March 26, 2002 10:20 PM
> Subject: Re: [PHP] Any PHP equivalent of Macromedia ColdFusion's location
> tag?
>
>
> > header("Location: http://www.google.com";);
> > replace that url with the page you want it to go to
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
Hi Mr. Lerdorf,
I look forward to you upcoming O'Reilly PHP book. =)

Yes, a META tag refresh or Javascript control seems to be the only way left.
Strange that URL redirection is so unusual to implement in PHP compared to
ASP or Coldfusion (unless they do something klunky under the hood).

Anyway, I also noticed that when the manual says you cannot output ANYTHING,
I found out that if I close out all my spaces in the PHP page by tightening
the php container tags, I will not output anything first.  I forgot that
even whitespace would be considered a web page and would generate http
headers (since the PHP processor probably translates whitespace as
echo/print statements).

Thanks.

--Stephen

----- Original Message -----
From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
To: "webapprentice" <[EMAIL PROTECTED]>
Cc: "James" <[EMAIL PROTECTED]>; "Jason Murray"
<[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, March 27, 2002 12:01 AM
Subject: Re: [PHP] Any PHP equivalent of Macromedia ColdFusion's location
tag?


> So use a Javascript meta-refresh
>
> On Wed, 27 Mar 2002, webapprentice wrote:
>
> > Hi,
> > Thanks for the reply.  I saw this as well in the mailing list archives,
but
> > everyone is saying you cannot output ANYTHING before calling header.
> >
> > Unfortunately, I'm calling this at the end of a process, so it won't
work.
> > It tells me I've already sent out header information.
> >
> > I've basically created a single PHP page with a form.  When the form is
> > submitted, it submits to itself.  It checks if the form is submitted,
and
> > then goes to mail the contents to someone.  After mailing, I want to go
to a
> > Thank You page.  I want to get away from this PHP page, because I don't
want
> > a person refreshing the page and causing the PHP page to submit again.
> >
> > Thus, is there something else I can do?  Or am I just not seeing this?
> >
> > Thanks,
> > Stephen
> >
> >
> >
> >
> > ----- Original Message -----
> > From: "James" <[EMAIL PROTECTED]>
> > To: "webapprentice" <[EMAIL PROTECTED]>
> > Sent: Tuesday, March 26, 2002 10:20 PM
> > Subject: Re: [PHP] Any PHP equivalent of Macromedia ColdFusion's
location
> > tag?
> >
> >
> > > header("Location: http://www.google.com";);
> > > replace that url with the page you want it to go to
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>

--- End Message ---
--- Begin Message ---
Or, alter your page's structure so that it writes its output into a 
buffer, and echo/print it at the end of the page. That way you can
do the redirect at any point it's needed within the page logic.

Jason

-- 
Jason Murray
[EMAIL PROTECTED]
Web Developer, Melbourne IT
"Work now, freak later!"

> -----Original Message-----
> From: webapprentice [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, March 27, 2002 4:25 PM
> To: Rasmus Lerdorf
> Cc: James; Jason Murray; [EMAIL PROTECTED]
> Subject: Re: [PHP] Any PHP equivalent of Macromedia ColdFusion's
> location tag?
> 
> 
> Hi Mr. Lerdorf,
> I look forward to you upcoming O'Reilly PHP book. =)
> 
> Yes, a META tag refresh or Javascript control seems to be the 
> only way left.
> Strange that URL redirection is so unusual to implement in 
> PHP compared to
> ASP or Coldfusion (unless they do something klunky under the hood).
> 
> Anyway, I also noticed that when the manual says you cannot 
> output ANYTHING,
> I found out that if I close out all my spaces in the PHP page 
> by tightening
> the php container tags, I will not output anything first.  I 
> forgot that
> even whitespace would be considered a web page and would generate http
> headers (since the PHP processor probably translates whitespace as
> echo/print statements).
> 
> Thanks.
> 
> --Stephen
> 
> ----- Original Message -----
> From: "Rasmus Lerdorf" <[EMAIL PROTECTED]>
> To: "webapprentice" <[EMAIL PROTECTED]>
> Cc: "James" <[EMAIL PROTECTED]>; "Jason Murray"
> <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
> Sent: Wednesday, March 27, 2002 12:01 AM
> Subject: Re: [PHP] Any PHP equivalent of Macromedia 
> ColdFusion's location
> tag?
> 
> 
> > So use a Javascript meta-refresh
> >
> > On Wed, 27 Mar 2002, webapprentice wrote:
> >
> > > Hi,
> > > Thanks for the reply.  I saw this as well in the mailing 
> list archives,
> but
> > > everyone is saying you cannot output ANYTHING before 
> calling header.
> > >
> > > Unfortunately, I'm calling this at the end of a process, 
> so it won't
> work.
> > > It tells me I've already sent out header information.
> > >
> > > I've basically created a single PHP page with a form.  
> When the form is
> > > submitted, it submits to itself.  It checks if the form 
> is submitted,
> and
> > > then goes to mail the contents to someone.  After 
> mailing, I want to go
> to a
> > > Thank You page.  I want to get away from this PHP page, 
> because I don't
> want
> > > a person refreshing the page and causing the PHP page to 
> submit again.
> > >
> > > Thus, is there something else I can do?  Or am I just not 
> seeing this?
> > >
> > > Thanks,
> > > Stephen
> > >
> > >
> > >
> > >
> > > ----- Original Message -----
> > > From: "James" <[EMAIL PROTECTED]>
> > > To: "webapprentice" <[EMAIL PROTECTED]>
> > > Sent: Tuesday, March 26, 2002 10:20 PM
> > > Subject: Re: [PHP] Any PHP equivalent of Macromedia ColdFusion's
> location
> > > tag?
> > >
> > >
> > > > header("Location: http://www.google.com";);
> > > > replace that url with the page you want it to go to
> > > >
> > > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> >
> 
--- End Message ---
--- Begin Message ---
> Hi Mr. Lerdorf,
> I look forward to you upcoming O'Reilly PHP book. =)
>
> Yes, a META tag refresh or Javascript control seems to be the only way left.
> Strange that URL redirection is so unusual to implement in PHP compared to
> ASP or Coldfusion (unless they do something klunky under the hood).

They do. There is no magic here. If you want output on a page and also do
a redirect, the only way to do it is with a javascript meta-refresh (well,
you can do some tricks with frames as well, but I lump those tricks under
Javascript redirects). I don't care what ASP of Cold Fusion tells you, if
they allow you to send some data for the page and then redirect, then they
are either doing a Javascript meta-refresh or simply tossing your data and
doing a Location redirect.

If you have no output, then you can use a Location redirect.  What ASP and
Cond Fusion might do is buffer your output and simply throw it away if you
then at some point do a Location redirect.  That seems kind of silly to me
though.  It seems like a mistake to me to just chuck away output data like
that.  You can do that with PHP as well by turning on output buffering.
You can send all sorts of output after a Location redirect, but there will
be no browser around to see it because it has already received the
Location redirect and is off viewing the other page.

> Anyway, I also noticed that when the manual says you cannot output ANYTHING,
> I found out that if I close out all my spaces in the PHP page by tightening
> the php container tags, I will not output anything first.  I forgot that
> even whitespace would be considered a web page and would generate http
> headers (since the PHP processor probably translates whitespace as
> echo/print statements).

Yup, a space is as valid a character as any other.

-Rasmus

PS. One of the things with PHP is that we have never gone out of our way
to hide the actual mechanics of HTTP very much from the users.  I think it
is important for people to actually understand what is going on.  That's
why we don't have a redirect() function but instead tell you to send an
HTTP header called Location.  Because that is what needs to happen under
the covers.

--- End Message ---
--- Begin Message ---
Seems like you're getting confused about output verses php code.  Let's say
you have a file called "form.php"...

it submits to itself, checking the submitted data.  if the form input is
good, you want to do "stuff", then redirect them to a thanks page.  if it
isn't, you want to send them back to try again.

Easy.

form.php
---
<?
if(!isset($action))
    {
    ?>
    <HTML>
    <?
    if($problem)
        {
        echo "there was a problem with your entry, please try again";
        }
    ?>
    <!-- form here -->
    </HTML>
    <?
    }
else
    {
    if($action == "validate")
        {
        //
        // check form input
        //
        if($input == "valid")
            {
            // insert stuff into your data base, or do whatever
            header("Location: form.php?action=thanks");
            // no output to screen
            }
        else   
            {
            header("Location: form.php?problem=1");
            // they're sent back to the form,
            // and told there was a problem
            // no output to screen
            }
        }
    elseif($action == "thanks")
        {
        ?>
        <HTML>
        <BODY>
        <FONT>Thanks!</FONT>
        </BODY>
        </HTML>
        <?
        }
    }
?>
---

So, obviously it needs massaging, and none of the code is tested, but it's
the same way I do my forms.

It'd be better if you told them where they went wrong on the form, and there
are lots of ways to streamline the code and make it more modular, but this
should be enough to give you an idea about how you can use the header(), and
at what point you've sent "output" to the browser.


Justin French
--------------------
Creative Director
http://Indent.com.au
--------------------

--- End Message ---
--- Begin Message ---
Can someone help me with this. I'm trying to get ?id= set to the id number
of the name in the database. I can get ?id="THE NAME" but I can't get it
to pick up the id number. here is the code i"m trying:
while($row = mysql_fetch_array($result))
        {

                 printf("<a href=\"%s?id=%s\">%s</a><br>\n", $PHP_SELF,
$row["ID"], $row["Name"], $row["Name"]);
}

If I change the first $row["ID"] to $row["Name"] then ?id="Name here" but
then when I try to extract the information from the database using:

$result = mysql_query("SELECT * FROM Profiles WHERE id=$id", $dbcnx);
$row = mysql_fetch_array($result);

It won't work, but in the address bar if I manually change ?id=1 then the
information will load fine. Can anyone help?
Thanks.
-Chris

--- End Message ---
--- Begin Message ---
Try echo '<a
href="'.$PHP_SELF.'?id='.$row["ID"].'">'.row["name"].'</a>';

if $row["id"] still isn't shown, then you most likely aren't getting the
right data from the database to the correct variable...

-----Original Message-----
From: Omland Christopher m [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, March 26, 2002 7:53 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: [PHP] ID NUMBER HELP

Can someone help me with this. I'm trying to get ?id= set to the id
number
of the name in the database. I can get ?id="THE NAME" but I can't get it
to pick up the id number. here is the code i"m trying:
while($row = mysql_fetch_array($result))
        {

                 printf("<a href=\"%s?id=%s\">%s</a><br>\n", $PHP_SELF,
$row["ID"], $row["Name"], $row["Name"]);
}

If I change the first $row["ID"] to $row["Name"] then ?id="Name here"
but
then when I try to extract the information from the database using:

$result = mysql_query("SELECT * FROM Profiles WHERE id=$id", $dbcnx);
$row = mysql_fetch_array($result);

It won't work, but in the address bar if I manually change ?id=1 then
the
information will load fine. Can anyone help?
Thanks.
-Chris


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




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

I'm trying to fill a rectangle with color in a php generated PDF 
document.  I get the following error:

*Fatal error*: PDFlib error: illegal state 0x00000000 in 
*/usr/local/apache/htdocs/EDR/generate_edr.php* on line *144*

I have tried both of the following on line 144:

pdf_setcolor($pdf, "both", "gray", 1);

pdf_setrgbcolor($pdf,1,1,0);

If I comment out the line to set color the PDF document gets generated 
correctly. I can't find any reference* *to this error on mailing lists 
or documentation. I'm using PHP Version 4.1.1 and PDFlib 4.0.1.

Does anyone have any ideas, thanks.

Wayne Bastow



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

I'm writing a web mail. Having problem grabbing user full name to be 
included in the email. So I hv a few questions:

1) How do I fetch the user's full name using a PHP function WITHOUT calling 
system program finger? I already have the Linux user ID and password since I 
am using HTTP authentication.

2) How do I fetch it using finger?

3) Do I put the full name in the from->personal variable?

Thanx

Gaukia


_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com

--- End Message ---
--- Begin Message ---
On Wednesday 27 March 2002 14:44, gaukia 345 wrote:
> Hi all,
>
> I'm writing a web mail. Having problem grabbing user full name to be
> included in the email. So I hv a few questions:
>
> 1) How do I fetch the user's full name using a PHP function WITHOUT calling
> system program finger? I already have the Linux user ID and password since
> I am using HTTP authentication.
>
> 2) How do I fetch it using finger?
>
> 3) Do I put the full name in the from->personal variable?

Where did you want to get the user's full name from !?!

Assuming the people using your webmail have system accounts on the machine 
running your webmail then you could try looking in /etc/passwd.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
politics, n.:
        A strife of interests masquerading as a contest of principles.
        The conduct of public affairs for private advantage.
                -- Ambrose Bierce
*/
--- End Message ---
--- Begin Message ---
On Wed, 27 Mar 2002, gaukia 345 wrote:
> I'm writing a web mail. Having problem grabbing user full name to be 
> included in the email. So I hv a few questions:
> 
> 1) How do I fetch the user's full name using a PHP function WITHOUT
> calling system program finger? I already have the Linux user ID and
> password since I am using HTTP authentication.

Check out the function posix_getpwnam(), in particular, the gecos field. 
This obviously only works if the user account is present on your web 
server.

> 2) How do I fetch it using finger?

I wouldn't if I were you.

> 3) Do I put the full name in the from->personal variable?

Difficult to say. What is the from->personal variable?

miguel

--- End Message ---
--- Begin Message ---
Thanx Miguel. The from->personal variable is an IMAP header to be sent out. 
I open a pipe to sendmail, but since I'm running Postfix, the sendmail -f 
(for fullname) option wouldn't work. As a result the receiver gets "Apache 
User" as value for the from->personal member. Do you know how to insert some 
name into this header? I've already used posix_getpwnam() gecos member as 
Miguel suggested to retrieve full name from local server. Now I'd like to 
put this into the mail header and send it along since sendmail can't help me 
with postfix running.

Strangely when I shut down postfix, the popen I used to run sendmail cannot 
trigger sendmail to send mails out. No bouncing back...nothing. When I 
switch postfix back on, the mails in queue were delivered. Any idea why?


>From: Miguel Cruz <[EMAIL PROTECTED]>
>To: gaukia 345 <[EMAIL PROTECTED]>
>CC: [EMAIL PROTECTED]
>Subject: Re: [PHP] How to get user full name using PHP function?
>Date: Wed, 27 Mar 2002 01:31:41 -0600 (CST)
>
>On Wed, 27 Mar 2002, gaukia 345 wrote:
> > I'm writing a web mail. Having problem grabbing user full name to be
> > included in the email. So I hv a few questions:
> >
> > 1) How do I fetch the user's full name using a PHP function WITHOUT
> > calling system program finger? I already have the Linux user ID and
> > password since I am using HTTP authentication.
>
>Check out the function posix_getpwnam(), in particular, the gecos field.
>This obviously only works if the user account is present on your web
>server.
>
> > 2) How do I fetch it using finger?
>
>I wouldn't if I were you.
>
> > 3) Do I put the full name in the from->personal variable?
>
>Difficult to say. What is the from->personal variable?
>
>miguel
>




_________________________________________________________________
Join the worlds largest e-mail service with MSN Hotmail. 
http://www.hotmail.com

--- End Message ---
--- Begin Message ---
Why does PHP set the execute bit on an uploaded file?  This means a user
could upload a script and it would be executable.  Ouch!  Especially if
the file is available via httpd after upload. . . HELP.

I am saving to a directory with permissions of 766

And when php copies the file it assigns the following permissions.  

        rwxr-xr-x  

I am using the copy command to move the file from the tmp directory.

David McInnis



--- End Message ---
--- Begin Message ---
The default file permission for new files on the *nix system may be set
to something like 755... that could be the problem...

-----Original Message-----
From: David McInnis [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, March 26, 2002 11:03 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Does this seem odd? File Upload Permissions

Why does PHP set the execute bit on an uploaded file?  This means a user
could upload a script and it would be executable.  Ouch!  Especially if
the file is available via httpd after upload. . . HELP.

I am saving to a directory with permissions of 766

And when php copies the file it assigns the following permissions.  

        rwxr-xr-x  

I am using the copy command to move the file from the tmp directory.

David McInnis




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--- End Message ---
--- Begin Message ---
First, the execute bit means nothing over HTTP.  So they couldn't just
execute it remotely.  They would need an account on the box.

And second, PHP does not set the x bit, you are doing that.  Check your
default umask or set it explicitly with a call to umask() before copying
the file into place.


On Tue, 26 Mar 2002, David McInnis wrote:

> Why does PHP set the execute bit on an uploaded file?  This means a user
> could upload a script and it would be executable.  Ouch!  Especially if
> the file is available via httpd after upload. . . HELP.
>
> I am saving to a directory with permissions of 766
>
> And when php copies the file it assigns the following permissions.
>
>       rwxr-xr-x
>
> I am using the copy command to move the file from the tmp directory.
>
> David McInnis
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
That's not entirely true... if php is running as cgi it would need the
execution bit set. Or if someone wanted to write a shell script in php
to be used to help compromise a server it would need to be executable as
well...

-----Original Message-----
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, March 26, 2002 11:08 PM
To: David McInnis
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Does this seem odd? File Upload Permissions

First, the execute bit means nothing over HTTP.  So they couldn't just
execute it remotely.  They would need an account on the box.

And second, PHP does not set the x bit, you are doing that.  Check your
default umask or set it explicitly with a call to umask() before copying
the file into place.


On Tue, 26 Mar 2002, David McInnis wrote:

> Why does PHP set the execute bit on an uploaded file?  This means a
user
> could upload a script and it would be executable.  Ouch!  Especially
if
> the file is available via httpd after upload. . . HELP.
>
> I am saving to a directory with permissions of 766
>
> And when php copies the file it assigns the following permissions.
>
>       rwxr-xr-x
>
> I am using the copy command to move the file from the tmp directory.
>
> David McInnis
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--- End Message ---
--- Begin Message ---
But it would mean that you would have to severly misconfigure your server
and write severely braindead code.  Simply putting a file in your
document_root that has the x bit set will under normal circumstances not
do anything.

On Tue, 26 Mar 2002, Demitrious S. Kelly wrote:

> That's not entirely true... if php is running as cgi it would need the
> execution bit set. Or if someone wanted to write a shell script in php
> to be used to help compromise a server it would need to be executable as
> well...
>
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 26, 2002 11:08 PM
> To: David McInnis
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Does this seem odd? File Upload Permissions
>
> First, the execute bit means nothing over HTTP.  So they couldn't just
> execute it remotely.  They would need an account on the box.
>
> And second, PHP does not set the x bit, you are doing that.  Check your
> default umask or set it explicitly with a call to umask() before copying
> the file into place.
>
>
> On Tue, 26 Mar 2002, David McInnis wrote:
>
> > Why does PHP set the execute bit on an uploaded file?  This means a
> user
> > could upload a script and it would be executable.  Ouch!  Especially
> if
> > the file is available via httpd after upload. . . HELP.
> >
> > I am saving to a directory with permissions of 766
> >
> > And when php copies the file it assigns the following permissions.
> >
> >     rwxr-xr-x
> >
> > I am using the copy command to move the file from the tmp directory.
> >
> > David McInnis
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>

--- End Message ---
--- Begin Message ---
Either severely mis-configure, or make a mistake (damn us humans and our
mistakes :)

-----Original Message-----
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, March 26, 2002 11:15 PM
To: Demitrious S. Kelly
Cc: 'David McInnis'; [EMAIL PROTECTED]
Subject: RE: [PHP] Does this seem odd? File Upload Permissions

But it would mean that you would have to severly misconfigure your
server
and write severely braindead code.  Simply putting a file in your
document_root that has the x bit set will under normal circumstances not
do anything.

On Tue, 26 Mar 2002, Demitrious S. Kelly wrote:

> That's not entirely true... if php is running as cgi it would need the
> execution bit set. Or if someone wanted to write a shell script in php
> to be used to help compromise a server it would need to be executable
as
> well...
>
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 26, 2002 11:08 PM
> To: David McInnis
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Does this seem odd? File Upload Permissions
>
> First, the execute bit means nothing over HTTP.  So they couldn't just
> execute it remotely.  They would need an account on the box.
>
> And second, PHP does not set the x bit, you are doing that.  Check
your
> default umask or set it explicitly with a call to umask() before
copying
> the file into place.
>
>
> On Tue, 26 Mar 2002, David McInnis wrote:
>
> > Why does PHP set the execute bit on an uploaded file?  This means a
> user
> > could upload a script and it would be executable.  Ouch!  Especially
> if
> > the file is available via httpd after upload. . . HELP.
> >
> > I am saving to a directory with permissions of 766
> >
> > And when php copies the file it assigns the following permissions.
> >
> >     rwxr-xr-x
> >
> > I am using the copy command to move the file from the tmp directory.
> >
> > David McInnis
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




--- End Message ---
--- Begin Message ---
OK.  But I am not changing the permissions.  How am I setting the x bit?
I am not doing anything in my code except executing a copy() or
move_uploaded_file(). Is my server not configured correctly?  If so, how
do I change the default permissions?  

By the way, move_uploaded_file() sets completely different permissions
[-rw-------]than copy() [rwxr-xr-x].  I still say . . . "strange".

David



-----Original Message-----
From: Demitrious S. Kelly [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, March 26, 2002 11:24 PM
To: 'Rasmus Lerdorf'
Cc: 'David McInnis'; [EMAIL PROTECTED]
Subject: RE: [PHP] Does this seem odd? File Upload Permissions

Either severely mis-configure, or make a mistake (damn us humans and our
mistakes :)

-----Original Message-----
From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]] 
Sent: Tuesday, March 26, 2002 11:15 PM
To: Demitrious S. Kelly
Cc: 'David McInnis'; [EMAIL PROTECTED]
Subject: RE: [PHP] Does this seem odd? File Upload Permissions

But it would mean that you would have to severly misconfigure your
server
and write severely braindead code.  Simply putting a file in your
document_root that has the x bit set will under normal circumstances not
do anything.

On Tue, 26 Mar 2002, Demitrious S. Kelly wrote:

> That's not entirely true... if php is running as cgi it would need the
> execution bit set. Or if someone wanted to write a shell script in php
> to be used to help compromise a server it would need to be executable
as
> well...
>
> -----Original Message-----
> From: Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 26, 2002 11:08 PM
> To: David McInnis
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] Does this seem odd? File Upload Permissions
>
> First, the execute bit means nothing over HTTP.  So they couldn't just
> execute it remotely.  They would need an account on the box.
>
> And second, PHP does not set the x bit, you are doing that.  Check
your
> default umask or set it explicitly with a call to umask() before
copying
> the file into place.
>
>
> On Tue, 26 Mar 2002, David McInnis wrote:
>
> > Why does PHP set the execute bit on an uploaded file?  This means a
> user
> > could upload a script and it would be executable.  Ouch!  Especially
> if
> > the file is available via httpd after upload. . . HELP.
> >
> > I am saving to a directory with permissions of 766
> >
> > And when php copies the file it assigns the following permissions.
> >
> >     rwxr-xr-x
> >
> > I am using the copy command to move the file from the tmp directory.
> >
> > David McInnis
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
On Wednesday 27 March 2002 15:33, David McInnis wrote:
> OK.  But I am not changing the permissions.  How am I setting the x bit?
> I am not doing anything in my code except executing a copy() or
> move_uploaded_file(). Is my server not configured correctly?  If so, how
> do I change the default permissions?
>
> By the way, move_uploaded_file() sets completely different permissions
> [-rw-------]than copy() [rwxr-xr-x].  I still say . . . "strange".

Have a look at the umask() function.

If that doesn't solve your problem you can always explicitly set the 
permissions after moving/copying using chmod().
-- 


Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
If you lived today as if it were your last, you'd buy up a box of rockets
and fire them all off, wouldn't you?
                -- Garrison Keillor
*/
--- End Message ---
--- Begin Message ---
Here's the situation.

I run the website for a macintosh user folding@home team.

We are providing certificates for users who have done a signifigant amount
of work for the team.

I have jpeg templates and I'm using ImageTTFBBox and ImageTTFText to write
the username of the user on the certificate.

Some of the more "artistic" mac users have noticed some pixelation on the
text.
I'm looking for a way to clean that up.

Is there a way to use Postscript fonts with php?
I looked at the ImageMagik php extension, and it looks like it is still
quite early in development.

I haven't used ImageMagik much, but would an exec() call to the real
ImageMagick and then have php display what it does be a solution to this?
(yes- I know exec() isn't as good as pure php but hey-)

If you want to see it for yourself, look at the images produced by the
usernames with links at http://macaddict4life.dhs.org/walloffame.php

The source to the image generation is at
http://macaddict4life.dhs.org/Certs/certificate.phps

I'm currently using php 4.1.2 with GD-2 and FreeType 2 support (x86 Linux
Apache DSO)

-=-=-=-=-=-=-=-=-
Different matter, is there a way to pass the username to the php script
from a hyperlink w/o needing a ?name=blah in the link?

It would be cool if the script could just end in .jpeg opposed to
.jpeg?name=blah
(in that directory apache handled .jpeg as if it was .php)

Thanks for any suggestions!
--- End Message ---
--- Begin Message ---
I can't imagine you'll ever get results that are to anyone's satisfaction
using JPEGs unless they aren't wearing their glasses. How about PDF? 

miguel

On Tue, 26 Mar 2002, Michael A. Peters wrote:

> Here's the situation.
> 
> I run the website for a macintosh user folding@home team.
> 
> We are providing certificates for users who have done a signifigant amount
> of work for the team.
> 
> I have jpeg templates and I'm using ImageTTFBBox and ImageTTFText to write
> the username of the user on the certificate.
> 
> Some of the more "artistic" mac users have noticed some pixelation on the
> text.
> I'm looking for a way to clean that up.
> 
> Is there a way to use Postscript fonts with php?
> I looked at the ImageMagik php extension, and it looks like it is still
> quite early in development.
> 
> I haven't used ImageMagik much, but would an exec() call to the real
> ImageMagick and then have php display what it does be a solution to this?
> (yes- I know exec() isn't as good as pure php but hey-)
> 
> If you want to see it for yourself, look at the images produced by the
> usernames with links at http://macaddict4life.dhs.org/walloffame.php
> 
> The source to the image generation is at
> http://macaddict4life.dhs.org/Certs/certificate.phps
> 
> I'm currently using php 4.1.2 with GD-2 and FreeType 2 support (x86 Linux
> Apache DSO)
> 
> -=-=-=-=-=-=-=-=-
> Different matter, is there a way to pass the username to the php script
> from a hyperlink w/o needing a ?name=blah in the link?
> 
> It would be cool if the script could just end in .jpeg opposed to
> .jpeg?name=blah
> (in that directory apache handled .jpeg as if it was .php)
> 
> Thanks for any suggestions!
> 
> 

--- End Message ---
--- Begin Message ---
This is a bug in GD2 - When you use Truecolor images with GD2,
anti-aliasing of ttf fonts break.  This is fixed in GD-2.0.2.  You don't
seem to have all that many colours on those certificates.  Try simply
using an indexed image just to see the real quality you can get with
GD+TTF before switching.

The patches to fix this are available privately, but you should bug the
folks at boutell.com to release a new version of GD2.

-Rasmus

On Tue, 26 Mar 2002, Michael A. Peters wrote:

> Here's the situation.
>
> I run the website for a macintosh user folding@home team.
>
> We are providing certificates for users who have done a signifigant amount
> of work for the team.
>
> I have jpeg templates and I'm using ImageTTFBBox and ImageTTFText to write
> the username of the user on the certificate.
>
> Some of the more "artistic" mac users have noticed some pixelation on the
> text.
> I'm looking for a way to clean that up.
>
> Is there a way to use Postscript fonts with php?
> I looked at the ImageMagik php extension, and it looks like it is still
> quite early in development.
>
> I haven't used ImageMagik much, but would an exec() call to the real
> ImageMagick and then have php display what it does be a solution to this?
> (yes- I know exec() isn't as good as pure php but hey-)
>
> If you want to see it for yourself, look at the images produced by the
> usernames with links at http://macaddict4life.dhs.org/walloffame.php
>
> The source to the image generation is at
> http://macaddict4life.dhs.org/Certs/certificate.phps
>
> I'm currently using php 4.1.2 with GD-2 and FreeType 2 support (x86 Linux
> Apache DSO)
>
> -=-=-=-=-=-=-=-=-
> Different matter, is there a way to pass the username to the php script
> from a hyperlink w/o needing a ?name=blah in the link?
>
> It would be cool if the script could just end in .jpeg opposed to
> .jpeg?name=blah
> (in that directory apache handled .jpeg as if it was .php)
>
> Thanks for any suggestions!
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
At 26.03.2002  23:56, you wrote:
>
>Here's the situation.
>
>I run the website for a macintosh user folding@home team.
>
>We are providing certificates for users who have done a signifigant amount
>of work for the team.
>
>I have jpeg templates and I'm using ImageTTFBBox and ImageTTFText to write
>the username of the user on the certificate.
>
>Some of the more "artistic" mac users have noticed some pixelation on the
>text.
>I'm looking for a way to clean that up.
>
>Is there a way to use Postscript fonts with php?
>I looked at the ImageMagik php extension, and it looks like it is still
>quite early in development.

Yes there is
$font=imagepsloadfont("HVB.PFB"); /* Helvetica */
$font=imagepsloadfont("HVB.PFB"); /* Helvetica */
// Attention I had to load the font twice to get it run, dont know if
// its necessary to do this today
    /* A case around the text to get correct center alignment */
    $coord=ImagePSBBox($str,$font,$f_size,$spacing,$tightness,$angle);
    /* claculate center*/

    for($i=4;$i<4;$i++)
    {
       echo "$i=$coord[$i]\n";
    }

    $xpos= ($piclen - $coord[2]) / 2;
    //floor($xpos);
    $ypos= ($pic_h - $f_size) / 2 + $f_size ;
    //floor($ypos);

    ImagePSText($im,$str,$font,$f_size,$foreground,$background,$xpos,$ypos 
- 2,$spacing,$tightness,$angle,$aalias);


>I haven't used ImageMagik much, but would an exec() call to the real
>ImageMagick and then have php display what it does be a solution to this?
>(yes- I know exec() isn't as good as pure php but hey-)
>
>If you want to see it for yourself, look at the images produced by the
>usernames with links at http://macaddict4life.dhs.org/walloffame.php
>
>The source to the image generation is at
>http://macaddict4life.dhs.org/Certs/certificate.phps
>
>I'm currently using php 4.1.2 with GD-2 and FreeType 2 support (x86 Linux
>Apache DSO)

>-=-=-=-=-=-=-=-=-
>Different matter, is there a way to pass the username to the php script
>from a hyperlink w/o needing a ?name=blah in the link?
>
>It would be cool if the script could just end in .jpeg opposed to
>.jpeg?name=blah
>(in that directory apache handled .jpeg as if it was .php)
Im not shure, but this is not possible, just a directory.
Try it with a .htacess in your path.  

--- End Message ---
--- Begin Message ---
I thought about that.
I may do that if I can't clean it up another way.

On Wed, 27 Mar 2002 02:01:16 -0600 (CST)
Miguel Cruz <[EMAIL PROTECTED]> mentioned:

> I can't imagine you'll ever get results that are to anyone's
satisfaction
> using JPEGs unless they aren't wearing their glasses. How about PDF? 
> 
> miguel
> 
> On Tue, 26 Mar 2002, Michael A. Peters wrote:
> 
> > Here's the situation.
> > 
> > I run the website for a macintosh user folding@home team.
> > 
> > We are providing certificates for users who have done a signifigant
amount
> > of work for the team.
> > 
> > I have jpeg templates and I'm using ImageTTFBBox and ImageTTFText to
write
> > the username of the user on the certificate.
> > 
> > Some of the more "artistic" mac users have noticed some pixelation on
the
> > text.
> > I'm looking for a way to clean that up.
> > 
> > Is there a way to use Postscript fonts with php?
> > I looked at the ImageMagik php extension, and it looks like it is
still
> > quite early in development.
> > 
> > I haven't used ImageMagik much, but would an exec() call to the real
> > ImageMagick and then have php display what it does be a solution to
this?
> > (yes- I know exec() isn't as good as pure php but hey-)
> > 
> > If you want to see it for yourself, look at the images produced by the
> > usernames with links at http://macaddict4life.dhs.org/walloffame.php
> > 
> > The source to the image generation is at
> > http://macaddict4life.dhs.org/Certs/certificate.phps
> > 
> > I'm currently using php 4.1.2 with GD-2 and FreeType 2 support (x86
Linux
> > Apache DSO)
> > 
> > -=-=-=-=-=-=-=-=-
> > Different matter, is there a way to pass the username to the php
script
> > from a hyperlink w/o needing a ?name=blah in the link?
> > 
> > It would be cool if the script could just end in .jpeg opposed to
> > .jpeg?name=blah
> > (in that directory apache handled .jpeg as if it was .php)
> > 
> > Thanks for any suggestions!
> > 
> > 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
--- End Message ---
--- Begin Message ---
Thank you.
I sent an e-mail to them explaining my problem and asking for gd 2.0.2

On Wed, 27 Mar 2002 00:15:02 -0800 (PST)
Rasmus Lerdorf <[EMAIL PROTECTED]> mentioned:

> This is a bug in GD2 - When you use Truecolor images with GD2,
> anti-aliasing of ttf fonts break.  This is fixed in GD-2.0.2.  You don't
> seem to have all that many colours on those certificates.  Try simply
> using an indexed image just to see the real quality you can get with
> GD+TTF before switching.
> 
> The patches to fix this are available privately, but you should bug the
> folks at boutell.com to release a new version of GD2.
> 
> -Rasmus
> 

* snip *
--- End Message ---
--- Begin Message ---
Is there any other way of enabling trans_sid besides when compiling php?
Can I enable it in the php.ini file or .htaccess? And if so what would the
syntax be?  I've tried multiple things, but nothing seems to work..

If that's not possible is there a way of getting rid of the '?' in the url
when people have cookies enabled?  When cookies are not enabled the sid will
follow the '?' in the url since currently all my links have <?=sid?> at the
end.. So for example:

<a href="login.htm?<?=sid?>">Please login</a>

As you can see there will always be the '?' at the end of login.htm.. When
the surfer has cookies off it doesnt look bad, but when he has them
enabled.. It just looks strange :)

Thanks!

Rick

"A good head and good heart are always a formidable combination. But when
you add to that a literate tongue or pen, then you have something very
special" - Nelson Mandela

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

I asked this same question to an ISP I'm with, and was told that it's only
possible through a re-compile. The way I got around it is this: I created a
function to check whether SID was present (it only is when the session is
first invoked, and from there on if the user doesn't have cookies enabled).
The function takes three arguments; type, url, and link text / image.
Here's how it looks:

// Function to auto append the session id to a link: takes the link and name
of link and
// the type of link (a=&, b=?) as arguments.
function AppendSessionId($link, $label, $type) {
 $display = "<a href=\"" . $link;
 if (SID) {
  if ($type == "a") {
   $display .= "&";
  } else
  if ($type == "b") {
   $display .= "?";
  }
  $display .= SID;
 }
 $display .= "\">" . $label . "</a>";

 return $display;
}

The type is for appending the SID onto links that already have a query
string. So if you did:

echo AppendSessionId("page.php?id=1", "Page 1", "a");

URL output would be:
page.php?id=1&session_id_variable_name=34567890

If the user has cookies enabled, ouput would simply be:
page.php?id=1

If you use type "b", then the sid is appended with a question mark (new
query string is started) for those users without cookies enabled:

echo AppendSessionId("page.php", "My page", "b");

output would be:
page.php for cookies enabled users and
page.php?session_id_variable_name=23456789 for those who cause us problems.

Hope that helps. If anyone's got a better solution, I'm all ears! :)

James

"Richard Baskett" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Is there any other way of enabling trans_sid besides when compiling php?
Can I enable it in the php.ini file or .htaccess? And if so what would the
syntax be?  I've tried multiple things, but nothing seems to work..

If that's not possible is there a way of getting rid of the '?' in the url
when people have cookies enabled?  When cookies are not enabled the sid will
follow the '?' in the url since currently all my links have <?=sid?> at the
end.. So for example:

<a href="login.htm?<?=sid?>">Please login</a>

As you can see there will always be the '?' at the end of login.htm.. When
the surfer has cookies off it doesnt look bad, but when he has them
enabled.. It just looks strange :)

Thanks!

Rick

"A good head and good heart are always a formidable combination. But when
you add to that a literate tongue or pen, then you have something very
special" - Nelson Mandela



--- End Message ---
--- Begin Message ---
At 26.03.2002  14:44, you wrote:
>I wasn't so much concearned about security of users grabbin pics. I am
>more trying to learn how these people load there menus dynamically and
>pics dynamically. Do you have any links to pages or code that describe how
>to make a link in the db to pics on my filesystem?
>Thanks.
>-Chris
<snip>

I cannot help you with code,also it wouldnt really help you understanding 
the problem
but give you more problems understanding my code.
I use to have a table with the following structure
TABLE MENU
rn      // thats an autoincrement number for indexing
page // on which page the component will appear "foobar.php3"
pt      // path to the pic (depending of quantity of path) "../pix/"
nop // the name of the pic "foo.jpg"
altval  // the word which will be shown in the alt tag of the pics 
reference "This is the foopic"
link    // where will the link go "newfoo.php"
orm     // a number to order the
sf      // showflag, to switch off unwanted/uncompleted pages

For pathinformations, I use an includefile which is included on every page.
This holds the informations about tablewidth, pathes(oops thats correct?), 
sitenames
and everything the Site needs on every page.

Now you just make a select like
select * from menu where page="$PHP_SELF" where sf=1 order by orm
And make your menu. If you put the menu in an extra page (or an object)
you just have to include it on every "content page" and the work is done.
echo '<table border="0" width="'.$tbwidth.'" cellpadding="0" 
cellspacing="0" summary="Menutable">'
while($res=answer from db)
{
         echo '<tr><td>'
         echo '<a href="'.$res[5].'?somevar=something">'
         echo '<img src="$res[2]" border="0" width="XX" height="YY" 
alt="$res[4]">
         echo '</a></td></tr>'
}
echo '</table>'

As you said you want to make a menu, width & height of the pics are known.
Otherwise you shoul check them using fuctions from the graphic library.
The Browsers are faster if they know exactly what the do.
Maybe this gives you some understanding how to do it.
Oliver
(sorry all trailing ; are missing. Its early today)

--- End Message ---
--- Begin Message ---
Hi, my question is how to change two pages in different frames in one click.
I am not sure if this is related to more like HTML.  But, here is my case.
I have two frames, frame1 and frame2.
In frame1, I have href tag targeted to frame1.
When I click it, I want my frame2 to be changes some other page also.  Would
this be possible?
If anyone knows how to do it, please let me know.  Thanks for your
consideration.

                                    Hiro




_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

--- End Message ---
--- Begin Message ---
This is not really PHP stuff anyway see here..

This is possible with Javascript which can be placed in your link to
refresh the frames

<a href="javascript:some_js_function();" ...>

inside the function you can change source of one or more frames if you
know javascript

parent.frame1.src =  .. 
parent.frame2.src = ....




On Wed, 27 Mar 2002, Hironoshin Tanaka wrote:

>Hi, my question is how to change two pages in different frames in one click.
>I am not sure if this is related to more like HTML.  But, here is my case.
>I have two frames, frame1 and frame2.
>In frame1, I have href tag targeted to frame1.
>When I click it, I want my frame2 to be changes some other page also.  Would
>this be possible?
>If anyone knows how to do it, please let me know.  Thanks for your
>consideration.
>
>                                    Hiro
>
>
>
>
>_________________________________________________________
>Do You Yahoo!?
>Get your free @yahoo.com address at http://mail.yahoo.com
>
>
>-- 
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>

<[EMAIL PROTECTED]>
-------------------------------------------------------------------
We must use time wisely and forever realize that the time is 
always ripe to do right."
            
                -- Nelson Mandela
-------------------------------------------------------------------

--- End Message ---
--- Begin Message ---
Can anyone give me the quick and easy on IMAP and POP3 ?

What I want to do is, check my POP3 server for messages, download those
messages into my MySQL DB.  I want to retrieve the FROM, SUBJECT, HEADER and
BODY from the messages and place them in the corresponding mysql fields.

I know the mysql / php stuff fine ... it's the IMAP / POP3 thing I'm a
little lost on.  Perhaps someone can point me to a script posted on some
website that shows some examples of how to use IMAP to connect and retrieve
messages via POP3, or if anyone out there already has some examples, that'll
be very helpful.

Thanks.
Jason



--- End Message ---
--- Begin Message ---
On Wednesday 27 March 2002 16:25, Jason Caldwell wrote:
> Can anyone give me the quick and easy on IMAP and POP3 ?
>
> What I want to do is, check my POP3 server for messages, download those
> messages into my MySQL DB.  I want to retrieve the FROM, SUBJECT, HEADER
> and BODY from the messages and place them in the corresponding mysql
> fields.
>
> I know the mysql / php stuff fine ... it's the IMAP / POP3 thing I'm a
> little lost on.  Perhaps someone can point me to a script posted on some
> website that shows some examples of how to use IMAP to connect and retrieve
> messages via POP3, or if anyone out there already has some examples,
> that'll be very helpful.

You could take a look at SquirrelMail (www.squirrelmail.org). That uses IMAP 
(albeit it's own functions rather than PHP's). And if you take a look at the 
plugins (mailfetch or something), that should give you an idea of how to do 
POP.

In fact check out all the other webmail systems written in PHP.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
If you want to know how old a man is, ask his brother-in-law.
*/
--- End Message ---
--- Begin Message ---

Hello,

  Can anyone please tell me how to create a table in mysql using php
code..


-Uma

--- End Message ---
--- Begin Message ---
On Wednesday 27 March 2002 16:51, Uma Shankari T. wrote:
> Hello,
>
>   Can anyone please tell me how to create a table in mysql using php
> code..

<sigh> 

This is really basic stuff. Please take a look at the numerous tutorials out 
the on the world wide web.


-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk

/*
When you don't know what to do, walk fast and look worried.
*/
--- End Message ---
--- Begin Message ---
hi folks,
to compile PHP4 i need apache AND roxen being installed in my development
distribution.
BUT if i install apache AND roxen the same time it conflicts together and no
webserver is running anymore.
the building of PHP is working well if i have installed both.
does anybody know a workaround that i can have apache webserver running AND
roxen being on the system for compiling-work only
or should i forget running a webserver on a development system?
lothar
--- End Message ---
--- Begin Message ---
Hello,

Could you help me: I really need to use the follow function:
xslt_set_sax_handlers

I've not found documentation on this function.

I use PHP version 4.1.1. Does this function work or not in this
version?

Thank you in advance,
Sincerely,
Alexey


--- End Message ---
--- Begin Message ---
This is what i have in EDITPLUS tools

Menu text :    PHP Syntax Check
Command :    c:\intraserver\php\php.exe
Argument:      -l -f $ (FileName)


And I have checked 'Capture output'

Sijan Khadka
[EMAIL PROTECTED]

> -----Original Message-----
> From: Luca Grossi [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, March 24, 2002 2:00 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Using EditPlus with PHP
>
>
>                          I'm sorry if this question has been asked before
> but could anyone give me instructions on how to debug and interpret php
> scripts using Edit Plus ? I download the php modules for edit plus so
> it recognise the syntax. But how do I setup the user tools , so I can
check
> for bugs in the script and run it
>
> Thanks
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
You will have to build another page that receive a parameter(let's say the
index of the pic from the database) and return the image.
In this page you'll have to set the Content-Type first using:
header("Content-Type: image/jpeg") or
header("Content-Type: image/gif") or
header("Content-Type: image/png")
depends of what you need.
After that you will find the pic in the database and return it with echo.



--
---------------------------------
Cirstoiu Aurel Sorin
Interakt Online Support
http://www.interakt.ro/

"David Juras" <[EMAIL PROTECTED]> wrote in message
003101c1d4be$d4e77d60$4d01a8c0@Yxendis">news:003101c1d4be$d4e77d60$4d01a8c0@Yxendis...
Hi,
I'm working with PHP and ODBC to get images stored in a database (Blob
fields). But I experiment little problems to display these pics. Has anyone
any information about PHP/ODBC/images ?

Thanks,

Bilbo




--- End Message ---
--- Begin Message ---
I'm looking for a way to close the connection with the browser yet have the
script carry on doing some processing.
Any ideas?

Peter


--- End Message ---
--- Begin Message ---
How would I compare to variables where I would want one variable to equal
only part or some of the other variable?
Here is the code

<?
if ($HTTP_USER_AGENT !== "%MSIE 5.5%") {
 print "You must upgrade your browser";
} else {
 exit;
}

?>

Any suggestions


--- End Message ---
--- Begin Message ---
use regular expressions: 

if (ereg("MSIE 5.5", $HTTP_USER_AGENT)) {
}

Greets,

Edward

----- Original Message ----- 
From: "Ron" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 27, 2002 1:46 PM
Subject: [PHP] Comparrison


> How would I compare to variables where I would want one variable to equal
> only part or some of the other variable?
> Here is the code
> 
> <?
> if ($HTTP_USER_AGENT !== "%MSIE 5.5%") {
>  print "You must upgrade your browser";
> } else {
>  exit;
> }
> 
> ?>
> 
> Any suggestions
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


--- End Message ---
--- Begin Message ---
http://php.net/ereg

"Ron" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> How would I compare to variables where I would want one variable to equal
> only part or some of the other variable?
> Here is the code
>
> <?
> if ($HTTP_USER_AGENT !== "%MSIE 5.5%") {
>  print "You must upgrade your browser";
> } else {
>  exit;
> }
>
> ?>
>
> Any suggestions
>
>


--- End Message ---
--- Begin Message ---
  Hi All!

  Here's something I am trying to do, and I don't know if it's possible. I
have a function that must register session variables, values that come from
an array. But each of these values will be the value of an session array, of
non-fixed size.

  Let me explain (w and d stands for Write and Del):

What I need:
$_SESSION['news']['w'] = 1;
$_SESSION['news']['d'] = 1;

  So what I am doing:

$w = 1;
$d = 1
$powers = ($w, $d); // This array can have an undetermined number of values

function MakePowers ($area, $powers)
{
    foreach ($powers as $value) {
        $area = $value;
    }
}

  Now here comes the real problem, $area specifies where in the $_SESSION
array I will store the power.

  I did $area = $_SESSION['news'] but gives me a "undefined index 'news". I
could define 'news' for each page of my application but that's not much
function reuse :-)

  And $area could be, in different pages, $_SESSION['news]['admin'],
$_SESSION['forum'], etc...

  That's my non-fixed sized array. I need to make a central function that
will store in different keys of $_SESSION values that say what powers the
user has, powers that come from the $powers array.


  ANY help? I hope I did a good job trying to explain what I am trying to do
:-)

  Many thanks for any help, sincerely!

--

Julio Nobrega.


--- End Message ---

Reply via email to