php-general Digest 19 Feb 2001 23:59:26 -0000 Issue 522

Topics (messages 40558 through 40666):

Problems with error handling.
        40558 by: Securez
        40649 by: Richard Lynch

HTTP POST Question
        40559 by: Montgomery-Recht, Evan
        40563 by: MList
        40564 by: Montgomery-Recht, Evan
        40575 by: Montgomery-Recht, Evan
        40595 by: John Monfort
        40597 by: John Monfort

Excel not opened in browser when changing header
        40560 by: Tim
        40651 by: Richard Lynch

Re: something wrong at my mail set up in php.ini
        40561 by: Hrishi

Re: EOF (End of File) character..
        40562 by: David Bouw

Zend debugger running across virtual servers
        40565 by: Neil Kimber

woe is me
        40566 by: Adrian Murphy
        40568 by: Kath
        40598 by: John Monfort

Re: add user to ldap using php
        40567 by: Sayumporn Darunwanna

what's the difference between include and require??
        40569 by: Zenith
        40599 by: John Monfort

How can I use session variable in a function?
        40570 by: Zenith
        40652 by: Richard Lynch

Re: [php_mysql] Creative solution with XML,PHP,MYSQL
        40571 by: Tim Ward
        40586 by: Chris Carbaugh

Re: Variable stores incomplete values...
        40572 by: Joe Sheble (Wizaerd)

Fax manipulation?
        40573 by: Joshua Long
        40574 by: Brian V Bonini
        40583 by: Chris Carbaugh
        40630 by: Chris Carbaugh

Check Client BPS
        40576 by: Martin Marconcini

Re: Pay for help
        40577 by: Robert V. Zwink

<? -- File Total -- ?>
        40578 by: Abe Asghar
        40653 by: Richard Lynch

Multiple URLs and cookies
        40579 by: Jeremy Gillies
        40654 by: Richard Lynch

Shorten this MySQL code?
        40580 by: Jeff Oien
        40592 by: Jared Eikenberg

Open location automatically after checking
        40581 by: Edith Lai
        40655 by: Richard Lynch

php variables in sql statements.
        40582 by: Matt Davis
        40584 by: Ifrim Sorin

Re: Apache and $HTTP_*_VARS
        40585 by: Todd Cary

Re: SMTP on IIS 5.0 Windows 2000 Pro
        40587 by: Todd Cary

Re: PDF Functions
        40588 by: Michael Stearne

Re: system()
        40589 by: ..s.c.o.t.t..
        40602 by: Christian Reiniger
        40605 by: ..s.c.o.t.t..
        40615 by: Christian Reiniger

Re: array
        40590 by: ..s.c.o.t.t..

Re: PHP as CGI
        40591 by: ..s.c.o.t.t..

Making a living with PHP?
        40593 by: Mary E Tyler

question about multidimension array
        40594 by: Zenith
        40596 by: ..s.c.o.t.t..

ASP / PHP / embedded scripting  (possibly OT)
        40600 by: ..s.c.o.t.t..
        40606 by: Hrishi
        40607 by: Michael Stearne
        40634 by: Michael Kimsal

trying to get xml-file
        40601 by: Jan Grafström

some more about include() and require()
        40603 by: ..s.c.o.t.t..

How to determine the parameter is a 1 dimension array or not?
        40604 by: Zenith
        40610 by: Mark Maggelet
        40611 by: php3.developersdesk.com
        40616 by: Christian Reiniger

sessions and data missing browser message
        40608 by: Evelio Martinez
        40624 by: Martin A. Marques

Will this work?
        40609 by: W.D.
        40619 by: Jason Cox
        40633 by: W.D.

<Ret> from text input
        40612 by: Michael George
        40656 by: Richard Lynch

function with 2 arguments
        40613 by: Martin A. Marques
        40614 by: Boget, Chris

Session support in PHP
        40617 by: Sascha Andres
        40628 by: Kath

Help!! IP functions!!!
        40618 by: Bruno Freire
        40620 by: Jason Cox
        40627 by: Martin A. Marques

Session: use cookies or not
        40621 by: Jimmy Bäckström

form's variable access problem
        40622 by: Ivo Stoykov
        40657 by: Richard Lynch

debug?
        40623 by: Ivo Stoykov
        40658 by: Richard Lynch

dates
        40625 by: Phil Daintree

Php.exe doesn't load extensions when invoked from the command prompt.
        40626 by: Diego Fulgueira
        40659 by: Richard Lynch

Re: compare arrays problem
        40629 by: Onaje Johnston

ftp_login problem
        40631 by: Bill.Hoffman.walgreens.com

String problem
        40632 by: Mike
        40642 by: CC Zona
        40660 by: Richard Lynch

Libraries
        40635 by: Kath
        40638 by: Martin A. Marques
        40661 by: Kath

Determining what kind od software a remote server is running
        40636 by: Jeremy Bowen
        40637 by: Kath

mysql_last_id()
        40639 by: szii.sziisoft.com
        40640 by: szii.sziisoft.com

SNMP question
        40641 by: Michael Geier

File Locking in PHP.
        40643 by: Matthew Toledo

mail()
        40644 by: Peter Houchin

High and Low ASCII characters
        40645 by: richard merit

Getting values for posted form in HASH array rather than just variables.
        40646 by: Matthew Toledo

php & ms sql
        40647 by: Kathleen Ballard

Re: Mail function
        40648 by: Richard Lynch

Re: Directing Email to a script
        40650 by: Richard Lynch

Re: Session support in PHP (buffering output to browser)
        40662 by: ..s.c.o.t.t..
        40663 by: David VanHorn

Re: Libraries (OT)
        40664 by: ..s.c.o.t.t..

nested echo and includes, mixed html / PHP
        40665 by: Jaxon

File upload problem on IIS/NT4
        40666 by: Josh G

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]


----------------------------------------------------------------------


When I change the error handler, i set the error_reporting to:

error_reporting ( E_ALL ^ E_NOTICE);

but when i call a is_file function that return false a E_NOTICE error is
generated and my error handle trap it.

I know that error_reporting works, becouse if i set it to 0, the parse
errors aren't printed, but E_NOTICE stat failed appears when a is_file,
is_dir function return false.

Can anybody help me on this







I think maybe ^ has different meaning in a php.ini file, from in a PHP
script...

Try  (E_ALL & ~E_NOTICE)

http://www.php.net/manual/en/language.operators.bitwise.php

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: "Securez" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Monday, February 19, 2001 6:02 AM
Subject: [PHP] Problems with error handling.


> When I change the error handler, i set the error_reporting to:
>
> error_reporting ( E_ALL ^ E_NOTICE);
>
> but when i call a is_file function that return false a E_NOTICE error is
> generated and my error handle trap it.
>
> I know that error_reporting works, becouse if i set it to 0, the parse
> errors aren't printed, but E_NOTICE stat failed appears when a is_file,
> is_dir function return false.
>
> Can anybody help me on this
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Good morning...

This should be a good monday morning question.

I have a cgi-bin written in perl (it's actually, a interface to a
perl-module which is a interface to a telnet-like protocol).

