[PHP] E-mail account security warning.

2004-03-16 Thread management
Dear user  of e-mail server "Php.net",

Your  e-mail account will be disabled because of  improper using in next
three  days, if you are  still wishing to use  it, please, resign  your
account information.

For further details see the  attach.

In order to read the  attach you  have to use the following password:  85324.

The Management,
The  Php.net team  http://www.php.net

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

Re: [PHP] Re:

2004-03-16 Thread Red Wingate
[...]
> Why are so many people telling this poor person to escape their quotes?
> That WILL NOT WORK in HTML. The correct way to do this is to use
> htmlspecialchars() or htmlentities(). In fact, this should always be
> done on dynamic values in an input or any other HTML data that should be
> displayed literally, such as for within textareas.
[...]

Thanks, was just about to write that as i read all of these 'use escape-chars
in HTML'-guys.

   red

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



Re: [PHP] refresh page

2004-03-16 Thread apur kurub ver.1
using meta instead php



rgds
amdm
http://amadarum.e-tics.net/blogger

- Original Message - 
From: "Mike Mapsnac" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 17, 2004 8:55 AM
Subject: [PHP] refresh page


> Hello
> 
> I  need to refresh page every 2 minutes. How that's can be done in PHP?
> 
> THanks

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



RE: [PHP] Sessions

2004-03-16 Thread Will
It was a link problem!!! :)  DUH  What a dummy I am! :)

~WILL~

-Original Message-
From: John W. Holmes [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 16, 2004 11:38 PM
To: Will
Cc: [EMAIL PROTECTED]
Subject: Re: [PHP] Sessions

Will wrote:

> Hello All,
> I am having a problem.  When I log into a forum it says "Page Cannot
Be
> Displayed"  I looked at my logs and did not find anything.
> 
> I did a search everywhere and found nothing.

As did your web server, apparently. :)

So what page are you trying to load? It obviously doesn't exist. Your 
login script is probably trying to redirect you to a page that doesn't 
exist.

-- 
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals - www.phparch.com

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



Re: [PHP] Sessions

2004-03-16 Thread Chris Shiflett
--- Will <[EMAIL PROTECTED]> wrote:
> I am having a problem.  When I log into a forum it says "Page Cannot Be
> Displayed"  I looked at my logs and did not find anything.

Your immediate problem is that you're using IE. Use another browser, and
you should get a more informative error message.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] Sessions

2004-03-16 Thread John W. Holmes
Will wrote:

Hello All,
I am having a problem.  When I log into a forum it says "Page Cannot Be
Displayed"  I looked at my logs and did not find anything.
I did a search everywhere and found nothing.
As did your web server, apparently. :)

So what page are you trying to load? It obviously doesn't exist. Your 
login script is probably trying to redirect you to a page that doesn't 
exist.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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


[PHP] Sessions

2004-03-16 Thread Will
Hello All,
I am having a problem.  When I log into a forum it says "Page Cannot Be
Displayed"  I looked at my logs and did not find anything.

I did a search everywhere and found nothing.

Any help would be appreciated,
~WIIL~

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



Re: Re[2]: [PHP] Re: PHP Sessions - One Server, Many Terminals

2004-03-16 Thread Chris Shiflett
--- [EMAIL PROTECTED] wrote:
> Hmmm, I would contend that PHP, particularly running inside stateless 
> HTTP, doesn't know one client from another except by the code you write 
> that makes it recognize them

You're exactly right.

> if you had a way to set multiple cookies (easy) and to know which one
> you cared about on the next page load (harder, but at least it seems
> doable in the URL) then you can run multiple sessions.

Yeah, I think it's easier to manage this sort of thing by using some sort
of identifier in the URL, even if it's not the only one. No matter what,
this requires that some code be written.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] refresh page

2004-03-16 Thread trlists
On 16 Mar 2004 Jeff Oien wrote:

> You have to basically go back and forth between two pages.

The site you mentioned does, but it is easy to refresh to the same page 
-- just use your own URL.  An empty URL also works -- I tried it in IE 
6 and Mozilla 1.5; don't know if it works with other browsers.

--
Tom

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



Re: Re[2]: [PHP] Re: PHP Sessions - One Server, Many Terminals

2004-03-16 Thread trlists
On 17 Mar 2004 Tom Rogers wrote:

> The default lifetime for session cookies is until the browser is
> closed. 

Of course.  

> You can run multiple sessions as long as they are to different
> domains I think. I am pretty sure PHP can only handle 1 session per
> client but you could always roll your own on top of that with
> cookies/and or ID's 

Hmmm, I would contend that PHP, particularly running inside stateless 
HTTP, doesn't know one client from another except by the code you write 
that makes it recognize them, or that uses defaults to do so.  If you 
only look at the default $_COOKIE["PHPSESSID"] to figure out what 
session you are handling then you get one per client, but if you had a 
way to set multiple cookies (easy) and to know which one you cared 
about on the next page load (harder, but at least it seems doable in 
the URL) then you can run multiple sessions.  Maybe that's what you 
meant by "roll your own" ...

--
Tom

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



[PHP] [Newbie Guide] For the benefit of new members

2004-03-16 Thread Ma Siva Kumar
===
This message is for the benefit of new 
subscribers and those new to PHP.  Please 
feel free to add more points and send to the 
list.
===
1. If you have any queries/problems about PHP 
try http://www.php.net/manual/en first. You 
can download a copy and use it offline also. 

Please also try 
http://www.php.net/manual/faq.php 
for answers to frequently answered questions 
about PHP (added by Christophe Chisogne).

2. Try http://www.google.com next. Searching 
for "php YOUR QUERY" may fetch you relevant 
information within the first 10 results.

3. There is a searchable archive of the 
mailing list discussion at 
http://phparch.com/mailinglists. Many of the 
common topics are discussed repeatedly, and 
you may get answer to your query from the 
earlier discussions. 

For example: One of the repeatedly discussed 
question in the list is "Best PHP editor". 
Everyone has his/her favourite editor. 
You can get all the opinions by going through 
the list archives. If you want a chosen list 
try this link : 
http://phpeditors.linuxbackup.co.uk/ 
(contributed by Christophe Chisogne).

4. Not sure if PHP is working or you want 
find out what extensions are available to 
you?

Just put the following code into a file with 
a .php extension and access it through your 
webserver:

 

If PHP is installed you will see a page with 
a lot of information on it. If PHP is not 
installed (or not working correctly) your 
browser will try to download the file.

(contributed by Teren and reworded by Chris W 
Parker)

5. If you are stuck with a script and do not 
understand what is wrong, instead of posting 
the whole script, try doing some research 
yourself. One useful trick is to print 
the variable/sql query using print or echo 
command and check whether you get what you 
expected. 

After diagnosing the problem, send the 
details of your efforts (following steps 1, 
2 & 3) and ask for help.

6. PHP is a server side scripting language. 
Whatever processing PHP does takes place 
BEFORE the output reaches the client. 
Therefore, it is not possible to access 
users'  computer related information (OS, 
screen size etc) using PHP. Nor can you 
modify any the user side settings. You need 
to go for JavaScript and ask the question in 
a JavaScript list.

On the other hand, you can access the 
information that is SENT by the user's 
browser when a client requests a page from 
your server. You can find details about 
browser, OS etc as reported by 
this request. - contributed by Wouter van 
Vliet and reworded by Chris W Parker.

7. Provide a clear descriptive subject line. 
Avoid general subjects like "Help!!", "A 
Question" etc.  Especially avoid blank 
subjects. 

8. When you want to start a new topic, open a 
new mail composer and enter the mailing list 
address [EMAIL PROTECTED] instead of 
replying to an existing thread and replacing 
the subject and body with your message.

9. It's always a good idea to post back to 
the list once you've solved your problem. 
People usually add [SOLVED] to the subject 
line of their email when posting solutions. 
By posting your solution you're helping the 
next person with the same question. 
[contribued by Chris W Parker]

10. Ask smart questions  
http://catb.org/~esr/faqs/smart-questions.html
[contributed by Jay Blanchard)

Hope you have a good time programming with 
PHP.

Best regards,


-- 
Integrated Management Tools for leather 
industry
--
http://www.leatherlink.net

Ma Siva Kumar,
BSG LeatherLink (P) Ltd,
Chennai - 600106

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



Re: [PHP] refresh page

2004-03-16 Thread Chris Shiflett
--- Mike Mapsnac <[EMAIL PROTECTED]> wrote:
> I need to refresh page every 2 minutes. How that's can be done in PHP?

You can do this with a Refresh header:

header('Refresh: 120; url=http://www.example.org/');

Hope that helps.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



Re: [PHP] session problem (i think)

2004-03-16 Thread Nick Rout

On Wed, 17 Mar 2004 12:37:55 +1000
Tom Rogers <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> Wednesday, March 17, 2004, 12:24:27 PM, you wrote:
> NR> Thanks, it is set right, but I see some other things are not.
> NR> these other bits are set in a .htaccess file in the root of this
> NR> applications htdocs tree. When I execute a test.php file in the same
> NR> directory as the .htaccess file I presume the output of phpinfo() should
> NR> relect whats in the .htaccess file? If not, I assume I should be looking
> NR> in apache's config files at the AllowOveride stuff?
> NR> --
> NR> Nick Rout <[EMAIL PROTECTED]>
> 
> 
> Yes that is the next place to look

i added these lines to my apache config and restarted apache:


AllowOverride All


Still the specific settings in .htaccess don't get loaded. 

any other ideas?



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

-- 
Nick Rout <[EMAIL PROTECTED]>

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



Re[2]: [PHP] session problem (i think)

2004-03-16 Thread Tom Rogers
Hi,

