Re: [PHP] Newbie needs compile

2002-05-05 Thread Julian

> He did say he did /not/ want to invoke it from a browser :)
I didn't think that PHP could run w/o one though, so my idea was to use a
text browser, have it run the script, then exit out.  As I said, I was
probably wrong ;)
Sabre


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




php-general Digest 6 May 2002 06:27:45 -0000 Issue 1328

2002-05-05 Thread php-general-digest-help


php-general Digest 6 May 2002 06:27:45 - Issue 1328

Topics (messages 96166 through 96206):

Re: SSH
96166 by: Kyle Gibson
96187 by: Richard Archer
96188 by: Kyle Gibson

help!!!
96167 by: J. H.
96168 by: Austin Marshall
96171 by: George Nicolae
96174 by: John Holmes
96182 by: David Jackson

Re: PHP compared to JSP
96169 by: SP
96170 by: Dennis Moore
96176 by: Manuel Lemos

Re: function sql question
96172 by: John Holmes
96186 by: Richard Archer

Re: Please, can you help me?
96173 by: John Holmes
96194 by: David Freeman

Re: HTML to mysql - from msql to html
96175 by: Mantas Kriauciunas
96177 by: Jason Wong
96189 by: Miguel Cruz
96193 by: David Freeman
96200 by: Mantas Kriauciunas

Stuck using mail() in script with variable
96178 by: Cheyenne Vermeulen

Who's having a good hosting experience these days?
96179 by: Marcus James Christian
96180 by: Kyle Gibson
96192 by: David Freeman
96196 by: Justin French
96201 by: olinux

F/U on  sendmail return-path (not 4 newbies)
96181 by: Anthony Rodriguez

Re: Php Sessions
96183 by: Daniel Svanbäck
96184 by: Daniel Svanbäck

mail function
96185 by: Diana Castillo
96190 by: Austin Marshall

Re: replace question
96191 by: Miguel Cruz

Re: Tailing a log file {!?}
96195 by: .ben
96198 by: David Freeman
96203 by: Miguel Cruz

Register Globals workarounds
96197 by: Justin French
96205 by: Philip Olson

Re: Postnuke Anyone ?
96199 by: Ricardo Fitzgerald

Newbie needs compile
96202 by: Sogno Kahlenberg
96204 by: Julian
96206 by: Jason Wong

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

--- Begin Message ---

> Your ISP has safe mode turned on which means you cannot use backquotes. Read all 
> about it at http://www.php.net/manual/en/features.safe-mode.php.


I am my own ISP, techically.

In the php.ini file, safe mode is off. Which is why I am curious as to 
why this is occuring.

---
;
; Safe Mode
;
safe_mode = Off

---


-Kyle


--- End Message ---
--- Begin Message ---

At 2:29 PM -0400 5/5/02, Kyle Gibson wrote:

>In the php.ini file, safe mode is off. Which is why I am curious as to
>why this is occuring.

What does phpinfo() have to say about it?

 ...R.

--- End Message ---
--- Begin Message ---

> What does phpinfo() have to say about it?


It says that the Local Value is "on" but the master value is "off".


-Kyle



--- End Message ---
--- Begin Message ---

Can anyone here help me write a simple auto shop
scheduling program? Would really appreciate it if you
would help me out. 

Jane H. 

__
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

--- End Message ---
--- Begin Message ---

J. H. wrote:
> Can anyone here help me write a simple auto shop
> scheduling program? Would really appreciate it if you
> would help me out. 
> 
> Jane H. 
> 
> __
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com

Don't expect anyone to write your code for you.  If you come across a 
specific problem, then we may be able to help you.  If you want someone 
to write your code for you, money talks.  Hire someone.


--- End Message ---
--- Begin Message ---

If you find someone pls tell him to write for me a new portal with secure
user authentication and a webmail system with Oracle backend.
tanx.
--


Best regards,
George Nicolae
IT Manager
___
PaginiWeb.com  - Professional Web Design
www.PaginiWeb.com


"J. H." <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Can anyone here help me write a simple auto shop
> scheduling program? Would really appreciate it if you
> would help me out.
>
> Jane H.
>
> __
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com



--- End Message ---
--- Begin Message ---

And I need a PHP script to help me take over the world. It has to be
fewer than 666 lines and I don't have MySQL. Also, could you write the
PHP in ASP, please?

---John Holmes...

> -Original Message-
> From: George Nicolae [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, May 05, 2002 12:25 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: help!!!
> 
> If you find someone pls tell him to write for me a new portal with
secure
> user authentication and a webmail system with Oracle backend.
> tanx.
> --
> 
> 
> Best regards,
> G

Re: [PHP] Newbie needs compile

2002-05-05 Thread Jason Wong

On Monday 06 May 2002 13:59, Julian wrote:
> > I need to schedule to run a PHP script on server side, rather than invoke
> > it from browser. Is there any way to compile it to .exe so it can run on
> > Solaris/Apache environment?

Yes, full instructions in the manual.

> no such thing as .exe in Solaris ;)  just "chmod 755" a file and it will
> execute.
>
> > If yes, can you help me know how? Thanks a great deal!
>
> If you want to schedule something to run, say, every 5 minutes, then you
> add it to your cron jobs.  In FreeBSD, you have to edit /etc/crontab to do
> this, then restart cron.  Inorder to execute a PHP script like you
> want (and I could be way off on this one), I would install lynx and make
> cron call lynx with a link to your .php file.

He did say he did /not/ want to invoke it from a browser :)

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Beat your son every day; you may not know why, but he will.
*/

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




Re: [PHP] Register Globals workarounds

2002-05-05 Thread Philip Olson

> 2. use a .htaccess file to change register_globals for your 
> domain / dir, as long as your Apache config file allows it.
> http://www.php.net/manual/en/configuration.php

As Justin stated, doing this (use of .htaccess) is possible 
if your host allows it.  The following will work in 
.htaccess:

  php_flag register_globals on

> 3. (untested) use ini_set() to turn them back on at a 
> per-script or per-config file level.
> http://www.php.net/manual/en/function.ini-set.php

This will not work as expected, $_GET['foo'] will not 
be $foo with register_globals set via ini_set().

> 4. add this code to the top of your pages, or in a common 
> library of code / config file:
> 
>  foreach($GLOBALS as $key => $value)
> { $$key=$value; }
> ?>

This will not work, the whole point of register_globals is 
to register variables into the global scope, which is what 
$GLOBALS is.  You're also trying to rewrite a ton of variables, 
such as $_GET.  Not a good idea.  To see what I mean, try:

  print_r($GLOBALS);

Also note that $GLOBALS lives within $GLOBALS.  As do all 
the PHP variables.

> If you have this url: page.php?foo=bah, with register_globals off, 
> $foo will not be available in your script automatically, as it 
> was in older PHP versions.

Just to be clear to everyone, register_globals is a directive that 
can be set in php.ini any time, in any version of PHP.  Also read 
about the mysterious variables_order directive.

> Using the above code, we scroll through the $GLOBALS array, and for 
> each key (eg foo) we assign a var of the same name (eg $foo) and 
> assign it the matching value (eg $foo = "bah").

As stated above, this will not work.  register_globals = on will 
add 'foo' to $GLOBALS.

> I think foreach() was only available in newer versions of PHP 
> though sorry.

foreach has been around since PHP 4.0.0, see php.net/foreach 
for PHP 3 alternatives.

Now, to hack them old scripts to work, consider using either 
extract() and/or import_request_variables().  These will allow 
you to easily mimik register_globals at runtime.  I believe 
the following is a pretty good hack to get the job done:

Goal:  register a lot of variables into the global scope
order: gpcss (order of $types_to_register)

  $types_to_register = array('GET','POST','COOKIE','SESSION','SERVER');
  foreach ($types_to_register as $type) {
$arr = @${'HTTP_' . $type . '_VARS'};
if (@count($arr) > 0) {
  extract($arr, EXTR_OVERWRITE);
}
  }

Granted that it may not be identical to your register_globals, 
it may or may not be what you want so adjust accordingly.

I've posted a few related replies to this topic, see:

  Re: Using the new AUTOGLOBALS
http://marc.theaimsgroup.com/?l=php-general&m=101803683730027

  Re: tutorial on global variables
http://marc.theaimsgroup.com/?l=php-general&m=102036870428992


Regards,
Philip Olson




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




Re: [PHP] Newbie needs compile

2002-05-05 Thread Julian

> I need to schedule to run a PHP script on server side, rather than invoke it
> from browser. Is there any way to compile it to .exe so it can run on
> Solaris/Apache environment?
no such thing as .exe in Solaris ;)  just "chmod 755" a file and it will
execute.

> If yes, can you help me know how? Thanks a great deal!
If you want to schedule something to run, say, every 5 minutes, then you
add it to your cron jobs.  In FreeBSD, you have to edit /etc/crontab to do
this, then restart cron.  Inorder to execute a PHP script like you
want (and I could be way off on this one), I would install lynx and make
cron call lynx with a link to your .php file.

Sabre


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




RE: [PHP] Tailing a log file {!?}

2002-05-05 Thread Miguel Cruz

On Mon, 6 May 2002, .ben wrote:
> Is there a tail util for NT/W2K?

I suspect cygwin would include one.

miguel


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




[PHP] Newbie needs compile

2002-05-05 Thread Sogno Kahlenberg

Hi there,

I need to schedule to run a PHP script on server side, rather than invoke it 
from browser. Is there any way to compile it to .exe so it can run on 
Solaris/Apache environment? If yes, can you help me know how? Thanks a great 
deal!


_
Join the world’s largest e-mail service with MSN Hotmail. 
http://www.hotmail.com


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




Re: [PHP] Re: Who's having a good hosting experience these days?

2002-05-05 Thread olinux

php/mysql and tons of other features. The absolute
best control panel I have seen. (demo on their site).
Great support when needed as well.

http://www.websitesource.com

olinux

--- Kyle Gibson <[EMAIL PROTECTED]> wrote:
> > My clients aren't rich big money folks but I need
> a PHP capable host for
> > 
> > about $11ish or less a month.  Traffic is minimal,
> and like I say the
> > only tech support calls I've had to make this past
> year were when the
> > hosting service tweeked and freaked something thus
> messing it all up.
> 
> 
> http://solutions.plaguenet.com/
> 
> HTH
> 
> 
> -Kyle
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 


__
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

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




Re[3]: [PHP] HTML to mysql - from msql to html

2002-05-05 Thread Mantas Kriauciunas

Hey Miguel Cruz,

Got your email on:Sunday, May 05, 2002, 3:29:49 PM writing:

:
MC> On Sun, 5 May 2002, Mantas Kriauciunas wrote:
>> Hey PHP General List,
>> 
>> ok i solwed the problems with line breaks but i didn't use
>> nl12br() function. i did like this:
>> 
>> $newz = str_replace("\n","",$myrow[3]);
>> 
>> now i am having problems with spaces
>> 
>> text is:
>> ---
>> bla bla bla  foo
>> ---
>> 
>> and shows:
>> ---
>> bla bla bla foo
>> ---
>> 
>> what do i have to do to get all those spaces? as i understand(english
>> is weak) nl12br() is for breaks only. what about spaces?