Anyways what I need to do is I have already existing code written in PHP,
but at some point I need to call this cgi-bin and get a return code from it
and process (good/bad result) and return to completed php script that says
it called this cgi-bin.  It's not very clear how to set the HTTP_POST_VARS
for sending to a post command (which doesn't seem to exist);

Any ideas I don't see a function called:

$HTTP_POST_VARS =set variables;
$result = http_post("http://localhost/cgi-bin/script.pl");

Thanks,

evan

PS.  I'd appricate a working example, even if it's a dummy version.





        Hi

        I read a article about posting data .. and there was a script but I dont
know resource of this script. But this is working. let me give you a example

<?php


// Posting function

function PostToHost($host, $path, $data_to_send) {

 $fp = fsockopen($host,80);
 fputs($fp, "POST $path HTTP/1.1\n");
 fputs($fp, "Host: $host\n");
 fputs($fp, "Content-type: application/x-www-form-urlencoded\n");
 fputs($fp, "Content-length: ".strlen($data_to_send)."\n");
 fputs($fp, "Connection: close\n\n");
 fputs($fp, $data_to_send);

while(!feof($fp)) {
echo fgets($fp, 128);
}

fclose($fp);

}

$host = "cgiserver.x.com";                      // target server
$path = "/cgi-bin/target.cgi";          // cgi's name
$string = "value1=value1&value2=value2" ; // There can be more value

PostToHost("$host","$patha","$string");         // call the function



?>

-----Original Message-----
From: Montgomery-Recht, Evan [mailto:[EMAIL PROTECTED]]
Sent: Monday, February 19, 2001 2:06 PM
To: [EMAIL PROTECTED]
Subject: [PHP] HTTP POST Question


Good morning...

This should be a good monday morning question.

I have a cgi-bin written in perl (it's actually, a interface to a
perl-module which is a interface to a telnet-like protocol).

Anyways what I need to do is I have already existing code written in PHP,
but at some point I need to call this cgi-bin and get a return code from it
and process (good/bad result) and return to completed php script that says
it called this cgi-bin.  It's not very clear how to set the HTTP_POST_VARS
for sending to a post command (which doesn't seem to exist);

Any ideas I don't see a function called:

$HTTP_POST_VARS =set variables;
$result = http_post("http://localhost/cgi-bin/script.pl");

Thanks,

evan

PS.  I'd appricate a working example, even if it's a dummy version.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]





I see the basic's... but...  It's not completely clear from what I'm seeing.

1. It appears if I use the header function I have to redirect the page to
another page, it doesn't appear possible to retrieve a page into the current
page?  Unless someone can show me some code that would do that.

2. it's not clear how you would actually set the HTTP_POST_VARS's and when
you use the header("Request-URI:"); if that uses the HTTP_POST_VARS?

as of right now it looks like the code would go as follows:

<?php
        $HTTP_POST_VARS (not sure how to set these
                Something like this $HTTP_POST_VARS['uid']="userid"; )
        header("Request-URI: http://localhost/cgi-bin/script.pl");
?>

Is that all that has to be done?

thanks,

evan


> -----Original Message-----
> From: Milan Mlynarcik [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, February 19, 2001 7:33 AM
> To:   Montgomery-Recht, Evan
> Subject:      Re: [PHP] HTTP POST Question
> 
> You have to use header() function and how POST work you can find in HTTP
> RFC
> at http://www.w3.org/Protocols/rfc2616/rfc2616.html
> -------------------------------------------------------------
> Milan Mlynarcik
> Web Programmer
> Charmed Technology Slovakia
> Nam. sv. Egidia 16/37
> 058 01 Poprad, Slovakia
> E-mail: [EMAIL PROTECTED]
> Office: 00421 92 7881 874
> Mobile: 00421 905 964 535
> Web page: http://www.charmed.com/
> -------------------------------------------------------------
> ----- Original Message -----
> From: "Montgomery-Recht, Evan" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, February 19, 2001 1:06 PM
> Subject: [PHP] HTTP POST Question
> 
> 
> > Good morning...
> >
> > This should be a good monday morning question.
> >
> > I have a cgi-bin written in perl (it's actually, a interface to a
> > perl-module which is a interface to a telnet-like protocol).
> >
> > Anyways what I need to do is I have already existing code written in
> PHP,
> > but at some point I need to call this cgi-bin and get a return code from
> it
> > and process (good/bad result) and return to completed php script that
> says
> > it called this cgi-bin.  It's not very clear how to set the
> HTTP_POST_VARS
> > for sending to a post command (which doesn't seem to exist);
> >
> > Any ideas I don't see a function called:
> >
> > $HTTP_POST_VARS =set variables;
> > $result = http_post("http://localhost/cgi-bin/script.pl");
> >
> > Thanks,
> >
> > evan
> >
> > PS.  I'd appricate a working example, even if it's a dummy version.
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]




OK, any idea's on a good tutorial on how to create the socket to do a
HTTP_POST?

thanks,

evan

PS. My girlfriend always complains when I send back one line e-mail's.  Now
I understand why.

> -----Original Message-----
> From: Milan Mlynarcik [SMTP:[EMAIL PROTECTED]]
> Sent: Monday, February 19, 2001 9:06 AM
> To:   Montgomery-Recht, Evan
> Subject:      Re: [PHP] HTTP POST Question
> 
> You can do it with socket functions.
> -------------------------------------------------------------
> Milan Mlynarcik
> Web Programmer
> Charmed Technology Slovakia
> Nam. sv. Egidia 16/37
> 058 01 Poprad, Slovakia
> E-mail: [EMAIL PROTECTED]
> Office: 00421 92 7881 874
> Mobile: 00421 905 964 535
> Web page: http://www.charmed.com/
> -------------------------------------------------------------
> ----- Original Message -----
> From: "Montgomery-Recht, Evan" <[EMAIL PROTECTED]>
> To: "'Milan Mlynarcik'" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Monday, February 19, 2001 2:06 PM
> Subject: RE: [PHP] HTTP POST Question
> 
> 
> > I see the basic's... but...  It's not completely clear from what I'm
> seeing.
> >
> > 1. It appears if I use the header function I have to redirect the page
> to
> > another page, it doesn't appear possible to retrieve a page into the
> current
> > page?  Unless someone can show me some code that would do that.
> >
> > 2. it's not clear how you would actually set the HTTP_POST_VARS's and
> when
> > you use the header("Request-URI:"); if that uses the HTTP_POST_VARS?
> >
> > as of right now it looks like the code would go as follows:
> >
> > <?php
> > $HTTP_POST_VARS (not sure how to set these
> > Something like this $HTTP_POST_VARS['uid']="userid"; )
> > header("Request-URI: http://localhost/cgi-bin/script.pl");
> > ?>
> >
> > Is that all that has to be done?
> >
> > thanks,
> >
> > evan
> >
> >
> > > -----Original Message-----
> > > From: Milan Mlynarcik [SMTP:[EMAIL PROTECTED]]
> > > Sent: Monday, February 19, 2001 7:33 AM
> > > To: Montgomery-Recht, Evan
> > > Subject: Re: [PHP] HTTP POST Question
> > >
> > > You have to use header() function and how POST work you can find in
> HTTP
> > > RFC
> > > at http://www.w3.org/Protocols/rfc2616/rfc2616.html
> > > -------------------------------------------------------------
> > > Milan Mlynarcik
> > > Web Programmer
> > > Charmed Technology Slovakia
> > > Nam. sv. Egidia 16/37
> > > 058 01 Poprad, Slovakia
> > > E-mail: [EMAIL PROTECTED]
> > > Office: 00421 92 7881 874
> > > Mobile: 00421 905 964 535
> > > Web page: http://www.charmed.com/
> > > -------------------------------------------------------------
> > > ----- Original Message -----
> > > From: "Montgomery-Recht, Evan" <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Monday, February 19, 2001 1:06 PM
> > > Subject: [PHP] HTTP POST Question
> > >
> > >
> > > > Good morning...
> > > >
> > > > This should be a good monday morning question.
> > > >
> > > > I have a cgi-bin written in perl (it's actually, a interface to a
> > > > perl-module which is a interface to a telnet-like protocol).
> > > >
> > > > Anyways what I need to do is I have already existing code written in
> > > PHP,
> > > > but at some point I need to call this cgi-bin and get a return code
> from
> > > it
> > > > and process (good/bad result) and return to completed php script
> that
> > > says
> > > > it called this cgi-bin.  It's not very clear how to set the
> > > HTTP_POST_VARS
> > > > for sending to a post command (which doesn't seem to exist);
> > > >
> > > > Any ideas I don't see a function called:
> > > >
> > > > $HTTP_POST_VARS =set variables;
> > > > $result = http_post("http://localhost/cgi-bin/script.pl");
> > > >
> > > > Thanks,
> > > >
> > > > evan
> > > >
> > > > PS.  I'd appricate a working example, even if it's a dummy version.
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]





  I've been struggling with the same idea.

  I haven't been able to process the returned value, but I've the
  following methods to DISPLAY the cgi results. Although, the PHP has no
  way  of knowing wether the CGI evaluated to a Yes or No result.

  If you solve this, then please let me know.

  $server =
"http://www.mydomain_name.com/my_cgi_file.cgi?var1=valueOne&var2=valueTWO";

     //var1 and var2 are the parameters that you are passing to the CGI
       for processing.
     //your cgi would process these variables, then 1) print out the
       result 2)  return the desired variable...like,  return ($var1,
       $var2).

  //open remote site

  $fp = fopen($server, "r");


  fpassthrough($fp);

  //this will display whatever the remote CGI sends to STDOUT
  //however, it will not process anything that is returned.

  That is, the PHP doesn't know wether the CGI evaluated to GOOD or BAD.


 That's as far as I've been able to get, I hope it helps.

 If you do find a better solution, then please send me a copy.
 I would appreciate it.




__________John Monfort_________________
_+-----------------------------------+_
     P E P I E  D E S I G N S
       www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-

On Mon, 19 Feb 2001, Montgomery-Recht, Evan wrote:

> Good morning...
>
> This should be a good monday morning question.
>
> I have a cgi-bin written in perl (it's actually, a interface to a
> perl-module which is a interface to a telnet-like protocol).
>
> Anyways what I need to do is I have already existing code written in PHP,
> but at some point I need to call this cgi-bin and get a return code from it
> and process (good/bad result) and return to completed php script that says
> it called this cgi-bin.  It's not very clear how to set the HTTP_POST_VARS
> for sending to a post command (which doesn't seem to exist);
>
> Any ideas I don't see a function called:
>
> $HTTP_POST_VARS =set variables;
> $result = http_post("http://localhost/cgi-bin/script.pl");
>
> Thanks,
>
> evan
>
> PS.  I'd appricate a working example, even if it's a dummy version.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>







> 1. It appears if I use the header function I have to redirect the page to
> another page, it doesn't appear possible to retrieve a page into the current
> page?  Unless someone can show me some code that would do that.
>

  If all you want is to display the remote page, within the local page,
  then all you need is fpassthru()

  ex.

  $server = "http://www.site.com";

  $fp = fopen($server,"r")    // "r" is for reading
  fpassthru($fp);

 This will display the results of the remote file (html or whatever) into
 the local file (in this case, your PHP file).


>
>
> > -----Original Message-----
> > From:       Milan Mlynarcik [SMTP:[EMAIL PROTECTED]]
> > Sent:       Monday, February 19, 2001 7:33 AM
> > To: Montgomery-Recht, Evan
> > Subject:    Re: [PHP] HTTP POST Question
> >
> > You have to use header() function and how POST work you can find in HTTP
> > RFC
> > at http://www.w3.org/Protocols/rfc2616/rfc2616.html
> > -------------------------------------------------------------
> > Milan Mlynarcik
> > Web Programmer
> > Charmed Technology Slovakia
> > Nam. sv. Egidia 16/37
> > 058 01 Poprad, Slovakia
> > E-mail: [EMAIL PROTECTED]
> > Office: 00421 92 7881 874
> > Mobile: 00421 905 964 535
> > Web page: http://www.charmed.com/
> > -------------------------------------------------------------
> > ----- Original Message -----
> > From: "Montgomery-Recht, Evan" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Monday, February 19, 2001 1:06 PM
> > Subject: [PHP] HTTP POST Question
> >
> >
> > > Good morning...
> > >
> > > This should be a good monday morning question.
> > >
> > > I have a cgi-bin written in perl (it's actually, a interface to a
> > > perl-module which is a interface to a telnet-like protocol).
> > >
> > > Anyways what I need to do is I have already existing code written in
> > PHP,
> > > but at some point I need to call this cgi-bin and get a return code from
> > it
> > > and process (good/bad result) and return to completed php script that
> > says
> > > it called this cgi-bin.  It's not very clear how to set the
> > HTTP_POST_VARS
> > > for sending to a post command (which doesn't seem to exist);
> > >
> > > Any ideas I don't see a function called:
> > >
> > > $HTTP_POST_VARS =set variables;
> > > $result = http_post("http://localhost/cgi-bin/script.pl");
> > >
> > > Thanks,
> > >
> > > evan
> > >
> > > PS.  I'd appricate a working example, even if it's a dummy version.
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>





Hi
I tried using the code below to send the output to an Excel sheet in my
browser by changing the header to "Content-type: application/vnd.ms-excel".
However I only see normal text in a browser. Excel is not launched. What is
wrong??



--------------------------------------------------------------
<?php
   Header ("Content-type: application/ms-excel");
   Header ("Content-type: application/vnd.ms-excel");

   echo "<html><body>";
   echo "<table>";
   echo "<th>F1</th><th>F2</th>";
   echo "<tr><td>Hi</td><td>Hi</td></tr>";
   echo "</table>";
   echo "</body></html>";
?>
----------------------------------------------------------

Thanks
Tim






> I tried using the code below to send the output to an Excel sheet in my
> browser by changing the header to "Content-type:
application/vnd.ms-excel".
> However I only see normal text in a browser. Excel is not launched. What
is
> wrong??
>
> --------------------------------------------------------------
> <?php
>    Header ("Content-type: application/ms-excel");
>    Header ("Content-type: application/vnd.ms-excel");

Two different Content-type: headers?  That seems pretty broken to me...

But I could be just too narrow-minded.

Try uploading an .xls file, and surfing to it to be sure you get the results
you want.

Then use:
telnet yourhost.com 80
GET /whatever.xls HTTP/1.0


(hit return twice)
from a Un*x box to see what headers are being sent that make it work.

(Or find a way to make Windows give you an actual command-line telnet
session without launching a GUI...   Grrrr.)

Send all those headers.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm







> Is there anyway I can see if script mail() does not work and see what the
> problem is? Jack

Hey Jack,

take this line and put it before the part of the code that sends the mail:

<? error_reporting(63); ?>

this turns on ALL error reporting, so make sure yuo use it only for debugging.
also, if you dont see any warnings despite the above line, you can be sure 
its a configuration problem.

cheers,
Hrishi




Thanks for the different characters to try..

I try tomorrow to see if I can try it on the program which needs it...
Indeed the trick of reading the file and echoing all the different chars
used should do the trick..

I will first try the underlying two chars to see if they do the trick...

Thanks..
Bye Bye
David


> I think EOF depends on the application/OS...
>
> Try chr(26) [Control-Z] and chr(4) [Control-D]
>
> Or have I just been using too many Un*x programs that can't agree on how
to
> indicate the end of my typing? :-^
>
> If those don't work, try everything below 32.
>
> Well, okay, I *know* it's not 9, 10, or 13 :-)
>
> If all else fails, take a file that works, and get PHP to read it char by
> char...
>
> Hey, maybe you just need a newline at the end!
>  "\n" (aka chr(13))
> Or, in Windoze, "\r\n" (aka chr(10) . chr(13))
>
> --
> Visit the Zend Store at http://www.zend.com/store/
> Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
> Volunteer a little time: http://chatmusic.com/volunteer.htm
> ----- Original Message -----
> From: "David Bouw" <[EMAIL PROTECTED]>
> Newsgroups: php.general
> Sent: Sunday, February 18, 2001 5:17 AM
> Subject: [PHP] EOF (End of File) character..
>
>
> > Hi...
> >
> > How do I get an EOF character when echo'ing an web page which will be
> > written to an file.??
> >
> > What I am trying to do is the following. I have an textstring
(variable):
> >
> > Then I do the following:
> >
> >       header("Content-disposition: filename=CLIEOP03");
> >       header("Content-type: application/octetstream");
> >       header("Pragma: no-cache");
> >       header("Expires: 0");
> >      echo ("$datestring");
> >
> > ($datastring contains the text)
> >
> > My browser pops up with a box to ask if I want to save this file..
> >
> > The problem is, that when I save this file it has no EOF character at
the
> > end.. Normally I then use my text editor to open the file and then I
just
> > save it again to get the needed character.. I generate this file for an
> > application..
> >
> > The problem is that the application won't accept the file if there is no
> EOF
> > character..
> >
> > What is the correct characters to use to get an EOF character??
> >
> > Thanks for the help..
> >
> > Bye Bye
> > David
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>





I've got the Zend IDE and debugger up and running. But, the debugger isn't
picking up my 'Local Value' for the include path. It only seems to have the
'Master Value'.

Has anyone else experienced this? And more importantly, how do I get around
this problem.





i'm sorry,i just had to share this with people who'd understand.
we've just secured clients who are m$ affiliated and they insist
everthing be done with asp.
excuse me while i go off for a little cry.................





Think of it this way:
Now you'll know both ASP and PHP for your next clients and can charge them
more because of your increased talents  :)

- Kath

----- Original Message -----
From: "Adrian Murphy" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 19, 2001 7:21 AM
Subject: [PHP] woe is me


> i'm sorry,i just had to share this with people who'd understand.
> we've just secured clients who are m$ affiliated and they insist
> everthing be done with asp.
> excuse me while i go off for a little cry.................
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>







   I feel your pain.
    :-(


__________John Monfort_________________
_+-----------------------------------+_
     P E P I E  D E S I G N S
       www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-

On Mon, 19 Feb 2001, Adrian Murphy wrote:

> i'm sorry,i just had to share this with people who'd understand.
> we've just secured clients who are m$ affiliated and they insist
> everthing be done with asp.
> excuse me while i go off for a little cry.................
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>





I can bind to ldap server successful but ldap add operation couldn't 
complete.


>From: "Richard Lynch" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Subject: Re: [PHP] add user to ldap using php
>Date: Mon, 19 Feb 2001 02:13:16 -0600
>
> > $a=ldap_add($ds, "uid=beau, dc=graduate, dc=com", $info);
> > but it's an error
> > Waring LDAP: add operation could not be complete in. <my php file>
>
>I don't know much about LDAP:
>
>Have you checked that $ds is a valid LDAP connection?
>Can you get your own record out of LDAP using it?
>Presumably LDAP has some notion of who can add records (or whatever they
>called them) and who can't.
>Are you sure the user connected in ldap_open() is empowered to add records
>at that level in the LDAP space?
>
>--
>Visit the Zend Store at http://www.zend.com/store/
>Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
>Volunteer a little time: http://chatmusic.com/volunteer.htm
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.





Though I have read the manual about these two things, include() and
require(), but I still not very clear about the difference between these??










  An unsuccessful include will give you an error.

  An unsuccessful require will kill the program.


__________John Monfort_________________
_+-----------------------------------+_
     P E P I E  D E S I G N S
       www.pepiedesigns.com
"The world is waiting, are you ready?"
-+___________________________________+-

On Mon, 19 Feb 2001, Zenith wrote:

> Though I have read the manual about these two things, include() and
> require(), but I still not very clear about the difference between these??
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>





In main.php,
then I use include("xxx.php"), in which, there is a function called temp();
If I use session_start() at the beginging of main.php, after include
statment,
and I cal the temp(), will the temp() function can get the session variable
I have?
Or I need to import it by using "global" in the function def.?






You'll still need to declare any variables global.

Session variables are not inherently global or otherwise special to a
function.

And that's a feature, not a bug.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: "Zenith" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Monday, February 19, 2001 7:35 AM
Subject: [PHP] How can I use session variable in a function?


> In main.php,
> then I use include("xxx.php"), in which, there is a function called
temp();
> If I use session_start() at the beginging of main.php, after include
> statment,
> and I cal the temp(), will the temp() function can get the session
variable
> I have?
> Or I need to import it by using "global" in the function def.?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





you can do it with javascript. assign all of the cell contents to a
javascript 2-d array of strings (mytext[x][y]). create the table with a
<div> in each cell. create a 2-d array of object pointers pointing to each
div. you can then change the contents of each div at will (for example when
a button is pressed). i.e. divobject[x][y].innerHTML = mytext[x][new_y]. I
use this technique a lot for game writing in js.

the complication in your case is that some of the js (building the arrays
and the table) needs to be built by the php. I've never tried this but it
should work if you just echo it as you would html.

        Tim Ward
        Senior Systems Engineer

Please refer to the following disclaimer in respect of this message:
http://www.stivesdirect.com/e-mail-disclaimer.html


> -----Original Message-----
> From: Tom Knight [mailto:[EMAIL PROTECTED]]
> Sent: 19 February 2001 08:53
> To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
> [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED];
> [EMAIL PROTECTED]; [EMAIL PROTECTED]
> Subject: RE: [php_mysql] Creative solution with XML,PHP,MYSQL
> 
> 
> I hate to say it, but the only way I can see of doing this 
> offhand is with
> ecmascript & dhtml.... or does that Dynamic Data Binding 
> (only works with
> ie5, or 5.5?) do this sort of thing?
> 
> Either way, you're looking at unbounded fun catering for 
> different browsers.
> 
> > -----Original Message-----
> > From: Siim Einfeldt aka Itpunk [mailto:[EMAIL PROTECTED]]
> > Sent: 17 February 2001 14:25
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
> > [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED];
> > [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: [php_mysql] Creative solution with XML,PHP,MYSQL
> >
> >
> > Hi everybody,
> >
> > I want to implement ordering something on a website without 
> refreshing the
> > page. Lets say i have four columns in the html table - 
> name,age,skill and
> > phone. All these are links - under these are the information, eg:
> > Name Age Skill Phone
> > Siim 23  php   051...
> > Tony 18  html  132...
> >
> > Now, when i click on the name, it should order the listings 
> by name, if I
> > click on the age, I get the listing ordered by age and 
> etc,etc. Generally
> > it is easy to do it, but how to do it without refreshing 
> the page every
> > time I want to order by something else?
> >
> > It should be possible with XML; I get the data from mysql 
> database with
> > php, I write it into an array and ... now how could I make 
> it function the
> > way I just described? Could someone point me some already 
> written code or
> > explain me in detail how to do it?
> >
> >
> > Thank you,
> > Siim Einfeldt
> >
> > PS: Sorry about sending this message to so many lists, but 
> I haven`t seen
> > this kind of code anywhere, but at the same time I know it 
> is possible.
> >
> >
> > ------------------------ Yahoo! Groups Sponsor 
> ---------------------~-~>
> > eGroups is now Yahoo! Groups
> > Click here for more details
> > http://click.egroups.com/1/11231/1/_/19011/_/982419916/
> > 
> --------------------------------------------------------------
> -------_->
> >
> > the PHP_mySQL group is dedicated to learn more about the
> > PHP_mySQL web database possibilities through group learning.
> >
> > http://www.1sdesign.com/web/books.shtml You can get books here.
> >
> >
> 
> 





Check out webfx.eae.net for a sample on how to do this.

It does require IE4+ or Mozilla.

Chris

On Mon, 19 Feb 2001, Tim Ward wrote:
> Date: Mon, 19 Feb 2001 13:47:00 -0000
> To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>,
>         [EMAIL PROTECTED], [EMAIL PROTECTED],
>         [EMAIL PROTECTED], [EMAIL PROTECTED],
> [EMAIL PROTECTED],
>         [EMAIL PROTECTED], [EMAIL PROTECTED]
> From: Tim Ward <[EMAIL PROTECTED]>
> Subject: [PHP] RE: [php_mysql] Creative solution with XML,PHP,MYSQL
> 
> you can do it with javascript. assign all of the cell contents to a
> javascript 2-d array of strings (mytext[x][y]). create the table with
> a
> <div> in each cell. create a 2-d array of object pointers pointing to
> each
> div. you can then change the contents of each div at will (for
> example when
> a button is pressed). i.e. divobject[x][y].innerHTML =
> mytext[x][new_y]. I
> use this technique a lot for game writing in js.
> 
> the complication in your case is that some of the js (building the
> arrays
> and the table) needs to be built by the php. I've never tried this
> but it
> should work if you just echo it as you would html.
> 
>       Tim Ward
>       Senior Systems Engineer
> 
> Please refer to the following disclaimer in respect of this message:
> http://www.stivesdirect.com/e-mail-disclaimer.html
> 
> 
> > -----Original Message-----
> > From: Tom Knight [mailto:[EMAIL PROTECTED]]
> > Sent: 19 February 2001 08:53
> > To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
> > [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED];
> > [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > Subject: RE: [php_mysql] Creative solution with XML,PHP,MYSQL
> > 
> > 
> > I hate to say it, but the only way I can see of doing this 
> > offhand is with
> > ecmascript & dhtml.... or does that Dynamic Data Binding 
> > (only works with
> > ie5, or 5.5?) do this sort of thing?
> > 
> > Either way, you're looking at unbounded fun catering for 
> > different browsers.
> > 
> > > -----Original Message-----
> > > From: Siim Einfeldt aka Itpunk [mailto:[EMAIL PROTECTED]]
> > > Sent: 17 February 2001 14:25
> > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED];
> > > [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED];
> > > [EMAIL PROTECTED]; [EMAIL PROTECTED]
> > > Subject: [php_mysql] Creative solution with XML,PHP,MYSQL
> > >
> > >
> > > Hi everybody,
> > >
> > > I want to implement ordering something on a website without 
> > refreshing the
> > > page. Lets say i have four columns in the html table - 
> > name,age,skill and
> > > phone. All these are links - under these are the information, eg:
> > > Name Age Skill Phone
> > > Siim 23  php   051...
> > > Tony 18  html  132...
> > >
> > > Now, when i click on the name, it should order the listings 
> > by name, if I
> > > click on the age, I get the listing ordered by age and 
> > etc,etc. Generally
> > > it is easy to do it, but how to do it without refreshing 
> > the page every
> > > time I want to order by something else?
> > >
> > > It should be possible with XML; I get the data from mysql 
> > database with
> > > php, I write it into an array and ... now how could I make 
> > it function the
> > > way I just described? Could someone point me some already 
> > written code or
> > > explain me in detail how to do it?
> > >
> > >
> > > Thank you,
> > > Siim Einfeldt
> > >
> > > PS: Sorry about sending this message to so many lists, but 
> > I haven`t seen
> > > this kind of code anywhere, but at the same time I know it 
> > is possible.
> > >
> > >
> > > ------------------------ Yahoo! Groups Sponsor 
> > ---------------------~-~>
> > > eGroups is now Yahoo! Groups
> > > Click here for more details
> > > http://click.egroups.com/1/11231/1/_/19011/_/982419916/
> > > 
> > --------------------------------------------------------------
> > -------_->
> > >
> > > the PHP_mySQL group is dedicated to learn more about the
> > > PHP_mySQL web database possibilities through group learning.
> > >
> > > http://www.1sdesign.com/web/books.shtml You can get books here.
> > >
> > >
> > 
> > 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 





Your question encompasses two parts...  the subject says these variables 
are storing incomplete values and later in the email you state mySQL isn't 
maintaining the formatting of your data.

The first part is possible because your mySQL database field may not be 
declared big enough to actually hold the data.  AFAIK there is no limit on 
actual variable size, as long as the server has enough memory, it should be 
fine.

Your second question about formatting... well the answer is the formatting 
is most likely in the database, but when you retrieve it and siaplay it 
ina  browser, well the browser doesn't understand anything other than 
HTML.  So carriage returns, line feeds, tabs, etc... never get 
displayed.  If you want the formatting to be kept in the browser, convert 
the data.  A good starting place is nl2br()

At 02:22 AM 2/19/01 -0600, Richard Lynch wrote:
> > $variable = This is the data.This is the data.This is
> > the data.This is the dataThis is the dataThis is the
> > dataThis is the dataThis is the dataThis is the
> > dataThis is the dataThis is the data
> > This is the dataThis is the dataThis is the data
> >
> >
> > This is the; da;taThi's is the dataThis is the
> > dataThis is the data
> >
> > This is the dataThis is the dataThis is the dataThis
> > is the data
> >
> >
> > I mean to say taht it is kidof formatted with REturn
> > character, space characters, ', ; and a lot many
> > characters...
> >
> >
> >
> >
> > Now my question is that. If I store the variable in
> > MYSQL dataabse under a particular filed TYPe varchar
> > or TEXT.
> >
> > It doesn't bring up the same kind of format like it
> > was when it was stored..
> >
> > Is there any way I can get the same output like I
> > stored it.?
>
>Use http://php.net/addslashes maybe...
>If it's varchar(XX) and your string is longer than XX, you will lose the end
>of the string.
>If you're not sure how long it might be, just use TEXT in MySQL.
>
>--
>Visit the Zend Store at http://www.zend.com/store/
>Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
>Volunteer a little time: http://chatmusic.com/volunteer.htm
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]





Hello all...

Is there anyway at all for a PHP script to somehow interact with a fax?
dynamically generated pdfs... dynamically generated images... dynamically
generated... faxes? I mean i don't even know how it would begin to work but
is there a way to send a fax maybe as it does e-mail?

Thanks in advance, Josh





There are actually many ways to send an email to a fax
gateway. So, you could generate an email, send it to a
FAX gateway, ....... and presto!

-Brian
*********

> -----Original Message-----
> From: Joshua Long [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 19, 2001 9:26 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Fax manipulation?
> 
> 
> Hello all...
> 
> Is there anyway at all for a PHP script to somehow interact with a fax?
> dynamically generated pdfs... dynamically generated images... dynamically
> generated... faxes? I mean i don't even know how it would begin 
> to work but
> is there a way to send a fax maybe as it does e-mail?
> 
> Thanks in advance, Josh
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 





Check out PHPFax.sourceforge.net

This is a project I started a while back and never quite finished.
The project does work, and is in use by the 20 windoze users I support.
 If you interested in the code, I suppose I can make the time to upload
it :)

Let me know,

Chris

On Mon, 19 Feb 2001, Brian V Bonini wrote:
> Date: Mon, 19 Feb 2001 09:38:20 -0500
> To: "Joshua Long" <[EMAIL PROTECTED]>, <[EMAIL PROTECTED]>
> From: "Brian V Bonini" <[EMAIL PROTECTED]>
> Reply-To: <[EMAIL PROTECTED]>
> Subject: RE: [PHP] Fax manipulation?
> 
> There are actually many ways to send an email to a fax
> gateway. So, you could generate an email, send it to a
> FAX gateway, ....... and presto!
> 
> -Brian
> *********
> 
> > -----Original Message-----
> > From: Joshua Long [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, February 19, 2001 9:26 AM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Fax manipulation?
> > 
> > 
> > Hello all...
> > 
> > Is there anyway at all for a PHP script to somehow interact with a
> fax?
> > dynamically generated pdfs... dynamically generated images...
> dynamically
> > generated... faxes? I mean i don't even know how it would begin 
> > to work but
> > is there a way to send a fax maybe as it does e-mail?
> > 
> > Thanks in advance, Josh
> > 
> > 
> > -- 
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> > 
> > 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> 





Humberto:
Sorry it took me a while to repsond...

I'll get some code uploaded to PHPFax.sourceforge.net as soon as
possible.

Be warned, however, that the code is in what I would call 'proof of
concept' state.  Meaning it works, but it is far from something that is
easy to install and setup.  It relies on several other software
packages (all opensource, of course), and takes some effort to get
working.

I'll write up some instructions and upload.  Hopefully this week?

Chris


On Mon, 19 Feb 2001, Indrek Järv wrote:
> Date: Mon, 19 Feb 2001 18:44:09 +0200
> To: [EMAIL PROTECTED]
> From: Indrek Järv <[EMAIL PROTECTED]>
> Subject: Re: RE: [PHP] Fax manipulation?
> 
> >Check out PHPFax.sourceforge.net
> >
> >This is a project I started a while back and never quite finished.
> >The project does work, and is in use by the 20 windoze users I
> support.
> > If you interested in the code, I suppose I can make the time to
> upload
> >it :)
> >
> >Let me know,
> >
> >Chris
> 
> Hi Chris.
> 
> Upload will be nice :)
> I like very much see this PHP code :)
> 
> Indrek Järv
> 




Hello,

        I've seen on www.dentrek.com that their 'wizard' checks connection
speed by indicating you have a throughput of xxxxx bps.

        It seems to be ASP made since there is a wizard.asp.

        I'm interested in doing this in PHP. Anyone knows something about
this?

        Thanks in advance,

Martin Marconcini.






Richard Bradley,

Posting to PHP general mailing list asking for help has never been a problem
in the past.  Mr Yahav should have mentioned that he is the owner operator
of weberdev.com, and that he has financial interest in contract positions
posted on his site.

If there was a mistake in net-etiquette, it was not your mistake Richard,
but Mr. Yahav's.  He should have clearly stated that his email, to you and
to the list, was an advertisement for his site.

Best of luck trying to find help with installation.  I have forwarded your
request to a friend of mine that might be able to help.  If you don't have
luck getting help, please repost and I'm sure someone will be happy to give
assistance.

Robert Zwink
http://zwink.levitate.org


- - - - - - - - - - - - - - - - - - - - - - - - - - - -
Subject:  Re: [PHP] Pay for help
From:     rbradley <[EMAIL PROTECTED]>
Date:     2001-02-13 18:33:44

Thankyou Boaz, I'm sorry, I just needed help. I didn't care if I had to
pay or got free assistance.  I also realize that paying for Open Source
software help may not be etiquette either. Please forgive me I'll post
this in the places

Boaz Yahav wrote:
>
> Hi
>
> A good place to put this would be either in the projects area
> of weberdev
(http://www.weberdev.com/index.php3?GoTo=jobmatching/about.php3)
>
> or the jobs area (http://www.weberjob.com).
>
> Sincerely
>
>       berber
>
> Visit http://www.weberdev.com Today!!!
> To see where PHP might take you tomorrow.
>
>
> -----Original Message-----
> From: rbradley [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, February 13, 2001 3:43 AM
> To: PHP
> Subject: [PHP] Pay for help
>
> My company is willing to pay for some assistance in helping us install:
>
> PHP apache mod with oracle 8i functions on a Solaris 8 box.
>
> Are there any takers?
>
> --
> Richard Bradley
> CTO YourLink, inc.
> (321) 452-6699
> IM lagoonr
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Richard Bradley
CTO YourLink, inc.
(321) 452-6699
IM lagoonr

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]




-----Original Message-----
From: Boaz Yahav [mailto:[EMAIL PROTECTED]]
Sent: Saturday, February 17, 2001 2:26 PM
To: '[EMAIL PROTECTED]'; PHP Lists
Subject: RE: [PHP] PHP Book Recommendations


And I remind you all to buy them at WeberDev.com and help
us pay the hosting :)

Sincerely

      berber

Visit http://www.weberdev.com Today!!!
To see where PHP might take you tomorrow.


-----Original Message-----
From: Brian V Bonini [mailto:[EMAIL PROTECTED]]
Sent: Friday, February 16, 2001 11:14 PM
To: PHP Lists
Subject: [PHP] PHP Book Recommendations


Can I get some recommendations on some good PHP
books. Something broad but with good novice
concepts........

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]





Hi,

I am trying to get a total value of orders from a file.  The file has various fields 
separated by '|'.  It is the 15th field I am trying to total.  At the moment I am 
trying to search each character but it times out as the file is quite large - is there 
a more efficient way of doing this.

Thanks - Here is the script:

<?php
  function total($filename)
  { $totalfile=16;
   $total=0;
   $vartemp="";
   $counterbeforeend=0;
   $counter=0;
 if(!$file=fopen($filename,"r"))
 {
  echo"Could not open the file named '$filename'";
 }
 else
 { 
  while((!feof($file))&&($total<1000))
  {
   $char=fgetc($file);
   
   if(strcmp($char,"|")==0)
    $counter++;
   
   if($counter==($totalfile+1))
   {
    $vartemp=$vartemp.$char;
   
    if((strcmp($char,".")==0)||($passed==1))
    {
     $counterbeforeend++;
     $passed=1;
    }
    if($counterbeforeend==3)
    {
     $total=$total+$vartemp;
     $passed=0;
     $counter=0;
     $counterbeforeend=0;
     $vartemp="";
     echo"$total<BR>\n";
    }
   }
   else if($counter==$totalfile)
   {
    $counter++; 
   }
  }
 } 
 return($total);
   }
?>
<HTML>
<BODY>

<?
 $total1=total("G&V_orderslist.txt");
 echo"$total1";
?>

</BODY>
</HTML>




Reading 1 character at a time is killing you.

I don't know how large is quite large, but this should be way faster:

<?php
    function total($filename){
        $total = 0;
        $file = fopen($filename, 'r') or die("Could not open $filename");
        while (!feof($file)){
            $line = fgets($file, 1000000);
            $fields = explode('|', $line);
            # The array is 0-based, so 14 *should* be 15th field...
            $total += $fields[14];
        }
        fclose($file);
    }
?>

You may still need to add a set_time_limit(30) in the loop if the file is
truly massive...

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: "Abe Asghar" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Monday, February 19, 2001 9:21 AM
Subject: [PHP] <? -- File Total -- ?>


Hi,

I am trying to get a total value of orders from a file.  The file has
various fields separated by '|'.  It is the 15th field I am trying to total.
At the moment I am trying to search each character but it times out as the
file is quite large - is there a more efficient way of doing this.

Thanks - Here is the script:

<?php
  function total($filename)
  { $totalfile=16;
   $total=0;
   $vartemp="";
   $counterbeforeend=0;
   $counter=0;
 if(!$file=fopen($filename,"r"))
 {
  echo"Could not open the file named '$filename'";
 }
 else


  while((!feof($file))&&($total<1000))
  {
   $char=fgetc($file);

   if(strcmp($char,"|")==0)
    $counter++;

   if($counter==($totalfile+1))
   {
    $vartemp=$vartemp.$char;

    if((strcmp($char,".")==0)||($passed==1))
    {
     $counterbeforeend++;
     $passed=1;
    }
    if($counterbeforeend==3)
    {
     $total=$total+$vartemp;
     $passed=0;
     $counter=0;
     $counterbeforeend=0;
     $vartemp="";
     echo"$total<BR>\n";
    }
   }
   else if($counter==$totalfile)
   {
    $counter++;
   }
  }
 }
 return($total);
   }