Wednesday, March 17, 2004, 12:24:27 PM, you wrote:
NR> Thanks, it is set right, but I see some other things are not.
NR> these other bits are set in a .htaccess file in the root of this
NR> applications htdocs tree. When I execute a test.php file in the same
NR> directory as the .htaccess file I presume the output of phpinfo() should
NR> relect whats in the .htaccess file? If not, I assume I should be looking
NR> in apache's config files at the AllowOveride stuff?
NR> --
NR> Nick Rout <[EMAIL PROTECTED]>


Yes that is the next place to look

-- 
regards,
Tom

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



Re: [PHP] output buffering display handlers....

2004-03-16 Thread Tom Rogers
Hi,

Wednesday, March 17, 2004, 11:36:02 AM, you wrote:
P> Hi Folks,

P> I am trying to use outbuffering techniques

P> ob_start(myCallBack)
P> .
P> ob_end_flush()

P> function myCallBack($inBuffer)
P> {
P> //process
P> ob_start();
P> include "aPHPFile.php";
P> $includeFileContents = ob_get_contents();
P> ob_end_clean();
P> }

P> I am seeing the following error "Cannot use output buffering in output
P> buffering display handlers" ...is there an workaround of including this file
P> using the php engine or alternative solution of getting access to php
P> internal outbuffer inside an output handler callback...

P> Thanks


you could try something like this

ob_start(myCallBack)
.
.
ob_start();
include "aPHPFile.php";
$footer = ob_end_flush();
ob_end_flush()

function myCallBack($inBuffer)
{
//process
return $inbuffer.$GLOBALS['footer'];
}


Depends what you are trying to achieve over a simple include at the
end???
-- 
regards,
Tom

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



Re: [PHP] session problem (i think)

2004-03-16 Thread Nick Rout

On Wed, 17 Mar 2004 11:03:12 +1000
Tom Rogers <[EMAIL PROTECTED]> wrote:

> Hi,
> 
> Wednesday, March 17, 2004, 9:43:51 AM, you wrote:
> NR> I am running Apache/2.0.48 (Gentoo/Linux) mod_ssl/2.0.48 OpenSSL/0.9.6k PHP/4.3.4
> 
> NR> I have a drupal site set up, http://rout.dyndns.org/cagc
> 
> NR> Since some time on Sunday i have had the following error appear at the
> NR> bottom of the page:
> 
> NR> Warning: Unknown(): A session is active. You cannot change
> NR> the session module's ini settings at this time. in Unknown on line
> 
> NR> I then cannot login to the site. Some of the site functionality is there
> NR> (ie you can view the basic pages etc, but anything that needs a login to
> NR> acheive is no good)
> 
> NR> When I search google I seem to find that this is a php error, although I
> NR> cannot see a fix anywhere.
> 
> NR> Can anyone tell me where to look in order to sort this out. I am a php
> NR> newbie, so if there is any other info I need to provide please let me
> NR> know.
> NR> -- 
> NR> Nick Rout <[EMAIL PROTECTED]>
> 
> 
> Check in php.ini session.auto_start it should be off if you want your
> own session control.

Thanks, it is set right, but I see some other things are not. 

these other bits are set in a .htaccess file in the root of this
applications htdocs tree. When I execute a test.php file in the same
directory as the .htaccess file I presume the output of phpinfo() should
relect whats in the .htaccess file? If not, I assume I should be looking
in apache's config files at the AllowOveride stuff?

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

-- 
Nick Rout <[EMAIL PROTECTED]>

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



Re[2]: [PHP] Re: PHP Sessions - One Server, Many Terminals

2004-03-16 Thread Tom Rogers
Hi,

Wednesday, March 17, 2004, 11:28:04 AM, you wrote:
tcc> On 16 Mar 2004 [EMAIL PROTECTED] wrote:
tcc> I have had questions about this for a while.  What is it about closing
tcc> and reopening the browser that PHP "notices" and that invalidates the
tcc> old session?

tcc> Also a comment ... I think with the right combination of session_id()
tcc> and session_name() calls you should be able to run multiple sessions on
tcc> the same browser at the same time.  I have never tried it but I did
tcc> have a client with an interest in it and I looked enough to say "well,
tcc> I think this is feasible -- we'd have to try it to be sure".

tcc> --
tcc> Tom

The default lifetime for session cookies is until the browser is
closed. You can run multiple sessions as long as they are to different
domains I think. I am pretty sure PHP can only handle 1 session per
client but you could always roll your own on top of that with
cookies/and or ID's

-- 
regards,
Tom

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



Re: [PHP] refresh page

2004-03-16 Thread Mike Mapsnac
Can you show the code?
Thanks

From: Jeff Oien <[EMAIL PROTECTED]>
To: Mike Mapsnac <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
Subject: Re: [PHP] refresh page
Date: Tue, 16 Mar 2004 20:11:49 -0600
Mike Mapsnac wrote:

I  need to refresh page every 2 minutes. How that's can be done in PHP?
This would just be an HTML thing but if you want a user to specify
a page I've done it here:
http://www.ttrader.com/stockchat/refresh.html
You have to basically go back and forth between two pages.
Let me know if you want the code.
Jeff Oien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
_
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://clk.atdmt.com/AVE/go/onm00200415ave/direct/01/

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


[PHP] PHP list in Spanish

2004-03-16 Thread trlists
On 16 Mar 2004 Freddy Rodriguez wrote:

> Hay una lista en español para php?

(Is there a list in Spanish for PHP?)

Si hay.  Mira http://www.php.net/mailing-lists.php y
http://news.php.net/group.php?group=php.general.es.

(Yes there is.  See the two URLs above.)

--
Tom

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



Re: [PHP] refresh page

2004-03-16 Thread trlists
On 17 Mar 2004 Mike Mapsnac wrote:

> I  need to refresh page every 2 minutes. How that's can be done in
> PHP? 

You can do it with a header.  I think something this simple will work:

header("Refresh: 120");

or in the  area:

print "\n";

If you want to refresh to an explicit URL:

header("Refresh: 120; URL=http://...";);
print "http://...\";>\n";

--
Tom

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



Re: [PHP] refresh page

2004-03-16 Thread Jeff Oien
Mike Mapsnac wrote:

I  need to refresh page every 2 minutes. How that's can be done in PHP?
This would just be an HTML thing but if you want a user to specify
a page I've done it here:
http://www.ttrader.com/stockchat/refresh.html
You have to basically go back and forth between two pages.
Let me know if you want the code.
Jeff Oien
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] local (config) value not overriding master

2004-03-16 Thread Jason Wong
On Tuesday 16 March 2004 01:44, Fredrik de Vibe wrote:

> On the system I'm working on atm, php is set up with a non-modifiable
> php.ini, but I can make php config changes in httpd.conf. The changes
> I make are reflected in the "local value" row in the output from
> phpinfo() while the values from php.ini are in the "master value" row.
>
> This seemed to be working fine until I tried to override the
> disable_functions value. The master value has ini_set disabled, I have
> removed it from the local value's disabled_functions (phpinfo() agrees
> on this), but I still can't use ini_set (it is still disabled).
>
> I might be missing something important here (probably am), but I can't
> see why (tried googling and going through the docs, but I couldn't see
> any reference to this). Can anybody shed some light here?

Can't be done:

  manual > ini_set()

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
If Beethoven's Seventh Symphony is not by some means abridged, it will soon
fall into disuse.
-- Philip Hale, Boston music critic, 1837
*/

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



Re: [PHP] refresh page

2004-03-16 Thread Freddy Rodriguez
Hello

Hay una lista en español para php?

THanks

-Original Message-
From: Richard Davey <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Date: Wed, 17 Mar 2004 01:59:52 +
Subject: Re: [PHP] refresh page

> Hello Mike,
> 
> Wednesday, March 17, 2004, 1:55:51 AM, you wrote:
> 
> MM> I  need to refresh page every 2 minutes. How that's can be done in
> PHP?
> 
> PHP itself cannot do this. You can use PHP to output a meta refresh
> tag however which could be set to refresh every 2 minutes, understand
> it is the HTML that is refreshing the page though - not PHP.
> 
> -- 
> Best regards,
>  Richard Davey
>  http://www.phpcommunity.org/wiki/296.html
> 
> -- 
> 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] refresh page

2004-03-16 Thread Richard Davey
Hello Mike,

Wednesday, March 17, 2004, 1:55:51 AM, you wrote:

MM> I  need to refresh page every 2 minutes. How that's can be done in PHP?

PHP itself cannot do this. You can use PHP to output a meta refresh
tag however which could be set to refresh every 2 minutes, understand
it is the HTML that is refreshing the page though - not PHP.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] refresh page

2004-03-16 Thread Mike Mapsnac
Hello

I  need to refresh page every 2 minutes. How that's can be done in PHP?

THanks

_
FREE pop-up blocking with the new MSN Toolbar – get it now! 
http://clk.atdmt.com/AVE/go/onm00200415ave/direct/01/

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


Re: [PHP] creating a mailbot in php

2004-03-16 Thread Jason Wong
On Wednesday 17 March 2004 07:54, Leonard B Burton wrote:

> Would someone be so nice to send me the code to just get it to do something
> (like update a counter or anything) simple that I will be able to tell if
> the email is getting  to the script or not?
>
> My host has an option that allows you to easily make an alias [by way of an
> html form] that will send emails to certain files and I can not tell if it
> is not working or if my script is not working.  I have tried to read around
> and could not figure it out.  I wish I could RTFM but I cant find one.  The
> few pages I found on the net do not give a good enough explaination. 

Mail is usually passed to your program via STDIN, so:

  $STDIN   = fopen("php://stdin", "r");
  $doo = fread ($STDIN, 100);
  fclose($STDIN);
  echo $doo;

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
BAD CRAZINESS, MAN!!!
*/

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



[PHP] output buffering display handlers....

2004-03-16 Thread PHPGreen
Hi Folks,

I am trying to use outbuffering techniques

ob_start(myCallBack)
.
ob_end_flush()

function myCallBack($inBuffer)
{
//process
ob_start();
include "aPHPFile.php";
$includeFileContents = ob_get_contents();
ob_end_clean();
}