MC> I think you're going to have a good time with . You could try
MC> swapping   for each space but they're sometimes wider than normal
MC> spaces and I suspect may have other weird side effects as well.

MC> As a print designer in a former life, by the way, the thought of you 
MC> trying to format something with spaces makes my skin crawl. But I'm trying 
MC> to keep my cool.

MC> miguel



:

well i thought that it would be good to do with spaces.. but when i
researched more..and thought more i decided to leave it alone ;) its
just simple thing...that does not nessasary need spaces :).. thanks
for help everyone..i realy appreciate it.

P.S bad english is also in my way trying to learn

:--:
Have A Nice Day! 
 Mantas Kriauciunas A.k.A mNTKz

Contacts:
[EMAIL PROTECTED]
Http://mntkz-hata.visiems.lt


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




[PHP] Re: Postnuke Anyone ?

2002-05-05 Thread Ricardo Fitzgerald

Kirk,

Thanx for your help, I've tried with another script and it worked, I
successfully retrieved variable content after issueing a POST, I had
to add my code after the heather code ---> 


>? footer code ?>

This code simply posts the form and uses javascript to validate form
contents before submit. But I still couldn't make my prior code to
work, because variable data is not outputed to mysql db, and I'm
getting parsing errors.

BTW is there a way to know the type of error code is producing ?

TIA 

Cheers,

Rick



Thanks for your help 


> Ricardo,
> I have noticed several things from just a quick look at your code:
> 
>  1. If your not able to post any data/receive any variables from your form
> when the submit button is clicked, you could have register_globals set to
> Off.  Here is a example form used for that situation:
> 
> '>
>   
> 
> Please note that I used $_SERVER instead of PHP_SELF alone, and note the use
> of the single quotes.  This is done when register_globals is turned off,
> which I have learned is the best way to write your scripts (thanks to the
> other guys & gals on this discussion board).
> 
> 2. Using
> if (isset($submit)) { stuff..}
> 
> is another thing i've been taught to do, rather than if($submit).
> 
> 3. You haven't given a variable name to your submit button:
> 
> 
> give the submit button a name="submit" and you will actually have a variable
> which your script can pick up.  Otherwise nothing will happen.
> 
> HTH,
> 
> -Kirk
> 
> "Ricardo Fitzgerald" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi,
> >
> > I've been unsuccesfully trying to add a php script to a postnuke menu.
> > What I did is a simple form, that connects to a mysql database, and
> > inserts data, then some data is retrieved to generate a page with
> > "Welcome $name $lastname ... and so on"
> > The problem is the script must be in the center and must include the
> > header, the footer and the left block, I don't understand many things
> > from the way postnuke works, and I couldn't display any variable
> > entered in the form, neither insert data into the db ...
> > I've tried with action="some.php" and action=;
> > so far I only got parsing errors.
> >
> > Any ideas ?
> >
> > Regards,
> >
> > Rick
> >
> >
> 
> 
> 

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




RE: [PHP] Tailing a log file {!?}

2002-05-05 Thread David Freeman


 > Is there a tail util for NT/W2K?

Almost certainly there will be a tool that will read the end of files.
The problem will be in what you want to look at.  If you want to look at
log files on NT/2K then, AFAIK, they aren't actually vanilla text files
so a tail util won't do the job.  I'm not actually sitting near an NT/2K
box at the moment so I can't check that for certain.

CYA, Dave



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




[PHP] Register Globals workarounds

2002-05-05 Thread Justin French

Hi all,

For those faced with the task of updating 100's or 1000's of pages that
assumed register_globals on, I've found a couple of solutions which can work
as a temporary solution whilst you re-engineer your pages (as I plan to do).

1. simple: ask your ISP to change php.ini :)

2. use a .htaccess file to change register_globals for your domain / dir, as
long as your Apache config file allows it.
http://www.php.net/manual/en/configuration.php

3. (untested) use ini_set() to turn them back on at a per-script or
per-config file level.
http://www.php.net/manual/en/function.ini-set.php

4. add this code to the top of your pages, or in a common library of code /
config file:

 $value)
{ $$key=$value; }
?>

If you have this url: page.php?foo=bah, with register_globals off, $foo will
not be available in your script automatically, as it was in older PHP
versions.

Using the above code, we scroll through the $GLOBALS array, and for each key
(eg foo) we assign a var of the same name (eg $foo) and assign it the
matching value (eg $foo = "bah").


The ultimate (secure) solution would be to get your code up to scratch with
the new set-up (and I plan to do this, ASAP), but I myself do not have time
for this, given that I have to update MANY sites within a short time frame,
and my ISP is planning a merge to the new version very soon.


I think foreach() was only available in newer versions of PHP though sorry.


Hope this helps.


Justin French

Creative Director
http://Indent.com.au





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




Re: [PHP] Who's having a good hosting experience these days?

2002-05-05 Thread Justin French

Cheap?
I've been with experthost.com for around 8 months, with very little to
complain about... I've got a reseller account with about 12 domains, so i'm
paying around US$6each, and I think the standard is US$15each for one, $10ea
for two, and then a sliding scale up to 25 domains @ $5ea or something.

It *shouldn't* be about the money, but I'm currently making a healthy profit
out of hosting some client domains under my account.


Reliable?
They have intelligent support staff on 24/7, and they've had one service
fallout in this time.  It was a biggie, and I had to reload some data from
my local copy, but I'd like to believe this was a one-off.


Fast?
The service seems fast (although I'm in Australia, so pings times are
affected by sheer distance).


Feature Rich?
50meg, 20POPs, redirects, groups, auto-responders, 2GB bandwidth, MySQL,
webmail, recent versions of Apache/MySQL/PHP, intelligent support staff, etc
etc.


I'm pretty happy.  Better still, they offer a free 1 month test account, so
you can try them for yourself.


Justin French

Creative Director
http://Indent.com.au






on 06/05/02 9:19 AM, David Freeman ([EMAIL PROTECTED]) wrote:

> 
>> My hosting service which WAS cool about 2 years ago has
>> grown into a bloated mess of zero logic.
> 
> Fast, Reliable, Cheap, Feature-Rich
> 
> Now pick any three.
> 
> In the end I guess you get what you pay for.  If you can only afford a
> lower price host then you only get lower value.
> 
> CYA, Dave
> 


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




RE: [PHP] Tailing a log file {!?}

2002-05-05 Thread .ben

Is there a tail util for NT/W2K?

 .b