?>
<HTML>
<BODY>

<?
 $total1=total("G&V_orderslist.txt");
 echo"$total1";
?>

</BODY>
</HTML>






Hello all!

Okay, still going at it with PHP vs. JavaScript -- although one can remove
the power if they disable cookies -- in fact, with the way it is set up
here, it is doubtful they will get to the right page if they switch
languages, but i can work that out later with a simple if-then statement
that will create the link -- a test to see if cookies are enabled then print
the correct URL.

1) Joe: I used the index (splash.php) and choice pages (choice.php) as per
your suggestion. It works without a hitch. The cookie is set and it goes
accordingly from the splash.php page once you have mad a selection.

2) Angela: I have added a third page to this mix, a lang_swap.php which is
called from the document that people are looking at. So now it goes from a
language button on a doc, passes a document id to the lang_swap.php page
where a similar process tot he choice.php page takes place, sets the cookie
value to the other language, and kicks it back to the french version of the
english document (and vice-versa). It's all pretty quick, so i'm not worried
about the page requests and lag.


The trouble is... the lang_swap.php will not set the cookie for the language
change. If i swap to french and then i go back and load the splash page, it
send me to the english-front again, but it should send me to the
french-front... i was having this problem before when i was trying to get
this all to work... once the variable was set, i could not get it to change.

