php-general Digest 2 Jun 2003 13:07:18 -0000 Issue 2093

Topics (messages 149745 through 149787):

can't connect to mysql
        149745 by: Chin Hui
        149767 by: Jason Wong

Re: UBB to HTML
        149746 by: Manuel Lemos

Re: Strange Behaviour of cookies
        149747 by: Jaap van Ganswijk

Re: static vars question
        149748 by: Joel Rees

cyrus c-client imap
        149749 by: Grigorian Arshavir

Re: user login idle timeout feature
        149750 by: Justin French
        149772 by: electroteque

PHP and POP3
        149751 by: Erich Kolb
        149753 by: Rasmus Lerdorf

Re: caching variables and preloading functions
        149752 by: Lance Lovette

Use of undefined constant PHP_SELF - assumed 'PHP_SELF'
        149754 by: Øystein Håland
        149761 by: Philip Olson

Re: php auction 2.1
        149755 by: Ferhat BINGOL
        149785 by: chris prior
        149786 by: Ferhat BINGOL
        149787 by: chris prior

redhat 9 compile of PHP
        149756 by: Greg Beaver
        149757 by: Tariq Murtaza
        149766 by: Jason Wong

GEnerating PDF's
        149758 by: Petre Agenbag
        149765 by: Jason Wong

Making a PHP Script "Very" Cache Friendly
        149759 by: Gerard Samuel
        149760 by: Joshua Moore-Oliva
        149764 by: Don Read

TABLE COLUMNS
        149762 by: Ralph
        149763 by: Veniamin Goldin
        149771 by: Don Read

Resources consumption
        149768 by: Armand Turpel

POST Values
        149769 by: Shaun
        149774 by: sven

Scandir Question
        149770 by: Miguel Angelo

Re: trikky authentication question
        149773 by: PHP4 Emailer

Re: $_POST array
        149775 by: sven

Adding a particalar POST value to a string
        149776 by: Shaun
        149780 by: Evan Nemerson

Sending a http body
        149777 by: Roland Welker
        149778 by: Axel Tietje
        149779 by: Leif K-Brooks

session
        149781 by: Aris  Santillan
        149782 by: Adrian Portsmouth

Cookies - recomendation please
        149783 by: Ryan A
        149784 by: Awlad Hussain

Administrivia:

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

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

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


----------------------------------------------------------------------
--- Begin Message --- hi,

i'm a newbie in php and mysql. i've just installed mysql 4.0.13 with a .tar.gz file. PHP 4.2.2 comes along with my redhat 9 installation.
I can't seem to connect to mysql with any php scripts. I've noticed a package named php-mysql. I've tried to install, but it has a dependency on mysql. It couldn't detect mysql installation that i did because i didn't install it with rpm binary package. Thus, if i try to install the php-mysql package, i would need to install mysql 3.23. Is there a way that i could get the functionality of php-mysql package?



--- End Message ---
--- Begin Message ---
On Monday 02 June 2003 09:15, Chin Hui wrote:

> i'm a newbie in php and mysql.  i've just installed mysql 4.0.13 with a
> .tar.gz file.  PHP 4.2.2 comes along with my redhat 9 installation.
> I can't seem to connect to mysql with any php scripts.  I've noticed a
> package named php-mysql.  I've tried to install, but it has a dependency
> on mysql.  It couldn't detect mysql installation that i did because i
> didn't install it with rpm binary package.  Thus, if i try to install
> the php-mysql package, i would need to install mysql 3.23.  Is there a
> way that i could get the functionality of php-mysql package?

If you're comfortable with installing from tarballs I recommend that you 
remove RPMs of apache, mysql and php and install all three from source 
(google for LAMP guide or similar). This is much better in the long run as 
you can upgrade each of them independently without having to wait for RH to 
release the relevant RPMs.

-- 
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
------------------------------------------


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

On 06/01/2003 10:05 PM, Zavaboy wrote:
How can I strip ALL HTML tags, then turn UBB code to HTML. And I also want
to know how to turn the HTML back to UBB?

This class seems to do exactly what you want.