> -Original Message-
> From: Dave Raven [mailto:[EMAIL PROTECTED]]
> Sent: 05 May 2002 10:33
> To: Liam MacKenzie; [EMAIL PROTECTED]; Tom Rogers
> Subject: Re: [PHP] Tailing a log file {!?}
>
>
> check directory rights.
>
> If need be, passwd the user and give it a shell.
> then try on the console as the webserver user
> to tail the file.
>
> - Original Message -
> From: "Liam MacKenzie" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>; "Tom Rogers" <[EMAIL PROTECTED]>
> Sent: Saturday, May 04, 2002 11:26 AM
> Subject: Re: [PHP] Tailing a log file {!?}
>
>
> > That doesn't work either!
> > Something's going on here...
> >
> >
> >
> > - Original Message -
> > From: "Tom Rogers" <[EMAIL PROTECTED]>
> > To: "Liam MacKenzie" <[EMAIL PROTECTED]>;
> > <[EMAIL PROTECTED]>
> > Sent: Sunday, May 05, 2002 6:49 PM
> > Subject: Re: [PHP] Tailing a log file {!?}
> >
> >
> > Hi
> > The following works for me, give it a try with the correct path.
> >
> >  > exec("tail -n 50 /usr/local/apache/logs/access_log",$result);
> > echo count($result)." results returned. ";
> > if(count($result) > 0){
> >  foreach($result as $line){
> >  echo $line."";
> >  }
> > }
> > ?>
> >
> > Tom
> >
> >
> > At 06:25 PM 4/05/2002, Liam MacKenzie wrote:
> > >$cmd = exec("tail -n $len /www/hosting/domains/lanolot/logs/$open",
> > >$result);
> > >
> > >echo "$cmd";
> > >
> > >Still returns nothing under the top text.
> > >
> > >All log files are chmodded 644 and are owned by the web server.
> > >The paths to the files are correct.
> > >
> > >I've run out of ideas  =(
> > >
> > >Thanks
> > >
> > >
> > >- Original Message -
> > >From: "Jason Wong" <[EMAIL PROTECTED]>
> > >To: <[EMAIL PROTECTED]>
> > >Sent: Sunday, May 05, 2002 6:22 PM
> > >Subject: Re: [PHP] Tailing a log file {!?}
> > >
> > >
> > >On Saturday 04 May 2002 16:09, Liam MacKenzie wrote:
> > > > Sorry, I should have included this in the first email...
> > >
> > >[snip]
> > >
> > > > When I call the page, I get the expected at the top:
> > > > Excecuting: tail -n 150 /www/hosting/domains/lanolot/logs/error.log
> > > > Displaying the last 150 lines of error.log...
> > > >
> > > > But there's nothing underneath it.
> > >
> > >1) Check that you have permissions to access the file
> > >2) Add a 'return_var' to your exec() call. And check what this
> contains.
> > >
> > >--
> > >Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> > >Open Source Software Systems Integrators
> > >* Web Design & Hosting * Internet & Intranet Applications Development *
> > >
> > >/*
> > >DeVries' Dilemma:
> > >If you hit two keys on the typewriter, the one you don't want
> > >hits the paper.
> > >*/
> > >
> > >--
> > >PHP General Mailing List (http://www.php.net/)
> > >To unsubscribe, visit: http://www.php.net/unsub.php
> > >
> > >
> > >
> > >
> > >
> > >
> > >--
> > >PHP General Mailing List (http://www.php.net/)
> > >To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




RE: [PHP] Please, can you help me?

2002-05-05 Thread David Freeman


 > I have a big problem and cannot find the answer anywhere, so 
 > please, help me if you can. When I use fwrite() function on 
 > webserver, it sometimes happens, that more then one user 
 > accesses the file and the result is, that the file is 
 > corrupted or truncated.

I suspect that flock() would be of use, consult the php manual for it's
use.

CYA, Dave



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




RE: Re[2]: [PHP] HTML to mysql - from msql to html

2002-05-05 Thread David Freeman


 > now i am having problems with spaces
 > 
 > text is:
 > ---
 > bla bla bla  foo
 > ---
 > 
 > and shows:
 > ---
 > bla bla bla foo
 > ---

Plain old HTML ignores white space.  You do understand this?  To include
what you want you'll need to substitute spaces for non-breaking spaces
( ) but I wouldn't advise it.  I'd be suggesting that if your
content requires such things that you reconsider how you are doing your
content.

CYA, Dave



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




RE: [PHP] Who's having a good hosting experience these days?

2002-05-05 Thread David Freeman


 > My hosting service which WAS cool about 2 years ago has 
 > grown into a bloated mess of zero logic.

Fast, Reliable, Cheap, Feature-Rich

Now pick any three.

In the end I guess you get what you pay for.  If you can only afford a
lower price host then you only get lower value.

CYA, Dave


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




Re: [PHP] replace question

2002-05-05 Thread Miguel Cruz

On Sun, 5 May 2002, Josh & Valerie McCormack wrote:
> I'm iterating through a CSV file pulling in rows as arrays with fgetcsv 
> and I'd like to search for patterns made up of the first two array items 
> of each row with a space between them in a text file, and make them into 
> links. I can't figure out how to do this, could someone help?

How about posting a sample row or two along with how you want the data to
appear after the transformation?

miguel


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




[PHP] Re: mail function

2002-05-05 Thread Austin Marshall

Diana Castillo wrote:
Diana Castillo wrote:
> Hi, if I use the mail function, as in :
> mail("[EMAIL PROTECTED]", "My Subject", "Line 1\nLine 2\nLine 3");
> The mail comes from "Webserver"  How can I change the from ?
> 
> 
> 
> 

Just as the manual says, the 4th parameter which is optional allows you 
to specify additional headers.

Try mail("[EMAIL PROTECTED]", "My Subject", "Line 1\nLine 2\nLine 
3","From: user@domain");



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




Re[2]: [PHP] HTML to mysql - from msql to html

2002-05-05 Thread Miguel Cruz

On Sun, 5 May 2002, Mantas Kriauciunas wrote:
> Hey PHP General List,
> 
> ok i solwed the problems with line breaks but i didn't use
> nl12br() function. i did like this:
> 
> $newz = str_replace("\n","",$myrow[3]);
> 
> now i am having problems with spaces
> 
> text is:
> ---
> bla bla bla  foo
> ---
> 
> and shows:
> ---
> bla bla bla foo
> ---
> 
> what do i have to do to get all those spaces? as i understand(english
> is weak) nl12br() is for breaks only. what about spaces?

I think you're going to have a good time with . You could try
swapping   for each space but they're sometimes wider than normal
spaces and I suspect may have other weird side effects as well.

As a print designer in a former life, by the way, the thought of you 
trying to format something with spaces makes my skin crawl. But I'm trying 
to keep my cool.

miguel


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




Re: [PHP] Re: SSH

2002-05-05 Thread Kyle Gibson

> What does phpinfo() have to say about it?


It says that the Local Value is "on" but the master value is "off".


-Kyle



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




Re: [PHP] Re: SSH

2002-05-05 Thread Richard Archer

At 2:29 PM -0400 5/5/02, Kyle Gibson wrote:

>In the php.ini file, safe mode is off. Which is why I am curious as to
>why this is occuring.

What does phpinfo() have to say about it?

 ...R.

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




Re: [PHP] function sql question

2002-05-05 Thread Richard Archer

At 6:34 PM +0200 5/5/02, John Fishworld wrote:

John,

Your mysql_db_query should contain either "DBWEB" (with
quotes) or $DBWEB (a var). Just DBWEB is an error.
Also, from the manual re: mysql_db_query
  Note:  This function has been deprecated since PHP 4.0.6.
  Do not use this function.
  Use mysql_select_db()  and mysql_query() instead.

Your SQL query is incorrect. The strings you use to identify
a column contain "_" instead of ".". Perhaps just an artifact
of your mailer, but the query as it is should be throwing
"unknown column t_city_name" errors. Try adding some "as"
clauses into your query to name these "virtual" columns.
Or replace the "_" with ".".

Hey, and it's nice to see a normalized database for a change :)

Your coding formatting style is likely to cause you problems.
You have (partially) indented the code the way you want to
behave logically, but your braces are all over the shop.

Try adopting one of the coding styles commonly in use and
that will almost certainly make your life easier. I use the
K&R "one true brace style" because I'm a C hacker from way
back, but you might like an extra line break before a "{".

As for this function, the first time through the loop,
unless the cityname is not "" you return 0. Since you test for
a blank cityname, I assume that's a possible return value from
the database. In this case you shouldn't return 0 then, but
instead loop though to the next result in the result set.


Try this:

function check_city_from_plz($str) {
// connect and select database
$city_query = "select distinct t_city.name AS t_city_name,
t_city.id_city AS t_city_id_city from
t_city,t_zipcodecity where
(t_city_id_city = t_zipcodecity_id_city) and
(t_zipcodecity.zipcode like '$str')";

$city_result = mysql_db_query(DBWEB, $city_query);

if ($city_result) {
while ($q = mysql_fetch_array($city_result)) {
$city_id = $q["t_city_id_city"];
$cityname = $q["t_city_name"];
if ($cityname != "") {
r["city_id"] = $city_id;
r["cityname"] = $cityname;
return $r;
} // close if
} // close while
// return 0 if no matches after iterating through data
return 0;
} //  close function


 ...R.

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




[PHP] mail function

2002-05-05 Thread Diana Castillo

Hi, if I use the mail function, as in :
mail("[EMAIL PROTECTED]", "My Subject", "Line 1\nLine 2\nLine 3");
The mail comes from "Webserver"  How can I change the from ?





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




[PHP] Re: Php Sessions

2002-05-05 Thread Daniel Svanbäck

I'm using winxp and php.. can this be the problem. I solved the problem by
donwgrade to php 4.1.0..



"Austin Marshall" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Daniel SvanbäCk wrote:
> > Hi
> >
> > I have a problem. I can't send the session_id to the next page. It
worked
> > before (when I had an old version of php, now I have 4.2.0). It can send
the
> > session_id() if it's a link, but not a header(). If it is a header I
have to
> > do this:
> >
> > define('MYSID', session_name().'='.session_id());
> > header('Location: ../index.php?'.zOLSID);
> >
> > Do I have to add this to every header()? Or is there a easyier way. I
have
> > global variables = on.
> >
> > //Daniel
> >
> >
>
> Straight from the manual at http://www.php.net/manual/en/ref.session.php
>
> PHP is capable of doing this transparently when compiled with
> --enable-trans-sid. If you enable this option, relative URIs will be
> changed to contain the session id automatically. Alternatively, you can
> use the constant SID which is defined, if the client did not send the
> appropriate cookie. SID is either of the form session_name=session_id or
> is an empty string.
>
> You probably didn't have --enable-trans-sid when you configured/compiled
PHP
>



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




[PHP] Re: help!!!

2002-05-05 Thread David Jackson

Jane --
Check http://www.freshmeat.net.
Keep in mind there's good and their simple.
Try searching on project, store, scheduler
also take a look at http://www.phprojetk.com ( or is it org).

HTH,
David

"J. H." wrote:
> 
> Can anyone here help me write a simple auto shop
> scheduling program? Would really appreciate it if you
> would help me out.
> 
> Jane H.
> 
> __
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com

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




[PHP] F/U on sendmail return-path (not 4 newbies)

2002-05-05 Thread Anthony Rodriguez

I've tried the "From" header (4th parameter) in mail().  It doesn't work.

My ISP does run Apache but I have no access to their files.

Thanks!
At 06:56 PM 5/3/2002 +0100, you wrote:
>On 3 May 2002 at 12:48, Anthony Rodriguez wrote:
> > PROBLEM
> >
> > When a php script uses mail() and sendmail, if the e-mail address is
> > not right, the e-mail is returned to the envelope sender (the hosting
> > provider), NOT to the "From", "Reply-To",  "Return-Path", or any other
> > additional headers included in mail().
> >
> > Apparently, this problem is faced by any user who utilizes a hosting
> > provider.
>
>The envelope address can be set on a per script basis by setting the 
>sendmail_from value
>using ini_set(). Alternatively, if you are using Apache, you can set it in 
>a .htaccess file.
>
>--
>Stuart


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




[PHP] Re: Who's having a good hosting experience these days?

2002-05-05 Thread Kyle Gibson

> My clients aren't rich big money folks but I need a PHP capable host for
> 
> about $11ish or less a month.  Traffic is minimal, and like I say the
> only tech support calls I've had to make this past year were when the
> hosting service tweeked and freaked something thus messing it all up.


http://solutions.plaguenet.com/

HTH


-Kyle


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




[PHP] Who's having a good hosting experience these days?

2002-05-05 Thread Marcus James Christian

Hello,

My hosting service which WAS cool about 2 years ago has grown into a
bloated mess of zero logic.

My clients are going nuts, I'm sick of having mistakes and problems
created by the hosting service be the only reason I have any problems to

deal with at all!!!

My clients aren't rich big money folks but I need a PHP capable host for

about $11ish or less a month.  Traffic is minimal, and like I say the
only tech support calls I've had to make this past year were when the
hosting service tweeked and freaked something thus messing it all up.

Thanks,
-Marcus

--
|||

Marcus Unlimited
http://marcusunlimited.com
Multimedia Internet Design and Education
|||

--
| Limited Time Offer!
| Download the Recordings of Chromaticus
| FREE! @ http://ampcast.com/chromaticus
| Complete song files and Sci-Fi Loops for
| programs like Reason, Flash, Premiere
| Logic, Cubase, Recycle, Acid, FruityLoops,
| and many, many, more!!!



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




[PHP] Stuck using mail() in script with variable

2002-05-05 Thread Cheyenne Vermeulen

Hi all!

I'm pretty green on this and i'm trying to create a form that sends a
authorization mail
using a few variable using the ()mail script.

I have all settings correct, added the smtp right, even tested it with the
following
scripts wich worked fine

""

and this one




When using the concerning script wich i copied below, it just doesnt send
the mail and
gives me the following error : "Warning: Server Error in x:\apache
group\apache\htdocs\php-pages\register.php on line 103"
It does in fact store the submitted data in the database so it is only the
mail that's given
me a headache!!! What is it i'm doing wrong? The error is in line:
mail($recipient, $subject, $message, $headers);


The source:



Inschrijven




  
  ";
 }
 if (strlen($ervaring)==0)
 {
 $fout.="Vul een geldige waarde in voor ervaring.";
 }
 if (strlen($nationaliteit)==0)
 {
 $fout.="Vul een geldige waarde in voor nationaliteit.";
 }
 if (strlen($naam)==0)
 {
 $fout.="Vul een geldige naam in.";
 }
 if (strlen($voornaam)==0)
 {
 $fout.="Vul een geldige voornaam in.";
 }
 if (strlen($adres)<7)
 {
 $fout.="Vul een geldig adres in.";
 }
 if (strlen($postcode)!=6)
 {
 $fout.="Vul een geldige postcode in.";
 }
 if (strlen($plaats)<5)
 {
 $fout.="Vul een geldige woonplaats in.";
 }
 if (strlen($tel)<10 || strlen($mobiel)<10)
 {
 $fout.="Een telefoonnummer bestaat uit minimaal 10 cijfers.";
 }

 if ($fout)
 {
 $fout.="Klik hier om de invoer te
verbeteren.";
 echo "FOUTE INVOER";
 echo $fout;
 }
 else
 {
 srand((double)microtime()*100);
 $mailcode= rand(1000,);
  if ($register=mysql_query("INSERT INTO TEST
VALUES('','$naam','$voornaam','$geslacht','$geboortedatum','$adres','$postco
de','$plaats','$tel','$mobiel','$email','$nationaliteit','$opleiding','$rijb
ewijzen','$cat1','$cat2','$cat3','$van','$tot','$ervaring','$info','$mailcod
e','0')"))
  {
  //variabalen declareren voor te versturen verificatie mail
  /* recipients */

  $recipient.= "$voornaam $naam  <$email>" ;

  /* subject */
  $subject= "E-mail verificatie TEST";

  /* message */
  $message.= "Beste ". $voornaam.",\n\n" ;
  $message.= "Je hebt je ingeschreven op de website van TEST.\n\n";
  $message.= "Om je inschrijving definitief te maken klik je op onderstaande
link.\n\n";
  $message.=
"http://notnamed.com/validate/validate.php?code=".$mailcode."\n\n";;
  $message.= "Staat je emailprogramma niet toe om email-links te volgen kun
je ook de volgende URL intypen:\n\n";
  $message.= "http://notnamed.com/validate/validate.php\n\n";;
  $message.= "Daar vul je dan de volgende code in:\n".$mailcode."\n\n";
  $message.= "Noteer deze persoonlijke code!\n".$mailcode."\n\n";
  $message.= "Deze code, samen met je emailadres geeft je de
mogelijkheid\n\n";
  $message.= "om te reageren op vacatures en je gegevens aan te
passen.\n\n";
  $message.= "Met vriendelijke groet,\n\TEST";

  $headers= "From: [EMAIL PROTECTED]>\n";
  $headers.= "X-Mailer: PHP\n"; // mailer
  $headers.= "Return-Path: <[EMAIL PROTECTED]>";  // Return path for errors

  mail($recipient, $subject, $message, $headers);

  echo "Uw gegevens zijn opgeslagen in het systeem.";
  echo "U heeft een e-mailbericht ontvangen met daarin verdere instructies
om de inschrijving definitief te maken.";
  echo "Pas als u die instructies heeft opgevolgd is uw inschrijving
definitief.";
  }
  else
  {
  echo "Er ging iets mis bij het invoeren in de
database.br>".mysql_error();
  }
 }

}
else{
?>


  

  Naam
  

  


  Voornaam
  

  


  Geslacht
  

Man

Vrouw 


  Geboortedatum
  

  
  
  
  
  


  
  
  
  
  


  
  
  
  
  

  


  Adres
  

  


  Postcode
  


  


  Woonplaats
  

  


  Nationaliteit
  

  


  Opleiding
  

  Laag
  Midden
  Hoog

  


  Rijbewijs
  

A

B

C 


  

D
  

E
  

  


  Telefoon
  

  


  Mobiel
  

  


  E-mailadres
  

  


  Beroepscategorie
  

  -- Keuze 1 --
  
  
  
  
  


  -- Keuze 2 --
  
  
  
  
  


  -- Keuze 3 --
  
  
  
  
  

  


  Ervaring
  

  


  Beschikbaar
  van

tot 
  

  
  
  
  

Re: Re[2]: [PHP] HTML to mysql - from msql to html

2002-05-05 Thread Jason Wong

On Monday 06 May 2002 06:01, Mantas Kriauciunas wrote:
> Hey PHP General List,
>
> ok i solwed the problems with line breaks but i didn't use
> nl12br() function. i did like this:
>
> $newz = str_replace("\n","",$myrow[3]);
>
> now i am having problems with spaces
>
> text is:
> ---
> bla bla bla  foo
> ---
>
> and shows:
> ---
> bla bla bla foo
> ---
>
> what do i have to do to get all those spaces? as i understand(english
> is weak) nl12br() is for breaks only. what about spaces?

replace the spaces with a non-breaking space:

  

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
It is a lesson which all history teaches wise men, to put trust in ideas,
and not in circumstances.
-- Emerson
*/

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




Re: [PHP] PHP compared to JSP

2002-05-05 Thread Manuel Lemos

Hello,

Sp wrote:
> Does anyone think caching should be built into php for it to edge out the 
>competition?
> (like what smarty is doing)
> 
> I mean a static page will always serve up faster then a dynamic one.  Also even if 
>you are
> getting 100 pages/sec on your database, you could cache it for 5 seconds and you 
>save 500
> accesses to your database.  Yeah the page would be at most 5 seconds old but no one 
>would
> know.

I have been doing that for quite some time and I can tell that it is not 
worthy to cache just database query results but rather the pages that 
are generated with the data that is returned with such queries.

For that I have developed of a robust class that caches pages in files 
while it prevents that concurrent accesses update the cache files 
simultaneously to prevent corrupting the cached data.

You may want to try getting it here:

http://www.phpclasses.org/browse.html/package/313.html

Regards,
Manuel Lemos


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




Re[2]: [PHP] HTML to mysql - from msql to html

2002-05-05 Thread Mantas Kriauciunas

Hey PHP General List,

ok i solwed the problems with line breaks but i didn't use
nl12br() function. i did like this:

$newz = str_replace("\n","",$myrow[3]);

now i am having problems with spaces

text is:
---
bla bla bla  foo
---

and shows:
---
bla bla bla foo
---

what do i have to do to get all those spaces? as i understand(english
is weak) nl12br() is for breaks only. what about spaces?

:
MC> On Sat, 4 May 2002, Mantas Kriauciunas wrote:
>>  I have hare a little problem. Well i have in the page 
>>  thingy and there i wrote text like that(between lines):
>> 
>>  --
>>  foo bar
>> 
>>  more foo bar
>>  --
>> 
>>  now i do msql_query("UPDATE."); and it sets into the
>>  database with just space. and when i take it out from database there
>>  is no empty line in the middle.

MC> View the source of the page displaying the retrieved data. If the text 
MC> displays on multiple lines there, then you just need to call nl2br() on 
MC> the string to convert internal line breaks to HTML breaks.

MC> If the text does not show line breaks in the source (or when you use the 
MC> mysql CLI to query), then you need to change the parameters of the 
MC> . Probably  but I'm not 100% sure offhand.

MC> miguel



:--:
Have A Nice Day! 
 Mantas Kriauciunas A.k.A mNTKz

Contacts:
[EMAIL PROTECTED]
Http://mntkz-hata.visiems.lt


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




RE: [PHP] Re: help!!!

2002-05-05 Thread John Holmes

And I need a PHP script to help me take over the world. It has to be
fewer than 666 lines and I don't have MySQL. Also, could you write the
PHP in ASP, please?

---John Holmes...

> -Original Message-
> From: George Nicolae [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, May 05, 2002 12:25 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: help!!!
> 
> If you find someone pls tell him to write for me a new portal with
secure
> user authentication and a webmail system with Oracle backend.
> tanx.
> --
> 
> 
> Best regards,
> George Nicolae
> IT Manager
> ___
> PaginiWeb.com  - Professional Web Design
> www.PaginiWeb.com
> 
> 
> "J. H." <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Can anyone here help me write a simple auto shop
> > scheduling program? Would really appreciate it if you
> > would help me out.
> >
> > Jane H.
> >
> > __
> > Do You Yahoo!?
> > Yahoo! Health - your guide to health and wellness
> > http://health.yahoo.com
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




RE: [PHP] Please, can you help me?

2002-05-05 Thread John Holmes

RTM... www.php.net/flock

---John Holmes...

> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, May 03, 2002 2:53 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Please, can you help me?
> 
> Hello!
> I have a big problem and cannot find the answer anywhere, so please,
> help me if you can. When I use fwrite() function on webserver, it
> sometimes happens, that more then one user accesses the file and the
> result is, that the file is corrupted or truncated. A good example of
> this problem is webpage access counter. I know, that I can use MySQL
> to count accesses, but on some servers I can't. When I have this
> counter as a file on my server and read/write into it, there's only a
> question of time, when it corrupts itself. Please, can you help me to
> solve this problem? I think, that the easiest solution should be to
> prevent more that one user to write to that file, but I have no idea,
> how to do this. Or is there any other way to prevent that files from
> their corruption? I'll be very happy, if you help me with this
> problem.
> Thank you in advance.
> Miloslav Dornak
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




RE: [PHP] function sql question

2002-05-05 Thread John Holmes

It will work; you're just doing something wrong. Do you want to fix it,
or keep doing it this way?

---John Holmes...

> -Original Message-
> From: John Fishworld [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, May 05, 2002 10:55 AM
> To: [EMAIL PROTECTED]; 'PHP-General'
> Subject: Re: [PHP] function sql question
> 
> duh !
> yeah that makes sense !
> but it doesn't work !
> I've no idea why but it refuses to give any information back !
> 
> I've managed to get round this by now no loger declaring it a function
> but just actually requiring it where i need it
> 
> require ("get_city_1.inc");
> print_r(array_values ($city));
> 
> I've also chopped the return part
> and just return the values
> 
>  $city[0] = $city_id;
>  $city_name[1] = $city_name;
> 
> Strange
> 
> 
> > >return 1;
> > >return $city_id;
> > >return $cityname;
> >
> > You can't return 3 values...try returning an array, instead.
> >
> > $ret[0] = $city_id;
> > $ret[1] = $cityname;
> > return $ret;
> >
> > or...
> >
> > $ret["City_ID"] = $city_id;
> > $ret["CityName"] = $cityname;
> > return $ret;
> >
> > ---John Holmes...
> >
> >
> 



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




[PHP] Re: help!!!

2002-05-05 Thread George Nicolae

If you find someone pls tell him to write for me a new portal with secure
user authentication and a webmail system with Oracle backend.
tanx.
--


Best regards,
George Nicolae
IT Manager
___
PaginiWeb.com  - Professional Web Design
www.PaginiWeb.com


"J. H." <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Can anyone here help me write a simple auto shop
> scheduling program? Would really appreciate it if you
> would help me out.
>
> Jane H.
>
> __
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com



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




Re: [PHP] PHP compared to JSP

2002-05-05 Thread Dennis Moore

Food for thought...

There are a lot of performance issues outside of PHP...

MySQL - version 4.0.x  supports caching...

Apache 2.0 -  is now threaded...

Memory is now cheap... Increase the server's memory

You may also want to consider Zends Optimizer and Accelerator if you need
additional boost in performance.  Or even write your appliation to generate
the HTML pages and place it in the cron job to keep the data refreshed...

Just my 2 cents...


- Original Message -
From: "SP" <[EMAIL PROTECTED]>
To: "Miguel Cruz" <[EMAIL PROTECTED]>; "Pag" <[EMAIL PROTECTED]>
Cc: "Luc Saint-Elie" <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Sunday, May 05, 2002 2:47 PM
Subject: RE: [PHP] PHP compared to JSP


> Does anyone think caching should be built into php for it to edge out the
competition?
> (like what smarty is doing)
>
> I mean a static page will always serve up faster then a dynamic one.  Also
even if you are
> getting 100 pages/sec on your database, you could cache it for 5 seconds
and you save 500
> accesses to your database.  Yeah the page would be at most 5 seconds old
but no one would
> know.
>
> Plus if you are a crappy programmer then it would mask how slow your code
is :-)
>
>
> -Original Message-
> From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
> Sent: May 5, 2002 3:01 AM
> To: Pag
> Cc: Luc Saint-Elie; [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP compared to JSP
>
>
> On Sat, 4 May 2002, Pag wrote:
> >> Does PHP compile : NO
> >> Does the user loading same page for 2nd time gets better response : YES
> >> it can if caching is provided
> >
> > On a side not..isnt caching a bit like going against why PHP was built
> > in the first place? I mean, information may get a bit out of date if we
> > get a page on the cache instead of getting it "fresh" from the server.
>
> Sometimes the developer knows how stale information can get before it
> needs to be refreshed. An awful lot of pages fetched with GET args are
> just straight-up retrievals from mostly-static databases, and can be
> cached with impunity.
>
> Also, there are other types of caching. On a multi-use machine that is
> busy with other stuff but not getting a lot of web traffic, httpd may have
> been paged out. And the PHP source file will be cached by the filesystem
> for a while after being read, saving subsequent repeat visits the delay of
> a disk operation.
>
> miguel
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




RE: [PHP] PHP compared to JSP

2002-05-05 Thread SP

Does anyone think caching should be built into php for it to edge out the competition?
(like what smarty is doing)

I mean a static page will always serve up faster then a dynamic one.  Also even if you 
are
getting 100 pages/sec on your database, you could cache it for 5 seconds and you save 
500
accesses to your database.  Yeah the page would be at most 5 seconds old but no one 
would
know.

Plus if you are a crappy programmer then it would mask how slow your code is :-)


-Original Message-
From: Miguel Cruz [mailto:[EMAIL PROTECTED]]
Sent: May 5, 2002 3:01 AM
To: Pag
Cc: Luc Saint-Elie; [EMAIL PROTECTED]
Subject: Re: [PHP] PHP compared to JSP


On Sat, 4 May 2002, Pag wrote:
>> Does PHP compile : NO
>> Does the user loading same page for 2nd time gets better response : YES
>> it can if caching is provided
>
> On a side not..isnt caching a bit like going against why PHP was built
> in the first place? I mean, information may get a bit out of date if we
> get a page on the cache instead of getting it "fresh" from the server.

Sometimes the developer knows how stale information can get before it
needs to be refreshed. An awful lot of pages fetched with GET args are
just straight-up retrievals from mostly-static databases, and can be
cached with impunity.

Also, there are other types of caching. On a multi-use machine that is
busy with other stuff but not getting a lot of web traffic, httpd may have
been paged out. And the PHP source file will be cached by the filesystem
for a while after being read, saving subsequent repeat visits the delay of
a disk operation.

miguel


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



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




[PHP] Re: help!!!

2002-05-05 Thread Austin Marshall

J. H. wrote:
> Can anyone here help me write a simple auto shop
> scheduling program? Would really appreciate it if you
> would help me out. 
> 
> Jane H. 
> 
> __
> Do You Yahoo!?
> Yahoo! Health - your guide to health and wellness
> http://health.yahoo.com

Don't expect anyone to write your code for you.  If you come across a 
specific problem, then we may be able to help you.  If you want someone 
to write your code for you, money talks.  Hire someone.


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




[PHP] help!!!

2002-05-05 Thread J. H.

Can anyone here help me write a simple auto shop
scheduling program? Would really appreciate it if you
would help me out. 

Jane H. 

__
Do You Yahoo!?
Yahoo! Health - your guide to health and wellness
http://health.yahoo.com

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




Re: [PHP] Re: SSH

2002-05-05 Thread Kyle Gibson

> Your ISP has safe mode turned on which means you cannot use backquotes. Read all 
> about it at http://www.php.net/manual/en/features.safe-mode.php.


I am my own ISP, techically.

In the php.ini file, safe mode is off. Which is why I am curious as to 
why this is occuring.

---
;
; Safe Mode
;
safe_mode = Off

---


-Kyle


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




php-general Digest 5 May 2002 18:24:02 -0000 Issue 1327

2002-05-05 Thread php-general-digest-help


php-general Digest 5 May 2002 18:24:02 - Issue 1327

Topics (messages 96113 through 96165):

Tailing Files
96113 by: Liam MacKenzie
96120 by: Miguel Cruz

Re: HTML to mysql - from msql to html
96114 by: Miguel Cruz

Re: Tailing a log file {!?}
96115 by: Tom Rogers
96125 by: Liam MacKenzie
96128 by: Jason Wong
96129 by: Liam MacKenzie
96130 by: Liam MacKenzie
96131 by: Jason Wong
96132 by: Liam MacKenzie
96133 by: Jason Wong
96134 by: Liam MacKenzie
96135 by: Tom Rogers
96136 by: Jason Wong
96137 by: Liam MacKenzie
96138 by: Dave Raven
96146 by: Richard Archer

Re: SSH
96116 by: Miguel Cruz
96144 by: Insomniac Admin
96150 by: Miguel Cruz
96164 by: Kyle Gibson
96165 by: Stuart Dallas

Re: Is  --enable-track-vars still needed?
96117 by: Miguel Cruz
96143 by: David J Jackson

Re: weird foreach problem when calling date or getdate function, variable does not 
change
96118 by: Miguel Cruz

Re: PHP compared to JSP
96119 by: Miguel Cruz

Defining PHP varibles from URL
96121 by: webmaster.tececo.com
96122 by: Miguel Cruz
96126 by: David Freeman
96140 by: Teemu Pentinsaari
96149 by: John Holmes
96151 by: Miguel Cruz

Re: weird foreach problem when calling date or getdate function,
96123 by: Kyle Gibson
96124 by: Miguel Cruz

Re: $HTTP_SERVER_VARS
96127 by: Mike Gohlke
96154 by: Kyle Gibson

Initializing a db $var and retrieving a required CONSTANT
96139 by: Dreamriver.com
96148 by: John Holmes

questions about a self-made mini chat
96141 by: The_RadiX

Mail server
96142 by: Diana Castillo
96145 by: Insomniac Admin
96152 by: Miguel Cruz

Download queueing
96147 by: Piotrek Szymañski

replace question
96153 by: Josh & Valerie McCormack
96156 by: John Holmes

function sql question
96155 by: John Fishworld
96157 by: John Holmes
96162 by: John Fishworld

Re: global variables
96158 by: Austin Marshall
96159 by: Austin Marshall

Re: Php Sessions
96160 by: Austin Marshall
96161 by: Austin Marshall

Please, can you help me?
96163 by: toycat.volny.cz

Administrivia:

To subscribe to the digest, e-mail:
[EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
[EMAIL PROTECTED]

To post to the list, e-mail:
[EMAIL PROTECTED]


--

--- Begin Message ---

Hi guys,

just a simple question, how would I go about displaying the last 100 lines
of a log file?
I know that on the command line it's:
tail -n 100 access_log

Is there a PHP function to do this?

Cheers,
Liam





--- End Message ---
--- Begin Message ---

On Sat, 4 May 2002, Liam MacKenzie wrote:
> just a simple question, how would I go about displaying the last 100 lines
> of a log file?
> I know that on the command line it's:
> tail -n 100 access_log
> 
> Is there a PHP function to do this?

Not that I know of, but the process is pretty simple. Seek to the end of 
the file, then read chunks backwards, spitting out a line each time you 
see a line break.

miguel


--- End Message ---
--- Begin Message ---

On Sat, 4 May 2002, Mantas Kriauciunas wrote:
>  I have hare a little problem. Well i have in the page 
>  thingy and there i wrote text like that(between lines):
> 
>  --
>  foo bar
> 
>  more foo bar
>  --
> 
>  now i do msql_query("UPDATE."); and it sets into the
>  database with just space. and when i take it out from database there
>  is no empty line in the middle.

View the source of the page displaying the retrieved data. If the text 
displays on multiple lines there, then you just need to call nl2br() on 
the string to convert internal line breaks to HTML breaks.

If the text does not show line breaks in the source (or when you use the 
mysql CLI to query), then you need to change the parameters of the 
. Probably  but I'm not 100% sure offhand.

miguel


--- End Message ---
--- Begin Message ---

Hi
You need
exec("tail -n 100 access_log",$result);
$result will be an array with the output of the command.
see http://www.php.net/manual/en/ref.exec.php
for more info
Tom



At 01:51 PM 4/05/2002, Liam MacKenzie wrote:
>Hi guys,
>
>just a simple question, how would I go about displaying the last 100 lines
>of a log file?
>I know that on the command line it's:
>tail -n 100 access_log
>
>Is there a PHP function to do this?
>
>Cheers,
>Liam
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---

OK, I did this and it does nothing but cause a loop and crash my browser...

";
}
?>

What's the problem with th

Re: [PHP] Re: SSH

2002-05-05 Thread Stuart Dallas

On 5 May 2002 at 14:12, Kyle Gibson wrote:
> Warning: Cannot execute using backquotes in safe mode in test.php on
> line 2

Your ISP has safe mode turned on which means you cannot use backquotes. Read all 
about it at http://www.php.net/manual/en/features.safe-mode.php.

-- 
Stuart

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




[PHP] Re: SSH

2002-05-05 Thread Kyle Gibson

I've tried this,



$cmd = `ftpwho`;
echo $cmd;

and/or

$cmd = shell_exec("ftpwho");
echo $cmd;




But I get this error:

Warning: Cannot execute using backquotes in safe mode in test.php on line 2



-Kyle


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




[PHP] Please, can you help me?

2002-05-05 Thread toycat

Hello!
I have a big problem and cannot find the answer anywhere, so please,
help me if you can. When I use fwrite() function on webserver, it
sometimes happens, that more then one user accesses the file and the
result is, that the file is corrupted or truncated. A good example of
this problem is webpage access counter. I know, that I can use MySQL
to count accesses, but on some servers I can't. When I have this
counter as a file on my server and read/write into it, there's only a
question of time, when it corrupts itself. Please, can you help me to
solve this problem? I think, that the easiest solution should be to
prevent more that one user to write to that file, but I have no idea,
how to do this. Or is there any other way to prevent that files from
their corruption? I'll be very happy, if you help me with this
problem.
Thank you in advance.
Miloslav Dornak

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




Re: [PHP] function sql question

2002-05-05 Thread John Fishworld

duh !
yeah that makes sense !
but it doesn't work !
I've no idea why but it refuses to give any information back !

I've managed to get round this by now no loger declaring it a function
but just actually requiring it where i need it

require ("get_city_1.inc");
print_r(array_values ($city));

I've also chopped the return part
and just return the values

 $city[0] = $city_id;
 $city_name[1] = $city_name;

Strange


> >return 1;
> >return $city_id;
> >return $cityname;
>
> You can't return 3 values...try returning an array, instead.
>
> $ret[0] = $city_id;
> $ret[1] = $cityname;
> return $ret;
>
> or...
>
> $ret["City_ID"] = $city_id;
> $ret["CityName"] = $cityname;
> return $ret;
>
> ---John Holmes...
>
>



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




[PHP] Re: Php Sessions

2002-05-05 Thread Austin Marshall

Daniel SvanbäCk wrote:
> Hi
> 
> I have a problem. I can't send the session_id to the next page. It worked
> before (when I had an old version of php, now I have 4.2.0). It can send the
> session_id() if it's a link, but not a header(). If it is a header I have to
> do this:
> 
> define('MYSID', session_name().'='.session_id());
> header('Location: ../index.php?'.zOLSID);
> 
> Do I have to add this to every header()? Or is there a easyier way. I have
> global variables = on.
> 
> //Daniel
> 
> 

Straight from the manual at http://www.php.net/manual/en/ref.session.php

PHP is capable of doing this transparently when compiled with 
--enable-trans-sid. If you enable this option, relative URIs will be 
changed to contain the session id automatically. Alternatively, you can 
use the constant SID which is defined, if the client did not send the 
appropriate cookie. SID is either of the form session_name=session_id or 
is an empty string.

You probably didn't have --enable-trans-sid when you configured/compiled PHP


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




Re: [PHP] global variables

2002-05-05 Thread Austin Marshall

Jule wrote:
> Hey,
> i'm just wondering if there is another way to write global variables to a 
> global.php, now i just the whole fopen etc script, where i open a file and 
> write the sctring $number_right = [whatever number it is] to the file, but is 
> there a different way to write it to the file with one simple command?
> 
> i could use cookies, but i prefer a simpler way.
> 
> thanks
> 
> Jule

At want point did you stop and think that it would be *easier* to write 
information to a file?  You could use cookies and should use cookies if 
your looking for a simpler way, sessions as well.

If you don't mind information not being around the next time the user 
returns (after closing his/her browser) you could write to the always 
global always available $_SESSION array. For example 
$_SESSION['foo']="bar"; and $_SESSION['bar']="foo";  It's not writing to 
a file, but is one simple command and the information you store will 
follow them anywhere within your site.

If you want save the information you could just as easily use $_COOKIES. 
  But would require that you use the setcookie command.


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




RE: [PHP] function sql question

2002-05-05 Thread John Holmes

>return 1;
>return $city_id;
>return $cityname;

You can't return 3 values...try returning an array, instead.

$ret[0] = $city_id;
$ret[1] = $cityname;
return $ret;

or...

$ret["City_ID"] = $city_id;
$ret["CityName"] = $cityname;
return $ret;

---John Holmes...


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




RE: [PHP] replace question

2002-05-05 Thread John Holmes

Are you having trouble pulling the data out of the file, or creating the
link? Do you want a link created for every row? What is the makeup of
the file? Is array[0] the URL, and array[1] the desription? If it's just
the link you need, that's easy...

echo "" . $array[1] . "";

---John Holmes...

> -Original Message-
> From: Josh & Valerie McCormack [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, May 05, 2002 8:23 AM
> To: PHP-General
> Subject: [PHP] replace question
> 
> I'm iterating through a CSV file pulling in rows as arrays with
fgetcsv
> and I'd like to search for patterns made up of the first two array
items
> of each row with a space between them in a text file, and make them
into
> links. I can't figure out how to do this, could someone help?
> 
> Josh
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




[PHP] function sql question

2002-05-05 Thread John Fishworld

I've got a small function which checks city name with post codes
And because this needs to be checked in several scripts I want to have it in
my common functions file
and include it !
  require ("common_funtions.inc");

and then use it
if (!check_city_from_plz($t_zipcode)){
echo  "Your city does not exist with the
plz!
";
}

It doesn't work though, I'm sure it something simple but can someone please
point me in the right direction !

This is the function itself

function check_city_from_plz($str) {
connect and select database
$city_query = "select distinct t_city_name,t_city_id_city from
t_city,t_zipcodecity where
(t_city_id_city = t_zipcodecity_id_city) and (t_zipcodecity_zipcode like
'$str')";

$city_result = mysql_db_query(DBWEB, $city_query);
if ($city_result) {
while ($q = mysql_fetch_array($city_result)) {
$city_id = $q["t_city_id_city"];
$cityname = $q["t_city_name"];

if ($cityname !="") {
   return 1;
   return $city_id;
   return $cityname;
   } else {
   return 0;
   }

   } // close if
   } // close while
   } //  close function

Thanks in advance !




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




Re: [PHP] $HTTP_SERVER_VARS

2002-05-05 Thread Kyle Gibson

> My last guess, was to turn off my Firewall (*Norton* Personal Firewall)
> and after that my PC returned a correct HTTP_REFERER!


Exactly what I did. Funky, huh?


Thanks,

Kyle Gibson


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




[PHP] replace question

2002-05-05 Thread Josh & Valerie McCormack

I'm iterating through a CSV file pulling in rows as arrays with fgetcsv 
and I'd like to search for patterns made up of the first two array items 
of each row with a space between them in a text file, and make them into 
links. I can't figure out how to do this, could someone help?

Josh


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




Re: [PHP] Mail server

2002-05-05 Thread Miguel Cruz

On Sun, 5 May 2002, Diana Castillo wrote:
> Does anyone know of a free mail server to install on a  linux server that
> works better than fmail?

Never heard of fmail, but qmail works a treat. Used by yahoo mail, etc. 
Fast and secure.

The place to talk about this stuff is the comp.mail.* newsgroup hierarchy.

miguel


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




Re: [PHP] Defining PHP varibles from URL

2002-05-05 Thread Miguel Cruz

On Sun, 5 May 2002, Teemu Pentinsaari wrote:
>>> It could be what I was typing in the url bar.
>>>
>>> file.php?file=foobar.inc
>>
>> 1) Try include $_GET['file'];
>>
>> 2) Let me know where your server is so I can go to
>>
>>http://your.server/file.php?file=/etc/passwd
> 
> You might want to use .php file extension and /include/ directory to prevent
> Miquel stealing your pressious passwords :))

http://your.server/file.php?file=../../../etc/passwd%00

miguel


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




RE: [PHP] RE: SSH

2002-05-05 Thread Miguel Cruz

Well, as described below, the key is read by a root-owned, sudo-gated
shell script which executes a specific remote command. And of course the
arguments, if any, are strictly sanitized by the shell script. So the
worst someone could do is cause the premature execution of that remote
command.

Also, I rarely if ever work on servers shared with untrusted users, which
changes the security situation somewhat. People in that situation are
going to have it much harder. But if PHP's in safe mode, they can use a
similar scheme but provide access to their individual user ID rather than
'nobody'.

miguel

On Sun, 5 May 2002, Insomniac Admin wrote:
> Wouldn't that be like very insecure? I wouldn't need to root the server
> in order to use that connection!
> 
> Example Scenario:
> 
> I generate a key pair from server local to server remote, and place the
> auth key in a 0400 moded file owned by root, but accessable by "nobody"
> (as this is the uid I will be sshing out as). Multiple people have
> access to write php scripts on this server.
> 
> Now *anyone* who is able to execute commands as "nobody" can (very very
> easily) get from server local to server remote without the need for a
> password to be entered.
> 
> Fair enough that they would need to know the address of server remote,
> and that they would never get the password - but they wouldn't need one
> either.
> 
> Just my PoV on security... You could always try investigating SSH
> wrappers.
> 
> - Dan
> 
> -Original Message-
> From: Miguel Cruz [mailto:[EMAIL PROTECTED]] 
> Sent: 05 May 2002 07:44
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] RE: SSH
> 
> 
> On Sun, 5 May 2002, Insomniac Admin wrote:
> > You could use "popen" to open a ssh process and wait to be asked for 
> > the password etc... Remember to check the RSA key pattern.
> 
> My experience, at least with recent SSH versions, is that they try very 
> hard to verify stdin is an actual pty before accepting a password from
> it. 
> This is specifically to stop people from storing passwords in cleartext.
> 
> However, you can do wonderful things with key pairs. Read all about 
> ssh-keygen.
> 
> We have servers that need to do things on other servers. We store the
> private keys in 0400 files owned by root, create root-owned shell
> scripts 
> to ssh into the remote servers and execute specific commands, and allow 
> the web server to run those with sudo. Not perfect, but reasonably
> secure 
> as long as nobody r00ts the web server.
> 
> miguel
> 
> 
> 


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




RE: [PHP] Defining PHP varibles from URL

2002-05-05 Thread John Holmes

> 
>   file.php?file=inc.foobar.php
>  -
>   include("include/$file");
> 

That doesn't fix anything...

file.php?file=../../../etc/passwd

Just a matter of a few tries to see how many directories you have to go
up...

---John Holmes...


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




RE: [PHP] Initializing a db $var and retrieving a required CONSTANT

2002-05-05 Thread John Holmes

Neither of those change. You don't have to use stripslashes() on
incoming DB data, unless magic_quotes_runtime is ON in php.ini.

---John Holmes...

> -Original Message-
> From: Dreamriver.com [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, May 05, 2002 2:33 AM
> To: [EMAIL PROTECTED]
> Cc: [EMAIL PROTECTED]
> Subject: [PHP] Initializing a db $var and retrieving a required
CONSTANT
> 
> 
> Hi Folks,
> Two questions:
> 
> 1) Initializing a db $var
> What's the best way to code $dbvar, which is coming from a database
query,
> given the new superglobals:
> 
> $data = mysql_fetch_array();
> $dbvar = stripslashes($data['someFieldName']);
> 
> Is there a newer or better way to initialize $dbvar?
> 
> 
> 2) retrieving a required CONSTANT
> If a CONSTANT is defined on foo.php and called with a
> require_once("foo.php") on another page called bar.php, then CONSTANT
is
> not global and is not called with the new supernotation, but rather
same
> as before:
> 
> $someVar = CONSTANT;
> 
> ... correct?
> 
> richard.
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



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




[PHP] Download queueing

2002-05-05 Thread Piotrek Szymański

Hi!

I'm writing a download queueing script, and it works quite well, except
for one thing: I'm unable to determine the amount of data actually transfered to the 
client.

The script sends a portion of a file (eg. 10 kb) and waits for a second, this
way achieving a transfer rate of 10 kb/s. The problem is that the client doesn't
necessarily have to receive the data as soon as the script sends it, because of
server buffering. Is there a way to determine how much data is still in the server's 
buffer?
Or maybe it is possible to determine if all the data outputted by the script has been
sent to the client?

I'm using PHP under Apache.

Regards,
Peter Szymański ([EMAIL PROTECTED])



Re: [PHP] Tailing a log file {!?}

2002-05-05 Thread Richard Archer

At 7:26 PM +1000 4/5/02, Liam MacKenzie wrote:
>That doesn't work either!
>Something's going on here...

Are you fully aware of the implications of safe mode?

Who owns the file you're trying to read?
Who owns the PHP script being executed?
What errors are you getting from the script?
What errors show up in the server logs?

 ...R.

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




RE: [PHP] Mail server

2002-05-05 Thread Insomniac Admin

Qmail : www.lifewithqmail.org / www.qmail.org / http://cr.yp.to/qmail/

-Original Message-
From: Diana Castillo [mailto:[EMAIL PROTECTED]] 
Sent: 05 May 2002 12:17
To: [EMAIL PROTECTED]
Subject: [PHP] Mail server


Does anyone know of a free mail server to install on a  linux server
that works better than fmail?



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



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




RE: [PHP] RE: SSH

2002-05-05 Thread Insomniac Admin

Wouldn't that be like very insecure? I wouldn't need to root the server
in order to use that connection!

Example Scenario:

I generate a key pair from server local to server remote, and place the
auth key in a 0400 moded file owned by root, but accessable by "nobody"
(as this is the uid I will be sshing out as). Multiple people have
access to write php scripts on this server.

Now *anyone* who is able to execute commands as "nobody" can (very very
easily) get from server local to server remote without the need for a
password to be entered.

Fair enough that they would need to know the address of server remote,
and that they would never get the password - but they wouldn't need one
either.

Just my PoV on security... You could always try investigating SSH
wrappers.

- Dan

-Original Message-
From: Miguel Cruz [mailto:[EMAIL PROTECTED]] 
Sent: 05 May 2002 07:44
To: [EMAIL PROTECTED]
Subject: Re: [PHP] RE: SSH


On Sun, 5 May 2002, Insomniac Admin wrote:
> You could use "popen" to open a ssh process and wait to be asked for 
> the password etc... Remember to check the RSA key pattern.

My experience, at least with recent SSH versions, is that they try very 
hard to verify stdin is an actual pty before accepting a password from
it. 
This is specifically to stop people from storing passwords in cleartext.

However, you can do wonderful things with key pairs. Read all about 
ssh-keygen.

We have servers that need to do things on other servers. We store the
private keys in 0400 files owned by root, create root-owned shell
scripts 
to ssh into the remote servers and execute specific commands, and allow 
the web server to run those with sudo. Not perfect, but reasonably
secure 
as long as nobody r00ts the web server.

miguel


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



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




Re: [PHP] Is --enable-track-vars still needed?

2002-05-05 Thread David J Jackson

Miguel Cruz wrote:
> On Sat, 4 May 2002, David Jackson wrote:
> 
>>Is I still recommended that config be run with the --enable-track-vars flag?
>>Or has this been deprieciated? Recently? Does the chagnes to global vars 
>>come in to play here?
> 
> 
> I believe that has had no effect (i.e., they were always enabled) for a 
> while now. In any case, no need these days.
> 
> miguel
> 

Migual --
Thanks for the clarification.

David


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




[PHP] Mail server

2002-05-05 Thread Diana Castillo

Does anyone know of a free mail server to install on a  linux server that
works better than fmail?



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




[PHP] questions about a self-made mini chat

2002-05-05 Thread The_RadiX

Try telling the frame (text one) to "go to" a location. instead of just
refreshing..


It may just work... :) I think that annoying click only occurs on
"refresh/reload" not actually going there..




:::
:  Julien Bonastre [The-Spectrum.org CEO]
:  A.K.A. The_RadiX
:  [EMAIL PROTECTED]
:  ABN: 64 235 749 494
:  QUT Student :: 04475739
:::
- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, May 05, 2002 12:18 AM
Subject: Re: [PHP] questions about a self-made mini chat


> On Saturday 04 May 2002 21:23, Duncan wrote:
> > Hi there,
> >
> > i have some questions to solve some problems, i recently encountered
with
> > my self made mini chat script.
> >
> > Ok, i use the meta-refresh in the main chat-messages frame to update the
> > frame every few seconds. In windows OS, you always get that "click"
sounds
> > whenever it refreshes the frame. Is there any way to stop this?
>
> That's an IE problem. Use Opera or Netscape if you don't want the click or
> see if there's an option in IE to disable the click.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> You can do very well in speculation where land or anything to do with dirt
> is concerned.
> */
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




Re: [PHP] Defining PHP varibles from URL

2002-05-05 Thread Teemu Pentinsaari

> > It could be what I was typing in the url bar.
> >
> > file.php?file=foobar.inc
>
> 1) Try include $_GET['file'];
>
> 2) Let me know where your server is so I can go to
>
>http://your.server/file.php?file=/etc/passwd
>
> miguel

