Re: [PHP] Variable variable

2001-04-18 Thread Chris Fry

Jacky,

You do not need the value. The variable $id will either exist (if the user checked it) 
or not (if the user did not check it).

Hope this helps.

Chris

Jacky wrote:

> Hi all
> I have a form with check box and name of those checkboxes is usuing variable lke 
>this,
>
> 
> 
>
> and when I submit the form to page foo.php4, at that page, I use Variable variable 
>to call the value of the check box to see if it checked like this
>
> $quey = "select id from table";
> $result = .. ( assumeing it is done and i got value for $id for all records from 
>table)
>
> if ($$id =="on"){
> echo "on";
> }else{
> echo "off";
> }
>
> It always returns echo "off", why is that?
> cheers
> Jack
> [EMAIL PROTECTED]
> "There is nothing more rewarding than reaching the goal you set for yourself"

--
Chris Fry
Quillsoft Pty Ltd
Specialists in Secure Internet Services and E-Commerce Solutions
10 Gray Street
Kogarah
NSW  2217
Australia

Phone: +61 2 9553 1691
Fax: +61 2 9553 1692
Mobile: 0419 414 323
eMail: [EMAIL PROTECTED]
http://www.quillsoft.com.au

You can download our Public CA Certificate from:-
https://ca.secureanywhere.com/htdocs/cacert.crt

**

This information contains confidential information intended only for
the use of the authorised recipient.  If you are not an authorised
recipient of this e-mail, please contact Quillsoft Pty Ltd by return
e-mail.
In this case, you should not read, print, re-transmit, store or act
in reliance on this e-mail or any attachments, and should destroy all
copies of them.
This e-mail and any attachments may also contain copyright material
belonging to Quillsoft Pty Ltd.
The views expressed in this e-mail or attachments are the views of
the author and not the views of Quillsoft Pty Ltd.
You should only deal with the material contained in this e-mail if
you are authorised to do so.

This notice should not be removed.



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




Re: [PHP] Variable variable

2001-04-18 Thread [EMAIL PROTECTED]

the variable $id in the second sniplet come from the id from talble when I
run query and loop it using mysql_fetch_array. So I end up have value of $id
from the id field from table, right?But the value store in $id is now in
string value, and if I need to use that value for the if..then.. else
condition to check if which checkbox is checked, I will need to use Variable
variable to make the string back to be variable again , like $$id, for
instance after I run the query and get all Id value from table, it will be
like
$id = 1, $id=2, and so on
and as I used this for checkbox name at the previous page, in order to uset
it in the if..then..else condition in the second sniplet, it will be like
if ($1=="on") {
do something
}else{
do somehting
}
 but something is wrong here at the if then else bit. But I don't know what
is it.
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"
- Original Message -
From: Ulf Wendel <[EMAIL PROTECTED]>
To: Jacky <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, April 18, 2001 2:20 AM
Subject: Re: [PHP] Variable variable


>
>
> Jacky schrieb:
> > 
> > 
> >
> > and when I submit the form to page foo.php4, at that page, I use
Variable variable to call the value of the check box to see if it checked
like this
> >
> > $quey = "select id from table";
> > $result = .. ( assumeing it is done and i got value for $id for all
records from table)
> >
> > if ($$id =="on"){
> > echo "on";
> > }else{
> > echo "off";
> > }
>
> What's the value of $id in the second snippet? Generally speaking using
> $GLOBALS[$id] gives you more readable code but variable variables.
>
> Ulf
>
> --
> Neu: PEAR Menu 3 - Navigationsstrukturen dynamisch dargestellt
> http://www.ulf-wendel.de/projekte/menu/tutorial.php |
> http://www.phpdoc.de
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




Re: [PHP] Variable variable

2001-04-18 Thread Jacky

so how do I check at the next page which one is checked?
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"
- Original Message -
From: Chris Fry <[EMAIL PROTECTED]>
To: Jacky <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, April 18, 2001 2:31 AM
Subject: Re: [PHP] Variable variable


> Jacky,
>
> You do not need the value. The variable $id will either exist (if the user
checked it) or not (if the user did not check it).
>
> Hope this helps.
>
> Chris
>
> Jacky wrote:
>
> > Hi all
> > I have a form with check box and name of those checkboxes is usuing
variable lke this,
> >
> > 
> > 
> >
> > and when I submit the form to page foo.php4, at that page, I use
Variable variable to call the value of the check box to see if it checked
like this
> >
> > $quey = "select id from table";
> > $result = .. ( assumeing it is done and i got value for $id for all
records from table)
> >
> > if ($$id =="on"){
> > echo "on";
> > }else{
> > echo "off";
> > }
> >
> > It always returns echo "off", why is that?
> > cheers
> > Jack
> > [EMAIL PROTECTED]
> > "There is nothing more rewarding than reaching the goal you set for
yourself"
>
> --
> Chris Fry
> Quillsoft Pty Ltd
> Specialists in Secure Internet Services and E-Commerce Solutions
> 10 Gray Street
> Kogarah
> NSW  2217
> Australia
>
> Phone: +61 2 9553 1691
> Fax: +61 2 9553 1692
> Mobile: 0419 414 323
> eMail: [EMAIL PROTECTED]
> http://www.quillsoft.com.au
>
> You can download our Public CA Certificate from:-
> https://ca.secureanywhere.com/htdocs/cacert.crt
>
> **
>
> This information contains confidential information intended only for
> the use of the authorised recipient.  If you are not an authorised
> recipient of this e-mail, please contact Quillsoft Pty Ltd by return
> e-mail.
> In this case, you should not read, print, re-transmit, store or act
> in reliance on this e-mail or any attachments, and should destroy all
> copies of them.
> This e-mail and any attachments may also contain copyright material
> belonging to Quillsoft Pty Ltd.
> The views expressed in this e-mail or attachments are the views of
> the author and not the views of Quillsoft Pty Ltd.
> You should only deal with the material contained in this e-mail if
> you are authorised to do so.
>
> This notice should not be removed.
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>


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




Re: [PHP] Is it possible to parse a variable by character?

2001-04-18 Thread Sean Coyle

Thanks for that help!  Now I am getting an interesting error that I am not
sure what to make of.

Warning: REG_ERANGE in /home/httpd/www/worldvibe.org/digitall/edit_f.php on
line 91

Here are lines surrounding 91:

89->   strtolower($f_loc_name);
90->   $f_loc_new = "";
91->   $f_loc_new = ereg_replace("[^[_a-z0-9-\.]]", "", $f_loc_name);
92->   $f_loc_name = "";
93->   $f_loc_name = $f_loc_new;

I have tried tow other variations of line 91, and both of them do not seem
to work the way I am hoping for.