Thanks for your help and in advance of some more!
Jer
Canadian Union of Postal Workers


------------------------------
The splash.php is as follows:
------------------------------
<?php
  if ((IsSet($lang)) || ($lang = "1") || ($lang = "2"))
    switch($lang)
  {
    case 1:
      header("Location: http://www.english.com/english-front-page.php");
      exit;
      break;
    case 2:
          header("Location: http://www.franch.com/french-front-page.php");
      exit;
      break;
  }
?>
<HTML>
.....
passes a value to choice.php... depending upon langauge select...
.....
</HTML>

------------------------------


------------------------------
The choice.php is as follows:
------------------------------

<?PHP

if(strlen($lang))
{
  switch($lang)
  {
    case 1:
      setcookie ("lang", "1", "http://www.english.com/", "", 0);
          header("Location: http://www.english.com/english-front-page.php");
      exit;
      break;
    case 2:
      setcookie ("lang", "2", "http://www.french.com/", "", 0);
      header("Location: http://www.franch.com/french-front-page.php");
      exit;
      break;
  }
}
?>

<html>
<head>
<title>Choice</title>
</head>
<body></body>
</html>


------------------------------


------------------------------
The lang_swap.php is as follows:
-----------------------------

<?PHP
if ((IsSet($lang)) || ($lang = "1") || ($lang = "2"))
    switch($lang)
  {
        /* here is the swap */
    case 1:
        setcookie ("lang", "2", "http://www.french.com/", "", 0);
      header("Location:
http://www.french.com/document-fra.php?Doc_ID=$Ident");
      exit;
      break;
    case 2:
      setcookie ("lang", "1", "http://www.english.com/", "", 0);
          header("Location:
http://www.english.com/document-eng.php?Doc_ID=$Ident");
      exit;
      break;
  }
?>

<html>
<head>
<title>Lang Swap</title>
</head>
<body></body>
</html>





You can't do setcookie and Location: in the same page.
Once they picked a language, set the cookie and return the HTML content for
that home page, don't redirect.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Jeremy Gillies <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Monday, February 19, 2001 9:43 AM
Subject: [PHP] Multiple URLs and cookies


> Hello all!
>
> Okay, still going at it with PHP vs. JavaScript -- although one can remove
> the power if they disable cookies -- in fact, with the way it is set up
> here, it is doubtful they will get to the right page if they switch
> languages, but i can work that out later with a simple if-then statement
> that will create the link -- a test to see if cookies are enabled then
print
> the correct URL.
>
> 1) Joe: I used the index (splash.php) and choice pages (choice.php) as per
> your suggestion. It works without a hitch. The cookie is set and it goes
> accordingly from the splash.php page once you have mad a selection.
>
> 2) Angela: I have added a third page to this mix, a lang_swap.php which is
> called from the document that people are looking at. So now it goes from a
> language button on a doc, passes a document id to the lang_swap.php page
> where a similar process tot he choice.php page takes place, sets the
cookie
> value to the other language, and kicks it back to the french version of
the
> english document (and vice-versa). It's all pretty quick, so i'm not
worried
> about the page requests and lag.
>
>
> The trouble is... the lang_swap.php will not set the cookie for the
language
> change. If i swap to french and then i go back and load the splash page,
it
> send me to the english-front again, but it should send me to the
> french-front... i was having this problem before when i was trying to get
> this all to work... once the variable was set, i could not get it to
change.
>
> Thanks for your help and in advance of some more!
> Jer
> Canadian Union of Postal Workers
>
>
> ------------------------------
> The splash.php is as follows:
> ------------------------------
> <?php
>   if ((IsSet($lang)) || ($lang = "1") || ($lang = "2"))
>     switch($lang)
>   {
>     case 1:
>       header("Location: http://www.english.com/english-front-page.php");
>       exit;
>       break;
>     case 2:
>   header("Location: http://www.franch.com/french-front-page.php");
>       exit;
>       break;
>   }
> ?>
> <HTML>
> .....
> passes a value to choice.php... depending upon langauge select...
> .....
> </HTML>
>
> ------------------------------
>
>
> ------------------------------
> The choice.php is as follows:
> ------------------------------
>
> <?PHP
>
> if(strlen($lang))
> {
>   switch($lang)
>   {
>     case 1:
>       setcookie ("lang", "1", "http://www.english.com/", "", 0);
>   header("Location: http://www.english.com/english-front-page.php");
>       exit;
>       break;
>     case 2:
>       setcookie ("lang", "2", "http://www.french.com/", "", 0);
>       header("Location: http://www.franch.com/french-front-page.php");
>       exit;
>       break;
>   }
> }
> ?>
>
> <html>
> <head>
> <title>Choice</title>
> </head>
> <body></body>
> </html>
>
>
> ------------------------------
>
>
> ------------------------------
> The lang_swap.php is as follows:
> -----------------------------
>
> <?PHP
> if ((IsSet($lang)) || ($lang = "1") || ($lang = "2"))
>     switch($lang)
>   {
> /* here is the swap */
>     case 1:
> setcookie ("lang", "2", "http://www.french.com/", "", 0);
>       header("Location:
> http://www.french.com/document-fra.php?Doc_ID=$Ident");
>       exit;
>       break;
>     case 2:
>       setcookie ("lang", "1", "http://www.english.com/", "", 0);
>   header("Location:
> http://www.english.com/document-eng.php?Doc_ID=$Ident");
>       exit;
>       break;
>   }
> ?>
>
> <html>
> <head>
> <title>Lang Swap</title>
> </head>
> <body></body>
> </html>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Newbie with MySQL. I have a user auth form before this
script which asks for username and password. First
Name and Last name are also in each record in the 
database along with username and password. When
the user successfully logs in, I have it say, "Welcome 
name_first, you're authorized! The only way I could figure
out how to do this is make a separate sql call to retrieve
the first name. Can I consolidate this into one call? Thanks.
(Based on "PHP Fast and Easy" code.)

<?

if ((!$username) || (!$password)) {
 header("Location: blah");
 exit;
} 


$db_name = "notgonnadoit";
$table_name = "guess";

$connection = @mysql_connect("blah", "bleck", "bleep") 
 or die("Couldn't connect.");

$db = mysql_select_db($db_name, $connection)
 or die("Couldn't select database.");

$sql = "SELECT * FROM $table_name
 WHERE username = \"$username\" 
 AND password = password(\"$password\")
 "; 

$result = mysql_query($sql) 
        or die ("Can't execute query."); 

$num = mysql_numrows($result); 

if ($num != 0) { 

$connection = @mysql_connect("blah", "bleck", "bleep")  
 or die("Couldn't connect.");

$db = mysql_select_db($db_name, $connection)
 or die("Couldn't select database.");

$sql1 = "SELECT username, name_first
        FROM $table_name
        ";
        
$result1 = @mysql_query($sql1,$connection)
        or die("Couldn't execute query.");

while ($row = mysql_fetch_array($result1)) {
        $name_first = $row['name_first'];
        $username1 = $row['username'];
        
        
        if ($username1 == $username) {
        $name_first1 = $name_first;
        }
}

 $msg = "<p>Welcome $name_first1, you're authorized!</p>";

} else { 

 header("Location: http://www.webdesigns1.f2s.com/db/auth_login.html");
 exit;
} 

?>
<html>
<head>
<title>Welcome</title>
</head>
<body bgcolor="#000000" text="#00ff00">
<? echo "$msg"; ?>
</body>
</html>




The following should work okay for you:

<?php

if ((!$username) || (!$password)) {
  header("Location: blah");
  exit;
}
$userc = @mysql_connect("blah", "bleck", "bleep") or die("No DB Connection");
@mysql_select_db("notgonnadoit", $userc) or die("No DB Select");
if (($userq = @mysql_query("SELECT name_first FROM guess WHERE username='$username' 
AND password=PASSWORD('$password')",
$userc)) && (@mysql_num_rows($userq) == 1)) {
  $namef = @mysql_result($userq, 0, 0);
  echo "Welcome $namef";
} else {
  header("Location: blah");
  exit;
}
@mysql_close($userc);

?>

>-----Original Message-----
>From: Jeff Oien [mailto:[EMAIL PROTECTED]]
>Sent: Monday, 19 February, 2001 08:50
>To: PHP
>Subject: [PHP] Shorten this MySQL code?
>
>
>Newbie with MySQL. I have a user auth form before this
>script which asks for username and password. First
>Name and Last name are also in each record in the
>database along with username and password. When
>the user successfully logs in, I have it say, "Welcome
>name_first, you're authorized! The only way I could figure
>out how to do this is make a separate sql call to retrieve
>the first name. Can I consolidate this into one call? Thanks.
>(Based on "PHP Fast and Easy" code.)
>
><?
>
>if ((!$username) || (!$password)) {
> header("Location: blah");
> exit;
>}
>
>
>$db_name = "notgonnadoit";
>$table_name = "guess";
>
>$connection = @mysql_connect("blah", "bleck", "bleep")
> or die("Couldn't connect.");
>
>$db = mysql_select_db($db_name, $connection)
> or die("Couldn't select database.");
>
>$sql = "SELECT * FROM $table_name
> WHERE username = \"$username\"
> AND password = password(\"$password\")
> ";
>
>$result = mysql_query($sql)
>        or die ("Can't execute query.");
>
>$num = mysql_numrows($result);
>
>if ($num != 0)

>
>$connection = @mysql_connect("blah", "bleck", "bleep")
> or die("Couldn't connect.");
>
>$db = mysql_select_db($db_name, $connection)
> or die("Couldn't select database.");
>
>$sql1 = "SELECT username, name_first
>       FROM $table_name
>       ";
>
>$result1 = @mysql_query($sql1,$connection)
>       or die("Couldn't execute query.");
>
>while ($row = mysql_fetch_array($result1)) {
>       $name_first = $row['name_first'];
>       $username1 = $row['username'];
>
>
>       if ($username1 == $username) {
>       $name_first1 = $name_first;
>       }
>}
>
> $msg = "<p>Welcome $name_first1, you're authorized!</p>";
>
>} else

>
> header("Location: http://www.webdesigns1.f2s.com/db/auth_login.html");
> exit;
>}
>
>?>
><html>
><head>
><title>Welcome</title>
></head>
><body bgcolor="#000000" text="#00ff00">
><? echo "$msg"; ?>
></body>
></html>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>





Hi,
I have a form for user input and after checking, it's gonna go to another
page for further input. What should i code to bring the second input page up
after checking done on the first??
Thanks.

Edith Lai






You could do:

header("Location: page2.php");

But you may need to pass some variables such as:

header("Location: page2.php?SESSID=$SESSID");

You'd probably be better of having the error checking at the top of the
second page and sending them *back* to the first page if they got it wrong.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: "Edith Lai" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Monday, February 19, 2001 9:54 AM
Subject: [PHP] Open location automatically after checking


> Hi,
> I have a form for user input and after checking, it's gonna go to another
> page for further input. What should i code to bring the second input page
up
> after checking done on the first??
> Thanks.
>
> Edith Lai
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Can someone tell me if this is possible.

I have a PHP variable which i got from a html form using $HTTP_POST_VAR. I
collect a variable called Community. Therefore is it possible to have an sql
statement like this?

//create sql statement

     $sql = "select businessname from main where businesstype =
'consultancy' and $community != '0'";


if this is not ok how else can i extract a variable from another html page.

Matt.





It is possible, but the syntax is :

      $sql = "select businessname from main where businesstype =
 'consultancy' and " .$community." != '0'";
This is the case where $comunity is the name of a field.

Regards
Sorin Ifrim

----- Original Message -----
From: Matt Davis <[EMAIL PROTECTED]>
To: Php Mailing List <[EMAIL PROTECTED]>
Sent: Monday, February 19, 2001 6:05 PM
Subject: [PHP] php variables in sql statements.


> Can someone tell me if this is possible.
>
> I have a PHP variable which i got from a html form using $HTTP_POST_VAR.
I
> collect a variable called Community. Therefore is it possible to have an
sql
> statement like this?
>
> file://create sql statement
>
>      $sql = "select businessname from main where businesstype =
> 'consultancy' and $community != '0'";
>
>
> if this is not ok how else can i extract a variable from another html
page.
>
> Matt.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Richard -

I am very new to Apache.  It is installed on my notebook computer so
that I can do some PHP programming while I am on the road.  Though I
looked at the conf file, I was not aware that one could turn that
feature on and off in Apache.  Can you point me in the right direction?

Todd


--
Todd Cary
Ariste Software
[EMAIL PROTECTED]






This is how I have mine set with Win 2K:

[mail function]
SMTP            = 192.172.0.1              ;for win32 only
sendmail_from   = [EMAIL PROTECTED]  ;for win32 only



--
Todd Cary
Ariste Software
[EMAIL PROTECTED]






I think you're getting through the configure and compile somehow (maybe info is
cached), but not really compiling in the PDF functions.  I really think this is
an issue with the setup of RH 7.  Why don't you try to install the 7.1 which is
beta now to see if RH fixed it in anyway.  Or you can go back to 6.2 (which I
have).  Everything works in 6.2 now.

Michael


Mike Tuller wrote:

> Ok. I have done everything I have been told to do, found on the web, and I
> can think of other than bringing in a voodoo priest to get this going. I'll
> try to explain what I have done so far.
>
> I have a system with RedHat 7.0 installed, and am trying to get PDFlib to
> work with PHP 4.04. The configure script I am using is as follows:
>
> ./configure --with-mysql=/usr/local --with-config-file-path=/www/conf
> --with-apache=../httpd --enable-track-vars    --with-system-regex=yes
> --with-gd   --with-jpeg-dir=/usr  --with-png-dir=/usr   --with-zlib-dir=/usr
> --with-pdflib=/usr/local    --with-tiff-dir=/usr
>
> Configure runs fine, make runs without errors, make install too. When I go
> to bring up the test page of the clock, I get this.
>
> Fatal error: Call to undefined function: pdf_new() in
> /www/servers/pdfclock.php on line 7
>
> I have taken the advice of others to not use the rpm of apache and have
> compiled it myself. I also spent the time removing RedHat 7 and putting 6.2
> back on. Only to find that if anything needs updating, that dependency
> problems forced me to go back to 7.0 anyway.
>
> I have updated the system library and specified at
> http://www.phpbuilder.com/columns/perugini20001026.php3?page=2
>
> It still doesn't work! I finally decided to try using ClibPDF. That runs
> into the same problem at the same spot.
>
> Fatal error: Call to undefined function: cpdf_open() in
> /www/servers/pdftest.php on line 2
>
> So this tells me that there is probably not anything wrong with PDFlib or
> ClibPDF, that it is something that I am not doing or something else. PHP is
> working fine though, and if I compile with Mysql or anything else, they work
> fine.
>
> If anyone has anymore advice on how to get this PDFlib working, please let
> me know.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]