You might want to use .php file extension and /include/ directory to prevent
Miquel stealing your pressious passwords :))

  file.php?file=inc.foobar.php
 -
  include("include/$file");


Just a thought :)))


Teemu





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




[PHP] Initializing a db $var and retrieving a required CONSTANT

2002-05-05 Thread Dreamriver.com


Hi Folks,
Two questions:

1) Initializing a db $var
What's the best way to code $dbvar, which is coming from a database query, given the 
new superglobals:

$data = mysql_fetch_array();
$dbvar = stripslashes($data['someFieldName']);

Is there a newer or better way to initialize $dbvar?


2) retrieving a required CONSTANT
If a CONSTANT is defined on foo.php and called with a require_once("foo.php") on 
another page called bar.php, then CONSTANT is not global and is not called with the 
new supernotation, but rather same as before:

$someVar = CONSTANT;

... correct?

richard.



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




Re: [PHP] Tailing a log file {!?}

2002-05-05 Thread Dave Raven

check directory rights.

If need be, passwd the user and give it a shell.
then try on the console as the webserver user
to tail the file.

- Original Message - 
From: "Liam MacKenzie" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>; "Tom Rogers" <[EMAIL PROTECTED]>
Sent: Saturday, May 04, 2002 11:26 AM
Subject: Re: [PHP] Tailing a log file {!?}