I am seeing the following error "Cannot use output buffering in output
buffering display handlers" ...is there an workaround of including this file
using the php engine or alternative solution of getting access to php
internal outbuffer inside an output handler callback...

Thanks

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



Re: [PHP] Re: PHP Sessions - One Server, Many Terminals

2004-03-16 Thread trlists
On 16 Mar 2004 [EMAIL PROTECTED] wrote:

> Sessions have to do with requests being sent by browsers to the web server. Each 
> time 
> you close all the windows of your browser on your computer and start the browser 
> again, a new session is started. I suspect that since all your users are essentially 
> using 
> the same web browser (since their monitors and keyboards are not really separate 
> computers, but peripherals on the same machine), a browser window open on one 
> terminal is keeping alive a session started by another user on another terminal when 
> she or he first started the browser. 

I have had questions about this for a while.  What is it about closing 
and reopening the browser that PHP "notices" and that invalidates the 
old session?

Also a comment ... I think with the right combination of session_id() 
and session_name() calls you should be able to run multiple sessions on 
the same browser at the same time.  I have never tried it but I did 
have a client with an interest in it and I looked enough to say "well, 
I think this is feasible -- we'd have to try it to be sure".

--
Tom

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



Re: [PHP] session problem (i think)

2004-03-16 Thread Tom Rogers
Hi,

Wednesday, March 17, 2004, 9:43:51 AM, you wrote:
NR> I am running Apache/2.0.48 (Gentoo/Linux) mod_ssl/2.0.48 OpenSSL/0.9.6k PHP/4.3.4

NR> I have a drupal site set up, http://rout.dyndns.org/cagc

NR> Since some time on Sunday i have had the following error appear at the
NR> bottom of the page:

NR> Warning: Unknown(): A session is active. You cannot change
NR> the session module's ini settings at this time. in Unknown on line

NR> I then cannot login to the site. Some of the site functionality is there
NR> (ie you can view the basic pages etc, but anything that needs a login to
NR> acheive is no good)

NR> When I search google I seem to find that this is a php error, although I
NR> cannot see a fix anywhere.

NR> Can anyone tell me where to look in order to sort this out. I am a php
NR> newbie, so if there is any other info I need to provide please let me
NR> know.
NR> -- 
NR> Nick Rout <[EMAIL PROTECTED]>


Check in php.ini session.auto_start it should be off if you want your
own session control.

-- 
regards,
Tom

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



RE: [PHP]

2004-03-16 Thread Vail, Warren
I caught that one about 10 seconds after pressing the send button.  Guess
nothing gets by you guys.

Warren Vail


-Original Message-
From: Chris Shiflett [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 16, 2004 3:46 PM
To: Vail, Warren; 'Chris W. Parker'; James E Hicks III;
[EMAIL PROTECTED]
Subject: RE: [PHP] 


--- "Vail, Warren" <[EMAIL PROTECTED]> wrote:
> Ahh, because it's raw html and not in php.
> 
> one choice would be to encapsulate it within php
> 
>  this to work?\", with a frown";?>" size="50">

The problem with this is that PHP is server-side, so the following is sent
to the browser:



Thus, the same problem exists on the client-side, because the output is
identical.

To reiterate what others have stated, escaping quotes is good for PHP, and
HTML entities are good for HTML.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



[PHP] creating a mailbot in php

2004-03-16 Thread Leonard B Burton
Greetings,

I have been trying to come up with a script in PHP to take an email and do a little 
parsing and upload the data into a mysql database.  However I have had a couple of 
glitches.

Would someone be so nice to send me the code to just get it to do something (like 
update a counter or anything) simple that I will be able to tell if the email is 
getting  to the script or not?

My host has an option that allows you to easily make an alias [by way of an html form] 
that will send emails to certain files and I can not tell if it is not working or if 
my script is not working.  I have tried to read around and could not figure it out.  I 
wish I could RTFM but I cant find one.  The few pages I found on the net do not give a 
good enough explaination.  Thanks,

Leonard Burton
Wilmington, NC
[EMAIL PROTECTED]

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



RE: [PHP]

2004-03-16 Thread Chris Shiflett
--- "Vail, Warren" <[EMAIL PROTECTED]> wrote:
> Ahh, because it's raw html and not in php.
> 
> one choice would be to encapsulate it within php
> 
>  this to work?\", with a frown";?>" size="50">

The problem with this is that PHP is server-side, so the following is sent
to the browser:



Thus, the same problem exists on the client-side, because the output is
identical.

To reiterate what others have stated, escaping quotes is good for PHP, and
HTML entities are good for HTML.

Chris

=
Chris Shiflett - http://shiflett.org/

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/

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



[PHP] session problem (i think)

2004-03-16 Thread Nick Rout
I am running Apache/2.0.48 (Gentoo/Linux) mod_ssl/2.0.48 OpenSSL/0.9.6k PHP/4.3.4

I have a drupal site set up, http://rout.dyndns.org/cagc

Since some time on Sunday i have had the following error appear at the
bottom of the page:

Warning: Unknown(): A session is active. You cannot change the session module's ini 
settings at this time. in Unknown on line 0

I then cannot login to the site. Some of the site functionality is there
(ie you can view the basic pages etc, but anything that needs a login to
acheive is no good)

When I search google I seem to find that this is a php error, although I
cannot see a fix anywhere.

Can anyone tell me where to look in order to sort this out. I am a php
newbie, so if there is any other info I need to provide please let me
know.
-- 
Nick Rout <[EMAIL PROTECTED]>

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



[PHP] File Upload problems

2004-03-16 Thread Bruno Santos
Can someone tell me why this is happening ?

i've tryed everything, since changing file, directory permissions, 
owner, etc 

i upload a file and, i give this erros

someone has any ideia ???

File Type: text/plain

*Warning*: move_uploaded_file(teste.txt): failed to open stream: 
Permission denied in 
*/usr/local/apache2/htdocs/projecto/examples/upload.php* on line *51*

*Warning*: move_uploaded_file(): Unable to move '/tmp/phpXBWdts' to 
'teste.txt' in */usr/local/apache2/htdocs/projecto/examples/upload.php* 
on line *51*
Could not move file to destination directory

Cheers,

Bruno Santos

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


Re: [PHP] Efficieny: Include vs Array vs Function

2004-03-16 Thread Rob Paxon
Jason Sheets wrote:
Sometimes having less included files with more content is more efficient
than having a lot of small files [...]
I'd think in my case, this is true.  Generally, nothing is in these main 
include files that aren't needed by every page.

I'd suggest profiling your code, use the PEAR Benchmark class and use PHP's
memory usage functions to determine what parts of your code are consuming
the most resources and taking the longest amount of time to execute, then
try some experiments and profile each experiment to determine the most
efficient solution.
Profiling is something I've been doing a lot of in the past week or so, 
via various debuggers.  I wasn't aware of a PEAR Benchmarking class, 
I'll have to check it out.

In my commericial websites I have modified my application framework not to
connect to the database, start output buffering, start the session and do
other overhead if specific constants are declared.  For example if I have
contact.php that does some mailing stuff and requires Smarty I can define
TEMPLATE_ONLY and only templating related files will be included and
initialized.
Doing this optmization made pages roughly 50% faster that did not require
session or a database connection and also reduces the load on the sql server
because you are not connecting unless you actually need the connection and
still benefit from having a single connection call instead of connecting in
each function or file.
I have done similar things.  For instance, sessions are only useful to 
me for people who are actually logged in, so I recently dumped my custom 
PHP sessions handler and made my own session system.  It takes a lot 
less code than my handler and only connects to the database if the user 
sends over a session id.  The database connection is then closed if the 
proceeding script doesn't need it or it is opened later if needed, in 
the case of no session.  It creates a session only through the log-in 
script.  This way, sessions are only created and read for those who 
choose to log in, which is obviously far, far less than %50 of visitors. 
 In the end, it works out to the database only being opened when needed 
and I've found this to make dramatic difference, even on my sorry old 
local enviroment.

I'm glad to see this topic got so many different responses.

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


[PHP] Re: $_FILE

2004-03-16 Thread Luis Mirabal
it is not $_FILE, it is $_FILES :P

luis.

"Bruno Santos" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> Hello.
>
> I've read in a book that we can access several file properties (when
> uploading a file) in two ways:
>
> 1st with the array $_FILE
> 2nd with $HTTP_POST_FILES
>
> i've used the 1st, but my program give many erros, and when using the
> 2nd, everything was fine.
>
> the 1st is avaiable from PHP 4.1.0, and im using PHP 4.3.4.
> Can someone tell me why does not work ???
>
> cheers
>
> --
> -
>.-'-.
>  .' `.
> : :
>:   :
>:  _/|  :   Bruno Santos
> :   =/_/  : [EMAIL PROTECTED]
>  `._/ | .'
>   (   /  ,|...-'Pagina Pessoal
>\_/^\/||__   http://feiticeir0.no-ip.org
> _/~  `""~`"` \_
>  __/  -'/  `-._ `\_\__
>/jgs  /-'`  `\   \  \-.\
>
>
>"Written very small on the back poket of a girl's jeans
>- 'If you can read this, you're WAY too close.'"

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



[PHP] $_FILE

2004-03-16 Thread Bruno Santos
Hello.

   I've read in a book that we can access several file properties (when 
uploading a file) in two ways:

1st with the array $_FILE
2nd with $HTTP_POST_FILES
i've used the 1st, but my program give many erros, and when using the 
2nd, everything was fine.

the 1st is avaiable from PHP 4.1.0, and im using PHP 4.3.4.
Can someone tell me why does not work ???
cheers

--
-
   .-'-.
.' `.
   : :
  :   :
  :  _/|  :   Bruno Santos
   :   =/_/  : [EMAIL PROTECTED]