Class: UBBCode
http://www.phpclasses.org/ubb


--


Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/


--- End Message ---
--- Begin Message ---
At 2003-06-02 01:49 +0500, Haseeb Iqbal wrote:
>when ever i set a cookie it didn't get set even i refresh the page (with php header 
>function) but then i echo something on the page and then use HTML meta refresh the 
>cookie becomes availble on the next page.
>what is it that i am missing here.

I'm not sure what you're trying to say, but please be aware that
you can only set cookies and output header() info before any
normal output has taken place. If for example an include file
has an empty line after it's closing '?>'-line it will output
an empty line in HTML and no more cookies and header info
can be send (in the main file).

Check out the ob_start() (output-buffer start) function
in the manual and also the sections about cookies and
about the header() function. It is all being explained
somewhere but it may be hard to find and piece together.
It took me quite a while in an older version of the
manual. (But currently Chapter 17 is very clear about it.)

To make a fail-safe system, try this in your main .php
file:

<?php
//make sure the previous line is the first line in the file
ob_start();

include "whatever.php";

In the include file and the rest of the file you can use
header() and setcookie() etc. as much as you like,
as long as you don't flush the output buffer.

Beware however that debugging scripts like these might
get a lot tougher since all output is halted until the
script ends and if something goes wrong it may not
output it's data at all.

Greetings,
Jaap


--- End Message ---
--- Begin Message ---
> As I said, since I was recursing through the function by calling it numerous
> times in the middle of its execution, and since the function didn't
> explicitly return, I didn't expect it to continue past each call. That's
> all!

Sounds like you're coming in from CoBOL or maybe BASIC?



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

I am having some issues with PHP's IMAP support and was 
hoping that a kind soul on this list would point me in the right
direction.

First of all, I am confused how PHP provides IMAP support.
Is '--with-cyrus' supposed to complement the functionality provided 
by the c-client? or is it a complete replacement for the latter?

I would much rather not have to use the c-client and was wondering whether 
I can get away just '--with-cyrus'.

TIA for any pointers.

Arsh
 


--- End Message ---
--- Begin Message ---
off the top of my head...

have a column in your user table called "last_active"... it should hold a
date-time, or a unix timestamp, or something like that.

on each page request by a logged in user, you would update that value with a
newer stamp

on physical logout, you would set that to zero or null.

on login, you would check that the value is either zero, or that there has
been at least "X" seconds/minutes passed since the user was last active.

if a user tries to log-in whilst still "active", you'd need to tell them
what happened, explain there's a wait time, or get them to force-logout via
an email sent to their member email address or something.


justin






on 02/06/03 10:38 AM, [EMAIL PROTECTED] ([EMAIL PROTECTED])
wrote:

> ok so i worked out the connection_status and connection_abort will only
> work if the script is actually running and a request to the server , so i
> wont be able to tell if someone had closed the browser or not , what i'd
> like to know is , how can i tell if a user has not accessed the script for
> a certain ammount of time , i need this to calculate the idle time to
> prevent multiple logins , although a static idle time will let a multiple
> login after that and then the first login will get kicked , any ideas ?
> 
> 


--- End Message ---
--- Begin Message ---
thats what i was thinking of logic but i may be having about 10 users logged
in doing full text searching on a 200 meg + database will that affect it ?