> That doesn't work either!
> Something's going on here...
> 
> 
> 
> - Original Message -
> From: "Tom Rogers" <[EMAIL PROTECTED]>
> To: "Liam MacKenzie" <[EMAIL PROTECTED]>;
> <[EMAIL PROTECTED]>
> Sent: Sunday, May 05, 2002 6:49 PM
> Subject: Re: [PHP] Tailing a log file {!?}
> 
> 
> Hi
> The following works for me, give it a try with the correct path.
> 
>  exec("tail -n 50 /usr/local/apache/logs/access_log",$result);
> echo count($result)." results returned. ";
> if(count($result) > 0){
>  foreach($result as $line){
>  echo $line."";
>  }
> }
> ?>
> 
> Tom
> 
> 
> At 06:25 PM 4/05/2002, Liam MacKenzie wrote:
> >$cmd = exec("tail -n $len /www/hosting/domains/lanolot/logs/$open",
> >$result);
> >
> >echo "$cmd";
> >
> >Still returns nothing under the top text.
> >
> >All log files are chmodded 644 and are owned by the web server.
> >The paths to the files are correct.
> >
> >I've run out of ideas  =(
> >
> >Thanks
> >
> >
> >- Original Message -
> >From: "Jason Wong" <[EMAIL PROTECTED]>
> >To: <[EMAIL PROTECTED]>
> >Sent: Sunday, May 05, 2002 6:22 PM
> >Subject: Re: [PHP] Tailing a log file {!?}
> >
> >
> >On Saturday 04 May 2002 16:09, Liam MacKenzie wrote:
> > > Sorry, I should have included this in the first email...
> >
> >[snip]
> >
> > > When I call the page, I get the expected at the top:
> > > Excecuting: tail -n 150 /www/hosting/domains/lanolot/logs/error.log
> > > Displaying the last 150 lines of error.log...
> > >
> > > But there's nothing underneath it.
> >
> >1) Check that you have permissions to access the file
> >2) Add a 'return_var' to your exec() call. And check what this contains.
> >
> >--
> >Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> >Open Source Software Systems Integrators
> >* Web Design & Hosting * Internet & Intranet Applications Development *
> >
> >/*
> >DeVries' Dilemma:
> >If you hit two keys on the typewriter, the one you don't want
> >hits the paper.
> >*/
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
> >
> >
> >
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


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