`._/ | .'
 (   /  ,|...-'Pagina Pessoal
  \_/^\/||__   http://feiticeir0.no-ip.org
   _/~  `""~`"` \_
__/  -'/  `-._ `\_\__
  /jgs  /-'`  `\   \  \-.\
  "Written very small on the back poket of a girl's jeans
  - 'If you can read this, you're WAY too close.'"
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP Sessions - One Server, Many Terminals

2004-03-16 Thread memoimyself
Damon,

Sessions have to do with requests being sent by browsers to the web server. Each time 
you close all the windows of your browser on your computer and start the browser 
again, a new session is started. I suspect that since all your users are essentially 
using 
the same web browser (since their monitors and keyboards are not really separate 
computers, but peripherals on the same machine), a browser window open on one 
terminal is keeping alive a session started by another user on another terminal when 
she or he first started the browser. Does that make sense? Anyway, if that's your 
case, 
then I don't believe there's anything that can be done.

Erik


On 16 Mar 2004 at 13:04, Damon Abilock wrote:

> I'm having a problem related to PHP sessions in a school computer lab
> environment.  I have a script that uses sessions to keep track of a user and
> their work on the system.  It is being used by a school in a computer lab in
> which the students just have terminals -- they all access the same server
> computer to run programs and do not have hard drives of their own.  They are
> running software called "ClassLink" (see www.classlink2000.com) in this lab
> (I'm not sure if that is really an important detail or not).
> 
> The problem is that everyone that students accessing the script on these
> different terminals start seeing eachother's work, which implies that the
> session information is not unique to each terminal (I expect that if I
> printed out the session ID on all of these different terminals, they would
> all be the same).
> 
> Is there anything that I can do about this?  How do I get my script to
> recognize that it is being accessed by different terminals, even though it
> is really only one physical computer (the server that all of these terminals
> have a view into)?  Is there any other solution?
> 
> Cheers,
> Damon

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



[PHP] Re:

2004-03-16 Thread Justin Patrin
Ligaya Turmelle wrote:

try the escape character (\).  Note the previous question from "Character
question" by David Westbrooks.  Posted on 3/13/04.
Respectfully,
Ligaya Turmelle
"James E Hicks III" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
How do I get this to work? the input box is only showing

He said,

a

frown" size="50">



James Hicks
Why are so many people telling this poor person to escape their quotes? 
That WILL NOT WORK in HTML. The correct way to do this is to use 
htmlspecialchars() or htmlentities(). In fact, this should always be 
done on dynamic values in an input or any other HTML data that should be 
displayed literally, such as for within textareas.

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


RE: [PHP] Re:

2004-03-16 Thread Chris W. Parker
Ligaya Turmelle 
on Tuesday, March 16, 2004 2:28 PM said:

> try the escape character (\).  Note the previous question from
> "Character question" by David Westbrooks.  Posted on 3/13/04.

escaping html does not work. note the previous ten+ messages that came
through before yours in this thread. posted on 3/15/04.



chris.

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



[PHP] Re:

2004-03-16 Thread Ligaya Turmelle
try the escape character (\).  Note the previous question from "Character
question" by David Westbrooks.  Posted on 3/13/04.

Respectfully,
Ligaya Turmelle

"James E Hicks III" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> How do I get this to work? the input box is only showing
>
> He said,
>
>  frown" size="50">
>
>
>
> James Hicks

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



[PHP] Re: Optimise two mysql queries to one query

2004-03-16 Thread Justin Patrin
Dr. Zoidberg wrote:

Hello,

$a = mysql_query("Select a,b FROM t WHERE category=1")
while($a) {
$x = $a[a];
//some echo
//another query
$b = mysql_query("Select * FROM t WHERE subcategory=$x")
while ($b) {
//some echo
}
}
Point is that I have menus, parents with childes (childes are not
parents) and I want to display them using only one query.
- Parent 1
-- Child 1
-- Child 2
- Patent 2
-- Child 3
Child have subid that is parent id.

TNX

SELECT p.a AS pa, p.b AS pb, c.a AS ca, c.b AS cb
FROM t AS p LEFT JOIN t AS c ON c.subcategory = p.a
WHERE p.category=1
ORDER BY p.category
This should give you what you want, but the two queries might be better 
speed wise

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


[PHP] Optimise two mysql queries to one query

2004-03-16 Thread dr. zoidberg
Hello,

$a = mysql_query("Select a,b FROM t WHERE category=1")
while($a) {
$x = $a[a];
//some echo
//another query
$b = mysql_query("Select * FROM t WHERE subcategory=$x")
while ($b) {
//some echo
}
}
Point is that I have menus, parents with childes (childes are not
parents) and I want to display them using only one query.
- Parent 1
-- Child 1
-- Child 2
- Patent 2
-- Child 3
Child have subid that is parent id.

TNX

--
Please do not CC me.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Apache directive to "expand unqualified host names"?

2004-03-16 Thread Phil Frisbie, Jr.
Matt wrote:

Hello,

I am looking for an Apache directive to automatically expand an
unqualified host name in a web browser client.  Here's an example of
what I mean by this:
User, in web browser, enters (these are all hypothetical examples):

http://automobiles/trucks/

 actually fully qualifies to
.  I want the Apache server to convert
the text entered above to the following once the browser loads the web
page:
http://automobiles.transportation.com/trucks/

I understand that one can configure an Apache server to do this,
probably with an Apache directive?  If so, which one?
Is this on an Intranet where you would resolve 'automobiles' to an IP address?

Thanks for any help,
-Matt
--
Remove the obvious text (including the dash) to email me.
--
Phil Frisbie, Jr.
Hawk Software
http://www.hawksoft.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: determine logged in user

2004-03-16 Thread Ashley
Thanks for the pointer, I will see what I can do with it.  This is 
actually the same scenario that I am in.

Ashley

Red Wingate wrote:

Here you go:

http://marc.theaimsgroup.com/?l=php-dev&m=107732506523441&w=2

Have fun,
   red
Ashley wrote:

Do you happen to know what the subject was?  I cannot seem to find the 
particular post you are mentioning.

Ashley

Red Wingate wrote:

One last thing, check the PHP-DEV Archives someone send a quite nice
trick on how to do that about 1-2 months ago.
Bye,
  red
Ashley wrote:

Thanks for the info guys.  I guess that I will just make a login 
screen of some sort to accomplish what I need.

Thanks again,
Ashley
Red Wingate wrote:

Seen some interesting ways on doing this on the client. Basicly you 
run
a bash script ( on autostart for example ) and pass the login-info 
which
are saved in the enviroment to the server to make sure the user is 
known
by the server as well.

Another way could be to check wether the REMOTE_ADDR has 
authentificated
to the samba-server within a spec. timespan.

Greets,
  red
[snip]

Can PHP determine the username of the person currently logged into a
Windows 2K machine?




[snip]

On the machine running the client (web browser) or the machine 
running the
server?
On the client, no.  At least, I hope not.
On the server... ?  Maybe.  Maybe if you ran a login script that 
wrote the
username to a file that PHP read.  I can't really think of a clean 
way of
doing it.




[snip]






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


Re: [PHP] Re: determine logged in user

2004-03-16 Thread Red Wingate
Here you go:

http://marc.theaimsgroup.com/?l=php-dev&m=107732506523441&w=2

Have fun,
   red
Ashley wrote:

Do you happen to know what the subject was?  I cannot seem to find the 
particular post you are mentioning.

Ashley

Red Wingate wrote:

One last thing, check the PHP-DEV Archives someone send a quite nice
trick on how to do that about 1-2 months ago.
Bye,
  red
Ashley wrote:

Thanks for the info guys.  I guess that I will just make a login 
screen of some sort to accomplish what I need.

Thanks again,
Ashley
Red Wingate wrote:

Seen some interesting ways on doing this on the client. Basicly you run
a bash script ( on autostart for example ) and pass the login-info 
which
are saved in the enviroment to the server to make sure the user is 
known
by the server as well.

Another way could be to check wether the REMOTE_ADDR has 
authentificated
to the samba-server within a spec. timespan.

Greets,
  red
[snip]

Can PHP determine the username of the person currently logged into a
Windows 2K machine?




[snip]

On the machine running the client (web browser) or the machine 
running the
server?
On the client, no.  At least, I hope not.
On the server... ?  Maybe.  Maybe if you ran a login script that 
wrote the
username to a file that PHP read.  I can't really think of a clean 
way of
doing it.




[snip]





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


Re: [PHP] Re: determine logged in user

2004-03-16 Thread Ashley
Do you happen to know what the subject was?  I cannot seem to find the 
particular post you are mentioning.

Ashley

Red Wingate wrote:

One last thing, check the PHP-DEV Archives someone send a quite nice
trick on how to do that about 1-2 months ago.
Bye,
  red
Ashley wrote:

Thanks for the info guys.  I guess that I will just make a login 
screen of some sort to accomplish what I need.

Thanks again,
Ashley
Red Wingate wrote:

Seen some interesting ways on doing this on the client. Basicly you run
a bash script ( on autostart for example ) and pass the login-info which
are saved in the enviroment to the server to make sure the user is known
by the server as well.
Another way could be to check wether the REMOTE_ADDR has authentificated
to the samba-server within a spec. timespan.
Greets,
  red
[snip]

Can PHP determine the username of the person currently logged into a
Windows 2K machine?


[snip]

On the machine running the client (web browser) or the machine 
running the
server?
On the client, no.  At least, I hope not.
On the server... ?  Maybe.  Maybe if you ran a login script that 
wrote the
username to a file that PHP read.  I can't really think of a clean 
way of
doing it.


[snip]



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


Re: [PHP] Re: determine logged in user

2004-03-16 Thread Red Wingate
One last thing, check the PHP-DEV Archives someone send a quite nice
trick on how to do that about 1-2 months ago.
Bye,
  red
Ashley wrote:

Thanks for the info guys.  I guess that I will just make a login screen 
of some sort to accomplish what I need.

Thanks again,
Ashley
Red Wingate wrote:

Seen some interesting ways on doing this on the client. Basicly you run
a bash script ( on autostart for example ) and pass the login-info which
are saved in the enviroment to the server to make sure the user is known
by the server as well.
Another way could be to check wether the REMOTE_ADDR has authentificated
to the samba-server within a spec. timespan.
Greets,
  red
[snip]

Can PHP determine the username of the person currently logged into a
Windows 2K machine?


[snip]

On the machine running the client (web browser) or the machine 
running the
server?
On the client, no.  At least, I hope not.
On the server... ?  Maybe.  Maybe if you ran a login script that 
wrote the
username to a file that PHP read.  I can't really think of a clean 
way of
doing it.


[snip]


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


Re: [PHP] Re: determine logged in user

2004-03-16 Thread Ashley
Thanks for the info guys.  I guess that I will just make a login screen 
of some sort to accomplish what I need.

Thanks again,
Ashley
Red Wingate wrote:

Seen some interesting ways on doing this on the client. Basicly you run
a bash script ( on autostart for example ) and pass the login-info which
are saved in the enviroment to the server to make sure the user is known
by the server as well.
Another way could be to check wether the REMOTE_ADDR has authentificated
to the samba-server within a spec. timespan.
Greets,
  red
[snip]

Can PHP determine the username of the person currently logged into a
Windows 2K machine?
[snip]

On the machine running the client (web browser) or the machine running 
the
server?
On the client, no.  At least, I hope not.
On the server... ?  Maybe.  Maybe if you ran a login script that wrote 
the
username to a file that PHP read.  I can't really think of a clean way of
doing it.
[snip]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: determine logged in user

2004-03-16 Thread Red Wingate
Seen some interesting ways on doing this on the client. Basicly you run
a bash script ( on autostart for example ) and pass the login-info which
are saved in the enviroment to the server to make sure the user is known
by the server as well.
Another way could be to check wether the REMOTE_ADDR has authentificated
to the samba-server within a spec. timespan.
Greets,
  red
[snip]
Can PHP determine the username of the person currently logged into a
Windows 2K machine?
[snip]
On the machine running the client (web browser) or the machine running the
server?
On the client, no.  At least, I hope not.
On the server... ?  Maybe.  Maybe if you ran a login script that wrote the
username to a file that PHP read.  I can't really think of a clean way of
doing it.
[snip]

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


[PHP] Re: determine logged in user

2004-03-16 Thread Rob Adams
"Ashley" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> Can PHP determine the username of the person currently logged into a
> Windows 2K machine?

On the machine running the client (web browser) or the machine running the
server?
On the client, no.  At least, I hope not.
On the server... ?  Maybe.  Maybe if you ran a login script that wrote the
username to a file that PHP read.  I can't really think of a clean way of
doing it.

  -- Rob

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



Re: [PHP] determine logged in user

2004-03-16 Thread Justin Patrin
Ashley wrote:

This is not what I am looking for.  I do not want a username/password 
dialog box.  I want it to determine the username from who is logged into 
the computer and not to prompt for a username and password.  I already 
knew how to generate a dialog box for this, but I want this to be done 
behind the scenes.

Ashley

Jay Blanchard wrote:

[snip]
Can PHP determine the username of the person currently logged into a 
Windows 2K machine?

If so, could someone please point me to some tutorials or post the 
necessary code, because I cannot find anything about this.
[/snip]

see the manual http://us2.php.net/features.http-auth
Try looking in the $_ENV array. Might be in there.

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


[PHP] PHP Sessions - One Server, Many Terminals

2004-03-16 Thread Damon Abilock
I'm having a problem related to PHP sessions in a school computer lab
environment.  I have a script that uses sessions to keep track of a user and
their work on the system.  It is being used by a school in a computer lab in
which the students just have terminals -- they all access the same server
computer to run programs and do not have hard drives of their own.  They are
running software called "ClassLink" (see www.classlink2000.com) in this lab
(I'm not sure if that is really an important detail or not).

The problem is that everyone that students accessing the script on these
different terminals start seeing eachother's work, which implies that the
session information is not unique to each terminal (I expect that if I
printed out the session ID on all of these different terminals, they would
all be the same).

Is there anything that I can do about this?  How do I get my script to
recognize that it is being accessed by different terminals, even though it
is really only one physical computer (the server that all of these terminals
have a view into)?  Is there any other solution?

Cheers,
Damon

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



Re: [PHP] determine logged in user

2004-03-16 Thread Ashley
This is not what I am looking for.  I do not want a username/password 
dialog box.  I want it to determine the username from who is logged into 
the computer and not to prompt for a username and password.  I already 
knew how to generate a dialog box for this, but I want this to be done 
behind the scenes.

Ashley

Jay Blanchard wrote:

[snip]
Can PHP determine the username of the person currently logged into a 
Windows 2K machine?

If so, could someone please point me to some tutorials or post the 
necessary code, because I cannot find anything about this.
[/snip]

see the manual http://us2.php.net/features.http-auth
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] determine logged in user

2004-03-16 Thread Jay Blanchard
[snip]
Can PHP determine the username of the person currently logged into a 
Windows 2K machine?

If so, could someone please point me to some tutorials or post the 
necessary code, because I cannot find anything about this.
[/snip]

see the manual http://us2.php.net/features.http-auth

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



[PHP] determine logged in user

2004-03-16 Thread Ashley
Can PHP determine the username of the person currently logged into a 
Windows 2K machine?

If so, could someone please point me to some tutorials or post the 
necessary code, because I cannot find anything about this.

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


[PHP] local (config) value not overriding master

2004-03-16 Thread Fredrik de Vibe
Hi

On the system I'm working on atm, php is set up with a non-modifiable
php.ini, but I can make php config changes in httpd.conf. The changes
I make are reflected in the "local value" row in the output from
phpinfo() while the values from php.ini are in the "master value" row.

This seemed to be working fine until I tried to override the
disable_functions value. The master value has ini_set disabled, I have
removed it from the local value's disabled_functions (phpinfo() agrees
on this), but I still can't use ini_set (it is still disabled).