-----Original Message-----
From: Justin French [mailto:[EMAIL PROTECTED]
Sent: Monday, June 02, 2003 11:21 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [PHP] user login idle timeout feature


off the top of my head...

have a column in your user table called "last_active"... it should hold a
date-time, or a unix timestamp, or something like that.

on each page request by a logged in user, you would update that value with a
newer stamp

on physical logout, you would set that to zero or null.

on login, you would check that the value is either zero, or that there has
been at least "X" seconds/minutes passed since the user was last active.

if a user tries to log-in whilst still "active", you'd need to tell them
what happened, explain there's a wait time, or get them to force-logout via
an email sent to their member email address or something.


justin






on 02/06/03 10:38 AM, [EMAIL PROTECTED] ([EMAIL PROTECTED])
wrote:

> ok so i worked out the connection_status and connection_abort will only
> work if the script is actually running and a request to the server , so i
> wont be able to tell if someone had closed the browser or not , what i'd
> like to know is , how can i tell if a user has not accessed the script for
> a certain ammount of time , i need this to calculate the idle time to
> prevent multiple logins , although a static idle time will let a multiple
> login after that and then the first login will get kicked , any ideas ?
>
>


--- End Message ---
--- Begin Message ---
I am somwhat aware of the ability to access email using php and IMAP, but is
it at all possible to download email via pop3?



--- End Message ---
--- Begin Message ---
Sure, all the imap_* functions in PHP also work for POP3.  Read through
http://php.net/imap

On Sun, 1 Jun 2003, Erich Kolb wrote:

> I am somwhat aware of the ability to access email using php and IMAP, but is
> it at all possible to download email via pop3?
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
If you are not running PHP under a Windows platform and can compile
extensions into PHP the most efficient way to solve problem #2 may be with a
PHP extension I developed. It handles constants and provides a type of
persistent variable too. It has been immensely useful for my projects.

http://pwee.sourceforge.net/

Lance

> -----Original Message-----
> From: ssamuel [mailto:[EMAIL PROTECTED]
> Sent: Sunday, May 25, 2003 7:05 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] caching variables and preloading functions
>
>
> Hi,
>
> I am looking for a way to do the following with PHP on Apache.
>
> 1) I have a list of functions that I would like loaded into memory when
> the Apache server starts so that other .PHPs can call these functions at
> any time.  Somewhat of a way to expand the API set for PHP.
>
> i.e., Say I have a file named "init.php" which has many functions
> defined.  When the Apache server loads, I want this file to be sourced
> so that these functions are visible to all other phps.
>
> 2) I have several variables, that I want to be cached at server init
> time.  These variables are global variables and live until the server is
> restarted and can be accessed by any .phps.
>
> Are there any ways to do these?
>
> thanks,
> sunil.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
What's the difference (and what's correct)?
With the use of error_reporting  =  E_ALL in php.ini I get an error as
mentioned above. In the code I use $_SERVER[PHP_SELF]. Changing this to
$_SERVER['PHP_SELF'] report no error but with error_reporting = E_ALL &
~E_NOTICE anything goes.
(Apache/2.0.46 (Win32) PHP/4.3.2 on Win2000 pro)



--- End Message ---
--- Begin Message ---
On Mon, 2 Jun 2003, Øystein Håland wrote:

> What's the difference (and what's correct)?
> With the use of error_reporting  =  E_ALL in php.ini I get an error as
> mentioned above. In the code I use $_SERVER[PHP_SELF]. Changing this to
> $_SERVER['PHP_SELF'] report no error but with error_reporting = E_ALL &
> ~E_NOTICE anything goes.
> (Apache/2.0.46 (Win32) PHP/4.3.2 on Win2000 pro)

The manual talks about this, look for the section 
titled:  Why is $foo[bar] wrong?

  http://us2.php.net/types.array

You want to quote your array key as otherwise PHP will
first look for a constant.  Undefined variables/constants 
are E_NOTICE level errors.  PHP throws this error but 
assumes you meant a string, so tries to be smart.  Also, 
read about strings:

  http://us2.php.net/types.string

Regards,
Philip


--- End Message ---
--- Begin Message ---
PEAR is a module for PHP, it is a common space. If you put a file there you
can include it any file you want by just given the command
include("file.php") in any file...

you have to put the password.inc.php file to your php "include" directory
otherwise it does not matter if you edit the config file or not.