Re: [PHP] Tailing a log file {!?}

2002-05-05 Thread Liam MacKenzie

That doesn't work either!
Something's going on here...



- Original Message -
From: "Tom Rogers" <[EMAIL PROTECTED]>
To: "Liam MacKenzie" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Sunday, May 05, 2002 6:49 PM
Subject: Re: [PHP] Tailing a log file {!?}


Hi
The following works for me, give it a try with the correct path.

";
if(count($result) > 0){
 foreach($result as $line){
 echo $line."";
 }
}
?>

Tom


At 06:25 PM 4/05/2002, Liam MacKenzie wrote:
>$cmd = exec("tail -n $len /www/hosting/domains/lanolot/logs/$open",
>$result);
>
>echo "$cmd";
>
>Still returns nothing under the top text.
>
>All log files are chmodded 644 and are owned by the web server.
>The paths to the files are correct.
>
>I've run out of ideas  =(
>
>Thanks
>
>
>- Original Message -
>From: "Jason Wong" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Sunday, May 05, 2002 6:22 PM
>Subject: Re: [PHP] Tailing a log file {!?}
>
>
>On Saturday 04 May 2002 16:09, Liam MacKenzie wrote:
> > Sorry, I should have included this in the first email...
>
>[snip]
>
> > When I call the page, I get the expected at the top:
> > Excecuting: tail -n 150 /www/hosting/domains/lanolot/logs/error.log
> > Displaying the last 150 lines of error.log...
> >
> > But there's nothing underneath it.
>
>1) Check that you have permissions to access the file
>2) Add a 'return_var' to your exec() call. And check what this contains.
>
>--
>Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
>Open Source Software Systems Integrators
>* Web Design & Hosting * Internet & Intranet Applications Development *
>
>/*
>DeVries' Dilemma:
>If you hit two keys on the typewriter, the one you don't want
>hits the paper.
>*/
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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






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