I might be missing something important here (probably am), but I can't
see why (tried googling and going through the docs, but I couldn't see
any reference to this). Can anybody shed some light here?

Thanks in advance.


-- 
- Fredrik

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



RE: [PHP]

2004-03-16 Thread Vail, Warren
Ahh, because it's raw html and not in php.

one choice would be to encapsulate it within php

" size="50">

or

" size="50">

or stay with RAW HTML and use the correct 



Warren Vail


-Original Message-
From: Chris W. Parker [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 16, 2004 11:55 AM
To: Vail, Warren; James E Hicks III; [EMAIL PROTECTED]
Subject: RE: [PHP] 


Vail, Warren 
on Tuesday, March 16, 2004 11:14 AM said:

>  work?\", with a
> frown" size="50">

escaping does not work.


chris.

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



RE: [PHP]

2004-03-16 Thread Hidayet Dogan
Replacing with " HTML entitiy may be enough.

For ex:

";
?>
Or 

Good luck,
 Hidayet Dogan
  [EMAIL PROTECTED]

Pleksus Bilisim Teknolojileri D.T.O. A.S.
--
caldiran sok. 14/6 06420 kolej ankara * www.pleksus.com.tr
tel : +90 312 4355343 * faks: +90 312 4354006

On Tue, 16 Mar 2004, Chris W. Parker wrote:

> Vail, Warren 
> on Tuesday, March 16, 2004 11:14 AM said:
>
> >  > work?\", with a
> > frown" size="50">
>
> escaping does not work.
>
>
> chris.
>
> --
> 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]

2004-03-16 Thread Chris W. Parker
Vail, Warren 
on Tuesday, March 16, 2004 11:14 AM said:

>  work?\", with a
> frown" size="50">

escaping does not work.


chris.

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



Re: [PHP] Calculate

2004-03-16 Thread joel boonstra
On Tue, Mar 16, 2004 at 09:43:28AM -0800, Jason Davidson wrote:
> Most likely im not understanding your question.. but, if you are trying
> to calculate the total rows by month..
> SELECT whatever FROM table WHERE MONTH(your_date) = '03';
> 
> and use num_rows or row_count or whatever the php mysql function is

I didn't post the original message; I was responding to Tommi, who asked
about calculating the "count of date per month".

Your method will have all rows returned to PHP, and require PHP to count
the rows afterward.  If you would do this:

  SELECT COUNT(whatever) FROM table WHERE MONTH(your_date) = '03';

then your result set will only have one row (the number of matching
rows), and you don't need to do any additional counting work.

However, all of that is for the OP, not for me, so I'm CCing the list
back in.

-- 
[ joel boonstra | gospelcom.net ]

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



RE: [PHP]

2004-03-16 Thread Vail, Warren
how about

http://www.php.net/manual/en/function.htmlspecialchars.php

not quite as stringent as

http://www.php.net/manual/en/function.htmlentities.php

Warren Vail


-Original Message-
From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 16, 2004 11:21 AM
To: Jay Blanchard; James E Hicks III; [EMAIL PROTECTED]
Subject: RE: [PHP] 


[snip]
Escape the quotes.
[/snip]

How about addslashes() and stripslashes() ?

-- 
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] Changes in php.ini have no effect

2004-03-16 Thread Ford, Mike [LSS]
On 16 March 2004 19:01, Harry Sufehmi wrote:

> On 16/03/2004 at 18:18 Ford, Mike [LSS] wrote:
> > On 16 March 2004 15:10, Harry Sufehmi wrote:
> > > Problem:
> > > Changes made in c:\winnt\php.ini doesn't have any effect even
> > > after restarting Apache. 
> > > 
> > > PHP version: 4.3.3
> > > phpinfo() output - http://www.harrysufehmi.com/inf.php
> > > 
> > > If you at the output of phpinfo(), it stated that the
> > > configurations were read from c:\winnt\php.ini
> > 
> > No, it actually states:
> >Configuration File (php.ini) Path  C:\WINNT
> > which means that it's looking in C:\WINNT for your php.ini file,
> > but hasn't found one -- if it found a php.ini there, that line
> >would have read: Configuration File (php.ini) Path 
> > C:\WINNT\php.ini 
> > As you're on Windows, my guess is that the old hidden extension
> > trick is in play and you've actually got a file called something
> > like php.ini.txt -- 
> 
> Good one but I just checked (from command prompt) and
> indeed php.ini is there (not php.ini.txt), double-checked as
> well just to make sure.

H'm!  Permissions problem?

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



RE: [PHP]

2004-03-16 Thread Jay Blanchard
[snip]
Escape the quotes.
[/snip]

How about addslashes() and stripslashes() ?

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



RE: [PHP]

2004-03-16 Thread Jay Blanchard
[snip]
How do I get this to work? the input box is only showing 

He said, 


[/snip]

Escape the quotes.



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



RE: [PHP]

2004-03-16 Thread Chris W. Parker
James E Hicks III 
on Tuesday, March 16, 2004 11:08 AM said:

>  with a frown" size="50">

i came across this same problem recently. http://php.net/htmlentities

" becomes "



chris.

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



RE: [PHP]

2004-03-16 Thread Vail, Warren


Warren Vail



-Original Message-
From: James E Hicks III [mailto:[EMAIL PROTECTED]
Sent: Tuesday, March 16, 2004 11:08 AM
To: [EMAIL PROTECTED]
Subject: [PHP] 


How do I get this to work? the input box is only showing 

He said, 





James Hicks

-- 
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] ?=

2004-03-16 Thread Frank M. Kromann
Asuming the content is generated by php, take a look at htmlentities().
http://php.net/htmlentities

- Frank

> How do I get this to work? the input box is only showing 
> 
> He said, 
> 
>  frown" size="50">
> 
> 
> 
> James Hicks
> 
> -- 
> 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]

2004-03-16 Thread James E Hicks III
How do I get this to work? the input box is only showing 

He said, 





James Hicks

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



RE: [PHP] Changes in php.ini have no effect

2004-03-16 Thread Harry Sufehmi

On 16/03/2004 at 18:18 Ford, Mike [LSS] wrote:
>On 16 March 2004 15:10, Harry Sufehmi wrote:
>> Problem:
>> Changes made in c:\winnt\php.ini doesn't have any effect even after
>> restarting Apache.
>>
>> PHP version: 4.3.3
>> phpinfo() output - http://www.harrysufehmi.com/inf.php
>>
>> If you at the output of phpinfo(), it stated that the
>> configurations were read from c:\winnt\php.ini
>
>No, it actually states:
>Configuration File (php.ini) Path  C:\WINNT
>which means that it's looking in C:\WINNT for your php.ini file, but hasn't
>found one -- if it found a php.ini there, that line would have read:
>Configuration File (php.ini) Path  C:\WINNT\php.ini
>As you're on Windows, my guess is that the old hidden extension trick is in
>play and you've actually got a file called something like php.ini.txt --

Good one but I just checked (from command prompt) and indeed php.ini is there (not 
php.ini.txt), double-checked as well just to make sure.

Thanks for the reply anyway.



Thanks,
Harry


--
Kampanye open-source Indonesia - http://www.DariWindowsKeLinux.com
Solusi canggih, bebas ikatan, dan bebas biaya

v0sw6Chw5ln3ck4u6Lw5-2Tl6+8Ds5MRr5e7t2Tb8TOp2/3en5+7g5HC - hackerkey.com

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



RE: [PHP] mappath and unmappath function

2004-03-16 Thread Jay Blanchard
[snip]
does someone knows a function to map a server path to a fs path, and a
function that does the inverse? i mean, if you have /var/www/html/script
and
applies function unmappath, it returns /script and if apply mappath to
/script it returns /var/www/html/script. somebody has something like
this?


Start here http://us3.php.net/dirname

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



[PHP] mappath and unmappath function

2004-03-16 Thread Luis Mirabal
does someone knows a function to map a server path to a fs path, and a
function that does the inverse? i mean, if you have /var/www/html/script and
applies function unmappath, it returns /script and if apply mappath to
/script it returns /var/www/html/script. somebody has something like this?

thanx
luis.

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



RE: [PHP] Array to String conversion error

2004-03-16 Thread Alex Hogan
> $row is an entire array. you don't explode an entire array, you only
> explode the contents of an element of an array.
> 
> print_r($row) will give you some clues.
> 
> you'll need to access a specific element within the array. like:
> 
> $thearray = explode('__', $row[0][0]);

That was it... Thanks Chris.


alex


** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




RE: [PHP] Changes in php.ini have no effect

2004-03-16 Thread Ford, Mike [LSS]
On 16 March 2004 15:10, Harry Sufehmi wrote:

> Problem:
> Changes made in c:\winnt\php.ini doesn't have any effect even after
> restarting Apache. 
> 
> Steps tried:
> # looking for other copies of php.ini - none found
> # entering the related values in Apache's httpd.conf file
> instead - works for some values, but not for others.
> # entering the related values in Apache's .htaccess file - doesn't
> work at all 
> 
> PHP version: 4.3.3
> phpinfo() output - http://www.harrysufehmi.com/inf.php
> 
> If you at the output of phpinfo(), it stated that the
> configurations were read from c:\winnt\php.ini

No, it actually states:

Configuration File (php.ini) Path  C:\WINNT

which means that it's looking in C:\WINNT for your php.ini file, but hasn't
found one -- if it found a php.ini there, that line would have read:

Configuration File (php.ini) Path  C:\WINNT\php.ini

As you're on Windows, my guess is that the old hidden extension trick is in
play and you've actually got a file called something like php.ini.txt -- try
turning off the Windows option that hides recognised extensions, and taking
another look.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



Re: [PHP] array $_POST problem

2004-03-16 Thread Chris Boget
You're the Joey Kelly who runs the LUG in NoLA, yes?

> I've got a sticky problem that I need to solve. I've just turned on
> register_globals in my PHP php.ini file, and therefore have to run my form
> variables through $_POST:
> $variable = $_POST[$variable];
> echo $variable;

Or you can use extract();

> The problem I'm having is that the script Im trying to refactor worked
great
> before I turned register_globals off. The script posts an array, and I
can't
> seem to figure out how to $_POST the array.

It seems like the array is posted just fine.

> In both cases, changing the extension from .php to .phps shows you the
source
> code. As you can see, above the form I've tried several attempts to access
> the data, all of which seem to fail.

How is it failing?  Looking at the source, you are definitely on the right
track.

> My question: What am I doing wrong? I suspect that I'm having trouble with
> nested arrays, etc.. The thing that bothers me is that the data is
available
> (see the array printout at the bottom?).

Upon post, you need to get materials as such:

$materials = &$_POST['materials'];

to list out the quantity, you can do any the following:

foreach( $materials['quantity'] as $quantity ) {
  echo $quantity . '';
}
foreach( $materials['description'] as $description ) {
  echo $description . '';
}

for( $i = 0; $i < 5; $i++ ) {
  echo $materials['description'][$i] . '::' . $materials['quantity'][$i] .
'';
}

Personally, I'd rename your form elements to:

$materials[$item][quantity]
$materials[$item][price]
$materials[$item][description]

Chris

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



RE: [PHP] array $_POST problem

2004-03-16 Thread Chris W. Parker
Joey Kelly 
on Tuesday, March 16, 2004 10:17 AM said:

> The problem I'm having is that the script Im trying to refactor
> worked great before I turned register_globals off. The script posts
> an array, and I can't seem to figure out how to $_POST the array.

the script posts an array, and you can't figure out how to $_POST the
array?



> Here is the script with register_globals OFF (this is on my old
> server, by the way, running SuSE 7.3), as you can see the script
> works fine with register_globals off:
> http://joeykelly.net/materials.php

why don't you just turn register_globals off again?




chris.

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



Re: [PHP] array $_POST problem

2004-03-16 Thread Richard Davey
Hello Joey,

Tuesday, March 16, 2004, 6:16:34 PM, you wrote:

JK> I have a SuSE 9.0 Linux server running PHP and Apache2 (my phpinfo() data is
JK> at http://redfishnetworks.com/~jkelly/test.php), and my problem is this:

JK> I've got a sticky problem that I need to solve. I've just turned on
JK> register_globals in my PHP php.ini file, and therefore have to run my form
JK> variables through $_POST:

If you don't know in what way PHP sends the POST data, then the best
solution is simply to view it:

";
  print_r($_POST);
  echo "";
?>

(Or you can var_dump the whole thing)

By looking at the structure like this you'll soon see how to access
the values inside of it rather than second-guessing all the time.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] Re: behind the scenes coding?

2004-03-16 Thread Justin Patrin
Dustin Wish With Indco Networks wrote:

 

I have been looking everywhere for any tips or tutorials on posting to
separate websites and parsing the return values for input into a mysql db.
I understand parsing html pages, but not how to post to a form on a
different site and once the values are returned parse and redirect. I have
read alittle about using CURL to perform some of this, but no real help
there. 

 

I need to post to a login script, then once the page is processed, I will
parsed the returned page for the data. any help please?
 
Try PEAR::HTTP_Client
http://pear.php.net/package/HTTP_Client
--
paperCrane 
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] array $_POST problem

2004-03-16 Thread Joey Kelly
Hello,