"Chris Prior" <[EMAIL PROTECTED]>, iletide şunu yazdı
news:[EMAIL PROTECTED]
> im having problems with the script to include the password.inc.php file
can
> anyone help  ?
>
> these are the error's
>
> Warning: Failed opening
>
'..//home/httpd/vhosts/abbytech.co.uk/httpdocs/auction/includes/passwd.inc.p
> hp' for inclusion (include_path='.:/usr/share/pear') in
> /home/httpd/vhosts/abbytech.co.uk/httpdocs/auction/includes/config.inc.php
> on line 89
>
> Warning: Access denied for user: '[EMAIL PROTECTED]' (Using password: NO)
in
> /home/httpd/vhosts/abbytech.co.uk/httpdocs/auction/includes/config.inc.php
> on line 93
>
> Warning: MySQL Connection Failed: Access denied for user:
'[EMAIL PROTECTED]'
> (Using password: NO) in
> /home/httpd/vhosts/abbytech.co.uk/httpdocs/auction/includes/config.inc.php
> on line 93
>
> Warning: Access denied for user: '[EMAIL PROTECTED]' (Using password: NO)
in
> /home/httpd/vhosts/abbytech.co.uk/httpdocs/auction/includes/config.inc.php
> on line 97
>
> Warning: MySQL Connection Failed: Access denied for user:
'[EMAIL PROTECTED]'
> (Using password: NO) in
> /home/httpd/vhosts/abbytech.co.uk/httpdocs/auction/includes/config.inc.php
> on line 97
>
> Warning: MySQL: A link to the server could not be established in
> /home/httpd/vhosts/abbytech.co.uk/httpdocs/auction/includes/config.inc.php
> on line 97
>
> Warning: Supplied argument is not a valid MySQL result resource in
> /home/httpd/vhosts/abbytech.co.uk/httpdocs/auction/admin/login.php on line
> 42
>
>
>



--- End Message ---
--- Begin Message ---
i havent got a pear for a common space im using a virtual host , can i get
pear and install it ? if so were can i get it from ?



--- End Message ---
--- Begin Message ---
pear looks like already installed ...

your include diretory is mentined in the error message soput the necassary
files there..

I think your answer MUST be in the README or INSTALL documentation.

I mean they cannot let a package out without tellin people which files will
be located where. There MUST be some info about that.

Please read it..

PEAR is at --> pear.php.net



"Chris Prior" <[EMAIL PROTECTED]>, iletide şunu yazdı
news:[EMAIL PROTECTED]
> i havent got a pear for a common space im using a virtual host , can i get
> pear and install it ? if so were can i get it from ?
>
>



--- End Message ---
--- Begin Message ---
ive read the read me file a hundred times ive done everything its says there
thankyou for the help

"Ferhat Bingol" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> pear looks like already installed ...
>
> your include diretory is mentined in the error message soput the necassary
> files there..
>
> I think your answer MUST be in the README or INSTALL documentation.
>
> I mean they cannot let a package out without tellin people which files
will
> be located where. There MUST be some info about that.
>
> Please read it..
>
> PEAR is at --> pear.php.net
>
>
>
> "Chris Prior" <[EMAIL PROTECTED]>, iletide şunu yazdı
> news:[EMAIL PROTECTED]
> > i havent got a pear for a common space im using a virtual host , can i
get
> > pear and install it ? if so were can i get it from ?
> >
> >
>
>



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

I'm trying to get an installation of PHP 4.3.2 with Apache 1.3.27 (SAPI), and mysql/zlib/xml-rpc support working with redhat 9's standard MySQL distribution 3.23.56-1.9

I have successfully compiled Apache and PHP so that normal programs work in both cases. However, I get an error when I use mysql_connect() (no parameters or with 'localhost' or with a username).

The error is somthing like couldn't connect to MySQL through /tmp/mysql.sock. (I'm sending this message from another system)

my configure line was --with-mysql (no directory).

Anyone with experience in this matter would be very helpful.

Thanks,
Greg


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

Make sure mysql is running.

Regards,
Tariq

Greg Beaver wrote:

Hi,

I'm trying to get an installation of PHP 4.3.2 with Apache 1.3.27 (SAPI), and mysql/zlib/xml-rpc support working with redhat 9's standard MySQL distribution 3.23.56-1.9

I have successfully compiled Apache and PHP so that normal programs work in both cases. However, I get an error when I use mysql_connect() (no parameters or with 'localhost' or with a username).