I have (since the last message, decided to remove the offending characters,
rather than replace them with an underscore (hence the "").  Below is an
example of what I am trying to accomplish:

Test_File#()*#$.txt should be converted to test_file.txt

TEST.file.#.txt should be converted to sean.coyle..txt

I am not all that great with regular expressions, so any help I can get on
this is greatly appreciated!

Kind Regards,

Sean


On 4/17/01 11:01 PM, in article
DC017B079D81D411998C009027B7112A015ED111@EXC-TYO-01, "Maxim Maletsky"
<[EMAIL PROTECTED]> wrote:

> 
> $str = eregi_replace("[^[_a-z0-9-]]", '_', $str)
> 
> would this 2-seconds written-in, non-tested scratch of code do the job?
> 
> If not then something like this...
> 
> eregi_replace() is what you are looking for.
> 
> 
> 
> Sincerely, 
> 
> Maxim Maletsky
> Founder, Chief Developer
> PHPBeginner.com (Where PHP Begins)
> [EMAIL PROTECTED]
> www.phpbeginner.com
> 
> 
> 
> 
> -Original Message-
> From: Sean Coyle [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, April 18, 2001 2:23 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Is it possible to parse a variable by character?
> 
> 
> Hey there guys,
> 
>   This may seem like a dumb question, but I have to ask it anyway.
> 
> I have a form in one of my php based scripts that allows for file uploads.
> I recently noticed a potential issue if people upload files containing
> anything else but the standard characters ([_a-z0-9-]+(\.[_a-z0-9-]).
> 
>   I am not sure if this can be done, but what I need to do is parse this
> variable (lets call it $file_name) by character looking for anything save
> letters a-z (A-Z) and numbers 0-9.  Any arrangements of numbers, letters and
> full stops (.) are to be permitted, and if any character does not meet those
> specifications, that single character should be converted to an underscore.
> 
>   Any ideas on how I can go about doing something like this?
> 
> BTW: (Some background info)  I examined the average validate e-mail idea,
> however, rather than reject the string, I would like to be able to 'replace'
> the offending character.
> 
> Thanks in advance,
> 
> Sean
> 


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




Re: [PHP] Is it possible to parse a variable by character?

2001-04-18 Thread Sean Coyle

Oops, noticed a small impossibility error:

TEST.file.#.txt should be converted to sean.coyle..txt

Should read

TEST.file.#.txt should be converted to test.file..txt

But, I would imagine you guys figured that one out already.

Cheers,

Sean

On 4/18/01 12:26 AM, in article [EMAIL PROTECTED], "Sean
Coyle" <[EMAIL PROTECTED]> wrote:

> Thanks for that help!  Now I am getting an interesting error that I am not
> sure what to make of.
> 
> Warning: REG_ERANGE in /home/httpd/www/worldvibe.org/digitall/edit_f.php on
> line 91
> 
> Here are lines surrounding 91:
> 
> 89->   strtolower($f_loc_name);
> 90->   $f_loc_new = "";
> 91->   $f_loc_new = ereg_replace("[^[_a-z0-9-\.]]", "", $f_loc_name);
> 92->   $f_loc_name = "";
> 93->   $f_loc_name = $f_loc_new;
> 
> I have tried tow other variations of line 91, and both of them do not seem
> to work the way I am hoping for.
> 
> I have (since the last message, decided to remove the offending characters,
> rather than replace them with an underscore (hence the "").  Below is an
> example of what I am trying to accomplish:
> 
> Test_File#()*#$.txt should be converted to test_file.txt
> 
> TEST.file.#.txt should be converted to sean.coyle..txt
> 
> I am not all that great with regular expressions, so any help I can get on
> this is greatly appreciated!
> 
> Kind Regards,
> 
> Sean
> 
> 
> On 4/17/01 11:01 PM, in article
> DC017B079D81D411998C009027B7112A015ED111@EXC-TYO-01, "Maxim Maletsky"
> <[EMAIL PROTECTED]> wrote:
> 
>> 
>> $str = eregi_replace("[^[_a-z0-9-]]", '_', $str)
>> 
>> would this 2-seconds written-in, non-tested scratch of code do the job?
>> 
>> If not then something like this...
>> 
>> eregi_replace() is what you are looking for.
>> 
>> 
>> 
>> Sincerely, 
>> 
>> Maxim Maletsky
>> Founder, Chief Developer
>> PHPBeginner.com (Where PHP Begins)
>> [EMAIL PROTECTED]
>> www.phpbeginner.com
>> 
>> 
>> 
>> 
>> -Original Message-
>> From: Sean Coyle [mailto:[EMAIL PROTECTED]]
>> Sent: Wednesday, April 18, 2001 2:23 PM
>> To: [EMAIL PROTECTED]
>> Subject: [PHP] Is it possible to parse a variable by character?
>> 
>> 
>> Hey there guys,
>> 
>>   This may seem like a dumb question, but I have to ask it anyway.
>> 
>> I have a form in one of my php based scripts that allows for file uploads.
>> I recently noticed a potential issue if people upload files containing
>> anything else but the standard characters ([_a-z0-9-]+(\.[_a-z0-9-]).
>> 
>>   I am not sure if this can be done, but what I need to do is parse this
>> variable (lets call it $file_name) by character looking for anything save
>> letters a-z (A-Z) and numbers 0-9.  Any arrangements of numbers, letters and
>> full stops (.) are to be permitted, and if any character does not meet those
>> specifications, that single character should be converted to an underscore.
>> 
>>   Any ideas on how I can go about doing something like this?
>> 
>> BTW: (Some background info)  I examined the average validate e-mail idea,
>> however, rather than reject the string, I would like to be able to 'replace'
>> the offending character.
>> 
>> Thanks in advance,
>> 
>> Sean
>> 
> 


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




[PHP] Cannot destroy session cookie

2001-04-18 Thread Jens Kisters

Hi there,
i'm having a little trouble with cleaning up sessions.
I have a login page that sets a certain session variable that is used to
determine wether a user is logged on.
When the user has cookies turned on the application recognizes the
running session an resumes it, that also happens on the login-page,
i'd like to explicitly destroy the session before logging on, i tried
unsetting the session variable, destroying the session, unsetting the
session cookie, but nothing worked, the session is always continued with
the same SessionID.
What can i do to destroy the session?

tks
Jens

--
Grüße aus dem schönen Kleve
Jens Kisters

rosomm et partner
Agentur für neue Medien GmbH
Dienstleistungszentrum am
Weißen Tor - Eingang B
Gocher Landstrasse 2
47551 Kleve / Bedburg-Hau

Telefon: 02821 - 97856-20
Telefax: 02821 - 97856-77
[EMAIL PROTECTED]
http://www.rosomm-partner.de



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




FW: RE: [PHP] highlighting search results (revisited)

2001-04-18 Thread Matt Williams


> The input from the search form is $searchtext.  The Returned
> Search data is
> $searchdata.
>
> 
> $sql = "SELECT searchdata FROM table WHERE searchdata LIKE
> '%$searchtext'";
> $result = @mysql_query($sql, $connection)
> or die (mysql_error());
>
> $num = mysql_num_rows($result);
>
> $x = 0;
>
> if ($num == 0) {
> echo "No results";
> } else {
>
> while($row = mysql_fetch_array($result)) {
> $searchdata = $row['searchdata'];
>
> $x++;
>
> $searchdata = eregi_replace("$searchtext", " color=\"#FF\">$searchtext", $searchdata);
>
> echo "$x. $searchdata";
>
> }
>
> }
>
> ?>
>
> Make sense?  And does it help?

Hi James

Yes and no.

I've got it to do that but what if the user enters more than one word?
I need to be able to loop inside the while for each word to be able to
highlight it. I think!
The problem is if someone enters a word which is used within the
hightlighting code. ie. font in your example.
This would then hightlight this again and screw the resulting code.

M@


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




[PHP] checkbox validation

2001-04-18 Thread Jacky

Hi all
I have a form with the checkbox like this

$query="select id from foo";
$result=($query,$con);
while ($row = mysql_fetch_array($result)) 
 {

 }
submit button and stuffs here...


After I submit to next page, at next page, how do I check which check box is checked?
like this?

if ($id=="on") {
do something
}else{
do something
}

I did try this but did not work, what am i suppose to do to achieve this?
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for yourself"



RE: [PHP] checkbox validation

2001-04-18 Thread Matt Williams


> After I submit to next page, at next page, how do I check which 
> check box is checked?
> like this?
> 
> if ($id=="on") {
> do something
> }else{
> do something
> }

Hi 

try this assuming you have no toher check boxes called $id

if(isset($id))
{
  do something
}else{
  do other
}

M@

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




Re: [PHP] Variable variable

2001-04-18 Thread Chris Fry

Sorry - thought you only had one! - it's late.

To Name the checkboxes you need:




You would have to do a $HTTP_GET_VARS on the next page to find out which ones
exist.

Then your select statement would be:

$query = "select * from table where id IN ('comma delimited list of values')";

Messy but do-able!

Probably a better way - There usually is!

Chris

Jacky wrote:

> so how do I check at the next page which one is checked?
> Jack
> [EMAIL PROTECTED]
> "There is nothing more rewarding than reaching the goal you set for
> yourself"
> - Original Message -
> From: Chris Fry <[EMAIL PROTECTED]>
> To: Jacky <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Wednesday, April 18, 2001 2:31 AM
> Subject: Re: [PHP] Variable variable
>
> > Jacky,
> >
> > You do not need the value. The variable $id will either exist (if the user
> checked it) or not (if the user did not check it).
> >
> > Hope this helps.
> >
> > Chris
> >
> > Jacky wrote:
> >
> > > Hi all
> > > I have a form with check box and name of those checkboxes is usuing
> variable lke this,
> > >
> > > 
> > > 
> > >
> > > and when I submit the form to page foo.php4, at that page, I use
> Variable variable to call the value of the check box to see if it checked
> like this
> > >
> > > $quey = "select id from table";
> > > $result = .. ( assumeing it is done and i got value for $id for all
> records from table)
> > >
> > > if ($$id =="on"){
> > > echo "on";
> > > }else{
> > > echo "off";
> > > }
> > >
> > > It always returns echo "off", why is that?
> > > cheers
> > > Jack
> > > [EMAIL PROTECTED]
> > > "There is nothing more rewarding than reaching the goal you set for
> yourself"
> >
> > --
> > Chris Fry
> > Quillsoft Pty Ltd
> > Specialists in Secure Internet Services and E-Commerce Solutions
> > 10 Gray Street
> > Kogarah
> > NSW  2217
> > Australia
> >
> > Phone: +61 2 9553 1691
> > Fax: +61 2 9553 1692
> > Mobile: 0419 414 323
> > eMail: [EMAIL PROTECTED]
> > http://www.quillsoft.com.au
> >
> > You can download our Public CA Certificate from:-
> > https://ca.secureanywhere.com/htdocs/cacert.crt
> >
> > **
> >
> > This information contains confidential information intended only for
> > the use of the authorised recipient.  If you are not an authorised
> > recipient of this e-mail, please contact Quillsoft Pty Ltd by return
> > e-mail.
> > In this case, you should not read, print, re-transmit, store or act
> > in reliance on this e-mail or any attachments, and should destroy all
> > copies of them.
> > This e-mail and any attachments may also contain copyright material
> > belonging to Quillsoft Pty Ltd.
> > The views expressed in this e-mail or attachments are the views of
> > the author and not the views of Quillsoft Pty Ltd.
> > You should only deal with the material contained in this e-mail if
> > you are authorised to do so.
> >
> > This notice should not be removed.
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> >
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

--
Chris Fry
Quillsoft Pty Ltd
Specialists in Secure Internet Services and E-Commerce Solutions
10 Gray Street
Kogarah
NSW  2217
Australia

Phone: +61 2 9553 1691
Fax: +61 2 9553 1692
Mobile: 0419 414 323
eMail: [EMAIL PROTECTED]
http://www.quillsoft.com.au

You can download our Public CA Certificate from:-
https://ca.secureanywhere.com/htdocs/cacert.crt

**

This information contains confidential information intended only for
the use of the authorised recipient.  If you are not an authorised
recipient of this e-mail, please contact Quillsoft Pty Ltd by return
e-mail.
In this case, you should not read, print, re-transmit, store or act
in reliance on this e-mail or any attachments, and should destroy all
copies of them.
This e-mail and any attachments may also contain copyright material
belonging to Quillsoft Pty Ltd.
The views expressed in this e-mail or attachments are the views of
the author and not the views of Quillsoft Pty Ltd.
You should only deal with the material contained in this e-mail if
you are authorised to do so.

This notice should not be removed.



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




Re: [PHP] Variable variable

2001-04-18 Thread Jacky

I did look up in the manual for $HTTP_GET_VARS but could not find it? what
is it? a function?
sorry to ask this again, just try to find out how to use that.
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"
- Original Message -
From: Chris Fry <[EMAIL PROTECTED]>
To: Jacky <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, April 18, 2001 2:59 AM
Subject: Re: [PHP] Variable variable


> Sorry - thought you only had one! - it's late.
>
> To Name the checkboxes you need:
>  while (get records from db) {
> $id = id from record;
> ?>
> 
>  }
> ?>
>
> You would have to do a $HTTP_GET_VARS on the next page to find out which
ones
> exist.
>
> Then your select statement would be:
>
> $query = "select * from table where id IN ('comma delimited list of
values')";
>
> Messy but do-able!
>
> Probably a better way - There usually is!
>
> Chris
>
> Jacky wrote:
>
> > so how do I check at the next page which one is checked?
> > Jack
> > [EMAIL PROTECTED]
> > "There is nothing more rewarding than reaching the goal you set for
> > yourself"
> > - Original Message -
> > From: Chris Fry <[EMAIL PROTECTED]>
> > To: Jacky <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Wednesday, April 18, 2001 2:31 AM
> > Subject: Re: [PHP] Variable variable
> >
> > > Jacky,
> > >
> > > You do not need the value. The variable $id will either exist (if the
user
> > checked it) or not (if the user did not check it).
> > >
> > > Hope this helps.
> > >
> > > Chris
> > >
> > > Jacky wrote:
> > >
> > > > Hi all
> > > > I have a form with check box and name of those checkboxes is usuing
> > variable lke this,
> > > >
> > > > 
> > > > 
> > > >
> > > > and when I submit the form to page foo.php4, at that page, I use
> > Variable variable to call the value of the check box to see if it
checked
> > like this
> > > >
> > > > $quey = "select id from table";
> > > > $result = .. ( assumeing it is done and i got value for $id for
all
> > records from table)
> > > >
> > > > if ($$id =="on"){
> > > > echo "on";
> > > > }else{
> > > > echo "off";
> > > > }
> > > >
> > > > It always returns echo "off", why is that?
> > > > cheers
> > > > Jack
> > > > [EMAIL PROTECTED]
> > > > "There is nothing more rewarding than reaching the goal you set for
> > yourself"
> > >
> > > --
> > > Chris Fry
> > > Quillsoft Pty Ltd
> > > Specialists in Secure Internet Services and E-Commerce Solutions
> > > 10 Gray Street
> > > Kogarah
> > > NSW  2217
> > > Australia
> > >
> > > Phone: +61 2 9553 1691
> > > Fax: +61 2 9553 1692
> > > Mobile: 0419 414 323
> > > eMail: [EMAIL PROTECTED]
> > > http://www.quillsoft.com.au
> > >
> > > You can download our Public CA Certificate from:-
> > > https://ca.secureanywhere.com/htdocs/cacert.crt
> > >
> > > **
> > >
> > > This information contains confidential information intended only for
> > > the use of the authorised recipient.  If you are not an authorised
> > > recipient of this e-mail, please contact Quillsoft Pty Ltd by return
> > > e-mail.
> > > In this case, you should not read, print, re-transmit, store or act
> > > in reliance on this e-mail or any attachments, and should destroy all
> > > copies of them.
> > > This e-mail and any attachments may also contain copyright material
> > > belonging to Quillsoft Pty Ltd.
> > > The views expressed in this e-mail or attachments are the views of
> > > the author and not the views of Quillsoft Pty Ltd.
> > > You should only deal with the material contained in this e-mail if
> > > you are authorised to do so.
> > >
> > > This notice should not be removed.
> > >
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
[EMAIL PROTECTED]
> > >
> > >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> --
> Chris Fry
> Quillsoft Pty Ltd
> Specialists in Secure Internet Services and E-Commerce Solutions
> 10 Gray Street
> Kogarah
> NSW  2217
> Australia
>
> Phone: +61 2 9553 1691
> Fax: +61 2 9553 1692
> Mobile: 0419 414 323
> eMail: [EMAIL PROTECTED]
> http://www.quillsoft.com.au
>
> You can download our Public CA Certificate from:-
> https://ca.secureanywhere.com/htdocs/cacert.crt
>
> **
>
> This information contains confidential information intended only for
> the use of the authorised recipient.  If you are not an authorised
> recipient of this e-mail, please contact Quillsoft Pty Ltd by return
> e-mail.
> In this case, you should not read, print, re-transmit, store or act
> in reliance on this e-mail or any attachments,

[PHP] to find out which checkbox is checked

2001-04-18 Thread [EMAIL PROTECTED]

Hi all,
I still cannot get my problem sought out, pretty desparate here so decided
to post my question again.
Allow me to repeat my question again:
I have a form with the checkbox like this

");
 }
submit button and stuffs here...
?>


After I submit to next page, at next page, how do I check which check box is
checked?
I did try isset() and empty() to check if variable exist ( as shown below)
and did not work as the result always turn up to be "off"

   if((empty($id))=='true'){
echo "off";
 }else{
   echo "on";
   }

And I also try
if(isset($id))
{
  ..do echo off here...
}else{
  ...do echo on
}

And the result is always "off" as well.

Somene advice me to use $http_var_gets btu I could not find it from manaual,
is that the solution I need?
cheers
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"
- Original Message -
From: Jacky <[EMAIL PROTECTED]>
To: Chris Fry <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, April 18, 2001 2:57 PM
Subject: Re: [PHP] Variable variable


> I did look up in the manual for $HTTP_GET_VARS but could not find it? what
> is it? a function?
> sorry to ask this again, just try to find out how to use that.
> Jack
> [EMAIL PROTECTED]
> "There is nothing more rewarding than reaching the goal you set for
> yourself"
> - Original Message -
> From: Chris Fry <[EMAIL PROTECTED]>
> To: Jacky <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Wednesday, April 18, 2001 2:59 AM
> Subject: Re: [PHP] Variable variable
>
>
> > Sorry - thought you only had one! - it's late.
> >
> > To Name the checkboxes you need:
> >  > while (get records from db) {
> > $id = id from record;
> > ?>
> > 
> >  > }
> > ?>
> >
> > You would have to do a $HTTP_GET_VARS on the next page to find out which
> ones
> > exist.
> >
> > Then your select statement would be:
> >
> > $query = "select * from table where id IN ('comma delimited list of
> values')";
> >
> > Messy but do-able!
> >
> > Probably a better way - There usually is!
> >
> > Chris
> >
> > Jacky wrote:
> >
> > > so how do I check at the next page which one is checked?
> > > Jack
> > > [EMAIL PROTECTED]
> > > "There is nothing more rewarding than reaching the goal you set for
> > > yourself"
> > > - Original Message -
> > > From: Chris Fry <[EMAIL PROTECTED]>
> > > To: Jacky <[EMAIL PROTECTED]>
> > > Cc: <[EMAIL PROTECTED]>
> > > Sent: Wednesday, April 18, 2001 2:31 AM
> > > Subject: Re: [PHP] Variable variable
> > >
> > > > Jacky,
> > > >
> > > > You do not need the value. The variable $id will either exist (if
the
> user
> > > checked it) or not (if the user did not check it).
> > > >
> > > > Hope this helps.
> > > >
> > > > Chris
> > > >
> > > > Jacky wrote:
> > > >
> > > > > Hi all
> > > > > I have a form with check box and name of those checkboxes is
usuing
> > > variable lke this,
> > > > >
> > > > > 
> > > > > 
> > > > >
> > > > > and when I submit the form to page foo.php4, at that page, I use
> > > Variable variable to call the value of the check box to see if it
> checked
> > > like this
> > > > >
> > > > > $quey = "select id from table";
> > > > > $result = .. ( assumeing it is done and i got value for $id
for
> all
> > > records from table)
> > > > >
> > > > > if ($$id =="on"){
> > > > > echo "on";
> > > > > }else{
> > > > > echo "off";
> > > > > }
> > > > >
> > > > > It always returns echo "off", why is that?
> > > > > cheers
> > > > > Jack
> > > > > [EMAIL PROTECTED]
> > > > > "There is nothing more rewarding than reaching the goal you set
for
> > > yourself"
> > > >
> > > > --
> > > > Chris Fry
> > > > Quillsoft Pty Ltd
> > > > Specialists in Secure Internet Services and E-Commerce Solutions
> > > > 10 Gray Street
> > > > Kogarah
> > > > NSW  2217
> > > > Australia
> > > >
> > > > Phone: +61 2 9553 1691
> > > > Fax: +61 2 9553 1692
> > > > Mobile: 0419 414 323
> > > > eMail: [EMAIL PROTECTED]
> > > > http://www.quillsoft.com.au
> > > >
> > > > You can download our Public CA Certificate from:-
> > > > https://ca.secureanywhere.com/htdocs/cacert.crt
> > > >
> > > >
**
> > > >
> > > > This information contains confidential information intended only for
> > > > the use of the authorised recipient.  If you are not an authorised
> > > > recipient of this e-mail, please contact Quillsoft Pty Ltd by return
> > > > e-mail.
> > > > In this case, you should not read, print, re-transmit, store or act
> > > > in reliance on this e-mail or any attachments, and should destroy
all
> > > > copies of them.
> > > > This e-mail and any attachments may also contain copyright material
> > > > belonging to Quillsoft Pty Ltd.
> > > > The views expressed in this e-mail or attachments are the views of
> > > > the author and not the views of Quillsoft Pty Ltd.
> > > > You should only deal with the material contained in this e-mail if
> > > > you are authorised to do so.

[PHP] AW: SSL SSL SSL SSL -- READ THIS!!!!!!

2001-04-18 Thread Jens Fisch

No. Just point your links to https://www.yoursecureserver.com/dir/page.htm
or, if your SSL is on another port, to
https://www.yoursecureserver.com:otherportnumber/dir/page.htm.

cu, Jens




> -Ursprüngliche Nachricht-
> Von: phpman [mailto:[EMAIL PROTECTED]]
> Gesendet: Dienstag, 17. April 2001 22:56
> An: [EMAIL PROTECTED]
> Betreff: SSL SSL SSL SSL -- READ THIS!!
>
>
> How do I establish an SSL socket connection with PHP?
> I have PHP compiled in an Apache Mod_SSL server. Do I need to compile PHP
> with
> some sort of open_ssl option? I have --enable-sockets in the command line.
> Please help!!!
>
> -dave
>
>
>
>
>
>
>
>
>


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




Re: [PHP] to find out which checkbox is checked

2001-04-18 Thread Martin Cabrera Diaubalick

Hello Jacky!

Try to echo the variable to see its value.

HTH



- Original Message -
From: "Jacky@lilst" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, April 18, 2001 10:19 PM
Subject: [PHP] to find out which checkbox is checked


> Hi all,
> I still cannot get my problem sought out, pretty desparate here so decided
> to post my question again.
> Allow me to repeat my question again:
> I have a form with the checkbox like this
> 
>  $query="select id from foo";
> $result=($query,$con);
> while ($row = mysql_fetch_array($result))
>  {
> print("");
>  }
> submit button and stuffs here...
> ?>
> 
>
> After I submit to next page, at next page, how do I check which check box
is
> checked?
> I did try isset() and empty() to check if variable exist ( as shown below)
> and did not work as the result always turn up to be "off"
>
>if((empty($id))=='true'){
> echo "off";
>  }else{
>echo "on";
>}
>
> And I also try
> if(isset($id))
> {
>   ..do echo off here...
> }else{
>   ...do echo on
> }
>
> And the result is always "off" as well.
>
> Somene advice me to use $http_var_gets btu I could not find it from
manaual,
> is that the solution I need?
> cheers
> Jack
> [EMAIL PROTECTED]
> "There is nothing more rewarding than reaching the goal you set for
> yourself"
> - Original Message -
> From: Jacky <[EMAIL PROTECTED]>
> To: Chris Fry <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Wednesday, April 18, 2001 2:57 PM
> Subject: Re: [PHP] Variable variable
>
>
> > I did look up in the manual for $HTTP_GET_VARS but could not find it?
what
> > is it? a function?
> > sorry to ask this again, just try to find out how to use that.
> > Jack
> > [EMAIL PROTECTED]
> > "There is nothing more rewarding than reaching the goal you set for
> > yourself"
> > - Original Message -
> > From: Chris Fry <[EMAIL PROTECTED]>
> > To: Jacky <[EMAIL PROTECTED]>
> > Cc: <[EMAIL PROTECTED]>
> > Sent: Wednesday, April 18, 2001 2:59 AM
> > Subject: Re: [PHP] Variable variable
> >
> >
> > > Sorry - thought you only had one! - it's late.
> > >
> > > To Name the checkboxes you need:
> > >  > > while (get records from db) {
> > > $id = id from record;
> > > ?>
> > > 
> > >  > > }
> > > ?>
> > >
> > > You would have to do a $HTTP_GET_VARS on the next page to find out
which
> > ones
> > > exist.
> > >
> > > Then your select statement would be:
> > >
> > > $query = "select * from table where id IN ('comma delimited list of
> > values')";
> > >
> > > Messy but do-able!
> > >
> > > Probably a better way - There usually is!
> > >
> > > Chris
> > >
> > > Jacky wrote:
> > >
> > > > so how do I check at the next page which one is checked?
> > > > Jack
> > > > [EMAIL PROTECTED]
> > > > "There is nothing more rewarding than reaching the goal you set for
> > > > yourself"
> > > > - Original Message -
> > > > From: Chris Fry <[EMAIL PROTECTED]>
> > > > To: Jacky <[EMAIL PROTECTED]>
> > > > Cc: <[EMAIL PROTECTED]>
> > > > Sent: Wednesday, April 18, 2001 2:31 AM
> > > > Subject: Re: [PHP] Variable variable
> > > >
> > > > > Jacky,
> > > > >
> > > > > You do not need the value. The variable $id will either exist (if
> the
> > user
> > > > checked it) or not (if the user did not check it).
> > > > >
> > > > > Hope this helps.
> > > > >
> > > > > Chris
> > > > >
> > > > > Jacky wrote:
> > > > >
> > > > > > Hi all
> > > > > > I have a form with check box and name of those checkboxes is
> usuing
> > > > variable lke this,
> > > > > >
> > > > > > 
> > > > > > 
> > > > > >
> > > > > > and when I submit the form to page foo.php4, at that page, I use
> > > > Variable variable to call the value of the check box to see if it
> > checked
> > > > like this
> > > > > >
> > > > > > $quey = "select id from table";
> > > > > > $result = .. ( assumeing it is done and i got value for $id
> for
> > all
> > > > records from table)
> > > > > >
> > > > > > if ($$id =="on"){
> > > > > > echo "on";
> > > > > > }else{
> > > > > > echo "off";
> > > > > > }
> > > > > >
> > > > > > It always returns echo "off", why is that?
> > > > > > cheers
> > > > > > Jack
> > > > > > [EMAIL PROTECTED]
> > > > > > "There is nothing more rewarding than reaching the goal you set
> for
> > > > yourself"
> > > > >
> > > > > --
> > > > > Chris Fry
> > > > > Quillsoft Pty Ltd
> > > > > Specialists in Secure Internet Services and E-Commerce Solutions
> > > > > 10 Gray Street
> > > > > Kogarah
> > > > > NSW  2217
> > > > > Australia
> > > > >
> > > > > Phone: +61 2 9553 1691
> > > > > Fax: +61 2 9553 1692
> > > > > Mobile: 0419 414 323
> > > > > eMail: [EMAIL PROTECTED]
> > > > > http://www.quillsoft.com.au
> > > > >
> > > > > You can download our Public CA Certificate from:-
> > > > > https://ca.secureanywhere.com/htdocs/cacert.crt
> > > > >
> > > > >
> **
> > > > >
> > > > > This information contains confidential information intended only
for

Re: [PHP] HTTP_POST_VARS not and array when used in a function?

2001-04-18 Thread Alexander Skwar

So sprach Joseph Blythe am Wed, Apr 18, 2001 at 10:48:14AM +0930:
> Hey,
> 
> Why doesn't HTTP_POST_VARS work inside functions?
> 
> ---somefile.php - forms action ---
> 
> function foo() {
>reset($HTTP_POST_VARS);

Because this particular HTTP_POST_VARS is not the HTTP_POST_VARS you have
outside the function.  Either you pass it along as a parameter, or you do:

global $HTTP_POST_VARS;

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 1 day 10 hours 18 minutes

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




Re: [PHP] function to add %20 in place of blank spaces

2001-04-18 Thread Alexander Skwar

So sprach Nando2 am Mon, Apr 16, 2001 at 03:28:11PM -0300:
> Can anyone remind me of that?

(raw)urlencode

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 1 day 10 hours 23 minutes

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




Re: [PHP] php like cgi

2001-04-18 Thread Alexander Skwar

So sprach Dddogbruce (@home.com) am Mon, Apr 16, 2001 at 03:12:25PM -0700:
>  $greeting = "Hello!"
> echo "$greeting"
> ?>

Since I also have this problem, I tried your suggestion, and it didn't work. 
However, I expected this, because apache doesn't know which interpreter to
use to exec this script.

Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 1 day 10 hours 24 minutes

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




[PHP] php equivalent for `command`

2001-04-18 Thread Greig, Euan

> Is there a php equivalent for the use of ` (I think) in Unix/Perl? So for example 
>echo "`$x++`" would first evaluate $x++ and then print the resulting value.
> 
> Euan Greig
> Technical Consultant
> BRANN DATA
> [EMAIL PROTECTED]
> 01285 645997
> 
> 
> 


**
Any opinions expressed in this email are those of the individual and 
not necessarily the Company. This email and any files transmitted with 
it, including replies and forwarded copies (which may contain alterations) 
subsequently transmitted from the Company, are confidential and solely for 
the use of the intended recipient. If you are not the intended recipient 
or the person responsible for delivering to the intended recipient, be 
advised that you have received this email in error and that any use is 
strictly prohibited.

**

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




[PHP] print_r style array content

2001-04-18 Thread Chien-pin Wang


Dear All,

I wonder if there is a php function that could return content
of an array, in print_r style, as a string. I need to get it and
send as debug information. If not, is there a workaround or
alternative, other than writing a function? Many thanks.

Chien-pin


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




Re: [PHP] php equivalent for `command`

2001-04-18 Thread Jason Brooke

echo ++$x;

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



> > Is there a php equivalent for the use of ` (I think) in Unix/Perl? So
for example echo "`$x++`" would first evaluate $x++ and then print the
resulting value.
> >
> > Euan Greig
> > Technical Consultant
> > BRANN DATA
> > [EMAIL PROTECTED]
> > 01285 645997




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




Re: [PHP] Variable variable

2001-04-18 Thread Chris Fry

Sorry - try $HTTP_POST_VARS

Chris

Jacky wrote:

> I did look up in the manual for $HTTP_GET_VARS but could not find it? what
> is it? a function?
> sorry to ask this again, just try to find out how to use that.
> Jack
> [EMAIL PROTECTED]
> "There is nothing more rewarding than reaching the goal you set for
> yourself"
> - Original Message -
> From: Chris Fry <[EMAIL PROTECTED]>
> To: Jacky <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Wednesday, April 18, 2001 2:59 AM
> Subject: Re: [PHP] Variable variable
>
> > Sorry - thought you only had one! - it's late.
> >
> > To Name the checkboxes you need:
> >  > while (get records from db) {
> > $id = id from record;
> > ?>
> > 
> >  > }
> > ?>
> >
> > You would have to do a $HTTP_GET_VARS on the next page to find out which
> ones
> > exist.
> >
> > Then your select statement would be:
> >
> > $query = "select * from table where id IN ('comma delimited list of
> values')";
> >
> > Messy but do-able!
> >
> > Probably a better way - There usually is!
> >
> > Chris
> >
> > Jacky wrote:
> >
> > > so how do I check at the next page which one is checked?
> > > Jack
> > > [EMAIL PROTECTED]
> > > "There is nothing more rewarding than reaching the goal you set for
> > > yourself"
> > > - Original Message -
> > > From: Chris Fry <[EMAIL PROTECTED]>
> > > To: Jacky <[EMAIL PROTECTED]>
> > > Cc: <[EMAIL PROTECTED]>
> > > Sent: Wednesday, April 18, 2001 2:31 AM
> > > Subject: Re: [PHP] Variable variable
> > >
> > > > Jacky,
> > > >
> > > > You do not need the value. The variable $id will either exist (if the
> user
> > > checked it) or not (if the user did not check it).
> > > >
> > > > Hope this helps.
> > > >
> > > > Chris
> > > >
> > > > Jacky wrote:
> > > >
> > > > > Hi all
> > > > > I have a form with check box and name of those checkboxes is usuing
> > > variable lke this,
> > > > >
> > > > > 
> > > > > 
> > > > >
> > > > > and when I submit the form to page foo.php4, at that page, I use
> > > Variable variable to call the value of the check box to see if it
> checked
> > > like this
> > > > >
> > > > > $quey = "select id from table";
> > > > > $result = .. ( assumeing it is done and i got value for $id for
> all
> > > records from table)
> > > > >
> > > > > if ($$id =="on"){
> > > > > echo "on";
> > > > > }else{
> > > > > echo "off";
> > > > > }
> > > > >
> > > > > It always returns echo "off", why is that?
> > > > > cheers
> > > > > Jack
> > > > > [EMAIL PROTECTED]
> > > > > "There is nothing more rewarding than reaching the goal you set for
> > > yourself"
> > > >
> > > > --
> > > > Chris Fry
> > > > Quillsoft Pty Ltd
> > > > Specialists in Secure Internet Services and E-Commerce Solutions
> > > > 10 Gray Street
> > > > Kogarah
> > > > NSW  2217
> > > > Australia
> > > >
> > > > Phone: +61 2 9553 1691
> > > > Fax: +61 2 9553 1692
> > > > Mobile: 0419 414 323
> > > > eMail: [EMAIL PROTECTED]
> > > > http://www.quillsoft.com.au
> > > >
> > > > You can download our Public CA Certificate from:-
> > > > https://ca.secureanywhere.com/htdocs/cacert.crt
> > > >
> > > > **
> > > >
> > > > This information contains confidential information intended only for
> > > > the use of the authorised recipient.  If you are not an authorised
> > > > recipient of this e-mail, please contact Quillsoft Pty Ltd by return
> > > > e-mail.
> > > > In this case, you should not read, print, re-transmit, store or act
> > > > in reliance on this e-mail or any attachments, and should destroy all
> > > > copies of them.
> > > > This e-mail and any attachments may also contain copyright material
> > > > belonging to Quillsoft Pty Ltd.
> > > > The views expressed in this e-mail or attachments are the views of
> > > > the author and not the views of Quillsoft Pty Ltd.
> > > > You should only deal with the material contained in this e-mail if
> > > > you are authorised to do so.
> > > >
> > > > This notice should not be removed.
> > > >
> > > >
> > > >
> > > > --
> > > > PHP General Mailing List (http://www.php.net/)
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > > To contact the list administrators, e-mail:
> [EMAIL PROTECTED]
> > > >
> > > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> > --
> > Chris Fry
> > Quillsoft Pty Ltd
> > Specialists in Secure Internet Services and E-Commerce Solutions
> > 10 Gray Street
> > Kogarah
> > NSW  2217
> > Australia
> >
> > Phone: +61 2 9553 1691
> > Fax: +61 2 9553 1692
> > Mobile: 0419 414 323
> > eMail: [EMAIL PROTECTED]
> > http://www.quillsoft.com.au
> >
> > You can download our Public CA Certificate from:-
> > https://ca.secureanywhere.com/htdocs/cacert.crt
> >
> > **

RE: [PHP] php equivalent for `command`

2001-04-18 Thread Greig, Euan

I deliberately gave a simple example, perhaps too simple.  I want to output quite long 
and complicated strings that may involve evaluated variables, calls to functions etc. 
But I also want it to as legible as possible. But even something simple along the 
lines I quoted gives me problems. See the following code and its output

";
echo $test++ . "";

$test=1;
echo "Value of test: $test++ ";
echo "Value of test: $test++ ";
?>

The output:

1
2
Value of test: 1++ 
Value of test: 1++ 

In the second set of code lines, what I need to do is somehow bracket off the $test++ 
so it is evaluated before being echoed.

Euan


-Original Message-
From: Jason Brooke [mailto:[EMAIL PROTECTED]]
Sent: 18 April 2001 09:46
To: Greig, Euan; [EMAIL PROTECTED]
Subject: Re: [PHP] php equivalent for `command`


echo ++$x;

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



> > Is there a php equivalent for the use of ` (I think) in Unix/Perl? So
for example echo "`$x++`" would first evaluate $x++ and then print the
resulting value.
> >
> > Euan Greig
> > Technical Consultant
> > BRANN DATA
> > [EMAIL PROTECTED]
> > 01285 645997




**
Any opinions expressed in this email are those of the individual and 
not necessarily the Company. This email and any files transmitted with 
it, including replies and forwarded copies (which may contain alterations) 
subsequently transmitted from the Company, are confidential and solely for 
the use of the intended recipient. If you are not the intended recipient 
or the person responsible for delivering to the intended recipient, be 
advised that you have received this email in error and that any use is 
strictly prohibited.

**

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




RE: [PHP] highlighting search results (revisited)

2001-04-18 Thread Matt Williams

Hi James

I'll paste the code I use..

$string = search string entered in the text box.
#
// REPLACE SPACES FOR MULTIWORD SEARCH
$string = str_replace(" ","%",$string);

$db->query("SELECT title,description FROM files WHERE (title LIKE
'%$string%') || (description LIKE '%$string%')");
// SPLIT THE SEARCH INTO PARTS FOR HIGHLIGHTING
$bg = explode("%",$string);
while($db->next_record())
{
$title = $db->f("title");
$des = $db->f("description");
for($z=0; $z <  count($bg); $z++)
{
// reset the array if it's at the end
if(next($bg) == false)
{
reset($bg);
}
$bgstring = current($bg);
$title = preg_replace("/($bgstring+)/ie", "'\\1'", $title);
$des = preg_replace ("/($bgstring+)/ie", "'\\1'", $des);
}
echo $title.NL;
echo $des.NL.NL;

}

###

The above code works as expectedexcept if I search for span and say
class;

now this will highlight span in the search string found from the database
but on the second run ie. hightlighting class, it will re-highlight the
  in the span tags from the original pass.

Do you get what I mean??


preg_replace is used to keep the original case of the results as it's a case
insensitive search

I need to be able to replace only result that aren't enclosed in a class tag

Cheers

M@


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




[PHP] how do I find out which checkbox is checked when form get submit

2001-04-18 Thread Jacky

Hi all,
Extremely desparate here as I still cannot get my problem sought out, so decided
to post my question again.
Allow me to repeat my question again:
I have a form with the checkbox like this

");
 }
submit button and stuffs here...
?>


After I tried check on few checkboxes and submit to next page, at next page, how do I 
check which check box is
checked so that I can get value of the checked one to process to next step?
I did try isset() and empty() to check if variable exist ( as shown below)
and did not work as the result always turn up to be "off"

   if((empty($id))=='true'){
echo "off";
 }else{
   echo "on";
   }

And I also try
if(isset($id))
{
  ..do echo off here...
}else{
  ...do echo on
}

And the result is always "off" as well.

Somene advice me to use $http_var_gets btu I could not find it from manaual,
is that the solution I need?
cheers

Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for yourself"



[PHP] shm_attach not found

2001-04-18 Thread Patrick Lai

I get this error

Fatal error: Call to undefined function: shm_attach() in
/usr/local/apache/phplib/ct_shm.inc on line 31

Here is my compile parameter
'./configure' '--with-apxs=/usr/local/apache/bin/apxs'
'--with-config-file-path=/usr/local/apache/conf' '--enable-versioning'
'--with-ldap' '--with-xml' '--enable-bcmath' '--with-database'
'--enable-ftp' '--with-gd=/usr/local/gd1.3' '--enable-bcmath'
'--disable-debug' '--enable-memory-limit=yes' '--enable-track-vars'

Can anyone tell me why the library can find the standard shm_attach()?

thanx,

Patrick



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




RE: [PHP] how do I find out which checkbox is checked when form get submit

2001-04-18 Thread Matt Williams

Hi Jacky

In it's simpliest form try this
###






##



>
> Hi all,
> Extremely desparate here as I still cannot get my problem sought
> out, so decided
> to post my question again.
> Allow me to repeat my question again:
> I have a form with the checkbox like this
> 
>  $query="select id from foo";
> $result=($query,$con);
> while ($row = mysql_fetch_array($result))
>  {
> print("");
>  }
> submit button and stuffs here...
> ?>
> 



>
> After I tried check on few checkboxes and submit to next page, at
> next page, how do I check which check box is
> checked so that I can get value of the checked one to process to
> next step?
> I did try isset() and empty() to check if variable exist ( as shown below)
> and did not work as the result always turn up to be "off"
>
>if((empty($id))=='true'){
> echo "off";
>  }else{
>echo "on";
>}
>
> And I also try
> if(isset($id))
> {
>   ..do echo off here...
> }else{
>   ...do echo on
> }
>
> And the result is always "off" as well.
>
> Somene advice me to use $http_var_gets btu I could not find it
> from manaual,
> is that the solution I need?
> cheers
>
> Jack
> [EMAIL PROTECTED]
> "There is nothing more rewarding than reaching the goal you set
> for yourself"
>


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




[PHP] Connection to postgresql DB used by 2 scripts ?

2001-04-18 Thread Picard, Cyril

I would like to query a postgresql db with the php language.
Today I wrote a script (connectandquery.php) performing the following : 
- connect to the DB : $conn = pg_Connect("dbname = foo");
- execute the query : $res = pg_Exec($conn,"SELECT * from BAR");


But I would like to write this in two scripts :
- connect.php : $conn = pg_Connect("dbname = foo");
- query.php : $res = pg_Exec($conn,"SELECT * from BAR");

but I don't know how to get the $conn variable (defined in connect.php) in
the script query.php.

Any idea is welcome !


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




[PHP] sessions

2001-04-18 Thread Ben

i'm trying to use sessions with my project, but it seems that registered
variables in a session aren't global by default.
It doesn't even seem like the session is global, because if I reference the
sessionid (which only shows up if cookies are disabled)
by using , it shows up within a function, if I reference it from
within the function.

if anyone can help me make my variables (such as $user, and $active)
globally registered with the session, I would be very grateful.
maybe its the cookie not being global, that would explain why the sessionid
shows up only from within a function (but not in the global scope)

thanks
ben
[EMAIL PROTECTED]




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




Re: [PHP] checkbox validation

2001-04-18 Thread Robert Vetter



Jacky wrote:
> 
> Hi all
> I have a form with the checkbox like this
> 
> $query="select id from foo";
> $result=($query,$con);
> while ($row = mysql_fetch_array($result))
>  {
> 
>  }
> submit button and stuffs here...
> 

One possibility:
Add a hidden field in the form and write all names of the checkboxes in
it, separated by a semicolon, for example.
-

$query="select id from foo";
$result=($query,$con);
while ($row = mysql_fetch_array($result))
{

$names_of_checkboxes.=$id.";";
}

 submit button and stuffs here...
 
---
Then, in the next page you just do following:
---
$checkboxes_names_array=explode(";",$names_of_checkboxes);
for($x=0;xhttp://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] What is cookies

2001-04-18 Thread Bertrand TACHAGO

Can anyone tell me what is cookiesand how i can use it

Thank

TACHAGO


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




Re: [PHP] Is it possible to parse a variable by character?

2001-04-18 Thread Wico de Leeuw

At 00:28 18-4-2001 -0700, Sean Coyle wrote:
>Thanks for that help!  Now I am getting an interesting error that I am not
>sure what to make of.
>
>Warning: REG_ERANGE in /home/httpd/www/worldvibe.org/digitall/edit_f.php on
>line 91
>
>Here are lines surrounding 91:
>
>89->   strtolower($f_loc_name);
>90->   $f_loc_new = "";
>91->   $f_loc_new = ereg_replace("[^[_a-z0-9-\.]]", "", $f_loc_name);
>92->   $f_loc_name = "";
>93->   $f_loc_name = $f_loc_new;


$f_loc_new = ereg_replace("[^_a-z0-9-\.]", "", $f_loc_name);



>I have tried tow other variations of line 91, and both of them do not seem
>to work the way I am hoping for.
>
>I have (since the last message, decided to remove the offending characters,
>rather than replace them with an underscore (hence the "").  Below is an
>example of what I am trying to accomplish:
>
>Test_File#()*#$.txt should be converted to test_file.txt
>
>TEST.file.#.txt should be converted to sean.coyle..txt
>
>I am not all that great with regular expressions, so any help I can get on
>this is greatly appreciated!
>
>Kind Regards,
>
>Sean
>
>
>On 4/17/01 11:01 PM, in article
>DC017B079D81D411998C009027B7112A015ED111@EXC-TYO-01, "Maxim Maletsky"
><[EMAIL PROTECTED]> wrote:
>
> >
> > $str = eregi_replace("[^[_a-z0-9-]]", '_', $str)
> >
> > would this 2-seconds written-in, non-tested scratch of code do the job?
> >
> > If not then something like this...
> >
> > eregi_replace() is what you are looking for.
> >
> >
> >
> > Sincerely,
> >
> > Maxim Maletsky
> > Founder, Chief Developer
> > PHPBeginner.com (Where PHP Begins)
> > [EMAIL PROTECTED]
> > www.phpbeginner.com
> >
> >
> >
> >
> > -Original Message-
> > From: Sean Coyle [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, April 18, 2001 2:23 PM
> > To: [EMAIL PROTECTED]
> > Subject: [PHP] Is it possible to parse a variable by character?
> >
> >
> > Hey there guys,
> >
> >   This may seem like a dumb question, but I have to ask it anyway.
> >
> > I have a form in one of my php based scripts that allows for file uploads.
> > I recently noticed a potential issue if people upload files containing
> > anything else but the standard characters ([_a-z0-9-]+(\.[_a-z0-9-]).
> >
> >   I am not sure if this can be done, but what I need to do is parse this
> > variable (lets call it $file_name) by character looking for anything save
> > letters a-z (A-Z) and numbers 0-9.  Any arrangements of numbers, 
> letters and
> > full stops (.) are to be permitted, and if any character does not meet 
> those
> > specifications, that single character should be converted to an underscore.
> >
> >   Any ideas on how I can go about doing something like this?
> >
> > BTW: (Some background info)  I examined the average validate e-mail idea,
> > however, rather than reject the string, I would like to be able to 
> 'replace'
> > the offending character.
> >
> > Thanks in advance,
> >
> > Sean
> >
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




Re: [PHP] how do I find out which checkbox is checked when form get submit

2001-04-18 Thread Szii

If a checkbox is NOT checked, the attached PHP variable is NOT set.  Only if
it
is checked will you be able to see/query the variable "id"

Using isset() should allow to you see the boolean state of a checkbox, or
using
the "value" component after you do an isset() call will give you the
specifics.

'Luck
-Szii

- Original Message -
From: Matt Williams <[EMAIL PROTECTED]>
To: Jacky <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, April 18, 2001 2:26 AM
Subject: RE: [PHP] how do I find out which checkbox is checked when form get
submit


> Hi Jacky
>
> In it's simpliest form try this
> ###
> 
> 
> 
>
> 
>  echo (isset($id)) ? "checked" : "not checked";
> ?>
> ##
>
>
>
> >
> > Hi all,
> > Extremely desparate here as I still cannot get my problem sought
> > out, so decided
> > to post my question again.
> > Allow me to repeat my question again:
> > I have a form with the checkbox like this
> > 
> >  > $query="select id from foo";
> > $result=($query,$con);
> > while ($row = mysql_fetch_array($result))
> >  {
> > print("");
> >  }
> > submit button and stuffs here...
> > ?>
> > 
>
> 
>
> >
> > After I tried check on few checkboxes and submit to next page, at
> > next page, how do I check which check box is
> > checked so that I can get value of the checked one to process to
> > next step?
> > I did try isset() and empty() to check if variable exist ( as shown
below)
> > and did not work as the result always turn up to be "off"
> >
> >if((empty($id))=='true'){
> > echo "off";
> >  }else{
> >echo "on";
> >}
> >
> > And I also try
> > if(isset($id))
> > {
> >   ..do echo off here...
> > }else{
> >   ...do echo on
> > }
> >
> > And the result is always "off" as well.
> >
> > Somene advice me to use $http_var_gets btu I could not find it
> > from manaual,
> > is that the solution I need?
> > cheers
> >
> > Jack
> > [EMAIL PROTECTED]
> > "There is nothing more rewarding than reaching the goal you set
> > for yourself"
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




[PHP-CVS] cvs: php4(PHP_4_0_5) /ext/mcrypt mcrypt.c

2001-04-18 Thread Derick Rethans

derick  Wed Apr 18 02:48:39 2001 EDT

  Modified files:  (Branch: PHP_4_0_5)
/php4/ext/mcryptmcrypt.c 
  Log:
  - MFH (Bug #8839)
  
  
Index: php4/ext/mcrypt/mcrypt.c
diff -u php4/ext/mcrypt/mcrypt.c:1.45.2.1 php4/ext/mcrypt/mcrypt.c:1.45.2.2
--- php4/ext/mcrypt/mcrypt.c:1.45.2.1   Sat Mar 17 06:55:24 2001
+++ php4/ext/mcrypt/mcrypt.cWed Apr 18 02:48:38 2001
@@ -339,36 +339,37 @@
return SUCCESS;
 }
 
+#include "ext/standard/php_smart_str.h"
+
 PHP_MINFO_FUNCTION(mcrypt)
 {
 #if HAVE_LIBMCRYPT24
char **modules;
int i, count;
-   char *tmp, *tmp2;
+   smart_str tmp1 = {0};
+   smart_str tmp2 = {0};
MCLS_FETCH();
 
-   tmp = emalloc (2048);
-   memset (tmp, 0, sizeof(tmp));
modules = mcrypt_list_algorithms (MCG(algorithms_dir), &count);
if (count == 0) {
-   strcpy (tmp, "none");
+   smart_str_appends (&tmp1, "none");
}
for (i = 0; i < count; i++) {
-   strcat (tmp, modules[i]);
-   strcat (tmp, " ");
+   smart_str_appends (&tmp1, modules[i]);
+   smart_str_appendc (&tmp1, ' ');
}
+   smart_str_0 (&tmp1);
mcrypt_free_p (modules, count);
 
-   tmp2 = emalloc (2048);
-   memset (tmp2, 0, sizeof(tmp2));
modules = mcrypt_list_modes (MCG(modes_dir), &count);
if (count == 0) {
-   strcpy (tmp2, "none");
+   smart_str_appends (&tmp2, "none");
}
for (i = 0; i < count; i++) {
-   strcat (tmp2, modules[i]);
-   strcat (tmp2, " ");
+   smart_str_appends (&tmp2, modules[i]);
+   smart_str_appendc (&tmp2, ' ');
}
+   smart_str_0 (&tmp2);
mcrypt_free_p (modules, count);
 #endif
 
@@ -379,10 +380,10 @@
 #endif
 #if HAVE_LIBMCRYPT24
php_info_print_table_row(2, "version", "2.4.x");
-   php_info_print_table_row(2, "Supported ciphers", tmp);
-   php_info_print_table_row(2, "Supported modes", tmp2);
-   efree (tmp2);
-   efree (tmp);
+   php_info_print_table_row(2, "Supported ciphers", tmp1.c);
+   php_info_print_table_row(2, "Supported modes", tmp2.c);
+   smart_str_free (&tmp1);
+   smart_str_free (&tmp2);
 #endif
php_info_print_table_end();

@@ -436,9 +437,9 @@
 {
zval **key, **iv;
zval **mcryptind;
-   char *key_s, *iv_s;
+   unsigned char *key_s, *iv_s;
char dummy[256];
-   int key_size, iv_size;
+   int max_key_size, iv_size;
MCRYPT td;
int argc;
 MCLS_FETCH();
@@ -450,21 +451,22 @@
ZEND_FETCH_RESOURCE (td, MCRYPT, mcryptind, -1, "MCrypt", MCG(le_h));  
 
convert_to_string_ex (key);
convert_to_string_ex (iv);
-
-   key_size = mcrypt_enc_get_key_size (td);
-   key_s = emalloc (key_size + 1);
-   memset (key_s, 0, key_size + 1);
 
+   max_key_size = mcrypt_enc_get_key_size (td);
iv_size = mcrypt_enc_get_iv_size (td);
+
+   key_s = emalloc (Z_STRLEN_PP(key));
+   memset (key_s, 0, Z_STRLEN_PP(key));
+
iv_s = emalloc (iv_size + 1);
memset (iv_s, 0, iv_size + 1);
 
-   if (Z_STRLEN_PP(key) != key_size) {
-   sprintf (dummy, "key size incorrect; supplied length: %d, needed: %d", 
-   Z_STRLEN_PP(key), key_size);
+   if (Z_STRLEN_PP(key) > max_key_size) {
+   sprintf (dummy, "key size too large; supplied length: %d, max: %d", 
+   Z_STRLEN_PP(key), max_key_size);
php_error (E_NOTICE, dummy);
}
-   strncpy (key_s, Z_STRVAL_PP(key), key_size);
+   strncpy (key_s, Z_STRVAL_PP(key), Z_STRLEN_PP(key));
 
if (Z_STRLEN_PP(iv) != iv_size) {
sprintf (dummy, "iv size incorrect; supplied length: %d, needed: %d", 
@@ -473,7 +475,7 @@
}
strncpy (iv_s, Z_STRVAL_PP(iv), iv_size);
 
-   RETVAL_LONG (mcrypt_generic_init (td, key_s, key_size, iv_s));
+   RETVAL_LONG (mcrypt_generic_init (td, key_s, Z_STRLEN_PP(key), iv_s));
efree (iv_s);
efree (key_s);
 }
@@ -487,7 +489,7 @@
zval **data, **mcryptind;
MCRYPT td;
int argc;
-   char* data_s;
+   unsigned char* data_s;
int block_size, data_size;
 MCLS_FETCH();

@@ -1294,7 +1296,7 @@
memset (data_s, 0, data_size);
memcpy (data_s, Z_STRVAL_PP(data), Z_STRLEN_PP(data));
}
-   
+
if (mcrypt_generic_init (td, key_s, use_key_length, iv_s) < 0) {
php_error (E_ERROR, "generic_init failed");
}
@@ -1307,10 +1309,10 @@
 
 /* freeing vars */
mcrypt_generic_end (td);
-   if (iv_s != NULL)
-   efree (iv_s);
if (key_s != NULL)
efree (key_s);
+   if (iv_s != NULL)
+   efree (iv_s);
efree (data_s);
mcrypt_

Re: [PHP] Connection to postgresql DB used by 2 scripts ?

2001-04-18 Thread Johannes Janson

Hi,

put: include("connect.php"); at the beginning of query.php.

Johannes

""Picard, Cyril"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I would like to query a postgresql db with the php language.
> Today I wrote a script (connectandquery.php) performing the following :
> - connect to the DB : $conn = pg_Connect("dbname = foo");
> - execute the query : $res = pg_Exec($conn,"SELECT * from BAR");
>
>
> But I would like to write this in two scripts :
> - connect.php : $conn = pg_Connect("dbname = foo");
> - query.php : $res = pg_Exec($conn,"SELECT * from BAR");
>
> but I don't know how to get the $conn variable (defined in connect.php) in
> the script query.php.
>
> Any idea is welcome !
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



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




[PHP-CVS] cvs: php4 / README.STREAMS

2001-04-18 Thread Wez Furlong

wez Wed Apr 18 03:43:21 2001 EDT

  Added files: 
/php4   README.STREAMS 
  Log:
  Information about php streams
  
  


Index: php4/README.STREAMS
+++ php4/README.STREAMS
An Overview of the PHP Streams abstraction
==
$Id: README.STREAMS,v 1.1 2001/04/18 10:43:21 wez Exp $

Please send comments to: Wez Furlong <[EMAIL PROTECTED]>

Note: this doc is preliminary and is intended to give the reader an idea of
how streams work and should be used.

Why Streams?

You may have noticed a shed-load of issock parameters flying around the PHP
code; we don't want them - they are ugly and cumbersome and force you to
special case sockets and files everytime you need to work with a "user-level"
PHP file pointer.
Streams take care of that and present the PHP extension coder with an ANSI
stdio-alike API that looks much nicer and can be extended to support non file
based data sources.

Using Streams
=
Streams use a php_stream* parameter just as ANSI stdio (fread etc.) use a
FILE* parameter.

The main functions are:

PHPAPI size_t php_stream_read(php_stream * stream, char * buf, size_t count);
PHPAPI size_t php_stream_write(php_stream * stream, const char * buf, size_t
count);
PHPAPI int php_stream_eof(php_stream * stream);
PHPAPI int php_stream_getc(php_stream * stream);
PHPAPI char *php_stream_gets(php_stream * stream, char *buf, size_t maxlen);
PHPAPI int php_stream_close(php_stream * stream);
PHPAPI int php_stream_flush(php_stream * stream);
PHPAPI int php_stream_seek(php_stream * stream, off_t offset, int whence);
PHPAPI off_t php_stream_tell(php_stream * stream);

These (should) behave in the same way as the ANSI stdio functions with similar
names: fread, fwrite, feof, fgetc, fgets, fclose, fflush, fseek, ftell.

Opening Streams
===
Ultimately, I aim to implement an fopen_wrapper-like call to do this with
minimum fuss.
Currently, mostly for testing purposes, you can use php_stream_fopen to open a
stream on a regular file.

PHPAPI php_stream * php_stream_fopen(const char * filename, const char *
mode);

This call behaves just like fopen(), except it returns a stream instead of a
FILE *

Casting Streams
===
What if your extension needs to access the FILE* of a user level file pointer?
You need to "cast" the stream into a FILE*, and this is how you do it:

FILE * fp;
php_stream * stream; /* already opened */

if (php_stream_cast(stream, PHP_STREAM_AS_STDIO, &fp, 1) == FAILURE){
RETURN_FALSE;
}

The prototype is:

PHPAPI int php_stream_cast(php_stream * stream, int castas, void ** ret, int
show_err);

The show_err parameter, if non-zero, will cause the function to display an
appropriate error message of type E_WARNING if the cast fails.

castas can be one of the following values:
PHP_STREAM_AS_STDIO - a stdio FILE*
PHP_STREAM_AS_FD - a generic file descriptor
PHP_STREAM_AS_SOCKETD - a socket descriptor

If you ask a socket stream for a FILE*, the abstraction will use fdopen to
create it for you.  Be warned that doing so may cause buffered data to be lost
if you mix ANSI stdio calls on the FILE* with php stream calls on the stream.

If your system has the fopencookie function, php streams can synthesize a
FILE* on top of any stream, which is useful for SSL sockets, memory based
streams, data base streams etc. etc.
NOTE: There might be situations where this is not desireable, and we need to
provide a flag to inform the casting routine of this.

You can use:

PHPAPI int php_stream_can_cast(php_stream * stream, int castas)

to find out if a stream can be cast, without actually performing the cast, so
to check if a stream is a socket you might use:

if (php_stream_can_cast(stream, PHP_STREAM_AS_SOCKETD) == SUCCESS)  {
/* it's a socket */
}


Stream Internals


There are two main structures associated with a stream - the php_stream
itself, which holds some state information (and possibly a buffer) and a
php_stream_ops structure, which holds the "virtual method table" for the
underlying implementation.

The php_streams ops struct consists of pointers to methods that implement
read, write, close, flush, seek, gets and cast operations.  Of these, an
implementation need only implement write, read, close and flush.  The gets
method is intended to be used for non-buffered streams if there is an
underlying method that can efficiently behave as fgets.  The ops struct also
contains a label for the implementation that will be used when printing error
messages - the stdio implementation has a label of "STDIO" for example.

The idea is that a stream implementation defines a php_stream_ops struct, and
associates it with a php_stream using php_stream_alloc.

As an example, the php_stream_fopen() function looks like this:

PHPAPI php_stream * php_stream_fopen(const char * filename, const char * mode)
{
FILE * fp = fopen(filenam

[PHP] write to a file

2001-04-18 Thread Wade Halsey

Hi

I have the following code

$fp=fopen($agentcode.date("m-d-Y-g-i-s").'CyberTrac.ctr', "w");
fwrite($fp,"$agentcode etc etc");

$fc = fopen($fp, 'rb');
$attachment = fread($fc , filesize($filename));
fclose($fc);

$mail = new html_mime_mail('X-Mailer: Html Mime Mail Class');
$mail->add_attachment($attachment, $agentcode.date("m-d-Y-g-i-s").'CyberTrac.ctr', 
'application/octet-stream');

The file is successfuly created. When it is attatched to the email however the size is 
written as 0 bytes, the filename is the same though. If I check the file on the server 
side it s perfectly ok, any ideas?

TIA
Wade




Re: [PHP] Site Sessions: Online/Offline - help?

2001-04-18 Thread Richard


> mt_srand ((double) microtime() * 100);


Thanks alot, I will use the upper one... Perhaps decrease it abit ;)


> Note: one way to auto-logout someone is to use something like a on_unload
> javascript procedure, but don't bother. Not worth the hassle and it's
isn't
> fool-proof.

Nopp, tried that. It loggs out every time you change site, and I don't use
frames. I intend to use frames, so when the main frame is closed, that means
that the whole shit is closed. But now, I switch sites constantly, without
frames.

But still, with frames, our trick would work.

- Richard



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




Re: [PHP] Variable variable

2001-04-18 Thread Plutarck

Your problem has little to do with the things mentioned.

First of all, you are refering to a variable variable incorrectly. You must
use brackets, like this:

${$id}

If ID has the value "Blue", then the above is the same as:

$Blue

So in your examble if you had the checkbox with the value "on", and you want
to see if it was checked, use this:

if (${$id} == "on")
{
echo 'on';
} else
{
echo 'off';
}

But that's an overly complicated way of doing it if you know the "name" of
the checkbox. If the name of the checkbox is "id", then use this piece of
code to access it if it was submitted via POST or GET (which works even if
register_globals is turned off):

$f = 'HTTP_' . $HTTP_ENV_VARS["REQUEST_METHOD"] . '_VARS';

if (${$f}["id"] == "on")
{
echo 'The checkbox with the name "id" has the value "on"';
} else
{
echo "The checkbox with the name "id" was not selected";
}


But if register globals was on, all you have to use is:

if ($id == "on")
{
echo 'The checkbox with the name "id" has the value "on"';
} else
{
echo "The checkbox with the name "id" was not selected";
}


Tell me if that doesn't answer your questions.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Jacky"" <[EMAIL PROTECTED]> wrote in message
011001c0c839$ebfb9b40$[EMAIL PROTECTED]">news:011001c0c839$ebfb9b40$[EMAIL PROTECTED]...
Hi all
I have a form with check box and name of those checkboxes is usuing variable
lke this,




and when I submit the form to page foo.php4, at that page, I use Variable
variable to call the value of the check box to see if it checked like this

$quey = "select id from table";
$result = .. ( assumeing it is done and i got value for $id for all
records from table)

if ($$id =="on"){
echo "on";
}else{
echo "off";
}

It always returns echo "off", why is that?
cheers
Jack
[EMAIL PROTECTED]
"There is nothing more rewarding than reaching the goal you set for
yourself"




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




[PHP] Images only with 256 Colors?!

2001-04-18 Thread Nils Sondermann

I want do create Images dynamicly, i have a High Color png but after
CreateImagefrompng() it have only 256 colors. What can i do?

thx
 Nils



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




Re: [PHP] What is cookies

2001-04-18 Thread Plutarck

RTFM (ReadTheFineManual ;)

http://us.php.net/manual/en/function.setcookie.php

As listed in the manual for an explanation on cookies:

http://www.netscape.com/newsref/std/cookie_spec.html



--
Plutarck
Should be working on something...
...but forgot what it was.


"Bertrand TACHAGO" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Can anyone tell me what is cookiesand how i can use it
>
> Thank
>
> TACHAGO
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



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




Re: [PHP] How do i include ASP script into PHP...??!

2001-04-18 Thread Christian Reiniger

On Tuesday 17 April 2001 15:56, you wrote:
> > Easy. Just use fopen('http://localhost/file.asp')  then fread
> > the data you want.  I do this technique to read Access tables
> > from a Linux box.
>
> But that gives you the RESULTS of the ASP script, not the script
> itself.

fopen ("/path/to/asp/script.asp", "r");

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

A - American Association Against Acronym Abuse

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




[PHP] Regular Expression

2001-04-18 Thread Jeroen Geusebroek

Hi,

I have question about regular expressions; I don't know anything
about it and was wondering if someone could help me out.

I have this text:

"[ this is atest ] and this is the rest of the text"

I want to get the text inbetween the [ and ].

If someone could help me out, i would appreciate it.
A link to a tuturial would also be nice.

Regards,

Jeroen Geusebroek


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




Re: [PHP] Persistent connection & many scripts ?

2001-04-18 Thread Christian Reiniger

On Tuesday 17 April 2001 16:28, you wrote:
> Yes... I'm not familiar with sessions. This should be like this ? :
>
> In connect.php :
>  session_start();
> $connect = pg_pConnect("blablabla");
> session_register("connect");
> clique ici
> ?>

Simply using pg_pconnect() (without saving the connection ID) should be 
just as fast and more failproof

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

A - American Association Against Acronym Abuse

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




RE: [PHP] print_r style array content

2001-04-18 Thread Neil Kimber

Try:


function getStringFromObj($prmObjIn)
{
ob_start(); 
var_dump($prmObjIn); 
$output = ob_get_contents(); 
ob_end_clean();

return $output;
}

I grabbed this from user comments somewhere on php.net. It works a treat.

-Original Message-
From: Chien-pin Wang [mailto:[EMAIL PROTECTED]]
Sent: 18 April 2001 05:02
To: [EMAIL PROTECTED]
Subject: [PHP] print_r style array content



Dear All,

I wonder if there is a php function that could return content
of an array, in print_r style, as a string. I need to get it and
send as debug information. If not, is there a workaround or
alternative, other than writing a function? Many thanks.

Chien-pin


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




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




Re: [PHP] sessions

2001-04-18 Thread Plutarck

Rather than bothering with SID whos existance is uncertain, use the variable
$PHPSESSID. It's set whenever you use session_start, to my knowledge.

The simplest method, and the only one I am aware of, of accessing session
variables globally is by explicitly declaring them global in your function.
It's also the best way to do it, as it may take extra typing when declaring
your function, but it makes it alot more readable and bug-free.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Ben"" <[EMAIL PROTECTED]> wrote in message
9bjn4n$41c$[EMAIL PROTECTED]">news:9bjn4n$41c$[EMAIL PROTECTED]...
> i'm trying to use sessions with my project, but it seems that registered
> variables in a session aren't global by default.
> It doesn't even seem like the session is global, because if I reference
the
> sessionid (which only shows up if cookies are disabled)
> by using , it shows up within a function, if I reference it
from
> within the function.
>
> if anyone can help me make my variables (such as $user, and $active)
> globally registered with the session, I would be very grateful.
> maybe its the cookie not being global, that would explain why the
sessionid
> shows up only from within a function (but not in the global scope)
>
> thanks
> ben
> [EMAIL PROTECTED]
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



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




RE: [PHP] Persistent connection & many scripts ?

2001-04-18 Thread Picard, Cyril

hummm... I don't know how to use pg_pconnect()... It returns a connection
ID, isn't it ? And I have to use this connection ID later ? 
I would like to reuse this connection ID to another script... and the
problem is here :(

I feel that I ignore something so important that I'm stopped and so trivial
that you do not think about it !

> -Message d'origine-
> De:   Christian Reiniger [SMTP:[EMAIL PROTECTED]]
> Date: mercredi 18 avril 2001 13:40
> À:[EMAIL PROTECTED]
> Objet:Re: [PHP] Persistent connection & many scripts ?
> 
> On Tuesday 17 April 2001 16:28, you wrote:
> > Yes... I'm not familiar with sessions. This should be like this ? :
> >
> > In connect.php :
> >  > session_start();
> > $connect = pg_pConnect("blablabla");
> > session_register("connect");
> > clique ici
> > ?>
> 
> Simply using pg_pconnect() (without saving the connection ID) should be 
> just as fast and more failproof
> 
> -- 
> Christian Reiniger
> LGDC Webmaster (http://sunsite.dk/lgdc/)
> 
> A - American Association Against Acronym Abuse
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

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




RE: [PHP] Connection to postgresql DB used by 2 scripts ?

2001-04-18 Thread Picard, Cyril

include will help me to organize my scripts, but it will effectively
establish the connection each time I perform the query.
I would like to establish the connection one time, and then to be able to
perform many queries using this connection.
I've been told that i could declare $conn as global in both script : 
-- connect.php:
   global $conn;
   $conn = pg_connect ...

-- query.php:
   global $conn;
   $res = pg_exec( $conn, ... 

What do you think about this way ?

> -Message d'origine-
> De:   Johannes Janson [SMTP:[EMAIL PROTECTED]]
> Date: mercredi 18 avril 2001 12:42
> À:[EMAIL PROTECTED]
> Objet:Re: [PHP] Connection to postgresql DB used by 2 scripts ?
> 
> Hi,
> 
> put: include("connect.php"); at the beginning of query.php.
> 
> Johannes
> 
> ""Picard, Cyril"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I would like to query a postgresql db with the php language.
> > Today I wrote a script (connectandquery.php) performing the following :
> > - connect to the DB : $conn = pg_Connect("dbname = foo");
> > - execute the query : $res = pg_Exec($conn,"SELECT * from BAR");
> >
> >
> > But I would like to write this in two scripts :
> > - connect.php : $conn = pg_Connect("dbname = foo");
> > - query.php : $res = pg_Exec($conn,"SELECT * from BAR");
> >
> > but I don't know how to get the $conn variable (defined in connect.php)
> in
> > the script query.php.
> >
> > Any idea is welcome !
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

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




[PHP] FastCGI and PHP

2001-04-18 Thread Alexander Skwar

(Learning from my last mistake, I'll now try to make clear right away what
each sentence means *G*)

Introductory lines:
I want to write a FastCGI compatible PHP script.  In order to do so, PHP
obviously need to recompile PHP with '--with-fastcgi'.  However, looking at
some PERL FastCGI scripts, I see that they mainly consist of a while loop
like this:

while( FCGI::accept() >= 0 ) {
foo();
FCGI::flush();
}

Questions:
What are the PHP equivalents to FCGI::accept() and FCGI::flush()?  


Alexander Skwar
-- 
How to quote:   http://learn.to/quote (german) http://quote.6x.to (english)
Homepage:   http://www.digitalprojects.com   |   http://www.iso-top.de
   iso-top.de - Die günstige Art an Linux Distributionen zu kommen
Uptime: 1 day 1 hour 7 minutes

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




Re: [PHP] Importing Data from Text File

2001-04-18 Thread Plutarck

Use file() to read the file up into an array (we'll call it $array).

Then I would personally use:

foreach ($array as $val)
{
 trim($val);
 $arr = explode("\t", $val); // "\t" means tab, but it will not work if
it's only spaces instead of a real tab

 $stock_name = $arr[0];
 $stock_desc = $arr[1];
 $stock_length = $arr[2];
 $stock_qty = $arr[3];
 $stock_price = $arr[4];

 // Do your insert/update SQL query right here, before the ending
bracket.

}


There you go. Now inside that loop you have 5 variables with the values they
should have, ready for you to do whatever you'd like with them.

If your wondering, trim() is used to remove the newline characters and
extraneous spaces from the begining and end of the string. As long as they
are using an actual "tab" button between each piece of data, and only ONE
tab, it works.

Tell me if this works for you. If it doesn't I can rethink it :)


--
Plutarck
Should be working on something...
...but forgot what it was.

"Chris Aitken" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi Everyone,
>
> Ive been asked to do a task here at my work and its something ive never
> done before. I was hoping you guys could point me in the right direction
so
> I can research some more and discover how in the hell im gonna do this :)
>
> Basically, I have been issued a TAB delimited text file which I need to
> process and insert all the data into a table. Here is a basic example of
> what I need to do..
>
> Say the text file had the following lines (thousands of them, 1 record per
> line)
>
> Screw   Big 12  200 1.99
> Screw   Big 10  400 1.50
>
> And I wanted to import each line into a table (Mysql DB) that had 6 fields
> (5 for each of the above plus an autoincremented ID field
>
> stock_id
> stock_name
> stock_desc
> stock_length
> stock_qty
> stock_price
>
>
> Any suggestions and direction pointing will be greatly appreciated.
>
>
>
>
> --
>Chris Aitken - Webmaster/Database Designer - IDEAL Internet
> email: [EMAIL PROTECTED]  phone: +61 2 4628   fax: +61 2 4628 8890
>  
>
>Unix -- because a computer's a terrible thing to waste!
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



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




[PHP] Security

2001-04-18 Thread Alessandro F. Rocha

Hi all,

I'd like to know if there is any vulnerability with PHP 4.0.4 pl1 running on 
IIS servers.

Regards,

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


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




[PHP] global sessions

2001-04-18 Thread Ben

i'm trying to use sessions with my project, but it seems that registered
variables in a session aren't global by default.
It doesn't even seem like the session is global, because if I reference the
sessionid (which only shows up if cookies are disabled)
by using , it shows up within a function, if I reference it from
within the function.

if anyone can help me make my variables (such as $user, and $active)
globally registered with the session, I would be very grateful.
maybe its the cookie not being global, that would explain why the sessionid
shows up only from within a function (but not in the global scope)

so...i guess my question is how can i globalize a session?

thanks
ben
[EMAIL PROTECTED]





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




Re: [PHP] print_r style array content

2001-04-18 Thread Christian Reiniger

On Wednesday 18 April 2001 06:01, you wrote:
> Dear All,
>
> I wonder if there is a php function that could return content
> of an array, in print_r style, as a string. I need to get it and
> send as debug information. If not, is there a workaround or
> alternative, other than writing a function? Many thanks.

serialize ()

A bit hard to read, but really useful nevertheless

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

A - American Association Against Acronym Abuse

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




RE: [PHP] Is there such an array like $array[][]?

2001-04-18 Thread Tim Ward

1. there are no multi-dimensional arrays in php, just single dimension
arrays each element of which may be an array (or any other variable type).
If you make every element of an array an array of size x, you will get what
can be used as a multi-dimensional array. But if you forget what it really
is, you'll run into problems like expecting to be able to sort
$array[$x][$y] by $y.
2. because of this you can have as many levels of an array as you want.

try :
$array[][][][] = "fred";
foreach($array as $level1)
foreach($level1 as $level2)
foreach($level2 as $level3)
foreach($level3 as $value)
echo($value);

Tim Ward
Senior Systems Engineer

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


> -Original Message-
> From: Plutarck [mailto:[EMAIL PROTECTED]]
> Sent: 17 April 2001 17:42
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Is there such an array like $array[][]?
> 
> 
> PHP can be a tad screwy with how it handles multi-dimensional 
> arrays, but
> yes PHP handles them. No real speed problems with them either.
> 
> But you may just want to use an associative array like:
> 
> $loc = array("y" => $y, "x" => $x);
> 
> Then just use $loc["y"] and $loc["x"].
> 
> Just another option, but feel free to use multi-dimensional 
> arrays. Just be
> aware that PHP supports only two dimensions (so $array[][][] 
> will not work),
> and if you try and get fancy with sort() and count() you are 
> going to give
> yourself a migraine.
> 
> 
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.
> 
> 
> "Jack Dempsey" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > yes, that's a multi-dimensional array, which is fine in php (and
> > everything else i can think of =P)...
> >
> > -jack
> >
> > Scott Fletcher wrote:
> > >
> > > Hi!  I am wondering if there is such a php array that can 
> take care of
> the x
> > > and y axis data.  I figure that using this array type, 
> $axis[$x][$y]
> would
> > > do the trick.  Would it work?  If not, then education me 
> on what would
> work!
> > > Thanks!
> > >
> > > Scott
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: 
> [EMAIL PROTECTED]
> >
> 
> 
> 

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




Re: [PHP] mysql error code - how to debug

2001-04-18 Thread Plutarck

Ensure your database name as listed in either mysql_select_db or
mysql_db_query is valid.

After that, it's probably a GRANT problem. Make sure the username/password
pair is correct, first of all, and check the privileges of that user.

My guess is that either the DB name is incorrect, or the user does not have
access to that database.


--
Plutarck
Should be working on something...
...but forgot what it was.


<[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Greetings,
>
> This is a mysql question, (but I'm using php with it).
>
> Most everything is working correctly; however, when
> I hit one button I get:
> Database error: cannot use database xx
> MySQL Error: 0 ()
> Session halted.
>
> What should I be looking for?  Is this a user/password
> problem?  Is this a GRANT problem?
>
> Any help here would be appreciated.
>
> Thanks!
>
>
>
>
> Max Pyziur BRAMA - Gateway Ukraine
> [EMAIL PROTECTED]  http://www.brama.com/
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



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




Re: [PHP] Is it possible to parse a variable by character?

2001-04-18 Thread Christian Reiniger

On Wednesday 18 April 2001 07:22, you wrote:
> Hey there guys,
>
> This may seem like a dumb question, but I have to ask it anyway.
>
> I have a form in one of my php based scripts that allows for file
> uploads. I recently noticed a potential issue if people upload files
> containing anything else but the standard characters
> ([_a-z0-9-]+(\.[_a-z0-9-]).
>
> I am not sure if this can be done, but what I need to do is parse
> this variable (lets call it $file_name) by character looking for
> anything save letters a-z (A-Z) and numbers 0-9.  Any arrangements of
> numbers, letters and full stops (.) are to be permitted, and if any
> character does not meet those specifications, that single character
> should be converted to an underscore.

$Input = preg_replace ('/[^\w.-]/', '_', $$Input);

I assumed that you also want to allow "minus" signs.

See the manual section on the regular expression functions 
(Perl-compatible) for an explanation

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

A - American Association Against Acronym Abuse

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




Re: [PHP] Regular Expression

2001-04-18 Thread Wico de Leeuw

At 13:39 18-4-2001 +0200, Jeroen Geusebroek wrote:
>Hi,
>
>I have question about regular expressions; I don't know anything
>about it and was wondering if someone could help me out.
>
>I have this text:
>
>"[ this is atest ] and this is the rest of the text"

$data = "[ this is a test ] and this is the rest of the text"
if (preg_match('"\[([^\]]+)\]"', $data, $match)) {
 var_dump($match[1])
}

>I want to get the text inbetween the [ and ].
>
>If someone could help me out, i would appreciate it.
>A link to a tuturial would also be nice.
>
>Regards,
>
>Jeroen Geusebroek
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>To contact the list administrators, e-mail: [EMAIL PROTECTED]


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




Re: [PHP] Is it possible to parse a variable by character?

2001-04-18 Thread Christian Reiniger

On Wednesday 18 April 2001 12:00, you wrote:
> >Warning: REG_ERANGE in
> > /home/httpd/www/worldvibe.org/digitall/edit_f.php on line 91
> >
> >Here are lines surrounding 91:
> >
> >89->   strtolower($f_loc_name);
> >90->   $f_loc_new = "";
> >91->   $f_loc_new = ereg_replace("[^[_a-z0-9-\.]]", "", $f_loc_name);
> >92->   $f_loc_name = "";
> >93->   $f_loc_name = $f_loc_new;
>
> $f_loc_new = ereg_replace("[^_a-z0-9-\.]", "", $f_loc_name);

That, and because the dash needs to be the last character in the 
character class:
$f_loc_new = ereg_replace("[^_a-z0-9.-]", "", $f_loc_name);


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

A - American Association Against Acronym Abuse

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




[PHP] unixodbc problem

2001-04-18 Thread Przem Kowalczyk

Hi.

I've installed unixODBC (2.0.5) and then compiled php (4.0.4pl1 and latest
CVS) with --with-unixodbc=/www/unixodbc. Suprisingly, when I noticed that
there is:

Fatal error: Call to undefined function: odbc_connect() in
/www/virtual/firebird/common/pre.php on line 25

Can anybody explained me why this happend? Did I forget to compile sometghin
in?

'./configure' '--with-prefix=/www/php' '--with-apxs=/www/apache/bin/apxs'
'--with-pgsql=/www/pgsql/' '--with-sigchild' '--with-memory-limit'
'--with-config-file-path=/www/php/conf' '--enable-wddx' '--enable-xml'
'--with-mysql=/www/mysql' '--with-unixodbc=/www/unixodbc/'

Przem







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




Re: [PHP] Wrox - Beginning PHP4 Ch12 example problem

2001-04-18 Thread Dave Mateer

Replying to myself...the first sign of madness.

I found the solution, which was hidden characters in the text file, which
was confusing javascript.



""Dave Mateer"" <[EMAIL PROTECTED]> wrote in message
9bf1v5$4iq$[EMAIL PROTECTED]">news:9bf1v5$4iq$[EMAIL PROTECTED]...
> Happy Easter to all!
>
> In the user viewer example at the end of Chapter 12 - has anyone had
> problems with the source downloaded from their website?
>
> The story so far with my trials of this example:
>
> downloaded source
> created table in mysql and populated it (with the SQL script provided)
>
> First page ie function list_records() works 'fine'.  Except a javascript
> error at the foot of the page - page done, with errors.  Sorting
hyperlinks
> all work, as does all the forward, reverse paging.
>
> What doesn't work is the function view_record() hyperlinks.
>
> I believe things are going awry in javascript (of which I know nothing,
and
> have the dummies guide in front of me) as it doesn't get to opening a new
> window.
>
> I've tried calling the function as follows:
>
> Google
>
> No joy at all - javascript error.
>
> 
>
>
>
> Any help greatly received.  Grrr  I'm trying to learn php, not hack
> javascript...
>
>
> David Mateer.
> [EMAIL PROTECTED]
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



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




Re: [PHP] Cannot destroy session cookie

2001-04-18 Thread Johannes Janson

Hi,

Why destroying it "before" a user logs in? Isn't it
better to start the session "after" a successful login?
And then destroying the session when the user logs out.
Or did I get it wrong. A few lines of code would help
to understand.

Johannes


"Jens Kisters" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
Hi there,
i'm having a little trouble with cleaning up sessions.
I have a login page that sets a certain session variable that is used to
determine wether a user is logged on.
When the user has cookies turned on the application recognizes the
running session an resumes it, that also happens on the login-page,
i'd like to explicitly destroy the session before logging on, i tried
unsetting the session variable, destroying the session, unsetting the
session cookie, but nothing worked, the session is always continued with
the same SessionID.
What can i do to destroy the session?

tks
Jens

--
Grüße aus dem schönen Kleve
Jens Kisters

rosomm et partner
Agentur für neue Medien GmbH
Dienstleistungszentrum am
Weißen Tor - Eingang B
Gocher Landstrasse 2
47551 Kleve / Bedburg-Hau

Telefon: 02821 - 97856-20
Telefax: 02821 - 97856-77
[EMAIL PROTECTED]
http://www.rosomm-partner.de



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




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




[PHP] HTTP_POST_VARS variable names?

2001-04-18 Thread Mat Marlow

Hi,
Does anyone know if php stores POST variable names as well as values? I'm
using HTTP_POST_VARS for the values but I'm having to create my own array
for the names.

cheers,

Mat



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




[PHP-CVS] cvs: php4 /ext/ircg ircg.c php_ircg.h

2001-04-18 Thread Sascha Schumann

sas Wed Apr 18 04:42:31 2001 EDT

  Modified files:  
/php4/ext/ircg  ircg.c php_ircg.h 
  Log:
  Support notice which should be used to query bots etc.
  
  
Index: php4/ext/ircg/ircg.c
diff -u php4/ext/ircg/ircg.c:1.59 php4/ext/ircg/ircg.c:1.60
--- php4/ext/ircg/ircg.c:1.59   Tue Apr 17 15:44:54 2001
+++ php4/ext/ircg/ircg.cWed Apr 18 04:42:30 2001
@@ -16,7 +16,7 @@
+--+
  */
 
-/* $Id: ircg.c,v 1.59 2001/04/17 22:44:54 sas Exp $ */
+/* $Id: ircg.c,v 1.60 2001/04/18 11:42:30 sas Exp $ */
 
 #include "php.h"
 #include "php_ini.h"
@@ -75,6 +75,7 @@
PHP_FE(ircg_join, NULL)
PHP_FE(ircg_part, NULL)
PHP_FE(ircg_msg, NULL)
+   PHP_FE(ircg_notice, NULL)
PHP_FE(ircg_nick, NULL)
PHP_FE(ircg_topic, NULL)
PHP_FE(ircg_channel_mode, NULL) 
@@ -1139,6 +1140,29 @@

irc_nick(&conn->conn, Z_STRVAL_PP(newnick));

+   RETURN_TRUE;
+}
+
+PHP_FUNCTION(ircg_notice)
+{
+   zval **id, **recipient, **msg;
+   php_irconn_t *conn;
+   smart_str l = {0};
+   smart_str m = {0};
+   smart_str tmp, tmp2;
+   
+   if (ZEND_NUM_ARGS() != 3 || zend_get_parameters_ex(3, &id, &recipient, &msg) 
+== FAILURE)
+   WRONG_PARAM_COUNT;
+
+   convert_to_long_ex(id);
+   convert_to_string_ex(recipient);
+   convert_to_string_ex(msg);
+
+   conn = lookup_irconn(Z_LVAL_PP(id));
+
+   if (!conn) RETURN_FALSE;
+
+   irc_handle_command(&conn->conn, "NOTICE", 2, Z_STRVAL_PP(recipient), 
+Z_STRVAL_PP(msg));
RETURN_TRUE;
 }
 
Index: php4/ext/ircg/php_ircg.h
diff -u php4/ext/ircg/php_ircg.h:1.10 php4/ext/ircg/php_ircg.h:1.11
--- php4/ext/ircg/php_ircg.h:1.10   Tue Apr  3 12:28:47 2001
+++ php4/ext/ircg/php_ircg.hWed Apr 18 04:42:30 2001
@@ -36,6 +36,7 @@
 PHP_FUNCTION(ircg_register_current_conn);
 PHP_FUNCTION(ircg_whois);
 PHP_FUNCTION(ircg_msg);
+PHP_FUNCTION(ircg_notice);
 PHP_FUNCTION(ircg_nick);
 PHP_FUNCTION(ircg_html_encode);
 PHP_FUNCTION(ircg_ignore_add);



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




[PHP-CVS] cvs: php4 /ext/dbx dbx.c dbx.h

2001-04-18 Thread Marc Boeren

mboeren Wed Apr 18 05:31:08 2001 EDT

  Modified files:  
/php4/ext/dbx   dbx.c dbx.h 
  Log:
  Added DBX_CMP_TEXT and DBX_CMP_NUMBER constants and support for them in
  the dbx_cmp_desc and dbx_cmp_asc functions. The old method of passing a
  string "number" is now no longer valid. (Mc)
  
  
Index: php4/ext/dbx/dbx.c
diff -u php4/ext/dbx/dbx.c:1.9 php4/ext/dbx/dbx.c:1.10
--- php4/ext/dbx/dbx.c:1.9  Wed Apr 11 01:14:57 2001
+++ php4/ext/dbx/dbx.c  Wed Apr 18 05:31:08 2001
@@ -138,6 +138,8 @@
 REGISTER_LONG_CONSTANT("DBX_RESULT_INFO", DBX_RESULT_INFO, CONST_CS | 
CONST_PERSISTENT);
 REGISTER_LONG_CONSTANT("DBX_RESULT_INDEX", DBX_RESULT_INDEX, CONST_CS | 
CONST_PERSISTENT);
 REGISTER_LONG_CONSTANT("DBX_RESULT_ASSOC", DBX_RESULT_ASSOC, CONST_CS | 
CONST_PERSISTENT);
+REGISTER_LONG_CONSTANT("DBX_CMP_TEXT", DBX_CMP_TEXT, CONST_CS | CONST_PERSISTENT);
+REGISTER_LONG_CONSTANT("DBX_CMP_NUMBER", DBX_CMP_NUMBER, CONST_CS | 
+CONST_PERSISTENT);
 
 return SUCCESS;
 }
@@ -498,7 +500,7 @@
 int min_number_of_arguments=3;
 int max_number_of_arguments=4;
 int number_of_arguments=-1;
-int comparison_type=0;
+long comparison_type;
 double dtemp;
 long ltemp;
 zval ** arguments[4];
@@ -516,10 +518,10 @@
 RETURN_LONG(0);
 }
 convert_to_string_ex(arguments[2]); /*/ field name /*/
-comparison_type = 0; // default, text
+comparison_type = DBX_CMP_TEXT;
 if (number_of_arguments>3) {
-convert_to_string_ex(arguments[3]); /*/ comparison type /*/
-if (!strcmp((*arguments[3])->value.str.val, "number")) comparison_type=1;
+convert_to_long_ex(arguments[3]); /*/ comparison type /*/
+comparison_type=(*arguments[3])->value.lval;
 }
 
 if (zend_hash_find((*arguments[0])->value.ht, (*arguments[2])->value.str.val, 
(*arguments[2])->value.str.len+1, (void **) &zv_a)==FAILURE
@@ -529,13 +531,13 @@
 }
 
 switch (comparison_type) {
-case 0:
+case DBX_CMP_TEXT:
 convert_to_string_ex(zv_a);
 convert_to_string_ex(zv_b);
 ltemp = strcmp((*zv_a)->value.str.val, (*zv_b)->value.str.val);
 result = (ltemp==0?0: (ltemp>0?1:-1));
 break;
-case 1:
+case DBX_CMP_NUMBER:
 convert_to_double_ex(zv_a);
 convert_to_double_ex(zv_b);
 dtemp = ((*zv_a)->value.dval - (*zv_b)->value.dval);
@@ -557,7 +559,7 @@
 int min_number_of_arguments=3;
 int max_number_of_arguments=4;
 int number_of_arguments=-1;
-int comparison_type=0;
+long comparison_type;
 double dtemp;
 long ltemp;
 zval ** arguments[4];
@@ -575,10 +577,10 @@
 RETURN_LONG(0);
 }
 convert_to_string_ex(arguments[2]); /*/ field name /*/
-comparison_type = 0; // default, text
+comparison_type = DBX_CMP_TEXT;
 if (number_of_arguments>3) {
-convert_to_string_ex(arguments[3]); /*/ comparison type /*/
-if (!strcmp((*arguments[3])->value.str.val, "number")) comparison_type=1;
+convert_to_long_ex(arguments[3]); /*/ comparison type /*/
+comparison_type=(*arguments[3])->value.lval;
 }
 
 if (zend_hash_find((*arguments[0])->value.ht, (*arguments[2])->value.str.val, 
(*arguments[2])->value.str.len+1, (void **) &zv_a)==FAILURE
@@ -588,13 +590,13 @@
 }
 
 switch (comparison_type) {
-case 0:
+case DBX_CMP_TEXT:
 convert_to_string_ex(zv_a);
 convert_to_string_ex(zv_b);
 ltemp = strcmp((*zv_b)->value.str.val, (*zv_a)->value.str.val);
 result = (ltemp==0?0: (ltemp>0?1:-1));
 break;
-case 1:
+case DBX_CMP_NUMBER:
 convert_to_double_ex(zv_a);
 convert_to_double_ex(zv_b);
 dtemp = ((*zv_b)->value.dval - (*zv_a)->value.dval);
Index: php4/ext/dbx/dbx.h
diff -u php4/ext/dbx/dbx.h:1.2 php4/ext/dbx/dbx.h:1.3
--- php4/ext/dbx/dbx.h:1.2  Fri Mar 23 02:23:58 2001
+++ php4/ext/dbx/dbx.h  Wed Apr 18 05:31:08 2001
@@ -33,6 +33,8 @@
 #define DBX_RESULT_INFO  1
 #define DBX_RESULT_INDEX2
 #define DBX_RESULT_ASSOC   4
+#define DBX_CMP_TEXT  0
+#define DBX_CMP_NUMBER  1
 
 #define MOVE_RETURNED_TO_RV(rv, returned_zval) { **rv = *returned_zval; 
zval_copy_ctor(*rv); zval_ptr_dtor(&returned_zval); }
 



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




Re: [PHP] HTTP_POST_VARS variable names?

2001-04-18 Thread Johannes Janson

Hi,

this will list all your posted variables with name and
the posted value.

while (list($key, $value)=each($HTTP_POST_VARS) ) {
echo "$key = $value ";
}

Johannes

""Mat Marlow"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
9bk11q$dvq$[EMAIL PROTECTED]">news:9bk11q$dvq$[EMAIL PROTECTED]...
> Hi,
> Does anyone know if php stores POST variable names as well as values? I'm
> using HTTP_POST_VARS for the values but I'm having to create my own array
> for the names.
>
> cheers,
>
> Mat
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



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




Re: [PHP] HTTP_POST_VARS variable names?

2001-04-18 Thread Renze Munnik

Mat Marlow wrote:
> 
> Hi,
> Does anyone know if php stores POST variable names as well as values? I'm
> using HTTP_POST_VARS for the values but I'm having to create my own array
> for the names.
> 
> cheers,
> 
> Mat
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]


Correct me if I misunderstand you're question, but;

If you use HTTP_POST_VARS you already have the variable names. I
mean... how else do you use the values you're talking about?
$HTTP_POST_VARS{"var_1"}, $HTTP_POST_VARS{"var_2"}, etc.
var_1 and var_2 are the variable names...
-- 

* R&zE:

***
**  Renze Munnik
**
**  E: [EMAIL PROTECTED]
**  M: +31 6 218 111 43
***

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




Re: [PHP] Security

2001-04-18 Thread Phil Driscoll

>I'd like to know if there is any vulnerability with PHP 4.0.4 pl1 running
on
>IIS servers.
None that I'm aware of that are due to php, unless you write silly scripts
which allow access to things they shouldn't. There are probably uncountable
NT vulnerabilities though. One which recently frightened me was that if you
append +.htr to a requested URL (eg www.mydomain.com/myphpfile.php  - or
indeed myaspfile.asp) on a standard setup you get the script source complete
with any passwords you were unwise enough to put in there. Easily fixed by
removing the .htr script mapping in the internet service manager, but
frightening to find out you've been running your servers for several years
whilst unaware of the problem.

Cheer
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org


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




RE: [PHP] Why is this happening

2001-04-18 Thread Boget, Chris

> >> >Ok, I found out what the problem was.  I'm still curious
> >> >why the problem is occuring.
> >> >> if( $tmpArray[errorNumber] & $typesToDisplay ) {  
> >> you're using the bitwise & when you want the logical &&
> >No, I actually wanted to use the bitwise &.  I wanted to see
> >if the "errorNumber" was in $typesToDisplay.
> without seeing the code I would guess you should be using in_array().

Except that $typesToDisplay is not an array.  It is made up of
something like this:

$typesToDisplay = ( 1 | 2 | 4 | 8 | 32 | 64 );

And to see if the errorNumber is part of the above, you bitwise
"&" it.

Chris



[PHP-CVS] cvs: php4 /ext/dbx dbx_pgsql.c

2001-04-18 Thread Marc Boeren

mboeren Wed Apr 18 05:34:53 2001 EDT

  Modified files:  
/php4/ext/dbx   dbx_pgsql.c 
  Log:
  Removed some old commented code (Mc)
  
  
Index: php4/ext/dbx/dbx_pgsql.c
diff -u php4/ext/dbx/dbx_pgsql.c:1.6 php4/ext/dbx/dbx_pgsql.c:1.7
--- php4/ext/dbx/dbx_pgsql.c:1.6Sat Apr 14 03:32:14 2001
+++ php4/ext/dbx/dbx_pgsql.cWed Apr 18 05:34:52 2001
@@ -20,13 +20,7 @@
 #include "php_dbx.h"
 #include "dbx_pgsql.h"
 #include 
-/*
-#ifdef ZTS
-extern int dbx_globals_id;
-#else
-extern ZEND_DBX_API zend_dbx_globals dbx_globals;
-#endif
-*/
+
 #define PGSQL_ASSOC1<<0
 #define PGSQL_NUM  1<<1
 
@@ -156,17 +150,7 @@
return 0;
}
 MOVE_RETURNED_TO_RV(rv, returned_zval);
-/*
-   if(strstr(Z_STRVAL_PP(sql_statement), "SELECT") ||
-  strstr(Z_STRVAL_PP(sql_statement), "select")){
-   DBXG(row_count) = 0;
 
-   args[0]=rv;
-   nargs = 1;
-   dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "pg_numrows", 
&num_rows_zval, nargs, args);
-   DBXG(num_rows) = Z_LVAL_P(num_rows_zval);
-   } 
-*/
 return 1;
 }
 
@@ -245,13 +229,8 @@
 ZVAL_LONG(zval_row, row_number);
 arguments[0]=result_handle;
 arguments[1]=&zval_row;
-/*
-   DBXG(row_count)++;
-   if (DBXG(row_count)>DBXG(num_rows)){
-   return 0;
-   }
-*/
-   if (EG(error_reporting) & E_WARNING){
+
+if (EG(error_reporting) & E_WARNING){
save_error_reporting = EG(error_reporting);
EG(error_reporting) &= ~E_WARNING;
}



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




[PHP] WDDX Deserialisation problem/bug?

2001-04-18 Thread Darren Beale

Hi

I'm using wddx_deserialize($packet) and what I'm getting returned does not
seem right in the slightest

my code is:

$values = wddx_deserialize($packet);

Packet:
Senior
Legal AdviserHead of Litigationblah blah blahblah blah
blah234236<
/data>

when I run wddx_deserialize on my packet, I'm getting a string with the
contents "Senior Legal Adviser"

i.e. the first value of the first field

I was expecting a nice associative array, what am I doing wrong?

FWIW the packet is coming through fine

regs
--
Darren Beale
Web Developer
Vardus Ltd  - www.vardus.com
+44 (0) 20 7471 8899


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




Re: [PHP] Is it possible to parse a variable by character?

2001-04-18 Thread Sean Coyle

Christian,

Thanks for pointing that out!  Everything works excellently now!

Now, all I have to do, is run another ereg_replace() to look for any
duplicate full stops '.' and replace them with one, but I don't think that
one will be to hard.

For those of you interested, this is what the code looks like now:

if(strlen($flf_desc)) {
  $f_loc_lower = strtolower($f_loc_name);
  $f_loc_new = "";
  $f_loc_new = ereg_replace("[^_a-z0-9\.-]", "", $f_loc_lower);
  $f_loc_name = "";
  $f_loc_name = $f_loc_new;
  $path = $destination.$f_loc_name;
  !file_exists($path) or die("Unable to copy $f_loc_name to location
$URL_sitepath.Because $f_loc_name already exists there");
  copy($f_loc, $path) or die("Unable to copy $f_loc_name to location
$URL_sitepath. Please phone your admistrator immediatly ASAP");
  $flf_loc = $URL_sitepath.$f_loc_name;
  $f_loc = $flf_loc;
  $flf_name = "$f_loc_name";
  $uploadline2 = "$f_loc_name was uploaded succesfully.";
  $uploadline3 = "If you wish to give a path for your clients to
download this filewithout having to log in, please send them this
URL$flf_loc";
}

Thanks the the help!

Cheers,

Sean

On 4/18/01 5:08 AM, in article 01041814104906.00662@chrisbig, "Christian
Reiniger" <[EMAIL PROTECTED]> wrote:

> On Wednesday 18 April 2001 12:00, you wrote:
>>> Warning: REG_ERANGE in
>>> /home/httpd/www/worldvibe.org/digitall/edit_f.php on line 91
>>> 
>>> Here are lines surrounding 91:
>>> 
>>> 89->   strtolower($f_loc_name);
>>> 90->   $f_loc_new = "";
>>> 91->   $f_loc_new = ereg_replace("[^[_a-z0-9-\.]]", "", $f_loc_name);
>>> 92->   $f_loc_name = "";
>>> 93->   $f_loc_name = $f_loc_new;
>> 
>> $f_loc_new = ereg_replace("[^_a-z0-9-\.]", "", $f_loc_name);
> 
> That, and because the dash needs to be the last character in the
> character class:
> $f_loc_new = ereg_replace("[^_a-z0-9.-]", "", $f_loc_name);
> 


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




Re: [PHP] Images only with 256 Colors?!

2001-04-18 Thread Rasmus Lerdorf

Don't use GD.  You need either the new GD2 extension or the Imlib2
extension from http://mmcc.cx/php_imlib/

-Rasmus

On Wed, 18 Apr 2001, Nils Sondermann wrote:

> I want do create Images dynamicly, i have a High Color png but after
> CreateImagefrompng() it have only 256 colors. What can i do?
>
> thx
>  Nils
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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




Re: [PHP] HTTP_POST_VARS variable names?

2001-04-18 Thread Plutarck

Quick answer: HTTP_POST_VARS is an associative array. The "name" of the
submitted variables are the keys, and the value of the element is the value
that was submitted.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Mat Marlow"" <[EMAIL PROTECTED]> wrote in message
9bk11q$dvq$[EMAIL PROTECTED]">news:9bk11q$dvq$[EMAIL PROTECTED]...
> Hi,
> Does anyone know if php stores POST variable names as well as values? I'm
> using HTTP_POST_VARS for the values but I'm having to create my own array
> for the names.
>
> cheers,
>
> Mat
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



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




[PHP] Connection with a Palm

2001-04-18 Thread Renzi, Sebastian

I ' m trying to develop a page that exports data to a Palm ,my question is
,can i do this with PHP or with JavaScript ? .If it's possible please let me
know ,thnks

Sebastián Renzi
Consultoría & Desarrollo de Sistemas.
CODES S.A


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




[PHP] New problem with PHP "odbc_exec".

2001-04-18 Thread Scott Fletcher

  Hi!  I don't understand why PHP is having trouble with the odbc_exec.  Is
there a bug in PHP code?  Here's what the error messages said!

  "SQL error: [OpenLink][ODBC][Driver]No key columns found for table
referenced by keyset driven cursor., SQL state IM909 in SQLExecDirect".

  This show that it had to do with primary (or secondary) keys or index
issues.  I'm using MS-SQL Sever and this table I'm using in the database
have primary key already!

  So, what can I do to fix it?  I need it to be working.  When I use the
Linux odbctest command and it execute without a problem.  So, it is obvious
the problem lie with PHP code, odbc_exec();

Thanks,
 Scott



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




Re: [PHP] global sessions

2001-04-18 Thread Plutarck

If you want to access a global variable in a function, it must be declared
"GLOBAL". Otherwise PHP's local scope would be totally useless.

If you want to access a variable inside of a function, you must explicitly
declare it as global.

There are a few exceptions such as $GLOBALS, but they should not be relied
on.

If nothing else, not using global in a function that requires a variable
that is declared outside of that function is bad practice.


Note: Try using get_defined_variables() inside of a function and see what it
returns.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Ben"" <[EMAIL PROTECTED]> wrote in message
9bjvo1$irv$[EMAIL PROTECTED]">news:9bjvo1$irv$[EMAIL PROTECTED]...
> i'm trying to use sessions with my project, but it seems that registered
> variables in a session aren't global by default.
> It doesn't even seem like the session is global, because if I reference
the
> sessionid (which only shows up if cookies are disabled)
> by using , it shows up within a function, if I reference it
from
> within the function.
>
> if anyone can help me make my variables (such as $user, and $active)
> globally registered with the session, I would be very grateful.
> maybe its the cookie not being global, that would explain why the
sessionid
> shows up only from within a function (but not in the global scope)
>
> so...i guess my question is how can i globalize a session?
>
> thanks
> ben
> [EMAIL PROTECTED]
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



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




Re: [PHP] Connection with a Palm

2001-04-18 Thread Plutarck

"exporting data to a palm" is far too vague.

PHP can produce data in a format suitable for saving on a Palm, or you can
have it interpret data from a Palm. To physically save data from a webpage
to a palm requires client-side scripting.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Renzi, Sebastian"" <[EMAIL PROTECTED]> wrote in message
A1581797259FD211B25E00805FCBC1FA1E4C1C@SRV_DES_01">news:A1581797259FD211B25E00805FCBC1FA1E4C1C@SRV_DES_01...
I ' m trying to develop a page that exports data to a Palm ,my question is
,can i do this with PHP or with JavaScript ? .If it's possible please let me
know ,thnks

Sebastián Renzi
Consultoría & Desarrollo de Sistemas.
CODES S.A


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




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




Re: [PHP] Variable variable

2001-04-18 Thread Steve Werby

"Plutarck" <[EMAIL PROTECTED]> wrote:
> Your problem has little to do with the things mentioned.
>
> First of all, you are refering to a variable variable incorrectly.

Actually, he's not.

>You must
> use brackets, like this:
>
> ${$id}

The braces aren't required in this case.  Of the four examples below, only
the 3rd won't return the expected results - because the first $ is
interpreted as a literal $.  Paste the code below into a webpage and see for
yourself.

' . $$field;
echo '' . ${$field};
echo '' . "My name is $$field.";
echo '' . "My name is ${$field}.";
?>

I have a few possible explanations for the problem of the original poster
(see below).

> if (${$id} == "on")
> {
> echo 'on';
> } else
> {
> echo 'off';
> }

1. If $id is a number I believe PHP will choke b/c I don't believe numbers
can be used as variable names.

2. Assume $id = 'age_bracket'.  The control structure checks to see if
$age_bracket == "on".  To set $id in the first place for your multiple
checkbox values, you'd have to loop through the values sent from the form.
Jack (original poster), did you do that?  If your form's method = post then
you would loop through $HTTP_POST_VARS and if it was get $HTTP_GET_VARS (and
then only loop through the checkbox variables).  Or you could predefine the
checkbox variables using:

$checkbox_fields = array( 'age_bracket', 'weight', 'gender', 'occupation' );

And then loop through as follows:

while( list( , $val ) = each( $checkbox_fields ) )
{
// may have to set as $$GLOBALS[$val] if within a function or declare $val
as global first.
if ( $$val == 'on' )
{
echo 'on';
}
else
{
echo 'off';
 }
}

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/


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




RE: [PHP] Connection with a Palm

2001-04-18 Thread Renzi, Sebastian

Thank you ,where i can download more info about this ?

> -Mensaje original-
> De:   Plutarck [SMTP:[EMAIL PROTECTED]]
> Enviado el:   miércoles 18 de abril de 2001 10:42
> Para: [EMAIL PROTECTED]
> Asunto:   Re: [PHP] Connection with a Palm
> 
> "exporting data to a palm" is far too vague.
> 
> PHP can produce data in a format suitable for saving on a Palm, or you can
> have it interpret data from a Palm. To physically save data from a webpage
> to a palm requires client-side scripting.
> 
> 
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.
> 
> 
> ""Renzi, Sebastian"" <[EMAIL PROTECTED]> wrote in message
> A1581797259FD211B25E00805FCBC1FA1E4C1C@SRV_DES_01">news:A1581797259FD211B25E00805FCBC1FA1E4C1C@SRV_DES_01...
> I ' m trying to develop a page that exports data to a Palm ,my question is
> ,can i do this with PHP or with JavaScript ? .If it's possible please let
> me
> know ,thnks
> 
> Sebastián Renzi
> Consultoría & Desarrollo de Sistemas.
> CODES S.A
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

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




Re: [PHP] Variable variable

2001-04-18 Thread Rasmus Lerdorf

> 1. If $id is a number I believe PHP will choke b/c I don't believe numbers
> can be used as variable names.

Well, generally that is true.  If you try to assign a value directly to a
variable that is a number such as:

 $1 = "Hello World";

Then it won't work.  However, due to a somewhat quirky implementation you
can get arund this by doing:

 $a=1;
 $$a = "Hello World";

You can verify that you do indeed have a variable named $1 in your global
symbol table by doing:

 echo $GLOBALS[1];

-Rasmus


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




Re: [PHP] New problem with PHP "odbc_exec".

2001-04-18 Thread Yasuo Ohgaki
[From BugDB]

ID: 10375
Updated by: kalowsky
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Closed
Bug Type: Reproduceable crash
PHP Version: 4.0.4pl1
Assigned To:
Comments:

fixed in cvs, will not be in 4.0.5, but later releases.

Previous Comments:
---

[2001-04-18 08:23:59] [EMAIL PROTECTED]
Documentation tells me that odbc_autocommit can be called with one or two
parameters.
(Without the OnOff parameter, this function returns auto-commit status for
connection_id. )

Calling with two parameters works, with one I get a crash.

I'm using ODBC 3.520.5303.2 against a Access 2000 database with Access ODBC
driver 4.00.5303.01




---



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=10375&edit=2


--
PHP Development Mailing List 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

You may find other bugs in BugDB.

Regards,
--
Yasuo Ohgaki


""Scott Fletcher"" <[EMAIL PROTECTED]> wrote in message
9bk5j8$iks$[EMAIL PROTECTED]">news:9bk5j8$iks$[EMAIL PROTECTED]...
>   Hi!  I don't understand why PHP is having trouble with the odbc_exec.  Is
> there a bug in PHP code?  Here's what the error messages said!
>
>   "SQL error: [OpenLink][ODBC][Driver]No key columns found for table
> referenced by keyset driven cursor., SQL state IM909 in SQLExecDirect".
>
>   This show that it had to do with primary (or secondary) keys or index
> issues.  I'm using MS-SQL Sever and this table I'm using in the database
> have primary key already!
>
>   So, what can I do to fix it?  I need it to be working.  When I use the
> Linux odbctest command and it execute without a problem.  So, it is obvious
> the problem lie with PHP code, odbc_exec();
>
> Thanks,
>  Scott
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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


Re: [PHP] Connection to postgresql DB used by 2 scripts ?

2001-04-18 Thread Plutarck

I think you're misunderstanding what include actually does.

Let's say we have a file called db.php, with the contents:



Now, if the contents of your other script are:



It is the same as having the contents:




When you execute a query with pg_exec you are using the current connection,
not establishing a new one.

There is no reason to use the global keyword to access the value of $conn,
unless you are trying to access $conn inside of the function.


I believe you are looking for the persistant connection function, in that
you don't have to open a new connection for every time the script is run.
However, you must still make a call to pg_pconnect before you attempt to
query your database.


Anyway, using include while not open a new connection for each query. But it
will open a new connection for each time the page is visited.


--
Plutarck
Should be working on something...
...but forgot what it was.



""Picard, Cyril"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
include will help me to organize my scripts, but it will effectively
establish the connection each time I perform the query.
I would like to establish the connection one time, and then to be able to
perform many queries using this connection.
I've been told that i could declare $conn as global in both script :
-- connect.php:
   global $conn;
   $conn = pg_connect ...

-- query.php:
   global $conn;
   $res = pg_exec( $conn, ...

What do you think about this way ?

> -Message d'origine-
> De: Johannes Janson [SMTP:[EMAIL PROTECTED]]
> Date: mercredi 18 avril 2001 12:42
> À: [EMAIL PROTECTED]
> Objet: Re: [PHP] Connection to postgresql DB used by 2 scripts ?
>
> Hi,
>
> put: include("connect.php"); at the beginning of query.php.
>
> Johannes
>
> ""Picard, Cyril"" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I would like to query a postgresql db with the php language.
> > Today I wrote a script (connectandquery.php) performing the following :
> > - connect to the DB : $conn = pg_Connect("dbname = foo");
> > - execute the query : $res = pg_Exec($conn,"SELECT * from BAR");
> >
> >
> > But I would like to write this in two scripts :
> > - connect.php : $conn = pg_Connect("dbname = foo");
> > - query.php : $res = pg_Exec($conn,"SELECT * from BAR");
> >
> > but I don't know how to get the $conn variable (defined in connect.php)
> in
> > the script query.php.
> >
> > Any idea is welcome !
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

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




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




Re: [PHP] Images only with 256 Colors?!

2001-04-18 Thread Yasuo Ohgaki
Don't forget take a look at dev-list archive, there are many useful posts how to
compile with gd2.

--
Yasuo Ohgaki


""Nils Sondermann"" <[EMAIL PROTECTED]> wrote in message
9bjthb$fu2$[EMAIL PROTECTED]">news:9bjthb$fu2$[EMAIL PROTECTED]...
> I want do create Images dynamicly, i have a High Color png but after
> CreateImagefrompng() it have only 256 colors. What can i do?
>
> thx
>  Nils
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


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


Re: [PHP] Persistent connection & many scripts ?

2001-04-18 Thread Plutarck

Nope, you don't need to save the ID. PHP/database does the work of
remembering what the ID of your persistant connection is.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Picard, Cyril"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
hummm... I don't know how to use pg_pconnect()... It returns a connection
ID, isn't it ? And I have to use this connection ID later ?
I would like to reuse this connection ID to another script... and the
problem is here :(

I feel that I ignore something so important that I'm stopped and so trivial
that you do not think about it !

> -Message d'origine-
> De: Christian Reiniger [SMTP:[EMAIL PROTECTED]]
> Date: mercredi 18 avril 2001 13:40
> À: [EMAIL PROTECTED]
> Objet: Re: [PHP] Persistent connection & many scripts ?
>
> On Tuesday 17 April 2001 16:28, you wrote:
> > Yes... I'm not familiar with sessions. This should be like this ? :
> >
> > In connect.php :
> >  > session_start();
> > $connect = pg_pConnect("blablabla");
> > session_register("connect");
> > clique ici
> > ?>
>
> Simply using pg_pconnect() (without saving the connection ID) should be
> just as fast and more failproof
>
> --
> Christian Reiniger
> LGDC Webmaster (http://sunsite.dk/lgdc/)
>
> A - American Association Against Acronym Abuse
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

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




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




RE: [PHP] Persistent connection & many scripts ?

2001-04-18 Thread Picard, Cyril

So :


Is it what you mean ? 

PS : I understand that my code here is not very usefull ;-)

> -Message d'origine-
> De:   Plutarck [SMTP:[EMAIL PROTECTED]]
> Date: mercredi 18 avril 2001 15:57
> À:[EMAIL PROTECTED]
> Objet:Re: [PHP] Persistent connection & many scripts ?
> 
> Nope, you don't need to save the ID. PHP/database does the work of
> remembering what the ID of your persistant connection is.
> 
> 
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.
> 
> 
> ""Picard, Cyril"" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hummm... I don't know how to use pg_pconnect()... It returns a connection
> ID, isn't it ? And I have to use this connection ID later ?
> I would like to reuse this connection ID to another script... and the
> problem is here :(
> 
> I feel that I ignore something so important that I'm stopped and so
> trivial
> that you do not think about it !
> 
> > -Message d'origine-
> > De: Christian Reiniger [SMTP:[EMAIL PROTECTED]]
> > Date: mercredi 18 avril 2001 13:40
> > À: [EMAIL PROTECTED]
> > Objet: Re: [PHP] Persistent connection & many scripts ?
> >
> > On Tuesday 17 April 2001 16:28, you wrote:
> > > Yes... I'm not familiar with sessions. This should be like this ? :
> > >
> > > In connect.php :
> > >  > > session_start();
> > > $connect = pg_pConnect("blablabla");
> > > session_register("connect");
> > > clique ici
> > > ?>
> >
> > Simply using pg_pconnect() (without saving the connection ID) should be
> > just as fast and more failproof
> >
> > --
> > Christian Reiniger
> > LGDC Webmaster (http://sunsite.dk/lgdc/)
> >
> > A - American Association Against Acronym Abuse
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

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




Re: [PHP] php equivalent for `command`

2001-04-18 Thread Plutarck

> In the second set of code lines, what I need to do is somehow bracket off
the $test++ so it is evaluated before being echoed.

You need to use the string concantenation operator (a period) to use things
like $test++, else PHP get's confused.

> echo "Value of test: $test++ ";

To get that to work like you want it to, you need only do:

echo 'Value of test: ' . $test++ . ' ';

It's functionally the same, no brackets needed. If you want it to be
evaluated BEFORE it's echoed, you need to use:

echo 'Value of test: ' . ++$test . ' ';


--
Plutarck
Should be working on something...
...but forgot what it was.



""Greig, Euan"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I deliberately gave a simple example, perhaps too simple.  I want to
output quite long and complicated strings that may involve evaluated
variables, calls to functions etc. But I also want it to as legible as
possible. But even something simple along the lines I quoted gives me
problems. See the following code and its output
>
>  $test=1;
> echo $test++ . "";
> echo $test++ . "";
>
> $test=1;
> echo "Value of test: $test++ ";
> echo "Value of test: $test++ ";
> ?>
>
> The output:
>
> 1
> 2
> Value of test: 1++
> Value of test: 1++
>
> In the second set of code lines, what I need to do is somehow bracket off
the $test++ so it is evaluated before being echoed.
>
> Euan
>
>
> -Original Message-
> From: Jason Brooke [mailto:[EMAIL PROTECTED]]
> Sent: 18 April 2001 09:46
> To: Greig, Euan; [EMAIL PROTECTED]
> Subject: Re: [PHP] php equivalent for `command`
>
>
> echo ++$x;
>
> http://www.php.net/manual/en/language.operators.increment.php
>
>
>
> > > Is there a php equivalent for the use of ` (I think) in Unix/Perl? So
> for example echo "`$x++`" would first evaluate $x++ and then print the
> resulting value.
> > >
> > > Euan Greig
> > > Technical Consultant
> > > BRANN DATA
> > > [EMAIL PROTECTED]
> > > 01285 645997
>
>
>
>
> **
> Any opinions expressed in this email are those of the individual and
> not necessarily the Company. This email and any files transmitted with
> it, including replies and forwarded copies (which may contain alterations)
> subsequently transmitted from the Company, are confidential and solely for
> the use of the intended recipient. If you are not the intended recipient
> or the person responsible for delivering to the intended recipient, be
> advised that you have received this email in error and that any use is
> strictly prohibited.
>
> **
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



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




Re: [PHP] Persistent connection & many scripts ?

2001-04-18 Thread Plutarck

Well I've never actually made two calls to connect in one script, but what
happens on the second one is PHP notices you already have a connection open,
and instead of establishing a new one it just returns the current connection
ID.

On your first call to pconnect, PHP looks for any persistant connections
that are available to it.

If it finds one it returns the ID of it to your script, which is really
fast. But if it doesn't find a connection, it creates a new one and returns
that.

Two connects or two pconnects in the same script will work the exact same
way, but one connect and one pconnect won't do exactly what you might think
it would.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Picard, Cyril"" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
So :


Is it what you mean ?

PS : I understand that my code here is not very usefull ;-)

> -Message d'origine-
> De: Plutarck [SMTP:[EMAIL PROTECTED]]
> Date: mercredi 18 avril 2001 15:57
> À: [EMAIL PROTECTED]
> Objet: Re: [PHP] Persistent connection & many scripts ?
>
> Nope, you don't need to save the ID. PHP/database does the work of
> remembering what the ID of your persistant connection is.
>
>
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.
>
>
> ""Picard, Cyril"" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hummm... I don't know how to use pg_pconnect()... It returns a connection
> ID, isn't it ? And I have to use this connection ID later ?
> I would like to reuse this connection ID to another script... and the
> problem is here :(
>
> I feel that I ignore something so important that I'm stopped and so
> trivial
> that you do not think about it !
>
> > -Message d'origine-
> > De: Christian Reiniger [SMTP:[EMAIL PROTECTED]]
> > Date: mercredi 18 avril 2001 13:40
> > À: [EMAIL PROTECTED]
> > Objet: Re: [PHP] Persistent connection & many scripts ?
> >
> > On Tuesday 17 April 2001 16:28, you wrote:
> > > Yes... I'm not familiar with sessions. This should be like this ? :
> > >
> > > In connect.php :
> > >  > > session_start();
> > > $connect = pg_pConnect("blablabla");
> > > session_register("connect");
> > > clique ici
> > > ?>
> >
> > Simply using pg_pconnect() (without saving the connection ID) should be
> > just as fast and more failproof
> >
> > --
> > Christian Reiniger
> > LGDC Webmaster (http://sunsite.dk/lgdc/)
> >
> > A - American Association Against Acronym Abuse
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > For additional commands, e-mail: [EMAIL PROTECTED]
> > To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

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




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




Re: [PHP] Connection with a Palm

2001-04-18 Thread Plutarck

Hm...can't say I've seen many subjects about this, but you might want to
look around for information on WAP/WML.

Maybe someone else would know more though, because I have no experiance with
non-PC browsers.


--
Plutarck
Should be working on something...
...but forgot what it was.


""Renzi, Sebastian"" <[EMAIL PROTECTED]> wrote in message
A1581797259FD211B25E00805FCBC1FA1E4C1D@SRV_DES_01">news:A1581797259FD211B25E00805FCBC1FA1E4C1D@SRV_DES_01...
Thank you ,where i can download more info about this ?

> -Mensaje original-
> De: Plutarck [SMTP:[EMAIL PROTECTED]]
> Enviado el: miércoles 18 de abril de 2001 10:42
> Para: [EMAIL PROTECTED]
> Asunto: Re: [PHP] Connection with a Palm
>
> "exporting data to a palm" is far too vague.
>
> PHP can produce data in a format suitable for saving on a Palm, or you can
> have it interpret data from a Palm. To physically save data from a webpage
> to a palm requires client-side scripting.
>
>
> --
> Plutarck
> Should be working on something...
> ...but forgot what it was.
>
>
> ""Renzi, Sebastian"" <[EMAIL PROTECTED]> wrote in message
> A1581797259FD211B25E00805FCBC1FA1E4C1C@SRV_DES_01">news:A1581797259FD211B25E00805FCBC1FA1E4C1C@SRV_DES_01...
> I ' m trying to develop a page that exports data to a Palm ,my question is
> ,can i do this with PHP or with JavaScript ? .If it's possible please let
> me
> know ,thnks
>
> Sebastián Renzi
> Consultoría & Desarrollo de Sistemas.
> CODES S.A
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]

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




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




[PHP] Graphic process within PHP

2001-04-18 Thread SED

Hi,

Recently I noticed e-mails on this list about Imlib2 and GD2 extensions
which I was not aware of. So I started to wander if there are more
extensions working with PHP which allows graphic process (the only one I
knew was GD). Is it? If so, is it possible to use these extensions on all
platforms (which PHP supports) and with all web servers?

Thanks!


Regards,
Sumarlidi Einar Dadason

SED - Graphic Design

--
Phone:   (+354) 4615501
Mobile:  (+354) 8960376
Fax: (+354) 4615503
E-mail:  [EMAIL PROTECTED]
Homepage:www.sed.is <- New Homepage!
--


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




Re: [PHP] Variable variable

2001-04-18 Thread Steve Werby

"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote:
> > 1. If $id is a number I believe PHP will choke b/c I don't believe
numbers
> > can be used as variable names.
>
> Well, generally that is true.  If you try to assign a value directly to a
> variable that is a number such as:
>
>  $1 = "Hello World";
>
> Then it won't work.  However, due to a somewhat quirky implementation you
> can get arund this by doing:
>
>  $a=1;
>  $$a = "Hello World";

Sure enough, it works.  Rasmus, can we expect this behavior to exist in
future releases of PHP?  I prefer to give variables a meaningful name, but
since I spend a fair amount of time working with other people's code and
clients who sometimes insist on things that aren't preferable, it would be
nice to know.

--
Steve Werby
President, Befriend Internet Services LLC
http://www.befriend.com/


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




Re: [PHP] Cannot destroy session cookie

2001-04-18 Thread Jens Kisters

> Why destroying it "before" a user logs in? Isn't it

In case the user did not log out properly, his session would still be marked
as valid & logged in

> better to start the session "after" a successful login?

starting works fine, restarting is the problem

> And then destroying the session when the user logs out.

You can't count on an explicit logout,
never rely on the users, they just don't act like you want them to ;)

cu
Jens
--
Grüße aus dem schönen Kleve
Jens Kisters

rosomm et partner
Agentur für neue Medien GmbH
Dienstleistungszentrum am
Weißen Tor - Eingang B
Gocher Landstrasse 2
47551 Kleve / Bedburg-Hau

Telefon: 02821 - 97856-20
Telefax: 02821 - 97856-77
[EMAIL PROTECTED]
http://www.rosomm-partner.de



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




[PHP] wddx installation

2001-04-18 Thread Markus Maussner

hi

i installed php with this "config" on rh6.2..
'./configure' '--with-mysql' '--with-apache=../apache_1.3.19' '--enable-trak-vars' 
'--with-xml' '--with-wddx'

and a phpinfo(); show me this too...

but when i try to use anny wddx function i get this message...

Fatal error:  Call to undefined function:  wddx_serialize_value() in
/usr/local/apache/htdocs/xml/xml.php on line 2 -- 

annybody have a idea whats wrong ?


~~~
Markus Maussner
Application Development and Operations
DISTEFORA Mobile (Germany) GmbH
Amsinckstrasse 69
D-20097 Hamburg
T: +49 (0) 40 80 80 99 - 904
F: +49 (0) 40 80 80 99 - 502
E: [EMAIL PROTECTED]
W: www.distefora.com
~~~


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




Re: [PHP] Variable variable

2001-04-18 Thread Rasmus Lerdorf

> "Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote:
> > > 1. If $id is a number I believe PHP will choke b/c I don't believe
> numbers
> > > can be used as variable names.
> >
> > Well, generally that is true.  If you try to assign a value directly to a
> > variable that is a number such as:
> >
> >  $1 = "Hello World";
> >
> > Then it won't work.  However, due to a somewhat quirky implementation you
> > can get arund this by doing:
> >
> >  $a=1;
> >  $$a = "Hello World";
>
> Sure enough, it works.  Rasmus, can we expect this behavior to exist in
> future releases of PHP?  I prefer to give variables a meaningful name, but
> since I spend a fair amount of time working with other people's code and
> clients who sometimes insist on things that aren't preferable, it would be
> nice to know.

Writing code that relies on this behaviour is a bad idea.  It is unlikely
to change in PHP 4, but who knows what will happen in the longer term...

-Rasmus


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




Re: [PHP] Cannot destroy session cookie

2001-04-18 Thread Johannes Janson

Hi,

how about setting a expiry time for the cookie. Like
45 min after logging in or whatever suits your needs.

You could use session_set_cookie_params() and set
the cookie lifetime to 0. That would at least prevent a login after
the browser window is closed.

Your site is nice by the way.

cheers
Johannes
--
Grüße aus dem schönen Tübingen
Johannes Janson ;)

"Jens Kisters" <[EMAIL PROTECTED]> schrieb im Newsbeitrag
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Why destroying it "before" a user logs in? Isn't it

In case the user did not log out properly, his session would still be marked
as valid & logged in

> better to start the session "after" a successful login?

starting works fine, restarting is the problem

> And then destroying the session when the user logs out.

You can't count on an explicit logout,
never rely on the users, they just don't act like you want them to ;)

cu
Jens
--
Grüße aus dem schönen Kleve
Jens Kisters

rosomm et partner
Agentur für neue Medien GmbH
Dienstleistungszentrum am
Weißen Tor - Eingang B
Gocher Landstrasse 2
47551 Kleve / Bedburg-Hau

Telefon: 02821 - 97856-20
Telefax: 02821 - 97856-77
[EMAIL PROTECTED]
http://www.rosomm-partner.de



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




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




Re: [PHP] Variable variable

2001-04-18 Thread Plutarck

> The braces aren't required in this case.

Yup, your right. I stand corrected.

I had forgotten that multiple $s are fine, and that I simply don't use them
because I have trouble reading them.

The joys of learning ;\


--
Plutarck
Should be working on something...
...but forgot what it was.


""Steve Werby"" <[EMAIL PROTECTED]> wrote in message
001e01c0c80e$45410400$6501a8c0@workstation7">news:001e01c0c80e$45410400$6501a8c0@workstation7...
> "Plutarck" <[EMAIL PROTECTED]> wrote:
> > Your problem has little to do with the things mentioned.
> >
> > First of all, you are refering to a variable variable incorrectly.
>
> Actually, he's not.
>
> >You must
> > use brackets, like this:
> >
> > ${$id}
>
> The braces aren't required in this case.  Of the four examples below, only
> the 3rd won't return the expected results - because the first $ is
> interpreted as a literal $.  Paste the code below into a webpage and see
for
> yourself.
>
>  $field = 'name';
> $name = 'Steve';
>
> echo '' . $$field;
> echo '' . ${$field};
> echo '' . "My name is $$field.";
> echo '' . "My name is ${$field}.";
> ?>
>
> I have a few possible explanations for the problem of the original poster
> (see below).
>
> > if (${$id} == "on")
> > {
> > echo 'on';
> > } else
> > {
> > echo 'off';
> > }
>
> 1. If $id is a number I believe PHP will choke b/c I don't believe numbers
> can be used as variable names.
>
> 2. Assume $id = 'age_bracket'.  The control structure checks to see if
> $age_bracket == "on".  To set $id in the first place for your multiple
> checkbox values, you'd have to loop through the values sent from the form.
> Jack (original poster), did you do that?  If your form's method = post
then
> you would loop through $HTTP_POST_VARS and if it was get $HTTP_GET_VARS
(and
> then only loop through the checkbox variables).  Or you could predefine
the
> checkbox variables using:
>
> $checkbox_fields = array( 'age_bracket', 'weight', 'gender',
'occupation' );
>
> And then loop through as follows:
>
> while( list( , $val ) = each( $checkbox_fields ) )
> {
> // may have to set as $$GLOBALS[$val] if within a function or declare $val
> as global first.
> if ( $$val == 'on' )
> {
> echo 'on';
> }
> else
> {
> echo 'off';
>  }
> }
>
> --
> Steve Werby
> President, Befriend Internet Services LLC
> http://www.befriend.com/
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>



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




Re: [PHP] Regular Expression

2001-04-18 Thread Christian Reiniger

On Wednesday 18 April 2001 13:39, you wrote:

> I have this text:
>
> "[ this is atest ] and this is the rest of the text"
>
> I want to get the text inbetween the [ and ].

if (preg_match ('/\[([^\]])\]/', $Subject, $Matches)) {
  echo "Found it : '" . $Matches [1] . "'";
}

looks a bit perverse (because the [] brackets have special meaning in 
regular expressions), but you'll get used to it :)

Also have a look at the description of the perl regex syntax in the manual

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

Even idiots can handle computers, and many do.

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




Re: [PHP] Regular Expression

2001-04-18 Thread Christian Reiniger

On Wednesday 18 April 2001 17:07, you wrote:
> On Wednesday 18 April 2001 13:39, you wrote:
> > I have this text:
> >
> > "[ this is atest ] and this is the rest of the text"
> >
> > I want to get the text inbetween the [ and ].
>
> if (preg_match ('/\[([^\]])\]/', $Subject, $Matches)) {
>   echo "Found it : '" . $Matches [1] . "'";
> }

Ooops. The expression should read '/\[([^\]]+)\]/'

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

Even idiots can handle computers, and many do.

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




[PHP] temp file part II

2001-04-18 Thread Randy Johnson

I have not managed to get IE to download my file on the fly as suggested.
so I was wondering if there are any other suggestions on how I can create a
temp file for download and after the download is complete the file is
deleted.

thanks

randy




Instead of:
header("Content-disposition: filename=backup.csv");
try
header('Content-Disposition: attachment; filename=backup.csv');

Cheers
--
Phil Driscoll
Dial Solutions
+44 (0)113 294 5112
http://www.dialsolutions.com
http://www.dtonline.org



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



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




Re: [PHP] wddx installation

2001-04-18 Thread Markus Maussner

hi...

sorry i found the error myself... it shoube be --enable-wddx and not --with-wddx

markus

Am Mit, 18 Apr 2001 schrieb Markus Maussner:
> hi
> 
> i installed php with this "config" on rh6.2..
> './configure' '--with-mysql' '--with-apache=../apache_1.3.19' '--enable-trak-vars' 
>'--with-xml' '--with-wddx'
> 
> and a phpinfo(); show me this too...
> 
> but when i try to use anny wddx function i get this message...
> 
> Fatal error:  Call to undefined function:  wddx_serialize_value() in
> /usr/local/apache/htdocs/xml/xml.php on line 2 -- 
> 
> annybody have a idea whats wrong ?
> 
> 
> ~~~
> Markus Maussner
> Application Development and Operations
> DISTEFORA Mobile (Germany) GmbH
> Amsinckstrasse 69
> D-20097 Hamburg
> T: +49 (0) 40 80 80 99 - 904
> F: +49 (0) 40 80 80 99 - 502
> E: [EMAIL PROTECTED]
> W: www.distefora.com
> ~~~
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
-- 
~~~
Markus Maussner
Application Development and Operations
DISTEFORA Mobile (Germany) GmbH
Amsinckstrasse 69
D-20097 Hamburg
T: +49 (0) 40 80 80 99 - 904
F: +49 (0) 40 80 80 99 - 502
E: [EMAIL PROTECTED]
W: www.distefora.com
~~~


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




Re: [PHP] need help

2001-04-18 Thread Joe Stump

The 3rd argument for fwrite() is the length of the string. So you should do:

$fp = fopen('./file.txt','w');
$line = "$text\n";
fwrite($fp,$line,strlen($line));
fclose($fp);

--Joe

On Wed, Apr 18, 2001 at 01:38:11AM -0500, chris herring wrote:
> this is really buggin me... i've got this free-for-all that i want to make, and 
>everything seems logical, but
> 
> echo "";
> echo "";
> echo "";
> echo "";
> echo "";
> 
> 
> 
> if (isset($url) && isset($text)) {
> $fp = fopen("./file.txt", "w");
> fwrite("$fp", "$text", "w");
> fclose($fp);
> }
> 
> ... that isn't writing anything to the file. any help would be appreciated. thx in 
>advance


/* Joe Stump
 * Sr. PHP Developer 
 * http://www.Care2.com http://www.joestump.net http://gtk.php-coder.net
 */


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




[PHP] Best non-tackified grip enhancer for golfers>

2001-04-18 Thread OWQj5h9v0


NO SALES PITCH, NO PRESSURE, NO NOTHING. 

Just the best non-tackified grip enhancer you'll ever use for your golf game, 
GUARANTEED, or your money back.

 From football's #1 specialty product company, SUPAGRIP25 is now available to golf 
enthusiasts everywhere.
 
Click here 
http://www.creativefootball.com
 to see the product that is taking all sports (where a good grip is essential) by 
storm! 

While you're there be sure to check out our "who uses our products" page, what you see 
just might surprise you. 
You really didn't think they make those great catches on talent alone, did you? 


Transmissions to you by the sender of 'this' email will be stopped promptly by sending 
an e-mail with "unsubscribe" in the subject line. Simply hit reply and send and we 
will remove you from our database. Please Note-This is a one time mailing.Thank you.

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




  1   2   3   >