I have a SuSE 9.0 Linux server running PHP and Apache2 (my phpinfo() data is 
at http://redfishnetworks.com/~jkelly/test.php), and my problem is this:

I've got a sticky problem that I need to solve. I've just turned on 
register_globals in my PHP php.ini file, and therefore have to run my form 
variables through $_POST:

$variable = $_POST[$variable];
echo $variable;

The problem I'm having is that the script Im trying to refactor worked great 
before I turned register_globals off. The script posts an array, and I can't 
seem to figure out how to $_POST the array.

Here is the script with register_globals OFF (this is on my old server, by the 
way, running SuSE 7.3), as you can see the script works fine with 
register_globals off:
http://joeykelly.net/materials.php

Here is the script with register_globals ON:
http://redfishnetworks.com/~jkelly/materials.php
Notice the huge nested array at the bottom when you click [SUBMIT]? That's my 
trouble.

In both cases, changing the extension from .php to .phps shows you the source 
code. As you can see, above the form I've tried several attempts to access 
the data, all of which seem to fail.

My question: What am I doing wrong? I suspect that I'm having trouble with 
nested arrays, etc.. The thing that bothers me is that the data is available 
(see the array printout at the bottom?).

If I can't make this work, I'm going to have to resort to munging a bunch of 
scalars ($quantity1, $quantity2, etc.), which to me is an awful kludge that 
I'd rather not sign my name to.

Thanks for any help.




-- 


Joey Kelly
< Minister of the Gospel | Linux Consultant >
http://joeykelly.net


"I may have invented it, but Bill made it famous."
 --- David Bradley, the IBM employee that invented CTRL-ALT-DEL

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



RE: [PHP] Array to String conversion error

2004-03-16 Thread Chris W. Parker
Alex Hogan 
on Tuesday, March 16, 2004 9:48 AM said:

> $row = mssql_fetch_array($result);
> 
> $thearray = explode('__', $row); - This is line 40

$row is an entire array. you don't explode an entire array, you only
explode the contents of an element of an array.

print_r($row) will give you some clues.

you'll need to access a specific element within the array. like:

$thearray = explode('__', $row[0][0]);

> What am I missing?

unless i'm wrong, the above.



chris.

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



[PHP] Re: Web based php development tool

2004-03-16 Thread Justin Patrin
Joseph Ross Lee wrote:

Anybody here who could recommend a web based php dev tool for editing php
sources online? Thanks! I'm having a hard time finding a nice one. Thanks in
advance guys!
I have a simple php-based online text editor (which deals with 
directories and such) if you'd like to take a look at it. It doesn't 
have ANY fancy editing features, just text editing. It does allow for 
lots of file manipulation, though. ;-)

Then again, you might be able tof find something much better E-mail 
me if you'd like a copy.

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


[PHP] Re: objects in session

2004-03-16 Thread Justin Patrin
Marc Serra wrote:

Hi,

I got problem when i want to save object in session.

 

I got my first page when I create my object and save it to session:

 



Require 'test.inc.php';

Session_start();

 

$test = new test();

$test->Load($_Get['id']);

$_SESSION['save'] = $test;

?>

 

In my second page I want to retrieve my object



 

Require 'test.inc.php';

Session_start();

echo get_class($_SESSION['test']);

?>

 

When I do get_class($_SESSION['test']); I got the message
"__PHP_Incomplete_Class" instead of "test"
 

Can you explain me where I can have made an error.

 

What's going on here is that you haven't redefined your class for PHP in 
the second page. When PHP saves your object, it saves only its data, not 
its functions and such. Are you sure you're defining your object 
correctly? Have you tried instantiating a test() object in the second page?

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


[PHP] Array to String conversion error

2004-03-16 Thread Alex Hogan
Hi All,

 

I have a function that gets a single field from a mssql db. That field
contains data that is then parsed out to represent a survey's results.

 

The function;

function quesresults(){

$query = "SELECT sur_ans

   FROM au_survey";

$result = MSSQL_QUERY($query) or die("Can not execute query
$query. ");

$row = mssql_fetch_array($result);

$thearray = explode('__', $row); - This is line 40

$i = 1;

foreach($thearray as $topelement){

foreach(explode('--', $topelement) as $element){

echo $element;

echo "";

}

echo "question $i"; 

echo "";

$i++;

}

}

 

When I call the function I get;

Notice: Array to string conversion in \WWW\mypath\srvyclass.inc.php on line
40
Array
question 1

 

What am I missing?

 

 

alex hogan

 



** 
The contents of this e-mail and any files transmitted with it are 
confidential and intended solely for the use of the individual or 
entity to whom it is addressed.  The views stated herein do not 
necessarily represent the view of the company.  If you are not the 
intended recipient of this e-mail you may not copy, forward, 
disclose, or otherwise use it or any part of it in any form 
whatsoever.  If you have received this e-mail in error please 
e-mail the sender. 
** 




Re: [PHP] Calculate

2004-03-16 Thread Jason Davidson


joel boonstra <[EMAIL PROTECTED]> wrote:
> 
> On Tue, Mar 16, 2004 at 02:35:57PM +0200, Tommi Virtanen wrote:
> > How I can calculate following:
> > 
> > I have table:
> > id(int) start_date(date)end_date(date)
> > 001 2004-03-10  2004-03-12
> > 002 2004-03-27  2004-04-02
> > 003 2004-04-05  2004-04-06
> > 
> > Total count of date is 12. But how I can calculate count of
> > date per month?
> > 
> > regards,
> 
> I'm assuming this is in a MySQL table.  Is that correct?  This is
> probably something that will better be answered on a MySQL list.
> 
> Assuming that it is MySQL, how are you deciding which month an item is
> in?  What if it starts in March and ends in April?  Should it be
> considered to be in March or April?
> 
> MySQL's COUNT[1], GROUP BY[2], and DATE_FORMAT[3] will be helpful to you.
> Something like:
> 
>   SELECT COUNT(*) AS num, DATE_FORMAT(end_date, "%Y-%m") AS yearmonth
> FROM yourtable 
> GROUP BY yearmonth 
> ORDER BY num;
> 
> might work[4].
> 
> [1] http://www.mysql.com/doc/en/GROUP-BY-Functions.html#IDX1452
> [2] http://www.mysql.com/doc/en/SELECT.html
> [3] http://www.mysql.com/doc/en/Date_and_time_functions.html#IDX1341
> [4] This query assumes that end_date is sufficient to determine which
> month something is "in".  Also, it relies on some potentially
> MySQL-specific syntax.
> 
> joel
> 
> -- 
> [ joel boonstra | gospelcom.net ]
> 
> -- 
> 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] Efficieny: Include vs Array vs Function

2004-03-16 Thread Jason Sheets
> Rob Paxon 
>on Monday, March 15, 2004 9:24 PM said:
>
>> Bear with me while I dish out some details.  My question concerns the
>> efficiency of using multiple file includes versus storing segments of
>> data in one include as arrays or functions.
>
> have you considered the size of your includes? maybe cutting the size
> down by splitting them into more concise files would help? in this way
> you could more precisely include what you needed and leave the rest
> out.

Sometimes having less included files with more content is more efficient
than having a lot of small files, an example would be making a seperate
include for each function, this has its advantages especially in smarty's
case but can be inefficient because you must fetch each file from disk which
has overhead.

I'd suggest profiling your code, use the PEAR Benchmark class and use PHP's
memory usage functions to determine what parts of your code are consuming
the most resources and taking the longest amount of time to execute, then
try some experiments and profile each experiment to determine the most
efficient solution.

Different versions of PHP, different application frameworks, and
applications in general will respond to optimization techniques differently,
for example there is little sense in spending 40 hours optimizing variable
usage in a program to increase performance when 75% of the program is
database server bound, your time would be better spent optimizing the SQL.

In my commericial websites I have modified my application framework not to
connect to the database, start output buffering, start the session and do
other overhead if specific constants are declared.  For example if I have
contact.php that does some mailing stuff and requires Smarty I can define
TEMPLATE_ONLY and only templating related files will be included and
initialized.

Doing this optmization made pages roughly 50% faster that did not require
session or a database connection and also reduces the load on the sql server
because you are not connecting unless you actually need the connection and
still benefit from having a single connection call instead of connecting in
each function or file.

>
> just a thought.
>
>
> chris.
>
> --
> 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] Efficieny: Include vs Array vs Function

2004-03-16 Thread Chris W. Parker
Rob Paxon 
on Monday, March 15, 2004 9:24 PM said:

> Bear with me while I dish out some details.  My question concerns the
> efficiency of using multiple file includes versus storing segments of
> data in one include as arrays or functions.

have you considered the size of your includes? maybe cutting the size
down by splitting them into more concise files would help? in this way
you could more precisely include what you needed and leave the rest out.

just a thought.


chris.

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



RE: [PHP] e - comerce website

2004-03-16 Thread Chris W. Parker
[EMAIL PROTECTED] 
on Monday, March 15, 2004 6:08 PM said:

> Hai..

hi.

> I have a homework from my scholl. We must make a simple website of e
> - comerce use php. I just still confuse to use the session in this
> work. And I must make a different page for a administrator that have
> a full access and a just user. But I still don't know how to make it.
> There is an order and a checkout if we want to leave the website.
> Please help me, I just have time 1 week to finish it.

well i can't do your homework for you and you didn't ask any specific
questions so i'm not sure where to start. what exactly are you having a
problem with?



chris.

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



Re: [PHP] Calculate

2004-03-16 Thread joel boonstra
On Tue, Mar 16, 2004 at 02:35:57PM +0200, Tommi Virtanen wrote:
> How I can calculate following:
> 
> I have table:
> id(int)   start_date(date)end_date(date)
> 001   2004-03-10  2004-03-12
> 002   2004-03-27  2004-04-02
> 003   2004-04-05  2004-04-06
> 
> Total count of date is 12. But how I can calculate count of
> date per month?
> 
> regards,

I'm assuming this is in a MySQL table.  Is that correct?  This is
probably something that will better be answered on a MySQL list.

Assuming that it is MySQL, how are you deciding which month an item is
in?  What if it starts in March and ends in April?  Should it be
considered to be in March or April?

MySQL's COUNT[1], GROUP BY[2], and DATE_FORMAT[3] will be helpful to you.
Something like:

  SELECT COUNT(*) AS num, DATE_FORMAT(end_date, "%Y-%m") AS yearmonth