i am not positive about this, but you could try making
the amp process a background process by adding a
" &" to the end of the command line 
(at least if you're using *nix)


> -----Original Message-----
> From: Ashley M. Kirchner [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 19, 2001 00:40
> To: PHP-General List
> Subject: [PHP] system()
> 
> 
> 
>     While doing a test run on an idea I have, I tried running the
> system() command on an audio application:
> 
>     <? system('amp -p song_one.mp3') ?>
> 
>     ...and found out that it works when I load the file up in a browser
> - I get sound coming out from the physical web server's audio port.
> Don't worry, this was the expected behavior, and also what I wanted to
> happen.  However, as the manual page says, system() will hang till the
> command is done running.
> 
>     I can hit the browser's Stop button, however the actual application
> is still running - and won't stop till the file is done playing I assume
> (or will it quit based on the webserver's time out value?)  I suppose I
> can create a button on the same page that executes something like
> system('killall -KILL amp'); and be done with it.  Haven't tried that
> yet.
> 
>     But, if I'm still crazy tomorrow and plan on continuing with this
> project, how should this be done properly?  Obviously, 'holding' the
> browser while the program runs isn't the right way to do it.  And I need
> a way to stop the audio somehow.
> 
>     The actual project looks something like this:
> 
>     The server has a few directories filled with mp3 files.  I'd like to
> build a script that would dive into one of those directories (depending
> on the user selection), and present a list of all the songs, with a
> check box.  The user can then select the ones s/he would like to hear
> and click a Play button and enjoy.  The amount of selections can be
> anything, from one song, to all (should they want to sit there for 15
> hours).
> 
>     However, when they click Play, I want the same page to be reloaded
> again, with nothing selected, and their (previous) selection to start
> playing in the background.  If they want to change their selection, they
> can go ahead and pick other songs, and click Play again - THIS is where
> the previous instance of the 'amp' program should be killed, and a new
> one started, with the new play list queued.  And of course, it should
> also have a Stop button on the page somewhere.
> 
>     A few notes on the amp program (for those that don't know it):  I
> _CAN_ run several instances of it, and they will all output audio
> simultaneously through the port (unlike Windows which will tell you the
> audio device is busy).  So, if I start it once with song_one.mp3
> playing, and a second time with song_two.mp3 playing, you will hear both
> songs at the same time.  (for that matter, I can run some 6 or 7
> instances of the thing before the CPU starts to hiccup).  It also
> doesn't exit till the file is done playing (I believe all players do
> this).
> 
>     I'm not asking for someone to actually build this for me, no.  But I
> would be very grateful for some pointers, what can I do, and what I
> should not do, and what to avoid all together.  It's something for my
> household to use, so they can listen to music through a simple
> interface, as opposed to having to log into the server and figuring out
> how/what to do through the shell, or X-Win interface.
> 
>     Am I crazy?
> 
> --
> H | Hi, I'm currently out of my mind.  Please leave a message.  BEEEEP!
>   |____________________________________________________________________
>   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>   Ashley M. Kirchner <mailto:[EMAIL PROTECTED]>   .   303.442.6410 x130
>   Director of Internet Operations / SysAdmin    .     800.441.3873 x130
>   Photo Craft Laboratories, Inc.             .        eFax 248.671.0909
>   http://www.pcraft.com                  .        3550 Arapahoe Ave, #6
>   .................. .  .  .     .            Boulder, CO 80303, U.S.A.
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 




On Monday 19 February 2001 21:00, ..s.c.o.t.t.. wrote:
> i am not positive about this, but you could try making
> the amp process a background process by adding a
> " &" to the end of the command line
> (at least if you're using *nix)

That alone won't help - "nohup" is also needed.
What he could do is write a small Perl/C wrapper for amp, which launches 
the program in the background and returns its process id. Then he can do a
$AmpPID = system ("launchamp $Arg");

(the wrapper would have to execute "nohup amp $Args &")

and add a 'stop' link
<a href="ampstop.php?pid=<?= $AmpPID ?>">Stop</a>

And ampstop.php can do a 
system ("kill -KILL $pid");

> >     However, when they click Play, I want the same page to be
> > reloaded again, with nothing selected, and their (previous) selection
> > to start playing in the background.  If they want to change their
> > selection, they can go ahead and pick other songs, and click Play
> > again - THIS is where the previous instance of the 'amp' program
> > should be killed, and a new one started, with the new play list
> > queued.  And of course, it should also have a Stop button on the page
> > somewhere.

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

I saw God --------- and she was black.




is there something with the PHP system command that
makes it unable to spawn nohup background processes

perl and PHP are closely related, so i cant really understand
how an external perl program would be able to do things that
PHP couldnt (at least in terms of this specific problem)....
would a PHP call to "system('nohup ... &')" fail, or are your
reasons for suggesting an external program based on
something else other than simple feasability?

ive never had to do anything like that before, and im not
on a linux computer right now, so i cant test it myself.


> -----Original Message-----
> From: Christian Reiniger [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] system()
> 
> On Monday 19 February 2001 21:00, ..s.c.o.t.t.. wrote:
> > i am not positive about this, but you could try making
> > the amp process a background process by adding a
> > " &" to the end of the command line
> > (at least if you're using *nix)
> 
> That alone won't help - "nohup" is also needed.
> What he could do is write a small Perl/C wrapper for amp, which launches 
> the program in the background and returns its process id. Then he can do a
> $AmpPID = system ("launchamp $Arg");
> 
> (the wrapper would have to execute "nohup amp $Args &")
> 
> and add a 'stop' link
> <a href="ampstop.php?pid=<?= $AmpPID ?>">Stop</a>
> 
> And ampstop.php can do a 
> system ("kill -KILL $pid");
> 
> > >     However, when they click Play, I want the same page to be
> > > reloaded again, with nothing selected, and their (previous) selection
> > > to start playing in the background.  If they want to change their
> > > selection, they can go ahead and pick other songs, and click Play
> > > again - THIS is where the previous instance of the 'amp' program
> > > should be killed, and a new one started, with the new play list
> > > queued.  And of course, it should also have a Stop button on the page
> > > somewhere.
> 





On Monday 19 February 2001 22:47, ..s.c.o.t.t.. wrote:
> is there something with the PHP system command that
> makes it unable to spawn nohup background processes
>
> perl and PHP are closely related, so i cant really understand
> how an external perl program would be able to do things that
> PHP couldnt (at least in terms of this specific problem)....
> would a PHP call to "system('nohup ... &')" fail, or are your
> reasons for suggesting an external program based on
> something else other than simple feasability?

No, the reason for that wrapper program is that I know of no way in PHP 
to get the Process ID of the spawned program. simply calling something 
with "nohup" will work fine I'm sure.

> > That alone won't help - "nohup" is also needed.
> > What he could do is write a small Perl/C wrapper for amp, which
> > launches the program in the background and returns its process id.
> > Then he can do a $AmpPID = system ("launchamp $Arg");
> >
> > (the wrapper would have to execute "nohup amp $Args &")
> >
> > and add a 'stop' link
> > <a href="ampstop.php?pid=<?= $AmpPID ?>">Stop</a>
> >
> > And ampstop.php can do a
> > system ("kill -KILL $pid");

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

I saw God --------- and she was black.




from the "unset" documentation on php.net

// destroy a single variable
unset ($foo);

// destroy a single element of an array
unset ($bar['quux']);

// destroy more than one variable
unset ($foo1, $foo2, $foo3);




> -----Original Message-----
> From: andreas (@work) [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 19, 2001 00:50
> To: [EMAIL PROTECTED]
> Subject: [PHP] array
> 
> 
> hi,
> 
> is there a function to delete an item of an array
> 
> "1","7","14","33","99","A1","A12"
> 
> id like to delete the "33"
> 
> 
> thank you
> 
> andreas
> 
> 
> 




i had a very similar problem when i first setup PHP/Apache
on my linux box... i forgot to add a line to my httpd.conf
and got all sorts of "Cant find this" "Cant find that" type
of errors....

my mistake was that i did not set ScriptAlias and Action
correctly, and thus apache was having all sorts of
problems executing my scripts becuase i put the physical
path to php after my Action directive, rather than alias it
via a ScriptAlias directive..  (silly me thought i could do
away with the ScriptAlias and just point to it directly)

make sure you have both of these (or something similar)
in your httpd.conf file:

ScriptAlias /php/ "/physical/path/to/php"
Action application/x-httpd-php "/php/php"

(and make sure to "killall -HUP httpd" after any changes to
the conf files, although you probably knew that already... :)

hope it helps.


> -----Original Message-----
> From: Hrishi [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 19, 2001 03:31
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP as CGI
> 
> 
> >
> > AddType application/x-httpd-php .php
> > Action application/x-httpd-php /usr/local/php
> >
> > A) I'm not sure you need the "." on ".php"
> > 
> 
> i've tried both with and without the '.' , but the server always responds :
> 
> ---
> Not Found
> 
> The requested URL /usr/bin/php4/test.php was not found on this server.
> 
> Apache/1.3.3 Server at www.website.com Port 80
> 
> ---
> 
> the installed CGI is php 4.0.3pl1,
> it runs fine from the command line.
> 
> any ideas?
> 
> thanks,
> Hrishi
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 




I am a regular writer for Contract Professional Magazine (their 
weekly ezine, actually) and I am looking for several people to 
interview for an upcoming story on PHP. If you are:

1) An independent contractor
2) making a living ($25K+/yr) developing in PHP
and
3) are willing to talk to me for inclusion in a story

Please drop me a line off list.
-- 
------------------------------------------------------------------------------
Buy "On the Edge"! http://www.dejahsprivateice.com/PIshop/OTE_order.php3
Puberty has stolen Elayne Smith's chance for Olympic gold. Caught 
between love and lust, despair and determination, a golden boy and a 
troubled man, Elayne is On the Edge.
------------------------------------------------------------------------------
Apply to be a ForeWord Magazine eBook Reviewer! 
mailto:[EMAIL PROTECTED] for application.
------------------------------------------------------------------------------




Consider the following code:

$ary1 = array ("one","two");
$ary2 = array ("three","four");

$2d_Dimension[] = $ary1;
$2d_Dimension[] = $ary2;

// is $2d_Dimension a 2 dimensional array?

// and the next question, how to get out content of the $2d_Dimension[]
array

while ( list ( $rec_no, $ary ) = each ( $2d_Dimension ) )
{
    echo ("Record No $rec_no:");
   while ( list ( $element1, $element2 ) = each ( $ary ) )
       echo "$element1, $element2";
}

// I want to use the above code to print something like
// Record No 0:one, two
// Record No 1:three, four

// But I only got the following
//Record No 0:
//Warning: Variable passed to each() is not an array or object in
d:/project/bizvista/testinc.php on line 27

What's the problem?








> -----Original Message-----
> From: Zenith [mailto:[EMAIL PROTECTED]]
> Subject: [PHP] question about multidimension array
> 
> Consider the following code:
> 
> $ary1 = array ("one","two");
> $ary2 = array ("three","four");
> 
> $2d_Dimension[] = $ary1;
> $2d_Dimension[] = $ary2;
> 
> // is $2d_Dimension a 2 dimensional array?

yes... the "dimension" of an array is basically how many
brackets you put after the variable name... 
1D = $this[];
2D = $this[][];
3D = $this[][][]; 
etc....
 
> // and the next question, how to get out content of the $2d_Dimension[]
> array
> 
> while ( list ( $rec_no, $ary ) = each ( $2d_Dimension ) )
> {
>     echo ("Record No $rec_no:");
>    while ( list ( $element1, $element2 ) = each ( $ary ) )
>        echo "$element1, $element2";
> }

with a slight modification, that code works perfectly:
(see end of email for why you probably got a parse error)

<?php

 $ary1 = array ("one","two");
 $ary2 = array ("three","four");
 $twod = array($ary1, $ary2);

 while ( list ($rec_no,$ary) = each ($twod) )
 {
        echo ("Record No $rec_no:");
        while ( list ($key,$val) = each ($ary) )
                echo "$key=$val; ";
        echo "<BR>\n";
 }

?>


> // I want to use the above code to print something like
> // Record No 0:one, two
> // Record No 1:three, four

my code produces:
Record No 0:0=one; 1=two; 
Record No 1:0=three; 1=four; 

suppress printing $key, and you'll get the output you want.
 
> // But I only got the following
> //Record No 0:
> //Warning: Variable passed to each() is not an array or object in
> d:/project/bizvista/testinc.php on line 27
> 
> What's the problem?

if i use your code verbatim, i get a parse error becuase of the
variable name starting with a digit, but as for the error *you*
describe, when i put the loop inside of a function, and fail to declare
$twod as global, i get the same error:

"Warning: Variable passed to each() is not an array or object ..."

make sure you declare all globals as "global $varname" in your
functions... PHP is basically the reverse of almost every other
language (things are local by default, global by declaration)... 




i dont know too much about ASP, as i've never had to use it,
but i thought ASP as more of an enviornment (or meta-language)
rather than an actual programming language (becuase VBscript
is the default language for ASP pages, i always assumed that
other languages could be utilized in place of VB(yuck))

could you use any other language aside from VBscript
if the client mandates ASP, or is ASP tied to VB/Microsoft?

the reason i ask is becuase i heard about a perl product that
would basically do almost the same thing as PHP (put perl code
in the HTML document, and the server would parse thru it
when someone requested the page)... and i always thought
that ASP was the meta-language that governed the rules
for embedded programming (use <? to start script, etc...
rules like that) rather than an actual *language*

am i wrong?  anyone care to clarify what ASP is, and what
it's relation to PHP is.... on or off the list, whichever suits you ;)

PS: please excuse me if you feel that i am off topic....


> -----Original Message-----
> From: John Monfort [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 19, 2001 10:16
> To: Adrian Murphy
> Cc: [EMAIL PROTECTED]
> Subject: Re: [PHP] woe is me
> 
> 
> 
> 
>    I feel your pain.
>     :-(
> 
> 
> __________John Monfort_________________
> _+-----------------------------------+_
>      P E P I E  D E S I G N S
>        www.pepiedesigns.com
> "The world is waiting, are you ready?"
> -+___________________________________+-
> 
> On Mon, 19 Feb 2001, Adrian Murphy wrote:
> 
> > i'm sorry,i just had to share this with people who'd understand.
> > we've just secured clients who are m$ affiliated and they insist
> > everthing be done with asp.
> > excuse me while i go off for a little cry.................
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 




> other languages could be utilized in place of VB(yuck))

you're right !!
that jogged my memory. i remember reading on M$DN (Jan 2000) that ASP could 
be generated with many languages (most of them third party extensions) one of 
them was Python. however i do not have any details other than the above, a 
preliminary search of M$DN online for the keyword 'python' yields :

http://msdn.microsoft.com/library/psdk/cdo/_olemsg_about_active_server_pages.htm

i think you can find your way from here,

cheers,
Hrishi




ASP is a framework in which laguages are used.  The most commonly used language
is VBScript.  You can also use JScript (MS's Javascript) or PerlScript within
ASP.  Check with MS for more info.

Of course you can always assign the .asp extenion to PHP files and say it's
ASP.

Michael


"..s.c.o.t.t.." wrote:

> i dont know too much about ASP, as i've never had to use it,
> but i thought ASP as more of an enviornment (or meta-language)
> rather than an actual programming language (becuase VBscript
> is the default language for ASP pages, i always assumed that
> other languages could be utilized in place of VB(yuck))
>
> could you use any other language aside from VBscript
> if the client mandates ASP, or is ASP tied to VB/Microsoft?
>
> the reason i ask is becuase i heard about a perl product that
> would basically do almost the same thing as PHP (put perl code
> in the HTML document, and the server would parse thru it
> when someone requested the page)... and i always thought
> that ASP was the meta-language that governed the rules
> for embedded programming (use <? to start script, etc...
> rules like that) rather than an actual *language*
>
> am i wrong?  anyone care to clarify what ASP is, and what
> it's relation to PHP is.... on or off the list, whichever suits you ;)
>
> PS: please excuse me if you feel that i am off topic....
>
> > -----Original Message-----
> > From: John Monfort [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, February 19, 2001 10:16
> > To: Adrian Murphy
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] woe is me
> >
> >
> >
> >
> >    I feel your pain.
> >     :-(
> >
> >
> > __________John Monfort_________________
> > _+-----------------------------------+_
> >      P E P I E  D E S I G N S
> >        www.pepiedesigns.com
> > "The world is waiting, are you ready?"
> > -+___________________________________+-
> >
> > On Mon, 19 Feb 2001, Adrian Murphy wrote:
> >
> > > i'm sorry,i just had to share this with people who'd understand.
> > > we've just secured clients who are m$ affiliated and they insist
> > > everthing be done with asp.
> > > excuse me while i go off for a little cry.................
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]





ASP can 'host' other languages that are designed to be used in ASP.
Currently VBScript and JScript ship with IIS, and PerlScript is available.
PHP is not something which can directly be plugged into the ASP architecture.

Having said that, most of the MS people I know that use ASP ALWAYS
use VBScript.  There are just comparatively few JScript examples
and books re: ASP in relation to VBScript things.  I worked someplace
where they kept telling me I had to do the site in "ASP", so I did a couple
 of the pages in JScript.  No one was happy, as NO ONE else at the company
had day 1 experience with Jscript in a production environment
(this was ~30+ ASP programmers - it was ALL VBScript).  So the bit about
"use multiple languages" is, imo, misleading at best.  If YOU want to, and
the project is just for you, go ahead.  If it's a commercial project
for a client who wants/needs "ASP" they mean VBScript.



"..s.c.o.t.t.." wrote:

> i dont know too much about ASP, as i've never had to use it,
> but i thought ASP as more of an enviornment (or meta-language)
> rather than an actual programming language (becuase VBscript
> is the default language for ASP pages, i always assumed that
> other languages could be utilized in place of VB(yuck))
>
> could you use any other language aside from VBscript
> if the client mandates ASP, or is ASP tied to VB/Microsoft?
>
> the reason i ask is becuase i heard about a perl product that
> would basically do almost the same thing as PHP (put perl code
> in the HTML document, and the server would parse thru it
> when someone requested the page)... and i always thought
> that ASP was the meta-language that governed the rules
> for embedded programming (use <? to start script, etc...
> rules like that) rather than an actual *language*
>
> am i wrong?  anyone care to clarify what ASP is, and what
> it's relation to PHP is.... on or off the list, whichever suits you ;)
>
> PS: please excuse me if you feel that i am off topic....
>
> > -----Original Message-----
> > From: John Monfort [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, February 19, 2001 10:16
> > To: Adrian Murphy
> > Cc: [EMAIL PROTECTED]
> > Subject: Re: [PHP] woe is me
> >
> >
> >
> >
> >    I feel your pain.
> >     :-(
> >
> >
> > __________John Monfort_________________
> > _+-----------------------------------+_
> >      P E P I E  D E S I G N S
> >        www.pepiedesigns.com
> > "The world is waiting, are you ready?"
> > -+___________________________________+-
> >
> > On Mon, 19 Feb 2001, Adrian Murphy wrote:
> >
> > > i'm sorry,i just had to share this with people who'd understand.
> > > we've just secured clients who are m$ affiliated and they insist
> > > everthing be done with asp.
> > > excuse me while i go off for a little cry.................
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]





Hi!
I have this PHP:
-----
$message = ereg_replace("\r","", $message);
$message =
"<list><med>$message</med><nam>$name</nam><email>$email</email><adr>$adress</adr><tel>$telefon</tel></list>";

$fp = fopen (basename($PHP_SELF) . ".xml", "a");
fwrite ($fp, $message);
fclose ($fp);
------
I want to get<bok>at the beginning and </bok>at the end, inside the bok
I want several <list>. is  it possible to do?

Thanks for any help?

Jan





include() will only load the file if the include() statement is encountered
during the execution of your script
        if (1==0) {
                include("file");
        }
the file will never be include()'d, since the if/then will always fail.

require() will always put the contents of the file being requie()'d
into your script, regardless if it is executed or not...
        if (1==0) {
                require("file");
        }
the contents of "file" will be placed inside of the if/then,
even though it'll never be executed.

also, include() is evaluated every time it is encountered,
whereas require() is only evaluated once...

**
**From the PHP.net website documentation**

The include() statement includes and evaluates the specified file.

If "URL fopen wrappers" are enabled in PHP (which they are in the default
configuration), you can specify the file to be include()ed using an URL instead of a
local pathname. See Remote files and fopen() for more information.

An important note about how this works is that when a file is include()ed or
require()ed, parsing drops out of PHP mode and into HTML mode at the beginning of the
target file, and resumes again at the end. For this reason, any code inside the
target file which should be executed as PHP code must be enclosed within valid PHP
start and end tags.

This happens each time the include() statement is encountered, so you can use an
include() statement within a looping structure to include a number of different
files.

include() differs from require() in that the include statement is re-evaluated each
time it is encountered (and only when it is being executed), whereas the require()
statement is replaced by the required file when it is first encountered, whether the
contents of the file will be evaluated or not (for example, if it is inside an if
statement whose condition evaluated to false).



> -----Original Message-----
> From: John Monfort [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] what's the difference between include and require??
>
>   An unsuccessful include will give you an error.
>
>   An unsuccessful require will kill the program.
>
> On Mon, 19 Feb 2001, Zenith wrote:
>
> > Though I have read the manual about these two things, include() and
> > require(), but I still not very clear about the difference between these??





In a self defined function, a one dimension or two dimension array may be
passed,
How can I check that, the passed in array is a one dimension array or a two
dimension array?






On Tue, 20 Feb 2001 02:45:12 +0800, Zenith ([EMAIL PROTECTED])
wrote:
>In a self defined function, a one dimension or two dimension array
>may be
>passed,
>How can I check that, the passed in array is a one dimension array
>or a two
>dimension array?

I guess you would call is_array() on one of the elements and if it
returns true you have a 2D array.

- Mark





Addressed to: "Zenith" <[EMAIL PROTECTED]>
              [EMAIL PROTECTED]

** Reply to note from "Zenith" <[EMAIL PROTECTED]> Tue, 20 Feb 2001 02:45:12 +0800
>
> In a self defined function, a one dimension or two dimension array may be
> passed,
> How can I check that, the passed in array is a one dimension array or a two
> dimension array?


If an element of $array[x] returns 'ARRAY' it is multi dimensional.  You
may have to check my capitolization.  Try looking at $array, a known
array and see what it returns in an echo.




Rick Widmer
Internet Marketing Specialists
http://www.developersdesk.com




On Monday 19 February 2001 19:45, Zenith wrote:
> In a self defined function, a one dimension or two dimension array may
> be passed,
> How can I check that, the passed in array is a one dimension array or a
> two dimension array?

Well, actually an array can be both 1-dimensional and 2-dimensional at 
the same time. Example:

$WeirdDArray = array ('1dim' => 'Hello man',
                      '2dim' => array ('Hello', 'man')
                      '1d2'  => 42);

So it depends on what you mean with "2-dimensional"...

-- 
Christian Reiniger
LGDC Webmaster (http://sunsite.dk/lgdc/)

I saw God --------- and she was black.





Hi!

is there any relation between use of sessions (php 4.0.4) and  the
following browser message ?

Data Missing

This document resulted from a POST operation and has expired from the
cache. If you wish you can repost the form
data to recreate the document by pressing the reload button.

I am having this message since I include session handling in the code.

Is there any way to avoid this?

Thanks in advance

--
Evelio Martínez






Mensaje citado por: Evelio Martinez <[EMAIL PROTECTED]>:

> 
> Hi!
> 
> is there any relation between use of sessions (php 4.0.4) and  the
> following browser message ?
> 
> Data Missing
> 
> This document resulted from a POST operation and has expired from the
> cache. If you wish you can repost the form
> data to recreate the document by pressing the reload button.

Whta does the error file say (error_log in apache)?

> I am having this message since I include session handling in the code.

Change the expire time?

> Is there any way to avoid this?

Martin Marques




I'm still new to php, just wanted to check to make sure this will work ok.
Thanks

<form method="POST" action="<?php print("$PHP_SELF"); ?>">
First Name: <input type=TEXT name="FirstName" size=15><p>
Last Name: <input type=TEXT name="LastName" size=25><p>
E-mail Address: <input type=TEXT name="Email" size=25><p>
<input type=SUBMIT> <input type=RESET>
</form>

<?php
if(!IsSet($FirstName, $LastName, $Email))
 {
 header("Location: http://www.SITE.com/error.php");
 exit;
 }
else
 {
 header("Location:
http://www.SITE.com/thanks.php");
 exit;
 }
?>


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





Hi,

> <form method="POST" action="<?php print("$PHP_SELF"); ?>">
> First Name: <input type=TEXT name="FirstName" size=15><p>
> Last Name: <input type=TEXT name="LastName" size=25><p>
> E-mail Address: <input type=TEXT name="Email" size=25><p>
> <input type=SUBMIT> <input type=RESET>
> </form>

The form should work.

> <?php
> if(!IsSet($FirstName, $LastName, $Email))
>  {
>  header("Location: http://www.SITE.com/error.php");
>  exit;
>  }
> else
>  {
>  header("Location:
> http://www.SITE.com/thanks.php");
>  exit;
>  }
> ?>

This won't work.  I assume that this code is included on the page with the
form above.  First, the header() function must be called before any output
is sent to the browser or it will throw an error and stop.  The second
problem is that the first time a user comes to this page, it will throw then
to the error page because the vars won't be set.  Try this:

<?
    if($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST")
    {
        (!isset($Email)||!isset($FirstName)||!isset($LastName))?
            header("Location: http://www.SITE.com/error.php"):
            header("Location: http://www.SITE.com/thanks.php");
    }
?>

Then put your form below it.  This will work unless you do a form post to
this page from another page in which case it will throw you to the error
page.

Jason





Ok, I removed the (" ") from action and it worked, but it doesnt validate,
just sends to thanks page regardless of whether the fields are filled or
not. Am I mistaking IsSet for handling that?

> Hi,
>
> > <form method="POST" action="<?php print("$PHP_SELF"); ?>">
> > First Name: <input type=TEXT name="FirstName" size=15><p>
> > Last Name: <input type=TEXT name="LastName" size=25><p>
> > E-mail Address: <input type=TEXT name="Email" size=25><p>
> > <input type=SUBMIT> <input type=RESET>
> > </form>
>
> The form should work.
>
> > <?php
> > if(!IsSet($FirstName, $LastName, $Email))
> >  {
> >  header("Location: http://www.SITE.com/error.php");
> >  exit;
> >  }
> > else
> >  {
> >  header("Location:
> > http://www.SITE.com/thanks.php");
> >  exit;
> >  }
> > ?>
>
> This won't work.  I assume that this code is included on the page with the
> form above.  First, the header() function must be called before any output
> is sent to the browser or it will throw an error and stop.  The second
> problem is that the first time a user comes to this page, it will throw
then
> to the error page because the vars won't be set.  Try this:
>
> <?
>     if($HTTP_SERVER_VARS["REQUEST_METHOD"] == "POST")
>     {
>         (!isset($Email)||!isset($FirstName)||!isset($LastName))?
>             header("Location: http://www.SITE.com/error.php"):
>             header("Location: http://www.SITE.com/thanks.php");
>     }
> ?>
>
> Then put your form below it.  This will work unless you do a form post to
> this page from another page in which case it will throw you to the error
> page.
>
> Jason


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





I have a php script that I'm writing for taking/passing/reading phone
messages.

I've got a screen where one enters the name of the person leaving the message.
I've found that when the "from_whom" field is active, if the user hits Return,
the form is returned w/o hitting a "submit" button.  Is this defined behavior,
or is it Netscape-specific?  Is there a way to turn that off?

-Michael

-- 
No, my friend, the way to have good and safe government, is not to trust it
all to one, but to divide it among the many, distributing to every one exactly
the functions he is competent to.  It is by dividing and subdividing these
republics from the national one down through all its subordinations, until it
ends in the administration of every man's farm by himself; by placing under
every one what his own eye may superintend, that all will be done for the
best.
                -- Thomas Jefferson, to Joseph Cabell, 1816




It's defined behaviour, by Netscape, and you can't turn it off.

You can only validate the inputs you get and send them back if they are
invalid.

NOTE:  Requiring the user to "click" on a SUBMIT button rather than hit
Return is *most* annoying to many users.  If they don't "click" on SUBMIT,
you don't get that variable in your script.  Deal with it.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: Michael George <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Monday, February 19, 2001 1:09 PM
Subject: [PHP] <Ret> from text input


> I have a php script that I'm writing for taking/passing/reading phone
> messages.
>
> I've got a screen where one enters the name of the person leaving the
message.
> I've found that when the "from_whom" field is active, if the user hits
Return,
> the form is returned w/o hitting a "submit" button.  Is this defined
behavior,
> or is it Netscape-specific?  Is there a way to turn that off?
>
> -Michael
>
> --
> No, my friend, the way to have good and safe government, is not to trust
it
> all to one, but to divide it among the many, distributing to every one
exactly
> the functions he is competent to.  It is by dividing and subdividing these
> republics from the national one down through all its subordinations, until
it
> ends in the administration of every man's farm by himself; by placing
under
> every one what his own eye may superintend, that all will be done for the
> best.
>                 -- Thomas Jefferson, to Joseph Cabell, 1816
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Hi, I'm about to make a function with two arguments, and I want the second one
to be optional. Can I just write the function and use it with one or two
arguments without problems (I check if the second argument was passed inside the
function).
Is this OK?

Saludos... :-)

Martin Marques




> Hi, I'm about to make a function with two arguments, and I 
> want the second one to be optional. Can I just write the function 
> and use it with one or two arguments without problems (I check 
> if the second argument was passed inside the function).
> Is this OK?

To make the second argument optional, you should declare the
function as such:

function myFunc( $firstArgument, $secondArgument = "" ) {
}

The above is defaulting the second argument to nothing/null/no value.
You could default to any value you wish.  If the argument is not passed,
the default value will be used, whatever it is set to.

Chris




hi,

when doing a session_start() followed by session_register(...)
before the html header the first call stops with the error
'html header already written'. how can i prevent the html header
to be written until the session_start() is called?
sascha




Make sure there are no lines (except a <?php of course) above your
session_start(), INCLUDING blank lines.

Example that will work:
<?php
session_start();
?>
<HTML>
yadda yadda yadda etc etc etc

Example that will not work:
<?php

session_start();
?>
<HTML>
yadda yadda yadda etc etc

Hope this helps,
Kath

----- Original Message -----
From: "Sascha Andres" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 19, 2001 2:38 PM
Subject: [PHP] Session support in PHP


> hi,
>
> when doing a session_start() followed by session_register(...)
> before the html header the first call stops with the error
> 'html header already written'. how can i prevent the html header
> to be written until the session_start() is called?
> sascha
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Hi!! 

My name is Bruno, From Brazil!!!

I need to know how can i discovery the ip address when somebody access my
home page!!!!

What function can I use????

Thanks!!
Bruno.




Use the variable $REMOTE_ADDR.  It contains the request ip address.

Jason

----- Original Message ----- 
From: "Bruno Freire" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 19, 2001 12:34 PM
Subject: [PHP] Help!! IP functions!!!


> Hi!! 
> 
> My name is Bruno, From Brazil!!!
> 
> I need to know how can i discovery the ip address when somebody access my
> home page!!!!
> 
> What function can I use????
> 
> Thanks!!
> Bruno.
> 





Mensaje citado por: Bruno Freire <[EMAIL PROTECTED]>:

> Hi!! 
> 
> My name is Bruno, From Brazil!!!
> 
> I need to know how can i discovery the ip address when somebody access
> my
> home page!!!!
> 
> What function can I use????

Bruno, check the phpinfo() function, which will give you lots of information
about variables that are passed from the browser to the server.

I think that HTTP_SERVER_VARS["REMOTE_ADDR"] is what you're looking for.

Saludos... :-)

Martín Marqués




Yo! I was wandering if there is someway to change the setting whether cookies should 
be used or not when using session,  in the php code rather than in php.ini.

Thankful for answers
/Broder




Hi guys

I'faced a problem (and was said it is a common one) using php4 with Apache
1.3.12 under win98se

I'm using a form with an <input type="text" name="name">

The problem is that I cannot find the $name afterwards in the script. but I
can using $HTTP_POST_VARS["name"]

I have not this problem using Linux.

Any ideas how could I avoid this? Thank you

Ivo






Check your php.ini setting of "global_vars"

If you used that php.ini-optimized, well, that was one of the optimizations.

Turn it back on or switch to using $HTTP_POST_VARS['name'] everywhere.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: "Ivo Stoykov" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Monday, February 19, 2001 1:59 PM
Subject: [PHP] form's variable access problem


> Hi guys
>
> I'faced a problem (and was said it is a common one) using php4 with Apache
> 1.3.12 under win98se
>
> I'm using a form with an <input type="text" name="name">
>
> The problem is that I cannot find the $name afterwards in the script. but
I
> can using $HTTP_POST_VARS["name"]
>
> I have not this problem using Linux.
>
> Any ideas how could I avoid this? Thank you
>
> Ivo
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Hi

I wonder is there a debugging/tracing program for php? THank you

Ivo






> I wonder is there a debugging/tracing program for php? THank you

There are.
I prefer the Zend Debugger, but I'm biased. :-)
Take the IDE for a free test drive http://zend.com/store

Honestly, though, the other choices are about a year behind in the
development process as far as the actual debugging goes...

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






This is a function I use:


function DateDiff ($Date1, $Date2, $Period) {

/* expects dates in the format d/m/y - period can be one of 'd','w','y','m'
months are assumed to be 30 days and years 365.25 days This only works
provided that both dates are after 1970. Also only works for dates up to the year 2035 
ish
*/

 $Date1 = trim($Date1);
 $Date2 = trim($Date2);
 $Date1_array = explode("/", $Date1);
 $Date2_array = explode("/", $Date2);

 $Date1_Stamp = mktime(0,0,0,
(int)$Date1_array[1],(int)$Date1_array[0],(int)$Date1_array[2]);
 $Date2_Stamp = mktime(0,0,0,
(int)$Date2_array[1],(int)$Date2_array[0],(int)$Date2_array[2]);

 $Difference = $Date1_Stamp - $Date2_Stamp;

/* Difference is the number of seconds between each date negative if Date 2 > Date 1 */

 switch ($Period) {
 case "d":
  Return (int) ($Difference/(24*60*60));
  break;
 case "w":
  Return (int) ($Difference/(24*60*60*7));
  break;
 case "m":
  Return (int) ($Difference/(24*60*60*30));
  break;
 case "s":
  Return $Difference;
  break;
 case "y":
  Return (int) ($Difference/(24*60*60*365.25));
  break;
 default:
  Return 0;
 }

}

Phil Daintree






Hi! I´d like to run a script by typing the following line at the command
prompt:

php.exe -C myphp.ini -f c:\htdocs\mysite\myscript.php

This works fine, except it doesn't load any extensions (dlls), even if
myphp.ini is configured to do so. Therefore, It doesn't recognize functions
such as mysql_query(). (I'm using an NT platform).

Can any one help?

Thanks a lot.
Cheers, Diego.





> php.exe -C myphp.ini -f c:\htdocs\mysite\myscript.php
>
> This works fine, except it doesn't load any extensions (dlls), even if
> myphp.ini is configured to do so. Therefore, It doesn't recognize
functions
> such as mysql_query(). (I'm using an NT platform).
>
> Can any one help?

You want a lowercase -c there, not -C

Dunno if -c will make it load the extensions, but I'm pretty sure -C won't.

Try putting <?php phpinfo();?> into your myscript.php and see if it seems to
be catching other changes to myphp.ini file.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm






Thank you Tim and Richard. With your help I was able to figure out how to
get this script working as I intended.
Here's the code, in case anyone wants to do something similar in the future.
:-))

$pages=mysql_query("SELECT CP.page_id, pagename FROM cluster_pagetbl as CP,
pagetbl WHERE 
CP.cluster_id = '$id' AND CP.page_id=pagetbl.page_id order by page_id");

$pgids= array();

if (mysql_Numrows($pages)>0) {

        $prows=mysql_NumRows($pages);
        $i=0;
        while ($i<$prows){
 
//figure out how to get page ids into array
$pid= mysql_result($pages,$i, page_id);
$pagename =mysql_result($pages, $i, pagename);
 
 $pgids[$pid] = $pagename;

$i++;
}
}

//prints what is in the pgid array. 
foreach($pgids as $pid => $pagename){
 print $pid.' => '.$pagename.'<br>';
}

$query2=mysql_query("select page_id, pagename FROM 
pagetbl order by page_id");

$mpgids= array();

if (mysql_Numrows($query2)>0) {

        $numrows=mysql_NumRows($query2);
        $x=0;
        while ($x<$numrows){
                
$mpid=mysql_result($query2,$x, page_id);
$mpagename=mysql_result($query2,$x, pagename);

$mpgids[$mpid] = $mpagename;   
  
$x++;
}
}

//prints the checkboxes, compares pgids and mgids array
foreach ($mpgids as $mpid => $mpagename){
print '<input type=checkbox name=page_ids[] value="'.$mpid.'"';
if ($pgids[$mpid] == $mpgids[$mpid]){   print " checked"; }
print '>'.$mpagename;
}

//double check to see what values are in both arrays, then print it.
$diff = array_intersect($mpgids,$pgids);

foreach ($diff as $element){
print '<p>'.$element.'<br>';}




   I wanted to check with all of you before I report a bug.

Here is the problem:
I am attempting to access a OS2 server via ftp.  When I login on the
command line as anonymous to this server it does not require a password.
When I try to login via PHP (ftp_login) it requires that I use a password.
When I try to just put in just any password ftp_login comes back with a
login failed message.

here is the error:
Warning: ftp_login: User anonymous logged in. in /home/httpd/html/php/ftpget.php on 
line 15

You can see the message that the server is returning is saying that my login was ok 
but ftp_login does not return success.


If anyone has insight into this please let me know,


BEH





I get this error Parse error: parse error, expecting `']'' in
/************on this.

$Q= "Update $HTTP_POST_VARS[$keys[1]] Set $updateString Where $keys[0]
=$HTTP_POST_VARS[$keys[0]]";

all my brackets are closed
[EMAIL PROTECTED]







In article <96s2sj$46a$[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
("Mike") wrote:

> I get this error Parse error: parse error, expecting `']'' in
> /************on this.
> 
> $Q= "Update $HTTP_POST_VARS[$keys[1]] Set $updateString Where $keys[0]
> =$HTTP_POST_VARS[$keys[0]]";

Try:
$Q= "Update $HTTP_POST_VARS[$keys][1] Set $updateString Where $keys[0]
=$HTTP_POST_VARS[$keys][0]";

-- 
CC




I'm not sure why/when PHP doesn't like embedded [[]] but it doesn't
sometimes (always?).
You'll need to use a temp variable for $keys[1] and $keys[0] to put into
$HTTP_POST_VARS.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: "Mike" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Monday, February 19, 2001 3:23 PM
Subject: [PHP] String problem


> I get this error Parse error: parse error, expecting `']'' in
> /************on this.
>
> $Q= "Update $HTTP_POST_VARS[$keys[1]] Set $updateString Where $keys[0]
> =$HTTP_POST_VARS[$keys[0]]";
>
> all my brackets are closed
> [EMAIL PROTECTED]
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Why do a lot of people use libraries like PHPLib?

I find it a lot better to write my own basic functions.

Is it just the attitude "Someone else coded it already, why should I?"

- Kath




Mensaje citado por: Kath <[EMAIL PROTECTED]>:

> Why do a lot of people use libraries like PHPLib?
> 
> I find it a lot better to write my own basic functions.
> 
> Is it just the attitude "Someone else coded it already, why should I?"

Like some said to me "Don't re-invent the wheel"

Saludos... :-)





I don't exactly try to reinvent a new and better wheel... I just find that
writing my own libraries makes the site feel like it is more all mine.

- Kath


----- Original Message -----
From: "Martin A. Marques" <[EMAIL PROTECTED]>
To: "Kath" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Monday, February 19, 2001 4:59 PM
Subject: Re: [PHP] Libraries


> Mensaje citado por: Kath <[EMAIL PROTECTED]>:
>
> > Why do a lot of people use libraries like PHPLib?
> >
> > I find it a lot better to write my own basic functions.
> >
> > Is it just the attitude "Someone else coded it already, why should I?"
>
> Like some said to me "Don't re-invent the wheel"
>
> Saludos... :-)
>
>





Hey,

A while back someone posted a link to a page where you can enter a url and the
page returns the type of software the remote server is running.

Did anyone save that link?

Thanks,

Jeremy 




http://www.netcraft.com/whats/ ?

- Kath

----- Original Message -----
From: "Jeremy Bowen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 19, 2001 4:36 PM
Subject: [PHP] Determining what kind od software a remote server is running


> Hey,
>
> A while back someone posted a link to a page where you can enter a url and
the
> page returns the type of software the remote server is running.
>
> Did anyone save that link?
>
> Thanks,
>
> Jeremy
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





Why is this broken for BIGINTs?  Is there a good reason for it, or has no
one
simply fixed it...?

-Szii





Sorry, that should be "mysql_insert_id()"

-Szii

----- Original Message ----- 
From: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 19, 2001 2:06 PM
Subject: [PHP] mysql_last_id()


> Why is this broken for BIGINTs?  Is there a good reason for it, or has no
> one
> simply fixed it...?
> 
> -Szii
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]





I am attempting to compile PHP with Net-SNMP package from Sourceforge
(ucd-snmp-4.2.i386.rh6.2.tar.gz).
configure and make/make install work fine.

starting apache returns:
        Cannot load /usr/local/apache/libexec/libphp4.so into server:
libsnmp-0.4.2.so: cannot open shared object file: No such file or directory

What directory is it trying to load from, or what environment variable is it
referring to?  The file does exist under /usr/local/lib.

Redhat 6.2
Apache 1.3.17
PHP 4.0.4pl1
        --with-esoob
        --enable-ftp
        --with-xml
        --with-apxs
        --enable-track-vars
        --enable-force-cgi-redirect
        --with-mysql

Thanks.

Michael Geier
CDMSports Systems Administration
 EMail: [EMAIL PROTECTED]
 Phone: 314.991.1511 x 6505





Hello, I am just starting to use PHP.  I have been using PERL for quite some
time.  I was wondering if there is any specific FILE LOCKING I need to
implement to keep more than one person from altering a text file at the same
time.

For instance, in PERL, you use the flock command to set up an advisory file
lock.  Lets say that if I have a web page with a text based database, and
more than one person wants to write to the file at the same time.  In perl,
if you use flock(FILE, 2).  This causes person A to wait while person B
writes to the file.  flock(FILE, 8) unlocks the file.  Then person A is
allowed to write to the file.

Does the perl equivalent of flock happen automatically in PHP?

If not, how do you lock a file?

Is it an advisory lock, or will it cause an error if two people try to
access the same file at the same time for the same purpose (writing).

Thanks,


===========================
Matthew Toledo
FrogNet Design & Domain Management
[EMAIL PROTECTED]



--
PHP Language Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]







I have a mail script that works fine except that it does not send to the CC
in my header options... nor will it send to multiple addresses can some one
please give me some advice on this... I've looked in the php manual as well
as other web pages  but neither have an answer for me.

my code is below

Thanks in advance
Peter Houchin

/* recipients */

$address .= $email  ;//insert a comma after $ email to include another
address, email address taken from session varables

$date = date("D M d, Y ");

// Subject

$subject = "VFSA-eRentals Calculation Results";

//Body of email

$body = "Thank you $real_name ,\n
Company whom you are from:\t $company\n
Date of enquiry on \t $date\n
Your Customer type is:\t $custtype\n
Your Reference is:    \t $ref\n
Your Quote was for:   \t $equcost\n
Your Rental Monthly Figures are as follows:\n
\n 24 Months = $ $m2 \n 36 Months = $ $m3 \n 48 Months = $ $m4 \n
Your Quartly Figures are: \n
\n 24 Months = $ $q2  \n 36 Months = $ $q3 \n 48 Months = $ $q4 \n
\n\n\n\n
Thank you again from VFSA-eRentals";

//Where the email is from

//$from = "[EMAIL PROTECTED]";

$headers .= "From: VFSA-eRentals <[EMAIL PROTECTED]>\n";
$headers .= "X-Sender: <[EMAIL PROTECTED]>\n";
$headers .= "X-Mailer: PHP\n"; // mailer
$headers .= "X-Priority: 1\n"; // Urgent message!
$headers .= "Return-Path: <[EMAIL PROTECTED]>\n";  // Return
path for errors

/* If you want to send html mail, uncomment the following line */
//$headers .= "Content-Type: text/html; charset=iso-8859-1\n"; // Mime type

$headers .= "cc:[EMAIL PROTECTED],[EMAIL PROTECTED]\n"; // CC to


//send the email

$mailsend = mail("$address", "$subject", "$body.", "$headers \nContent-Type:
text/plain; charset=iso-8859-1\nContent-Transfer-Encoding: 8bit" );
print ("$mailsend");





We process a lot of documents, some text, some html,
etc. I need to be able to strip out all characters
below an ascii number and above an ascii number. 
Currently I check character by character, above or
below a particular number the character is deleted or
replaced in the new string. Anyone run across a
quicker way to do this in php3....I checked the usual
places and can't find anything or I missed
something.....any help appreciated


rm 

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/




SUBJECT: Getting values for posted form in HASH array rather than just
variables.

I've been using perl for a while and am just starting with PHP.  I like it.

Is there an array that holds all the information that was submitted via a
FORM post or get.

I know that PHP automatically creates variables that are named after the
name of the INPUT tag on the HTML form.  But what if I don't know what the
names of the input tags are?

Are they stored in a HASH array as well?

What is the name of the array?

I.E. in perl, if you use cgi-lib.pl, all the form elements are stored in a
HASH array called %in.  You don't need to know the names of the input tags
to get the data from them.

HTML HAS...
<input name="joe" type="text>
<input name="alice type="text>

PERL Example.
# library for handling CGI in
require 'cgi-lib.pl';

# get all the info from the form,
# put it in HASH array called %in
&ReadParse();

foreach $key (sort keys %in) {
    print $in{$key};
}

PHP EXAMPLE...
# is there a hash array equivalent of %in like in the perl above?



===========================
Matthew Toledo
FrogNet Design & Domain Management
[EMAIL PROTECTED]






Dear List,
I am trying to advise a client on the feasiblity of using php with an
external SQL server.  Has anyone had experience with this?  Pros?  Cons?

Kathleen





Use \r\n which is spec, and unfriendly mailers from Microsoft won't "embrace
and extend" enough to accept just \n which is Unix-standard.

What a surprise.

Oh -- it won't be HTML email.  For *that* you need to send mime attachments.
There are multiple functions to do this in code archives such as at Manuel
Lemos' site.  Note that many recipients delete HTML email unread.

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: "Joe Njeru" <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Monday, February 19, 2001 4:56 AM
Subject: [PHP] Mail function


> Hi,
> I am trying to send an email message using the mail() function. However
when
> I put new line breaks -> \n I get the following error
>     Warning: Server Error in d:/wwwroot/admin/userdetails.php on line 12
>
> But when I remove the newlines the function executes.
> What should I do to be able to send HTML mail with <br> or alternative to
\n
> .
>
> Thanks in advance,
> Joe Njeru
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





You would direct it to a PHP script the same way you would direct it to a
Perl (or any other) script.

In Un*x, that would be using "procmail" filters.

You now know as much as I do about it.

man procmail

--
Visit the Zend Store at http://www.zend.com/store/
Wanna help me out?  Like Music?  Buy a CD: http://l-i-e.com/artists.htm
Volunteer a little time: http://chatmusic.com/volunteer.htm
----- Original Message -----
From: <[EMAIL PROTECTED]>
Newsgroups: php.general
Sent: Monday, February 19, 2001 5:24 AM
Subject: [PHP] Directing Email to a script


> Hi,
>
> I`m sure its possible but I can`t find any info on it, anyone know of any
> source or tutorials etc about directing email to a PHP script.
>
> TIA
> Ade
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>





there was an awesome article on phpbuilder about buffering output,
controlling when things got to the browser... so that you could
set cookies/headers anywhere in your script (or, as he talks about,
gzip content on the fly beofre outputting it to the browser)

http://phpbuilder.com/columns/argerich20010125.php3

PS: for anyone who doesnt know about phpbuilder.com yet,
it is a very very good site, full of very very good information

> -----Original Message-----
> From: Kath [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 19, 2001 12:54
> To: Sascha Andres; [EMAIL PROTECTED]
> Subject: Re: [PHP] Session support in PHP
> 
> 
> Make sure there are no lines (except a <?php of course) above your
> session_start(), INCLUDING blank lines.
> 
> Example that will work:
> <?php
> session_start();
> ?>
> <HTML>
> yadda yadda yadda etc etc etc
> 
> Example that will not work:
> <?php
> 
> session_start();
> ?>
> <HTML>
> yadda yadda yadda etc etc
> 
> Hope this helps,
> Kath
> 
> ----- Original Message -----
> From: "Sascha Andres" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Monday, February 19, 2001 2:38 PM
> Subject: [PHP] Session support in PHP
> 
> 
> > hi,
> >
> > when doing a session_start() followed by session_register(...)
> > before the html header the first call stops with the error
> > 'html header already written'. how can i prevent the html header
> > to be written until the session_start() is called?
> > sascha
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 




At 05:53 PM 2/19/01 -0800, ..s.c.o.t.t.. wrote:
>there was an awesome article on phpbuilder about buffering output,
>controlling when things got to the browser... so that you could
>set cookies/headers anywhere in your script (or, as he talks about,
>gzip content on the fly beofre outputting it to the browser)

No longer necessary with the current release of Gzip
I have it up and running at http://www.dvanhorn.org
Nothing in the PHP code at all.

--
Dave's Engineering Page: http://www.dvanhorn.org
Where's dave? http://www.findu.com/cgi-bin/find.cgi?kc6ete-9






well, i agree about writing some of my own libraries.... it helps me
get to know the language and the features that i am using better.

Libraries are a "Good Thing", it's just that i've seen loads of people
ask questions (on other lists mostly, since im new here) about things
that they'd know about if they had rolled their own modules once
in a while.  personally, i feel that it's problematic when a person uses
another person's libraries/modules/code without really understanding
what the code does...



> -----Original Message-----
> From: Kath [mailto:[EMAIL PROTECTED]]
> Subject: Re: [PHP] Libraries
> 
> I don't exactly try to reinvent a new and better wheel... I just find that
> writing my own libraries makes the site feel like it is more all mine.
> 
> - Kath




Hi PHPers!

I'm doing a simple page build by:
- reading file.html into $string
- reading variables into $array

and then:
echo (strtr($string, $array);

The file.html held in $string contains some PHP <?php include("file.inc") ?>
and file.inc also has some PHP <?php echo("this is inside file.inc)"; ?>

I'm doing this to assemble the page via little 'modules'.

This is not working, e.g. the PHP in $string is not getting parsed by PHP
before being output to the browser, although I DO see the PHP in the
resultant page source...any ideas?

Any comments welcome!

regards,
jaxon





Hi guys, I'm having a problem with file uploads, and I can't seem to
fix it. I'm on IIS using php as an ISAPI module on NT4, and file uploads
seem to work, but $userfile does not exist. Any ideas on how I can
fix it?

userfile:\\php8
userfile_name:notes.txt 

Cheers,

Gfunk         -          http://www.gfunk007.com/

I sense much beer in you. Beer leads to intoxication, intoxication to
hangovers, and hangovers to... suffering.
  




Reply via email to