The error is somthing like couldn't connect to MySQL through /tmp/mysql.sock. (I'm sending this message from another system)

my configure line was --with-mysql (no directory).

Anyone with experience in this matter would be very helpful.

Thanks,
Greg




--- End Message ---
--- Begin Message ---
On Monday 02 June 2003 14:19, Greg Beaver wrote:

> I'm trying to get an installation of PHP 4.3.2 with Apache 1.3.27
> (SAPI), and mysql/zlib/xml-rpc support working with redhat 9's standard
> MySQL distribution 3.23.56-1.9
>
> I have successfully compiled Apache and PHP so that normal programs work
> in both cases.  However, I get an error when I use mysql_connect() (no
> parameters or with 'localhost' or with a username).
>
> The error is somthing like couldn't connect to MySQL through
> /tmp/mysql.sock.  (I'm sending this message from another system)

Try specifying 'mysql.default_socket' in php.ini.

-- 
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
------------------------------------------
/*

*/


--- End Message ---
--- Begin Message ---
Hi List

I'm investigating different possibilities to generate printable and
read-only documents, and the "best" method seems to be generating PDF's,
however, I have NO experience with working with PDF's, and the examples
in the manual only list a simple "one-liner" text pdf. 
Where can I find more material that will explain in layman's terms how
to generate pdf's from various sources. As example, I'd like to generate
PDF's of a webpage "on-the-fly" or even from data in MySQL tables. It
seems that you need to provide the pdf generation process with the
co-ordinates and size of each "element", but it is the location of the
"elements" that I have trouble with, ie. what is needed to define each
element?

Thanks for the help.




--- End Message ---
--- Begin Message ---
On Monday 02 June 2003 14:32, Petre Agenbag wrote:

> I'm investigating different possibilities to generate printable and
> read-only documents, and the "best" method seems to be generating PDF's,
> however, I have NO experience with working with PDF's, and the examples
> in the manual only list a simple "one-liner" text pdf.
> Where can I find more material that will explain in layman's terms how
> to generate pdf's from various sources. 

There are several classes available which provide higher level functions 
making things much easier. One that I've used and can recommend is pc4p.

> As example, I'd like to generate
> PDF's of a webpage "on-the-fly" or even from data in MySQL tables. It
> seems that you need to provide the pdf generation process with the
> co-ordinates and size of each "element", but it is the location of the
> "elements" that I have trouble with, ie. what is needed to define each
> element?

Again, there are programs that convert HTML to PDF. But unless the page layout 
is fairly the simple the results can be pretty horrible. Your best bet is the 
hand code the page using one of the above mentioned classes.

-- 
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
------------------------------------------


--- End Message ---
--- Begin Message --- Searching through the archives, most people are running away from caching php scripts.
Im trying to do the opposite.
I have a script that fetches css files. Im trying to add header() calls to it so
that browsers can cache it like a normal css file.
This is what I have at the top of the file ->
----------
header('Content-type: text/css');
header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT');
header('Last-Modified: ' . gmdate('D, d M Y H:i:s', filemtime('./foo.php')) . ' GMT');
--------


For the life of me, according to the output of ethereal (a network sniffer), this file is always fetched from the server.
Yes I did breeze by the HTTP 1.1 spec, but I didn't pick up on anything special that I should be doing.


Is there a way to make the file be put into cache, or am I barking up the wrong tree.

Thanks for your insight.


--- End Message ---
--- Begin Message ---
You can always store the file and every so often regenerate it, and if the 
regernation hasn't timed out jsut passtrhu the cache.

On June 2, 2003 02:38 am, Gerard Samuel wrote:
> Searching through the archives, most people are running away from
> caching php scripts.
> Im trying to do the opposite.
> I have a script that fetches css files.  Im trying to add header() calls
> to it so
> that browsers can cache it like a normal css file.
> This is what I have at the top of the file ->
> ----------
> header('Content-type: text/css');
> header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT');
> header('Last-Modified: ' . gmdate('D, d M Y H:i:s',
> filemtime('./foo.php')) . ' GMT');
> --------
>
> For the life of me, according to the output of ethereal (a network
> sniffer), this file is always fetched from the server.
> Yes I did breeze by the HTTP 1.1 spec, but I didn't pick up on anything
> special that I should be doing.
>
> Is there a way to make the file be put into cache, or am I barking up
> the wrong tree.
>
> Thanks for your insight.


--- End Message ---
--- Begin Message ---
On 02-Jun-2003 Gerard Samuel wrote:
> Searching through the archives, most people are running away from 
> caching php scripts.
> Im trying to do the opposite.
> I have a script that fetches css files.  Im trying to add header() calls 
> to it so
> that browsers can cache it like a normal css file.
> This is what I have at the top of the file ->
> ----------
> header('Content-type: text/css');
> header('Expires: ' . gmdate('D, d M Y H:i:s', time() + 3600) . ' GMT');
> header('Last-Modified: ' . gmdate('D, d M Y H:i:s', 
> filemtime('./foo.php')) . ' GMT');
> --------
> 
> For the life of me, according to the output of ethereal (a network 
> sniffer), this file is always fetched from the server.
> Yes I did breeze by the HTTP 1.1 spec, but I didn't pick up on anything 
> special that I should be doing.
> 
> Is there a way to make the file be put into cache, or am I barking up 
> the wrong tree.
> 

Try adding one more 'hint':

header('Cache-Control: max-age=3600');

Regards,
-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

--- End Message ---
--- Begin Message ---
I'm querying a database then printing the results in a <TABLE>. What I
want to do is format the results in a <TABLE> with 4 columns per row.
Any suggestions?

Thanks.



--- End Message ---
--- Begin Message ---
probably something like:

echo "<table>";
$rs=mysql_query("select * from blabla;",$conn);
while($row=mysql_fetch_row($rs)) {
  echo "<tr>";
    echo "<td>".$row[0]."</td>";
    echo "<td>".$row[1]."</td>";
    echo "<td>".$row[2]."</td>";
    echo "<td>".$row[3]."</td>";
  echo "</tr>";
}
echo "</table>";

R> I'm querying a database then printing the results in a <TABLE>. What I
R> want to do is format the results in a <TABLE> with 4 columns per row.
R> Any suggestions?

R> Thanks.


--- End Message ---
--- Begin Message ---
On 02-Jun-2003 Ralph wrote:
> I'm querying a database then printing the results in a <TABLE>. What I
> want to do is format the results in a <TABLE> with 4 columns per row.
> Any suggestions?
> 
> Thanks.
> 

    $modulo=4;
    unset($a);

    echo "\n<table>";
    while($row = $r->FetchRow()) {
        if (count($a) >= $modulo) {
            echo "\n <tr><td>", implode('</td><td>', $a), '</td></tr>';
            unset($a);
        }
        $a[]=$row['blah'] .'&nbsp;' .$row['foo'];
    }
    while (count($a) < $modulo) {
        $a[]='&nbsp;';
    }
    echo "\n <tr><td>", implode('</td><td>', $a), '</td></tr>';
    echo "\n</table>\n";


Regards,
-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

--- End Message ---
--- Begin Message ---
Hi,
How can I find out the resources consumption (memory waste) of a script?

Thanks,
Armand


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

I have a page with 78 textfields on, is there a way of picking out the field
names and values that the user has filled in as they are very unlikey to be
filling in all of them?

Thanks for your help



--- End Message ---
--- Begin Message ---
take a look at the $_POST array (or $_REQUEST). they contain all submitted
values.

if there are still empty fields, try foreach() and !empty().

"Shaun" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> Hi,
>
> I have a page with 78 textfields on, is there a way of picking out the
field
> names and values that the user has filled in as they are very unlikey to
be
> filling in all of them?
>
> Thanks for your help
>
>



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

 I have a little question, i would like to load up a array with the file 
list of a virtual directory...
example http://my_server/my_directory

I have seen the scandir function and it looks great, but i would prefer load 
the thing using the virtual directory not the real directory

Is there any way to do this ?, or must i use the fisical directory ???



THankx for reading

Stay happy
Miguel Angelo


--- End Message ---
--- Begin Message ---
Daniel,
What about using IP Logging? If the user is already logged in with the same
IP you can let them on, if its a new IP you could ask them if they are a
returning user? If so, make them log in a second time for verification, and
close the other logged in user/account.

Make some fancy "It appears your at a different location message, for
security we'll need you to log in again."

Now if they have dial up that might be a pain in the rear as the IP can
change on each dial up, but for most broadband accounts and business that
the user could go to, IE public library, etc.. they'd still only have one IP
(assuming it's static) for each terminal....(ramblin) but you get the idea,
This is just another suggestion as I don't see it was one used yet.

BTW, I'm only a newbie, so don't ask me how you'd do it, cuz I'm still
learning the art of PHP yet.  ;) I can log ips into a database though, so it
shouldn't be that hard to pull them out and confirm that $newIp==$loggedIp.
If you coupled this idea some of the other expiration techniques mentioned
you could have one hell of a login monitoring system. Best of luck in your
solution.

David

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
Sent: Saturday, May 31, 2003 9:11 PM
To: [EMAIL PROTECTED]
Subject: [PHP] trikky authentication question


hi guys i have an authentication class , there is one last big issue to
fix , i am trying to prevent multiple logins , it does this ok except , the
first login gets kicked instead of the second one , i have a last_login
date entry to work with , what else should i have so on the login check if
the user is logged in , there is an issue using the logged in feature , ok
u give it an interval of say 2 hours , this may prevent that person
reloggin in for two hours right ?? :| , or say its a few minutes , i can
log bak in after a few minutes and still kick the first login, what are my
options



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



--- End Message ---
--- Begin Message ---
this works too:

$message =
 $_POST['first_name']." ".$_POST['last_name']."\n".
 $_POST['address']."\n".
 $_POST['city']." ".$_POST['state']." "$_POST['zip']."\n".
 $_POST['country']."\n".
 $_POST['email']."\n".
 $_POST['design']."\n".
 $_POST['comments'];

"Zbranigan" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
news:[EMAIL PROTECTED]
> >>>>> "Steven" == Steven Farrier <[EMAIL PROTECTED]> writes:
>
>     Steven> I have tried using $_POST array variables in the following
>     Steven> ways $message = "($_POST['first_name'])
>     Steven> ($_POST['last_name'])\n($_POST['address'])\n($_POST['city'])
>     Steven> ($_POST['state'])
>     Steven>
($_POST['zip'])\n($_POST['country'])\n($_POST['email'])\n($_POST['design'])\
>     Steven> n($_POST['comments'])";
>
>     Steven> $message = "$_POST['first_name']
>     Steven> $_POST['last_name']\n$_POST['address']\n$_POST['city']
>     Steven> $_POST['state']
>     Steven>
$_POST['zip']\n$_POST['country']\n$_POST['email']\n$_POST['design']\n$_POST[
>     Steven> 'comments']";
>
>     Steven> Neither of these have worked what am I doing wrong?
>
>     Steven> Steve
>
>
> try it like this:
> $message = "({$_POST['first_name']})
> ({$_POST['last_name']})\n({$_POST['address']})\n({$_POST['city']})
> ({$_POST['state']})
>
({$_POST['zip']})\n({$_POST['country']})\n({$_POST['email']})\n({$_POST['des
ign']})\
> n({$_POST['comments']})";
>
>      $message = "{$_POST['first_name']}
> {$_POST['last_name']}\n{$_POST['address']}\n{$_POST['city']}
{$_POST['state']}
>
{$_POST['zip']}\n{$_POST['country']}\n{$_POST['email']}\n{$_POST['design']}\
n{$_POST[
> 'comments']}";
>
> --
> no toll on the internet; there are paths of many kinds;
> whoever passes this portal will travel freely in the world



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

I have many textfields on my page. How can I add to a string the name of a
textfield that ends in the same number as another textfield i.e. 5?

Thanks for your help.



--- End Message ---
--- Begin Message ---
Taking into account your earlier post:

$string = '';
foreach ( array_keys($_POST) as $var ) {
        if ( !is_empty($_POST[$var]) ) {
                string .= $var.' ';
        }
}
trim($string);




On Monday 02 June 2003 03:22 am, Shaun wrote:
> Hi,
>
> I have many textfields on my page. How can I add to a string the name of a
> textfield that ends in the same number as another textfield i.e. 5?
>
> Thanks for your help.


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

I am a bit of a newby in php, so I hope the group my forgive me, if I ask a
question answered before.

The presumtion: php is first evaluating the complete script, before sending
anything back to the browser.

The situation: I have got a script, which retrieves data very slowly, and
causes the browser to timeout (worst case).

Is it possible, to send the elements, so far outputed, to the browser, and
use that as keep alive, i.e. give the user already something to see:-) 
And, of course, do that regular, out of my data retrieval loop.


Thanks,
Roland
-- 
Roland Welker
PHP Developer
MMS Graphics
6 Tyock Ind. Est
Elgin, Moray IV30 1XY

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

> Is it possible, to send the elements, so far outputed, to the browser, and
> use that as keep alive, i.e. give the user already something to see:-) 
> And, of course, do that regular, out of my data retrieval loop.

http://www.php.net/ob_implicit_flush is your friend.


HTH, Axel.

--- End Message ---
--- Begin Message --- www.php.net/flush

Roland Welker wrote:

Hi,

I am a bit of a newby in php, so I hope the group my forgive me, if I ask a
question answered before.

The presumtion: php is first evaluating the complete script, before sending
anything back to the browser.

The situation: I have got a script, which retrieves data very slowly, and
causes the browser to timeout (worst case).

Is it possible, to send the elements, so far outputed, to the browser, and
use that as keep alive, i.e. give the user already something to see:-) And, of course, do that regular, out of my data retrieval loop.



Thanks,
Roland



-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.



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

this code
cant print the value

<?

  session_start();
  $name = $_POST['name'];
  session_register('name');
  echo $_SESSION['name'];

?>

--- End Message ---
--- Begin Message ---
The value isn't available until the next page and you should register
with

$_SESSION["name"]=$_POST["name"];

HTH
Ade
www.phpscriptsearch.com


-----Original Message-----
From: Aris Santillan [mailto:[EMAIL PROTECTED] 
Sent: 02 June 2003 11:55
To: Php (E-mail)
Subject: [PHP] session


hi 

this code
cant print the value

<?

  session_start();
  $name = $_POST['name'];
  session_register('name');
  echo $_SESSION['name'];

?>


--- End Message ---
--- Begin Message ---
Hi everyone,
Some time back I had no idea about sessions and I asked this list to give me
a  few links on the web where i can learn about them, thanks to you guys I
understand sessions and use them without any problem.

Now I have the same problem with cookies, I of course first went to our
friend (google) and asked him about cookies in PHP, the problem is I got a
hell of a lot of answers from him....which one is good? I am a total newbie
when it comes to cookies so can you recomend any one (or two) URL/s which
gives a step by step totural on using cookies in PHP? hopefully in baby
steps if cookies are too complicated.

Thanks,
-Ryan


--- End Message ---
--- Begin Message ---
PHP Manual has good section on cookie... have you tried the manual?
good luck
awlad
----- Original Message ----- 
From: "Ryan A" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, June 01, 2003 1:56 PM
Subject: [PHP] Cookies - recomendation please


> Hi everyone,
> Some time back I had no idea about sessions and I asked this list to give
me
> a  few links on the web where i can learn about them, thanks to you guys I
> understand sessions and use them without any problem.
>
> Now I have the same problem with cookies, I of course first went to our
> friend (google) and asked him about cookies in PHP, the problem is I got a
> hell of a lot of answers from him....which one is good? I am a total
newbie
> when it comes to cookies so can you recomend any one (or two) URL/s which
> gives a step by step totural on using cookies in PHP? hopefully in baby
> steps if cookies are too complicated.
>
> Thanks,
> -Ryan
>
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


--- End Message ---

Reply via email to