Re: [PHP] Tailing a log file {!?}

2002-05-05 Thread Jason Wong

On Saturday 04 May 2002 16:43, Liam MacKenzie wrote:
> I have PHP's safe mode enabled, can't use backticks.
> And no I can't disable it, I'm hosting a few hundred sites  =)
>
> I looked up "return_var" in the manual and got nothing, had a read of
> return() but don't quite understand how that would benefit what's
> happening.
>
> Could you please give an example?

 ... read the manual entry for exec().

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
Absence is to love what wind is to fire.  It extinguishes the small,
it enkindles the great.
*/

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




Re: [PHP] Tailing a log file {!?}

2002-05-05 Thread Tom Rogers

Hi
The following works for me, give it a try with the correct path.

";
if(count($result) > 0){
 foreach($result as $line){
 echo $line."";
 }
}
?>

Tom


At 06:25 PM 4/05/2002, Liam MacKenzie wrote:
>$cmd = exec("tail -n $len /www/hosting/domains/lanolot/logs/$open",
>$result);
>
>echo "$cmd";
>
>Still returns nothing under the top text.
>
>All log files are chmodded 644 and are owned by the web server.
>The paths to the files are correct.
>
>I've run out of ideas  =(
>
>Thanks
>
>
>- Original Message -
>From: "Jason Wong" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Sent: Sunday, May 05, 2002 6:22 PM
>Subject: Re: [PHP] Tailing a log file {!?}
>
>
>On Saturday 04 May 2002 16:09, Liam MacKenzie wrote:
> > Sorry, I should have included this in the first email...
>
>[snip]
>
> > When I call the page, I get the expected at the top:
> > Excecuting: tail -n 150 /www/hosting/domains/lanolot/logs/error.log
> > Displaying the last 150 lines of error.log...
> >
> > But there's nothing underneath it.
>
>1) Check that you have permissions to access the file
>2) Add a 'return_var' to your exec() call. And check what this contains.
>
>--
>Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
>Open Source Software Systems Integrators
>* Web Design & Hosting * Internet & Intranet Applications Development *
>
>/*
>DeVries' Dilemma:
>If you hit two keys on the typewriter, the one you don't want
>hits the paper.
>*/
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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