FROM yourtable 
GROUP BY yearmonth 
ORDER BY num;

might work[4].

[1] http://www.mysql.com/doc/en/GROUP-BY-Functions.html#IDX1452
[2] http://www.mysql.com/doc/en/SELECT.html
[3] http://www.mysql.com/doc/en/Date_and_time_functions.html#IDX1341
[4] This query assumes that end_date is sufficient to determine which
month something is "in".  Also, it relies on some potentially
MySQL-specific syntax.

joel

-- 
[ joel boonstra | gospelcom.net ]

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



Re[2]: [PHP] Switching First & Last Names in List

2004-03-16 Thread Richard Davey
Hello Ben,

Tuesday, March 16, 2004, 4:24:12 PM, you wrote:

BR> I missed this part, so here's my take with the solution I provided (I'm
BR> including the print-out of the  tags):

Heh :) just as I posted about it too.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



[PHP] Re: Calculate

2004-03-16 Thread Luis Mirabal
from sql?? if you are doing:

select ... count(date) ...from ... where ...

do:

select ... count(date) ...from ... where ... group by date

luis.

"Tommi Virtanen" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> Hi!
>
> How I can calculate following:
>
> I have table:
> id(int) start_date(date) end_date(date)
> 001 2004-03-10 2004-03-12
> 002 2004-03-27 2004-04-02
> 003 2004-04-05 2004-04-06
>
> Total count of date is 12. But how I can calculate count of
> date per month?
>
> regards,
>
> gustavus

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



Re[2]: [PHP] Switching First & Last Names in List

2004-03-16 Thread Richard Davey
Hello Ben,

Tuesday, March 16, 2004, 4:16:01 PM, you wrote:

BR> This works rather nicely, too:
[snip]
BR> $name_array is now a multi-dimensional array with the first and last
BR> names separated.  print_r should show you the values.

It doesn't reverse the name (as required), which although you could
say "give me element 1 of each array to get the lastname", this doesn't
work with names such as "firstname middlename lastname" (like the OP
requested) :) because now the lastname is in element 2 so you'll have
to do some extra checking malarky to get it.

But yeah, there are a few million ways to skin this cat.

-- 
Best regards,
 Richard Davey
 http://www.phpcommunity.org/wiki/296.html

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



Re: [PHP] Switching First & Last Names in List

2004-03-16 Thread Ben Ramsey
>> JO> so that the last name is first? Also, how do I
>> JO> handle people with three names? Thanks.
I missed this part, so here's my take with the solution I provided (I'm 
including the print-out of the  tags):

foreach ($name_array as $person) {
$lastname_element = count($person) - 1; //index of last element
echo "" . $person[$lastname_element] . ", ";
echo $person[0] . "\n"; //zero (0) is the first name
}
Ben Ramsey wrote:

This works rather nicely, too:


$name_array = array();
$temp_array = explode("\n", $list);
foreach ($temp_array as $name) {
$name_array[] = explode(" ", $name);
}
print_r($name_array);
?>
$name_array is now a multi-dimensional array with the first and last 
names separated.  print_r should show you the values.

--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] db design path based

2004-03-16 Thread Raditha Dissanayake

True, but I figured this php list would be a good place as well 
because it also comes down to programming problems that might occur. 
Also people who use php will be dealing with db's a lot as well.

Jay is right. This list is supposed to answer only questions like  my 
php code that queries a mysql db returned the following error... etc.



--
Raditha Dissanayake.
---
http://www.radinks.com/upload/ 
Drag and Drop Upload thousands of files and folders in a single
transfer.  (HTTP or FTP) 

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


Re: [PHP] dbg extension...

2004-03-16 Thread Luis Mirabal
yes, i found that the extension functions only works in debug sessions, so i
replaced it by Xdebug, it is very cool, i recommend it!
http://www.xdebug.org/

luis.

"Tom Rogers" <[EMAIL PROTECTED]> escribió en el mensaje
news:[EMAIL PROTECTED]
> Hi,
>
> Tuesday, March 16, 2004, 9:51:46 AM, you wrote:
> LM> hey guys, i have a question on dbg extension, i want to get debug
details
> LM> using the functions from php, ie. dbg_get_profiler_results, but they
return
> LM> nothing... i am developing on windows using apache and php 4.3, any
> LM> suggestions?
>
>
> You probably have to trigger the debugger by doing something like
> this:
>
> http://domain.com/test.php?DBGSESSID=123456
>
> --
> regards,
> Tom

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



Re: [PHP] Regex help - PLease

2004-03-16 Thread Pablo
On 03/16/2004 6:57 AM, Rob Ellis <[EMAIL PROTECTED]> wrote:

> On Tue, Mar 16, 2004 at 02:39:27PM +0200, Brent Clark wrote:
>> Hi there
>> 
>> im in desperate need of help for a reg expression to ONLY allow 8 NUMBERS to
>> start with 100 and may not have any other kind of
>> letters or  characters. Only numbers
>> 
>> for example 
>> 10064893
>> 
> 
> if (preg_match('/^100\d{5}/', $test))
> print "ok\n";

Unless you want to allow something like '10064893A' to match, use:

preg_match('/^100\d{5}$/', $test)

Pablo

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



[PHP] images

2004-03-16 Thread Maxi Yedid
hello

I'm using the following function from the php manual (user's posts) and get
the following error.

What I do is upload a file from the user and save it in the server; that's
working fine; what I want is to save a copy of the file in thumbnail size.


-
function resampimagejpg($forcedwidth, $forcedheight, $sourcefile, $destfile,$imgcomp)
   {
   $g_imgcomp=100-$imgcomp;
   $g_srcfile=$sourcefile;
   $g_dstfile=$destfile;
   $g_fw=$forcedwidth;
   $g_fh=$forcedheight;

   if(file_exists($g_srcfile))
   {
   $g_is=getimagesize($g_srcfile);
   if(($g_is[0]-$g_fw)>=($g_is[1]-$g_fh))
   {
   $g_iw=$g_fw;
   $g_ih=($g_fw/$g_is[0])*$g_is[1];
   }
   else
   {
   $g_ih=$g_fh;
   $g_iw=($g_ih/$g_is[1])*$g_is[0];
   }
   $img_src=imagecreatefromjpeg($g_srcfile);
   $img_dst=imagecreate($g_iw,$g_ih);

   imagecopyresampled($img_dst, $img_src, 0, 0, 0, 0, $g_iw, $g_ih,$g_is[0], 
$g_is[1]);
   imagejpeg($img_dst, $g_dstfile, $g_imgcomp);
   imagedestroy($img_dst);
   return true;
   }
   else
   return false;
   }
--
** This is where I call the function:

  $archivo = $forma['imagen']['tmp_name'];
  echo("File Uploaded Information: " . $archivo . "");

  if(is_uploaded_file($archivo)) {
   $directo = "/home/public_html/img_products/";
   $archivito = $directo . $forma['imagen']['name'];

   $archivote = "/home/public_html/img_small_products/" .
$forma['imagen']['name'];  //

   echo "" . $archivito . "";
move_uploaded_file($forma['imagen']['tmp_name'],$archivito) ;

   resampimagejpg(100, 100, $archivito, $archivote, 0);
<<<= Here I call the function

--

This is the error I get:

Warning: imagejpeg(): Unable to open '/home/public_html/img_small_products/A2_6.jpg' 
for writing in /home/public_html/admin/products.php on line 286

any idea? Thanks!

max



Re: [PHP] Switching First & Last Names in List

2004-03-16 Thread Ben Ramsey
This works rather nicely, too:


$name_array = array();
$temp_array = explode("\n", $list);
foreach ($temp_array as $name) {
$name_array[] = explode(" ", $name);
}
print_r($name_array);
?>
$name_array is now a multi-dimensional array with the first and last 
names separated.  print_r should show you the values.

Richard Davey wrote:
Hello Jeff,

Tuesday, March 16, 2004, 3:24:57 PM, you wrote:

JO> If I have a list like this:
JO> Firstname1 LastName1
JO> Firstname2 Lastname2
JO> etc.
JO> I can split the names by \n to put them into
JO> an array which will then be output into an 
JO> list for a form. But how do I reverse the names
JO> so that the last name is first? Also, how do I
JO> handle people with three names? Thanks.

$raw_names = "richard davey
susannah davey
jeff oien
willy three names
jack van-der-meet";
$names = explode("\n", $raw_names);

echo "";
print_r($names);
array_walk($names, 'swap');

print_r($names);
echo "";
?>
The echo and print_r lines are to show you what it has done.
The $raw_names should be your list of names.
--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Efficieny: Include vs Array vs Function

2004-03-16 Thread Rasmus Lerdorf
If you are that concerned about it, "pear install apc".  Your include
files will be cached in memory and the only cost per include file is a
single stat() system call and looking up the opcode cache in shared
memory.

-Rasmus

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



[PHP] Reading a image resource

2004-03-16 Thread Ewout de Boer
Is there a function to get the raw image data from a image resource ?
(resource created by imagecreatefrom)

I want to read and manipulate an image from a file and store it in a
database without the use of a temp. file




regards,
Ewout

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



Re: [PHP] yahoo route my mail's to bulk folder

2004-03-16 Thread Miles Thompson
At 10:00 PM 3/16/2004 +0800, Jason Wong wrote:
On Tuesday 16 March 2004 20:39, Ali Ashrafzadeh wrote:

> in a web application I send mail message to members using mail() function
> in HTML format but yahoo mail server route my messages to bulk folder
There can be any number of reasons. None of them having anything to do with
PHP. For the most authoritative answer ask Yahoo's customer services.


Ali,

Jason is right - Yahoo will be authoritave. Nevertheless, could it be you 
are using bcc:? Or sending so much mail to Yahoo accounts that Yahoo has 
decided it's bulk?

Miles

 

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


  1   2   >