Re: [PHP] Tailing a log file {!?}

2002-05-05 Thread Liam MacKenzie

I have PHP's safe mode enabled, can't use backticks.
And no I can't disable it, I'm hosting a few hundred sites  =)

I looked up "return_var" in the manual and got nothing, had a read of
return() but don't quite understand how that would benefit what's happening.

Could you please give an example?

Thanks!

Liam

- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, May 05, 2002 6:40 PM
Subject: Re: [PHP] Tailing a log file {!?}


On Saturday 04 May 2002 16:25, Liam MacKenzie wrote:
> $cmd = exec("tail -n $len /www/hosting/domains/lanolot/logs/$open",
> $result);
>
> echo "$cmd";
>
> Still returns nothing under the top text.
>
> All log files are chmodded 644 and are owned by the web server.
> The paths to the files are correct.

That's not what I meant by 'return_var', check the manual.

> I've run out of ideas  =(

I prefer something simpler than exec(), try:

  $output = `tail -n $len /www/hosting/domains/lanolot/logs/$open`;
  echo $output;

--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
This fortune is inoperative.  Please try another.
*/

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






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




Re: [PHP] Tailing a log file {!?}

2002-05-05 Thread Jason Wong

On Saturday 04 May 2002 16:25, Liam MacKenzie wrote:
> $cmd = exec("tail -n $len /www/hosting/domains/lanolot/logs/$open",
> $result);
>
> echo "$cmd";
>
> Still returns nothing under the top text.
>
> All log files are chmodded 644 and are owned by the web server.
> The paths to the files are correct.

That's not what I meant by 'return_var', check the manual.

> I've run out of ideas  =(

I prefer something simpler than exec(), try:

  $output = `tail -n $len /www/hosting/domains/lanolot/logs/$open`;
  echo $output;

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
This fortune is inoperative.  Please try another.
*/

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




Re: [PHP] Tailing a log file {!?}

2002-05-05 Thread Liam MacKenzie

$cmd = exec("tail -n $len /www/hosting/domains/lanolot/logs/$open",
$result);

echo "$cmd";

Still returns nothing under the top text.

All log files are chmodded 644 and are owned by the web server.
The paths to the files are correct.

I've run out of ideas  =(

Thanks


- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, May 05, 2002 6:22 PM
Subject: Re: [PHP] Tailing a log file {!?}


On Saturday 04 May 2002 16:09, Liam MacKenzie wrote:
> Sorry, I should have included this in the first email...

[snip]

> When I call the page, I get the expected at the top:
> Excecuting: tail -n 150 /www/hosting/domains/lanolot/logs/error.log
> Displaying the last 150 lines of error.log...
>
> But there's nothing underneath it.

1) Check that you have permissions to access the file
2) Add a 'return_var' to your exec() call. And check what this contains.

--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
DeVries' Dilemma:
If you hit two keys on the typewriter, the one you don't want
hits the paper.
*/

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






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




Re: [PHP] Tailing a log file {!?}

2002-05-05 Thread Jason Wong

On Saturday 04 May 2002 16:09, Liam MacKenzie wrote:
> Sorry, I should have included this in the first email...

[snip]

> When I call the page, I get the expected at the top:
> Excecuting: tail -n 150 /www/hosting/domains/lanolot/logs/error.log
> Displaying the last 150 lines of error.log...
>
> But there's nothing underneath it.

1) Check that you have permissions to access the file
2) Add a 'return_var' to your exec() call. And check what this contains.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
DeVries' Dilemma:
If you hit two keys on the typewriter, the one you don't want
hits the paper.
*/

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




Re: [PHP] Tailing a log file {!?}

2002-05-05 Thread Liam MacKenzie

Sorry, I should have included this in the first email...

Here's my full code.  Page is called like this:
log.php?open=access.log&len=150

=



Excecuting: tail -n $len
/www/hosting/domains/lanolot/logs/$open ";
echo "Displaying the last $len lines of
$open...";

exec("tail -n $len /www/hosting/domains/lanolot/logs/$open", $result);

  foreach ($result as $val) {
echo "$val";
  }

?>



=


When I call the page, I get the expected at the top:
Excecuting: tail -n 150 /www/hosting/domains/lanolot/logs/error.log
Displaying the last 150 lines of error.log...

But there's nothing underneath it.


Any help would be greatly appreciated.

Cheers,
Liam



- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, May 05, 2002 5:58 PM
Subject: Re: [PHP] Tailing a log file {!?}


On Saturday 04 May 2002 15:32, Liam MacKenzie wrote:
> OK, I did this and it does nothing but cause a loop and crash my
browser...
>
>  exec("tail -n 100 /www/logs/access.log",$result);
>
> for ($i=0; $i<$result; $i++)
> {
>   echo "$result";
> }
> ?>
>
> What's the problem with that?

An infinite loop most likely. Remember, $result is an array. Try:

  foreach ($result as $val) {
echo "$val";
  }

--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
This is National Non-Dairy Creamer Week.
*/

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






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




Re: [PHP] Tailing a log file {!?}

2002-05-05 Thread Liam MacKenzie

It returns nothing

It's got me stumped



- Original Message -
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, May 05, 2002 5:58 PM
Subject: Re: [PHP] Tailing a log file {!?}


On Saturday 04 May 2002 15:32, Liam MacKenzie wrote:
> OK, I did this and it does nothing but cause a loop and crash my
browser...
>
>  exec("tail -n 100 /www/logs/access.log",$result);
>
> for ($i=0; $i<$result; $i++)
> {
>   echo "$result";
> }
> ?>
>
> What's the problem with that?

An infinite loop most likely. Remember, $result is an array. Try:

  foreach ($result as $val) {
echo "$val";
  }

--
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
This is National Non-Dairy Creamer Week.
*/

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






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




Re: [PHP] Tailing a log file {!?}

2002-05-05 Thread Jason Wong

On Saturday 04 May 2002 15:32, Liam MacKenzie wrote:
> OK, I did this and it does nothing but cause a loop and crash my browser...
>
>  exec("tail -n 100 /www/logs/access.log",$result);
>
> for ($i=0; $i<$result; $i++)
> {
>   echo "$result";
> }
> ?>
>
> What's the problem with that?

An infinite loop most likely. Remember, $result is an array. Try:

  foreach ($result as $val) {
echo "$val";
  }

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *

/*
This is National Non-Dairy Creamer Week.
*/

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




Re: [PHP] $HTTP_SERVER_VARS

2002-05-05 Thread Mike Gohlke

Kyle,
Here's a quote I found on Usenet:
http://groups.google.com/groups?selm=aec2ace8.0204180402.4c562696%40posting.google.com&output=gplain

--- paste ---
I think I found out what this HTTP_WEFERER is all about...

I was working on a perl script having this problem. Some PCs (Client)
running that script returned a HTTP_WEFERER (my PC for example) and
some a correct HTTP_REFERER!

Changing OS, Provider, Browser... had no effect.

My last guess, was to turn off my Firewall (*Norton* Personal Firewall)
and after that my PC returned a correct HTTP_REFERER!

Seems to be the solution
--- end paste ---


Hope this helps,
Mike...

Kyle Gibson wrote:

> Whoops. It wont show unless you come from somewhere else...
>
>
> Go here and click the link:
>
> http://www.plaguenet.com/wreferer.php
>
>
> Thanks,
>
>
> Kyle Gibson
>
>
>





RE: [PHP] Defining PHP varibles from URL

2002-05-05 Thread David Freeman


-Original Message-

$file = "";
//the above is defined from the url
include "$file";

It could be what I was typing in the url bar.
file.php?file=foobar.inc
-Original Message-

Hmm, so you define $file in your url as "foobar.inc" and then, in the
page itself you take change $file to be "".

At least, that's how I'd read it.  I'd suggest, it's not an overly good
idea to include a file like this as someone else has already mentioned.

In any event, your fix would have to be something like this:



If (!isset($file) || empty($file))
{
  $file = "some file";
}
Include "$file" ;



That way you're only going to over-write the contents of $file if it's
already either unset or empty.

CYA, Dave



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




Re: [PHP] Tailing a log file {!?}

2002-05-05 Thread Liam MacKenzie

OK, I did this and it does nothing but cause a loop and crash my browser...

";
}
?>

What's the problem with that?

Cheers,
Liam


- Original Message -
From: "Tom Rogers" <[EMAIL PROTECTED]>
To: "Liam MacKenzie" <[EMAIL PROTECTED]>;
<[EMAIL PROTECTED]>
Sent: Sunday, May 05, 2002 4:35 PM
Subject: Re: [PHP] Tailing a log file {!?}


Hi
You need
exec("tail -n 100 access_log",$result);
$result will be an array with the output of the command.
see http://www.php.net/manual/en/ref.exec.php
for more info
Tom



At 01:51 PM 4/05/2002, Liam MacKenzie wrote:
>Hi guys,
>
>just a simple question, how would I go about displaying the last 100 lines
>of a log file?
>I know that on the command line it's:
>tail -n 100 access_log
>
>Is there a PHP function to do this?
>
>Cheers,
>Liam
>
>
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php


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






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