[PHP] Re: merge array

2004-03-03 Thread Lucian Cozma
That should do it:

"Max" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello all,

I have two arrays as follows:

$x = array(3,4,6,8);
$y = array(10,20,40,10);

I need these arrays could be merged with '0' in between.

Result expected :

$x = array(1,2,3,4,5,6,7,8);
$y = array(0,0,10,20,0,40,0,10);


Can anybody help me ?
Thanks in advance.


Max

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



[PHP] Re: merge array

2004-03-03 Thread Lucian Cozma
That should do it:




"Max" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Hello all,

I have two arrays as follows:

$x = array(3,4,6,8);
$y = array(10,20,40,10);

I need these arrays could be merged with '0' in between.

Result expected :

$x = array(1,2,3,4,5,6,7,8);
$y = array(0,0,10,20,0,40,0,10);


Can anybody help me ?
Thanks in advance.


Max

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



Re: [PHP] numeric characters

2004-03-03 Thread Dominique ANOKRE
ok thanks, i have written a script with javascript and i think it's running
good !

Thanks

- Original Message -
From: "Daniel Clark" <[EMAIL PROTECTED]>
To: "Php List" <[EMAIL PROTECTED]>
Sent: Tuesday, March 02, 2004 7:15 PM
Subject: Re: [PHP] numeric characters


> Or you can us client side JavaScripting.
>
> > Hello Dominique,
> >
> > Tuesday, March 2, 2004, 6:31:00 PM, you wrote:
> >
> > DA> Is there a way with php to force the user to put only numeric
> > character in a text field ?
> >
> > No, because that's a client-side thing. You can however use the PHP
> > function is_numeric() to check the data once it has been entered to
> > ensure they are numbers and error out if not.
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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



Re: [PHP] resubmitting $POST data to another script

2004-03-03 Thread Erwin Kerk
Chris Shiflett wrote:

It loses all new data:




Because of this:

$_POST = unserialize(stripslashes($_POST['post']));
I think array_merge will fix this:

$_POST = array_merge($_POST,unserialize(stripslashes($_POST['post'])));



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


[PHP] writing file on server from database?

2004-03-03 Thread raisinlove
Hi, I'm currently working on a basic website creation script where I 
want an index file created automaticaly within each new folder created.
My attempts at using copy() were foiled by safe-mode restrictions on my 
account but after some research, I discovered this could be circumvented 
 with the use of move_uploaded_file() instead.
Now I'd like to figure out how I could use this to copy an existing 
"index.php" file on the server to the newly created directories.

But can I use move_uploaded_file() if the file is already on the server? 
If it needs to be an uploaded file, would uploading it once allow me to 
copy it anytime afterwards?

I figured an even better solution could be to store the index file as a 
blob in my MySQL db and have the script write that file to the newly 
created dirs. Is this feasible (especialy with the safe-mode restrictions) ?

Any tips or examples would be much appreciated.

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


[PHP] Re: numeric characters

2004-03-03 Thread Jakes
Another thing that you can do is cast the variable to integer

$int = (int) $_POST['data'];

"Dominique Anokre" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
Is there a way with php to force the user to put only numeric character in a
text field ?

thanks

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



[PHP] SQLite Support is library call?

2004-03-03 Thread DAvid Jackson
Howdy --
SQLite supported by  a direct call the sqlite library?
As apposed to calling the executable?
Could I use ini_set(include_path=) to tall PHP where the SQLite lib is 
located?

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


php-general Digest 3 Mar 2004 12:30:59 -0000 Issue 2624

2004-03-03 Thread php-general-digest-help

php-general Digest 3 Mar 2004 12:30:59 - Issue 2624

Topics (messages 179320 through 179336):

Re: resubmitting $POST data to another script
179320 by: Chris Shiflett
179321 by: Marek Kilimajer
179322 by: Chris Shiflett
179323 by: Leif Gregory
179324 by: Chris W. Parker
179333 by: Erwin Kerk

Re: IE6 with latest hotfixes breaks forms ...
179325 by: Marc G. Fournier
179328 by: Chris Shiflett

Re: PHP application design with WAE UML.
179326 by: Lukasz Karapuda

merge array
179327 by: Max
179330 by: Lucian Cozma
179331 by: Lucian Cozma

PHP5 COM get/set property trouble
179329 by: Daniel Daley

Re: numeric characters
179332 by: Dominique ANOKRE
179335 by: Jakes

writing file on server from database?
179334 by: raisinlove

SQLite Support is library call?
179336 by: DAvid Jackson

Administrivia:

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

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

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


--
--- Begin Message ---
--- Marek Kilimajer <[EMAIL PROTECTED]> wrote:
> Let's not make it complicated:
> 
> confirmation.php:
> 
> 
> 
> email.php:
> 
> $_POST = unserialize(stripslashes($_POST['post']));

I think the other person's suggestion (hidden fields) was made so that the
original poster doesn't lose all other POST data (since he mentioned a
second POST request).

Chris

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

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/
--- End Message ---
--- Begin Message ---
Chris Shiflett wrote:
--- Marek Kilimajer <[EMAIL PROTECTED]> wrote:

Let's not make it complicated:

confirmation.php:



email.php:

$_POST = unserialize(stripslashes($_POST['post']));


I think the other person's suggestion (hidden fields) was made so that the
original poster doesn't lose all other POST data (since he mentioned a
second POST request).
This method does not lose any post data as the whole $_POST array is 
serialized. Then it is unserialized back to $_POST array at the second page.
--- End Message ---
--- Begin Message ---
--- Marek Kilimajer <[EMAIL PROTECTED]> wrote:
> This method does not lose any post data as the whole $_POST array is 
> serialized. Then it is unserialized back to $_POST array at the second
> page.

It loses all new data:





Because of this:

$_POST = unserialize(stripslashes($_POST['post']));

The method is fine, but it's no simpler than the other person's suggestion
when this specific scenario is considered. More logic is necessary to
prevent the loss of data.

Chris

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

PHP Security - O'Reilly
 Coming mid-2004
HTTP Developer's Handbook - Sams
 http://httphandbook.org/
PHP Community Site
 http://phpcommunity.org/
--- End Message ---
--- Begin Message ---
Hello Charlie,

Tuesday, March 2, 2004, 1:54:43 PM, you wrote:
CFI> I'm creating a form with 170 fields, and I'd like to create an
CFI> intermediary page so the user can review their info before
CFI> submitting it again to the emailing script.

Just a thought. I'm guessing you are dumping this stuff to a database
for the final result. Why don't you create an intermediate table to
hold those fields (keeping track of the record ID in a hidden input
field), then re-read that data back on the validation page, then when
they submit it there, the changes are added to the real table.

My only thinking on this is to keep it simple rather than carrying
over a ton of hidden fields. It may not be the most efficient method,
but it'd work.



Cheers,
Leif Gregory 

-- 
TB Lists Moderator (and fellow registered end-user)
PCWize Editor  /  ICQ 216395  /  PGP Key ID 0x7CD4926F
Web Site 
--- End Message ---
--- Begin Message ---
Chris Shiflett 
on Tuesday, March 02, 2004 3:56 PM said:

> It loses all new data:

[snip]

> The method is fine, but it's no simpler than the other person's
> suggestion when this specific scenario is considered. More logic is
> necessary to prevent the loss of data.

it was my understanding that the second page does not introduce any new
data. it was merely a confirmation page where the previous pages data
would be displayed.



chris.
--- End Message ---
--- Begin Message ---
Chris Shiflett wrote:

It loses all new data:




Because of this:

$_POST = unserialize(stripslashes($_POST['post']));
I think array_merge will fix this:

$_POST = array_merge($_POST,unserialize(stripslashes($_POST['post'])));



Erwin Kerk
Web Developer
--- End Message ---
--- Begin Message ---
On Tue, 2 Mar 2004, Chris Bowlby wrote:

> Hi Chris,
>
>   He was referring to me actually :> I will be able to look it over today
> and see i

[PHP] POST form header

2004-03-03 Thread Richard Davey
Hi all,

Just a quick question - but does anyone know where I could find an
example of a POST form header? As in all of the raw HTTP headers that
are sent from the browser to the server when it submits a form via
POST? If it's possible to extract this information via a PHP function
then I'll be happy to rtfm if someone can tell me the function name I
need.

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

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



Re: [PHP] Re: why use safe mode?

2004-03-03 Thread Chris
Chris,
Thank you for your insight.

Now that I've become aware of safe mode, it appears to substantially
restrict many PHP file functions. What's more worrisome though is the
disclaimer posted at the top of the PHP safe mode documentation: "This is a
still probably incomplete and possibly incorrect listing of the functions
limited by safe mode"

Yikes What other limitations am I to expect.

Right now my biggest complaint is safe mode's disabling of set_time_limit.
My script is trying to process several thousand records in a MySQL db and
often exceeds the default 30 second time limit.

I look forward to reading your article, but hope you don't scare the living
daylights out of PHP admins without offering constructive alternatives to
the exploits you reveal.

One final comment. It seems there was some motivation, by the PHP creators,
to institute safe mode as a fix to potential security abuses. If that was
the case, why weren't the underlying problems be removed or remedied as
opposed to letting PHP admins make the call?

Best wishes, always,
Chris

Enabling safe mode seems to
"Chris Shiflett" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > Why do hosting providers (or anyone for that matter) choose to run PHP
> > with safe mode enabled?
> >
> > I've had problems running some of my scripts when safe mode is enabled,
> > so now I am seeking a new hosting service because the one I'm with
> > claims they cannot turn safe mode off for one account.
>
> Your Web host is correct.
>
> I am wrapping up an article for php|architect that will hopefully shed
> some more light on this issue, but consider this:
>
> 1. PHP has many filesystem functions. It can read files, write to files,
> list directories, etc.
> 2. PHP scripts are executed by the Web server (most of the time), and
> thus, they can do whatever the Web server can do.
> 3. In order to make your PHP scripts work at all, you must make them
> readable by the Web server.
>
> Add these together, and hopefully it is clear that it's trivial to write a
> PHP script that explores the filesystem looking for interesting things. In
> fact, I wrote a quick example for this article that I'm writing. On every
> server I've studied (that has safe_mode disabled), I can at least
> compromise any accounts's database username and password, and because of
> the tendency for these to be equivalent to the shell username and
> password, I can also usually compromise that as well.
>
> In addition, many people use PHP's default session configuration and store
> their session data in /tmp. Since the Web server has write access to these
> session files, not only can I browse through anyone's session data, I can
> also modify it as I see fit (including my own, to make myself
> administrator of your application or whatever I want). So, an attacker has
> the option of hijacking a session or just modifying his own.
>
> While I'm an ethical person and would never do anything malicious, I don't
> trust everyone else to do the same. I personally feel that it is
> irresponsible for Web hosts to have safe_mode disabled.
>
> Of course, the reason they do is that there are far more people who will
> notice when something doesn't work (as you have noticed) than those who
> will notice that there are serious security holes. If the support
> department can't handle the number of complaints about safe_mode, it's
> easiest to disable it.
>
> Hope that helps.
>
> Chris
>
> =
> Chris Shiflett - http://shiflett.org/
>
> PHP Security - O'Reilly
>  Coming mid-2004
> HTTP Developer's Handbook - Sams
>  http://httphandbook.org/
> PHP Community Site
>  http://phpcommunity.org/

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



[PHP] ibase_blob_create

2004-03-03 Thread Markus Ecker
hi all!!

can anybody explain me please how i have to use this function because there
is no explaination in the german manual

many thanks
markus

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



Re: [PHP] POST form header

2004-03-03 Thread Brian V Bonini
On Wed, 2004-03-03 at 08:22, Richard Davey wrote:
> Hi all,
> 
> Just a quick question - but does anyone know where I could find an
> example of a POST form header? As in all of the raw HTTP headers that
> are sent from the browser to the server when it submits a form via
> POST? If it's possible to extract this information via a PHP function
> then I'll be happy to rtfm if someone can tell me the function name I
> need.

Doesn't $GLOBALS['HTTP_RAW_POST_DATA'] have this info?


-- 
Brian V Bonini <[EMAIL PROTECTED]>

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



Re: [PHP] Re: why use safe mode?

2004-03-03 Thread joel boonstra
On Wed, Mar 03, 2004 at 08:39:06AM -0500, Chris wrote:
> One final comment. It seems there was some motivation, by the PHP creators,
> to institute safe mode as a fix to potential security abuses. If that was
> the case, why weren't the underlying problems be removed or remedied as
> opposed to letting PHP admins make the call?

To remove the underlying problem, changes in Apache would have to be
made.  The problem is that mod_php (not necessarily PHP as CGI) runs as
the same user that Apache runs as.  There is nothing PHP developers can
do about that.  This means (assuming mod_php) that when your hosted
website runs a PHP script, and another website hosted by the same
company runs a PHP script, both scripts are running as the same
username.  This opens any number of potential for malicious or
accidental access to others files. Additionally, all system calls will
be called as the same user, so the server's built-in mechanisms for
determining user permissions are useless.

One solution is to run PHP as CGI and use suexec to cause PHP scripts to
be run as specific usernames.  However, there are speed and integration
advantages to running as mod_php, so using CGI isn't necessarily the
best solution.

The other is to use safe mode, which does what it can to help solve
security concerns by relying on file permissions to determine what can
accessed, and by restricting things like system calls that are too
potentially harmful.  It's not the right way to solve the problem (as
they mention on the safe mode page), but solving at the Apache level[1]
may or may not be viable.

Safe mode is not necessarily appropriate for all situations; on personal
servers, or single-user websites, it can be too restrictive.  However,
for hosting companies, as others have said, not using it has the
potential to make your customers very unhappy when someone else's
poorly-coded script starts wreaking havoc.

[1] Apache 2's "perchild" MPM looks interesting:

http://httpd.apache.org/docs-2.0/mod/perchild.html

When it's functional, I'm not sure if it will eliminate the need for
safe mode or not.  It still appears that for large hosts, managing the
UIDs might be difficult.  I'm by no means an apache admin, but if my
hosting company has 300 vhosts, it seems like you'd have to start at
least that many servers, and that only one instance will be tied to a
vhost (so if one vhost is getting lots of traffic, and one is getting
only a little, there won't be spare servers around to balance things
out).  I'm basing that all on what I read at Apache's site, so I may
well be wrong.

joel

-- 
[ joel boonstra | gospelcom.net ]

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



[PHP] Login Form weird behaviour in Mozilla/Netscape Not in IE

2004-03-03 Thread Daniel Perez
Hi there,
I´ve got a login form, that calls a script, to check if
the user/pass match. If yes, the script do a header("Location :
index.php"). In Explorer works but not in Mozilla nor Netscape.
Anyone knows something about that

Thanks

Daniel Pérez.- (dpcma at mail dot com)
http://www.mundocamping.com/
-- 
___
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm

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



Re: [PHP] Login Form weird behaviour in Mozilla/Netscape Not in IE

2004-03-03 Thread Matt Matijevich
Try an absolute url.

>>> "Daniel Perez" <[EMAIL PROTECTED]> 3/3/2004 8:55:06 AM >>>
Hi there,
I´ve got a login form, that calls a script, to check if
the user/pass match. If yes, the script do a header("Location :
index.php"). In Explorer works but not in Mozilla nor Netscape.
Anyone knows something about that

Thanks

Daniel Pérez.- (dpcma at mail dot com)
http://www.mundocamping.com/ 
-- 
___
Sign-up for Ads Free at Mail.com
http://promo.mail.com/adsfreejump.htm 

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

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



[PHP] Re: writing file on server from database?

2004-03-03 Thread raisinlove
Raisinlove wrote:

Hi, I'm currently working on a basic website creation script where I 
want an index file created automaticaly within each new folder created.
My attempts at using copy() were foiled by safe-mode restrictions on my 
account but after some research, I discovered this could be circumvented 
 with the use of move_uploaded_file() instead.
Now I'd like to figure out how I could use this to copy an existing 
"index.php" file on the server to the newly created directories.

But can I use move_uploaded_file() if the file is already on the server? 
If it needs to be an uploaded file, would uploading it once allow me to 
copy it anytime afterwards?

I figured an even better solution could be to store the index file as a 
blob in my MySQL db and have the script write that file to the newly 
created dirs. Is this feasible (especialy with the safe-mode 
restrictions) ?

Any tips or examples would be much appreciated.

Thanks!
-s
Ok forget what I said regarding the database. I would just like to 
figure out how to copy a file from one directory to another using 
move_uploaded_file. I cant find any proper examples...

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


[PHP] Loop Oops....

2004-03-03 Thread Alex Hogan
Hi All,

 

I am having trouble with a nested loop and I can't seem to get it figured
out.

 

I keep getting an error that states, Invalid argument on line 20.

 

Here is the code;

 

Sessions capture question answers that are multiple answers for each
question.

$answers =
array($_SESSION['question1'],$_SESSION['question2'],$_SESSION['question3'],$
_SESSION['question4'],

 
$_SESSION['question6'],$_SESSION['question7'],$_SESSION['question8'],$_SESSI
ON['question9'],

  $_SESSION['question10'],$_SESSION['question11']);

 

I init the vars

$question = "";

$subquestion = "";

 

Here's the loop I'm having trouble with.

foreach ($answers as $questions) {
  $question .= "__";
foreach ($questions as $subquestion) { -- Here's the offending line --
  $question .= $subquestion."--";
}
}



I am inserting an array of arrays..., I know it's not the best way to do
this but I was only given a few hours to get this up.

The array is delimited by a double underscore and individual answers are
delimited by a double hyphen.  Or at lease that's what's supposed to happen.

 

$insert_query = "INSERT INTO SurveyTable

(sur_ques_id, sur_ans, sur_num)

VALUES (1, '$questions', 1)";

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

 

The value in the db is either "Array" or part of the string but not the
whole string.  I know the error is creating most of the problem.

 

I can't see what I'm doing wrong Why is that argument invalid?

 

alex hogan

 



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




[PHP] Re: Loop Oops....

2004-03-03 Thread Andre Cerqueira
probably, some of those $_SESSION['question#'] are unset, or arent arrays..

try:

foreach ($answers as $questions) {
  $question .= "__";
  if (!is_array($questions))
continue;
  foreach ($questions as $subquestion)
$question .= $subquestion."--";
  }
}
>$insert_query = "INSERT INTO SurveyTable
>(sur_ques_id, sur_ans, sur_num)
>VALUES (1, '$questions', 1)";
>
> $result = MSSQL_QUERY($insert_query) or die("Can not execute query
> $insert_query. ");
>
> The value in the db is either "Array" or part of the string but not
> the whole string.  I know the error is creating most of the problem.
you can only concatenate string with scalars (actually only strings, but 
php do some conversions...)
if $questions is an array, you cant do that, and if its a string, you 
cant foreach it
didnt you mean *VALUES (1, '$question', 1)"; ?

maybe im missing something... but i hope this helps



Alex Hogan wrote:

Hi All,

 

I am having trouble with a nested loop and I can't seem to get it figured
out.
 

I keep getting an error that states, Invalid argument on line 20.

 

Here is the code;

 

Sessions capture question answers that are multiple answers for each
question.
$answers =
array($_SESSION['question1'],$_SESSION['question2'],$_SESSION['question3'],$
_SESSION['question4'],
 
$_SESSION['question6'],$_SESSION['question7'],$_SESSION['question8'],$_SESSI
ON['question9'],

  $_SESSION['question10'],$_SESSION['question11']);

 

I init the vars

$question = "";

$subquestion = "";

 

Here's the loop I'm having trouble with.

foreach ($answers as $questions) {
  $question .= "__";
foreach ($questions as $subquestion) { -- Here's the offending line --
  $question .= $subquestion."--";
}
}


I am inserting an array of arrays..., I know it's not the best way to do
this but I was only given a few hours to get this up.
The array is delimited by a double underscore and individual answers are
delimited by a double hyphen.  Or at lease that's what's supposed to happen.
 

$insert_query = "INSERT INTO SurveyTable

(sur_ques_id, sur_ans, sur_num)

VALUES (1, '$questions', 1)";

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

The value in the db is either "Array" or part of the string but not the
whole string.  I know the error is creating most of the problem.
 

I can't see what I'm doing wrong Why is that argument invalid?

 

alex hogan

 



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



--
André Cerqueira


signature.asc
Description: OpenPGP digital signature


RE: [PHP] Re: Loop Oops....

2004-03-03 Thread Alex Hogan

Well that fixed the error from coming up, but now the values in the db are
empty.  I don't even get "Array".



alex hogan


> -Original Message-
> From: Andre Cerqueira [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 03, 2004 9:34 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Loop Oops
> 
> probably, some of those $_SESSION['question#'] are unset, or arent
> arrays..
> 
> try:
> 
> foreach ($answers as $questions) {
>$question .= "__";
> 
>if (!is_array($questions))
>  continue;
>foreach ($questions as $subquestion)
>  $question .= $subquestion."--";
>}
> }
> 
> 
>  >$insert_query = "INSERT INTO SurveyTable
>  >(sur_ques_id, sur_ans, sur_num)
>  >VALUES (1, '$questions', 1)";
>  >
>  > $result = MSSQL_QUERY($insert_query) or die("Can not execute query
>  > $insert_query. ");
>  >
>  > The value in the db is either "Array" or part of the string but not
>  > the whole string.  I know the error is creating most of the problem.
> 
> you can only concatenate string with scalars (actually only strings, but
> php do some conversions...)
> if $questions is an array, you cant do that, and if its a string, you
> cant foreach it
> didnt you mean *VALUES (1, '$question', 1)"; ?
> 
> 
> maybe im missing something... but i hope this helps
> 
> 
> 
> Alex Hogan wrote:
> 
> > Hi All,
> >
> >
> >
> > I am having trouble with a nested loop and I can't seem to get it
> figured
> > out.
> >
> >
> >
> > I keep getting an error that states, Invalid argument on line 20.
> >
> >
> >
> > Here is the code;
> >
> >
> >
> > Sessions capture question answers that are multiple answers for each
> > question.
> >
> > $answers =
> >
> array($_SESSION['question1'],$_SESSION['question2'],$_SESSION['question3']
> ,$
> > _SESSION['question4'],
> >
> >
> >
> $_SESSION['question6'],$_SESSION['question7'],$_SESSION['question8'],$_SES
> SI
> > ON['question9'],
> >
> >
> $_SESSION['question10'],$_SESSION['question11']);
> >
> >
> >
> > I init the vars
> >
> > $question = "";
> >
> > $subquestion = "";
> >
> >
> >
> > Here's the loop I'm having trouble with.
> >
> > foreach ($answers as $questions) {
> >   $question .= "__";
> > foreach ($questions as $subquestion) { -- Here's the offending line
> --
> >   $question .= $subquestion."--";
> > }
> > }
> >
> >
> >
> > I am inserting an array of arrays..., I know it's not the best way to do
> > this but I was only given a few hours to get this up.
> >
> > The array is delimited by a double underscore and individual answers are
> > delimited by a double hyphen.  Or at lease that's what's supposed to
> happen.
> >
> >
> >
> > $insert_query = "INSERT INTO SurveyTable
> >
> > (sur_ques_id, sur_ans, sur_num)
> >
> > VALUES (1, '$questions', 1)";
> >
> > $result = MSSQL_QUERY($insert_query) or die("Can not execute query
> > $insert_query. ");
> >
> >
> >
> > The value in the db is either "Array" or part of the string but not the
> > whole string.  I know the error is creating most of the problem.
> >
> >
> >
> > I can't see what I'm doing wrong Why is that argument invalid?
> >
> >
> >
> > alex hogan
> >
> >
> >
> >
> >
> > **
> > The contents of this e-mail and any files transmitted with it are
> > confidential and intended solely for the use of the individual or
> > entity to whom it is addressed.  The views stated herein do not
> > necessarily represent the view of the company.  If you are not the
> > intended recipient of this e-mail you may not copy, forward,
> > disclose, or otherwise use it or any part of it in any form
> > whatsoever.  If you have received this e-mail in error please
> > e-mail the sender.
> > **
> >
> >
> >
> 
> --
> André Cerqueira


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





[PHP] Updating content on the line. (cli)

2004-03-03 Thread Simon Fredriksson
I'm building a download-manager script (like wget), in PHP. Does any of 
you know how I can update a line in the console? I've tried to echo 
chr(7) which is the backspace character, but it won't work. This kind of 
thing is seen in tons of console applications. Like some "please wait" 
thing that changes from - to \, |, /,  and so on (looks like a rotating 
line).

Ideas?

//Simon

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


Re: [PHP] POST form header

2004-03-03 Thread Chris Shiflett
--- Richard Davey <[EMAIL PROTECTED]> wrote:
> Just a quick question - but does anyone know where I could find an
> example of a POST form header? As in all of the raw HTTP headers that
> are sent from the browser to the server when it submits a form via
> POST?

This function sends a POST manually, so it can give you an idea about what
the raw HTTP looks like:

http://shiflett.org/hacks/php/http_post

There are also some examples in this article:

http://shiflett.org/articles/the-truth-about-sessions

Hope that helps.

Chris

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

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

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



Re: [PHP] Updating content on the line. (cli)

2004-03-03 Thread Adam Voigt
I'm not sure of how you could do this, but one other thing you could do,
is like I've seen certain console FTP apps do, is just do a division of
the total size by whats downloaded, and have like 100 pound signs that
are gradually filled in as it downloads.


On Wed, 2004-03-03 at 10:53, Simon Fredriksson wrote:
> I'm building a download-manager script (like wget), in PHP. Does any of 
> you know how I can update a line in the console? I've tried to echo 
> chr(7) which is the backspace character, but it won't work. This kind of 
> thing is seen in tons of console applications. Like some "please wait" 
> thing that changes from - to \, |, /,  and so on (looks like a rotating 
> line).
> 
> Ideas?
> 
> //Simon
-- 

Adam Voigt
[EMAIL PROTECTED]

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



RE: [PHP] Re: Loop Oops....

2004-03-03 Thread Alex Hogan

Found it.

You were right, it was $question instead of $questions.

Many thanks.


alex


> -Original Message-
> From: Andre Cerqueira [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, March 03, 2004 9:34 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] Re: Loop Oops
> 
> probably, some of those $_SESSION['question#'] are unset, or arent
> arrays..
> 
> try:
> 
> foreach ($answers as $questions) {
>$question .= "__";
> 
>if (!is_array($questions))
>  continue;
>foreach ($questions as $subquestion)
>  $question .= $subquestion."--";
>}
> }
> 
> 
>  >$insert_query = "INSERT INTO SurveyTable
>  >(sur_ques_id, sur_ans, sur_num)
>  >VALUES (1, '$questions', 1)";
>  >
>  > $result = MSSQL_QUERY($insert_query) or die("Can not execute query
>  > $insert_query. ");
>  >
>  > The value in the db is either "Array" or part of the string but not
>  > the whole string.  I know the error is creating most of the problem.
> 
> you can only concatenate string with scalars (actually only strings, but
> php do some conversions...)
> if $questions is an array, you cant do that, and if its a string, you
> cant foreach it
> didnt you mean *VALUES (1, '$question', 1)"; ?
> 
> 
> maybe im missing something... but i hope this helps
> 
> 
> 
> Alex Hogan wrote:
> 
> > Hi All,
> >
> >
> >
> > I am having trouble with a nested loop and I can't seem to get it
> figured
> > out.
> >
> >
> >
> > I keep getting an error that states, Invalid argument on line 20.
> >
> >
> >
> > Here is the code;
> >
> >
> >
> > Sessions capture question answers that are multiple answers for each
> > question.
> >
> > $answers =
> >
> array($_SESSION['question1'],$_SESSION['question2'],$_SESSION['question3']
> ,$
> > _SESSION['question4'],
> >
> >
> >
> $_SESSION['question6'],$_SESSION['question7'],$_SESSION['question8'],$_SES
> SI
> > ON['question9'],
> >
> >
> $_SESSION['question10'],$_SESSION['question11']);
> >
> >
> >
> > I init the vars
> >
> > $question = "";
> >
> > $subquestion = "";
> >
> >
> >
> > Here's the loop I'm having trouble with.
> >
> > foreach ($answers as $questions) {
> >   $question .= "__";
> > foreach ($questions as $subquestion) { -- Here's the offending line
> --
> >   $question .= $subquestion."--";
> > }
> > }
> >
> >
> >
> > I am inserting an array of arrays..., I know it's not the best way to do
> > this but I was only given a few hours to get this up.
> >
> > The array is delimited by a double underscore and individual answers are
> > delimited by a double hyphen.  Or at lease that's what's supposed to
> happen.
> >
> >
> >
> > $insert_query = "INSERT INTO SurveyTable
> >
> > (sur_ques_id, sur_ans, sur_num)
> >
> > VALUES (1, '$questions', 1)";
> >
> > $result = MSSQL_QUERY($insert_query) or die("Can not execute query
> > $insert_query. ");
> >
> >
> >
> > The value in the db is either "Array" or part of the string but not the
> > whole string.  I know the error is creating most of the problem.
> >
> >
> >
> > I can't see what I'm doing wrong Why is that argument invalid?
> >
> >
> >
> > alex hogan
> >
> >
> >
> >
> >
> > **
> > The contents of this e-mail and any files transmitted with it are
> > confidential and intended solely for the use of the individual or
> > entity to whom it is addressed.  The views stated herein do not
> > necessarily represent the view of the company.  If you are not the
> > intended recipient of this e-mail you may not copy, forward,
> > disclose, or otherwise use it or any part of it in any form
> > whatsoever.  If you have received this e-mail in error please
> > e-mail the sender.
> > **
> >
> >
> >
> 
> --
> André Cerqueira


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





Re: [PHP] Updating content on the line. (cli)

2004-03-03 Thread Simon Fredriksson
Yes, that's one way. It's currently in development for Win32, but it 
would be nice if it works on *nix later on aswell. Got a tip from a user 
in a chatroom to use Ncurses for it, but then I can't use it on win32.

Just to correct myself; it's chr(8) and not 7.

//Simon

Adam Voigt wrote:

I'm not sure of how you could do this, but one other thing you could do,
is like I've seen certain console FTP apps do, is just do a division of
the total size by whats downloaded, and have like 100 pound signs that
are gradually filled in as it downloads.
On Wed, 2004-03-03 at 10:53, Simon Fredriksson wrote:

I'm building a download-manager script (like wget), in PHP. Does any of 
you know how I can update a line in the console? I've tried to echo 
chr(7) which is the backspace character, but it won't work. This kind of 
thing is seen in tons of console applications. Like some "please wait" 
thing that changes from - to \, |, /,  and so on (looks like a rotating 
line).

Ideas?

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


Re: [PHP] Re: why use safe mode?

2004-03-03 Thread Rasmus Lerdorf
On Wed, 3 Mar 2004, joel boonstra wrote:

> On Wed, Mar 03, 2004 at 08:39:06AM -0500, Chris wrote:
> > One final comment. It seems there was some motivation, by the PHP creators,
> > to institute safe mode as a fix to potential security abuses. If that was
> > the case, why weren't the underlying problems be removed or remedied as
> > opposed to letting PHP admins make the call?
>
> To remove the underlying problem, changes in Apache would have to be
> made.  The problem is that mod_php (not necessarily PHP as CGI) runs as
> the same user that Apache runs as.  There is nothing PHP developers can
> do about that.  This means (assuming mod_php) that when your hosted
> website runs a PHP script, and another website hosted by the same
> company runs a PHP script, both scripts are running as the same
> username.  This opens any number of potential for malicious or
> accidental access to others files. Additionally, all system calls will
> be called as the same user, so the server's built-in mechanisms for
> determining user permissions are useless.
>
> One solution is to run PHP as CGI and use suexec to cause PHP scripts to
> be run as specific usernames.  However, there are speed and integration
> advantages to running as mod_php, so using CGI isn't necessarily the
> best solution.
>
> The other is to use safe mode, which does what it can to help solve
> security concerns by relying on file permissions to determine what can
> accessed, and by restricting things like system calls that are too
> potentially harmful.  It's not the right way to solve the problem (as
> they mention on the safe mode page), but solving at the Apache level[1]
> may or may not be viable.
>
> Safe mode is not necessarily appropriate for all situations; on personal
> servers, or single-user websites, it can be too restrictive.  However,
> for hosting companies, as others have said, not using it has the
> potential to make your customers very unhappy when someone else's
> poorly-coded script starts wreaking havoc.
>
> [1] Apache 2's "perchild" MPM looks interesting:
>
> http://httpd.apache.org/docs-2.0/mod/perchild.html
>
> When it's functional, I'm not sure if it will eliminate the need for
> safe mode or not.  It still appears that for large hosts, managing the
> UIDs might be difficult.  I'm by no means an apache admin, but if my
> hosting company has 300 vhosts, it seems like you'd have to start at
> least that many servers, and that only one instance will be tied to a
> vhost (so if one vhost is getting lots of traffic, and one is getting
> only a little, there won't be spare servers around to balance things
> out).  I'm basing that all on what I read at Apache's site, so I may
> well be wrong.

That was a very good summary.  ;)

-Rasmus

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



Re: [PHP] Updating content on the line. (cli)

2004-03-03 Thread Adam Voigt
Well I bet it would work on Win32, it just depends on how much CYGWIN
your willing to include with your program. I think all you would need is
the basic CYGWIN DLL(s) and a terminal like bash (plus ncurses
obviously).


On Wed, 2004-03-03 at 11:07, Simon Fredriksson wrote:
> Yes, that's one way. It's currently in development for Win32, but it 
> would be nice if it works on *nix later on aswell. Got a tip from a user 
> in a chatroom to use Ncurses for it, but then I can't use it on win32.
> 
> Just to correct myself; it's chr(8) and not 7.
> 
> //Simon
> 
> Adam Voigt wrote:
> 
> > I'm not sure of how you could do this, but one other thing you could do,
> > is like I've seen certain console FTP apps do, is just do a division of
> > the total size by whats downloaded, and have like 100 pound signs that
> > are gradually filled in as it downloads.
> > 
> > 
> > On Wed, 2004-03-03 at 10:53, Simon Fredriksson wrote:
> > 
> >>I'm building a download-manager script (like wget), in PHP. Does any of 
> >>you know how I can update a line in the console? I've tried to echo 
> >>chr(7) which is the backspace character, but it won't work. This kind of 
> >>thing is seen in tons of console applications. Like some "please wait" 
> >>thing that changes from - to \, |, /,  and so on (looks like a rotating 
> >>line).
> >>
> >>Ideas?
> >>
> >>//Simon
-- 

Adam Voigt
[EMAIL PROTECTED]

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



[PHP] Re: writing file on server from database?

2004-03-03 Thread raisinlove
I found the answer. If safe-mode prevents you from copying files to a 
newly script-generated directory, simply use the following:

ftp_put($conn_id, $newdirectorypath,$sourcefilepath, FTP_ASCII)

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


[PHP] Starting dos application from php

2004-03-03 Thread Adrian Badoiu
Hi,
I'm Adrian and I have the following problem:
I have to encrypt a text file. For that I use a PGP DOS version (PGP 2.6 ui - 
Unofficial International, because I'm outside of the US).
I installed the PGP and it is working fine when starting it from a Dos command line: 
c:\PGP>  -e test_1.txt adrian   //The result of this command is that it creates the 
encrypted file (textfile.pgp) using my pubkey.

Then I created a batch file (called cript.bat) like this:
@echo off
SET PGPPASS=xy  //This is my cipherphrase
cd pgp//This change the directory
pgp -e test_1.txt adrian >log.txt  //This is the command that encripts the file   with 
my pubkey and redirects the pgp messages to a log.txt

I started like this:
c:\>c:\pgp\cript.bat  and everything was OK.

Then I tried to start all this from a php script:

$path = "c:/pgp/cript.bat";
exec($path,$return,$exit_code);
echo"$return$exit_code";

It does'n work. The script returns $return = Array and $exit_code = 0, but it never 
creates the pgp encrypted file.
I forgot to mention that my PHP is running on Win'98 toghether wirh the Apache.
Can anyone help me ? 
Thanks
Adrian


Re: [PHP] Re: why use safe mode?

2004-03-03 Thread DAvid Jackson
Joel Boonstra wrote:
This tread inerest me because I faced with a situation, where I have to 
work around don't having a database (out of my control).

What I want to do is use Pear + sqlite.so out of home directory of the 
home dir.(typical L.A.P vhost)?

I is modifying safe_mode relative directives the best/only option:
inlcude_path=/home/username/lib:/home/user/www
safe_mode_exec_dir=/home/username/lib
TIA,
David
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: why use safe mode?

2004-03-03 Thread DAvid Jackson

TIA,
David
Please read for content... and excuse the crapping spelling

DJJ

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


[PHP] Testing Pear install

2004-03-03 Thread DAvid Jackson
How can I test to see if and what portions of Pear are installed on a 
vhosted website?

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


RE: [PHP] Re: why use safe mode?

2004-03-03 Thread Chris W. Parker
DAvid Jackson 
on Wednesday, March 03, 2004 11:20 AM said:

>> TIA,
>> David
> Please read for content... and excuse the crapping spelling
> 
> DJJ

??

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



Re: [PHP] Re: why use safe mode?

2004-03-03 Thread DAvid Jackson
Chris W. Parker wrote:
DAvid Jackson 
on Wednesday, March 03, 2004 11:20 AM said:

TIA,
David
Please read for content... and excuse the crapping spelling

DJJ


??
Chris --
See reply to this thread right before this, I fat fingered it :)
And also the questions I asked .
TX,
david
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] test email

2004-03-03 Thread Andy B
just checking to see if i got on the list right...you can ignore 



Re: [PHP] Updating content on the line. (cli)

2004-03-03 Thread Frank M. Kromann
At least on Windows you can send chr(13), and then rebuild the entire
line.

- Frank

> Well I bet it would work on Win32, it just depends on how much CYGWIN
> your willing to include with your program. I think all you would need
is
> the basic CYGWIN DLL(s) and a terminal like bash (plus ncurses
> obviously).
> 
> 
> On Wed, 2004-03-03 at 11:07, Simon Fredriksson wrote:
> > Yes, that's one way. It's currently in development for Win32, but it 
> > would be nice if it works on *nix later on aswell. Got a tip from a
user 
> > in a chatroom to use Ncurses for it, but then I can't use it on
win32.
> > 
> > Just to correct myself; it's chr(8) and not 7.
> > 
> > //Simon
> > 
> > Adam Voigt wrote:
> > 
> > > I'm not sure of how you could do this, but one other thing you could
do,
> > > is like I've seen certain console FTP apps do, is just do a division
of
> > > the total size by whats downloaded, and have like 100 pound signs
that
> > > are gradually filled in as it downloads.
> > > 
> > > 
> > > On Wed, 2004-03-03 at 10:53, Simon Fredriksson wrote:
> > > 
> > >>I'm building a download-manager script (like wget), in PHP. Does any
of 
> > >>you know how I can update a line in the console? I've tried to echo

> > >>chr(7) which is the backspace character, but it won't work. This
kind of 
> > >>thing is seen in tons of console applications. Like some "please
wait" 
> > >>thing that changes from - to \, |, /,  and so on (looks like a
rotating 
> > >>line).
> > >>
> > >>Ideas?
> > >>
> > >>//Simon
> -- 
> 
> Adam Voigt
> [EMAIL PROTECTED]
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 

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



[PHP] "calling" one php script from another

2004-03-03 Thread Jim & Sara Feldman
Does anyone know of a way to jump from one php script to
another without going through the client browser? The closest I have
been able to come to doing that is to use nested frames where the
parent frame can call multiple php scripts, one for each child frame.
Jim
--
Jim Feldman
14 Linda Lane
Newton, MA 02461
617-527-0509

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


RE: [PHP] "calling" one php script from another

2004-03-03 Thread Jay Blanchard
[snip]
Does anyone know of a way to jump from one php script to
another without going through the client browser? The closest I have
been able to come to doing that is to use nested frames where the
parent frame can call multiple php scripts, one for each child frame.
[/snip]

You mean like ...

if("dog" == $_POST['animal']){
include("dog.script.php");
or <--not code
header("location: dog.script.php"); exit();
} elseif("cat" == $_POST['animal']){
include("cat.script.php");
or <--not code
header("location: cat.script.php"); exit();
} else {
include("generalpets.script.php");
or <--not code
header("location: generalpets.script.php"); exit();
}

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



Re: [PHP] "calling" one php script from another

2004-03-03 Thread Brian V Bonini
On Wed, 2004-03-03 at 14:49, Jim & Sara Feldman wrote:
>   Does anyone know of a way to jump from one php script to
> another without going through the client browser? The closest I have
> been able to come to doing that is to use nested frames where the
> parent frame can call multiple php scripts, one for each child frame.

header("Location: /path/to/script/foo.php");



-- 
BrianGnuPG -> KeyID: 0x04A4F0DC | URL: www.gfx-design.com/keys
  Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
GnuPG: http://gnupg.org
http://www.biglumber.com/x/web?qs=0x2C35011004A4F0DC
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] "calling" one php script from another

2004-03-03 Thread Lucas Gonze


On Wed, 3 Mar 2004, Brian V Bonini wrote:

> On Wed, 2004-03-03 at 14:49, Jim & Sara Feldman wrote:
> > Does anyone know of a way to jump from one php script to
> > another without going through the client browser? The closest I have
> > been able to come to doing that is to use nested frames where the
> > parent frame can call multiple php scripts, one for each child frame.
>
> header("Location: /path/to/script/foo.php");

Won't that redirect through the browser?


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



[PHP] Re: Testing Pear install

2004-03-03 Thread Ben Ramsey
David Jackson wrote:
How can I test to see if and what portions of Pear are installed on a 
vhosted website?

TX,
david
I'm not sure how to tell what portions are installed, exactly, but you 
can test to see whether PEAR itself is installed simply by using

require 'PEAR.php';

If it complains, then it can't find it and it's probably not installed. 
 You can download the PEAR packages yourself, though, drop them into a 
directory in your site (or outside the root of your site), and use 
ini_set() to set your include_path to the directory where your PEAR 
classes reside.  Then you can use PEAR without having to "install" it.

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


Re: [PHP] Session and Cookie issue

2004-03-03 Thread Hardik Doshi
Thank you Chris.

> > I have selected Disable cookie option in the
> safari
> > browser setting on my MAC. Before selecting this
> > option, my website was working fine but after
> > disabling the cookie option, i am not able to
> log-in
> > to my website.
> 
> There are at least two options:
> 
> 1. Include the session identifier in all your URLs
> manually.

I did this and it works fine. Now by doing this i have
a question pop up in my mind is about Security. What
security measures should i take when i am passing the
session id value on URL?

> 2. Let PHP do this for you by enabling
> session.use_trans_sid in your
> php.ini.

With option # 2 i have the same concern of Security.
Please clarify the security measures.

> With option 2, the session identifier will be
> appended to all URLs when
> the user first visits the page, and every visit
> thereafter only performs
> this action if the user has disabled cookies.
> 
> Hope that helps.
> 
> Chris


Thanks a lot.

Hardik

__
Do you Yahoo!?
Yahoo! Search - Find what you’re looking for faster
http://search.yahoo.com

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



Re: [PHP] Session and Cookie issue

2004-03-03 Thread Chris Shiflett
--- Hardik Doshi <[EMAIL PROTECTED]> wrote:
> > 1. Include the session identifier in all your URLs
> > manually.
> 
> I did this and it works fine. Now by doing this i have
> a question pop up in my mind is about Security. What
> security measures should i take when i am passing the
> session id value on URL?
> 
> > 2. Let PHP do this for you by enabling
> > session.use_trans_sid in your
> > php.ini.
> 
> With option # 2 i have the same concern of Security.
> Please clarify the security measures.

Good question.

Basically, if the session identifier is the only thing you use for
identification, your implementation is weak in terms of preventing (or
even complicating) impersonation. This is true regardless of whether the
client passes this identifier as GET data, POST data, or a cookie.

Rather than elaborate here, I'll point you to an article I wrote that will
hopefully give you a better idea about what sort of things you can do to
improve your implementation:

http://shiflett.org/articles/the-truth-about-sessions

Hope that helps.

Chris

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

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

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



Re: [PHP] "calling" one php script from another

2004-03-03 Thread Brian V Bonini
On Wed, 2004-03-03 at 15:21, Lucas Gonze wrote:
> On Wed, 3 Mar 2004, Brian V Bonini wrote:
> 
> > On Wed, 2004-03-03 at 14:49, Jim & Sara Feldman wrote:
> > >   Does anyone know of a way to jump from one php script to
> > > another without going through the client browser? The closest I have
> > > been able to come to doing that is to use nested frames where the
> > > parent frame can call multiple php scripts, one for each child frame.
> >
> > header("Location: /path/to/script/foo.php");
> 
> Won't that redirect through the browser?


Yes, perhaps it's not clear what you are trying to do. Can you elaborate
a little more. You said "jump form one script to another", are you
perhaps just asking how to pass data from one script to another?

-- 
BrianGnuPG -> KeyID: 0x04A4F0DC | URL: www.gfx-design.com/keys
  Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
GnuPG: http://gnupg.org
http://www.biglumber.com/x/web?qs=0x2C35011004A4F0DC
Linux Registered User #339825 at http://counter.li.org

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



Re: [PHP] resubmitting $POST data to another script

2004-03-03 Thread Charlie Fiskeaux II
Leif Gregory wrote:
Hello Charlie,

Tuesday, March 2, 2004, 1:54:43 PM, you wrote:
CFI> I'm creating a form with 170 fields, and I'd like to create an
CFI> intermediary page so the user can review their info before
CFI> submitting it again to the emailing script.
Just a thought. I'm guessing you are dumping this stuff to a database
for the final result. Why don't you create an intermediate table to
hold those fields (keeping track of the record ID in a hidden input
field), then re-read that data back on the validation page, then when
they submit it there, the changes are added to the real table.
My only thinking on this is to keep it simple rather than carrying
over a ton of hidden fields. It may not be the most efficient method,
but it'd work.
I'm not dumping to a database, unfortunately, I'm just 
emailing the results. Thanks, anyway, though. I think the 
hidden fields idea is the best one; I finally found a 
solution that uses each() and list() to travel the $_POST 
array, and I think it will work nicely.

Thanks to all for your responses!

--

Charlie Fiskeaux II
Media Designer
Cre8tive Group
cre8tivegroup.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] resubmitting $POST data to another script

2004-03-03 Thread Chris Shiflett
--- Charlie Fiskeaux II <[EMAIL PROTECTED]> wrote:
> I think the  hidden fields idea is the best one; I finally found a
> solution that uses each() and list() to travel the $_POST array,
> and I think it will work nicely.

You might strongly consider using foreach() instead for reasons of
performance (1000% or more faster):

http://www.blueshoes.org/en/developer/php_bench/

You could simply:

foreach ($_POST as $name => $value)
{
   ...
}

Hope that helps.

Chris

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

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

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



Re: [PHP] Testing Pear install

2004-03-03 Thread Ray Hunter
On Wed, 2004-03-03 at 12:21, DAvid Jackson wrote:
> How can I test to see if and what portions of Pear are installed on a 
> vhosted website?

If you have access to the command line pear you can also check with a
simple command:

$ pear list

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



Re: [PHP] PHP5 COM get/set property trouble

2004-03-03 Thread Daniel Daley

$comobj = &new COM('MyComlib.ComLib'); // Works
$comobj->FieldValue = "somedata";   // Works
$myval = $comobj->Property("Record");// Kind of 
Works.throws an exception if the value doesn't exist
$comobj->Property("Record") = "otherdata";  // Doesn't Work

I'm able to initialize the object and assign the FieldValue property 
some data. The last line however doesn't work and instead gives me:
PHP Fatal error: Can't use method return value in write context


Well, I was about to give up when I noticed the pecl extension php_perl. 
It turns out perl has a method to set properties that take parameters. I 
was able to successfully compile and install the extension and use the 
Perl() object to do work on the com objects that had properties like 
that. If anyone has any information about whetether setting properties 
with arguments is possible with strictly php or if that's a feature 
expected to be implemented I would still very much like to know.

Thanks,

--Dan--

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


[PHP] finding a date in the future based on a selected date

2004-03-03 Thread Andy B
Hi.

I am creating a section of a site (events system) that will post different events in 
the area. Part of the form has the date the events starts. The fields in question are: 
day of month the event starts, the month the event starts, day of the month the event 
ends and month event ends. the problem with these dates is all of the events are on 
the same week of the month every year. For example: event 1 starts the 3rd saturday of 
january and ends the 4th saturday of january every year without fail. I have been 
asked to take that and turn it in to actual dates. Then when the last date of the 
event ends I have to turn it into the date for the next year and put it back in the 
db...

How would i start going about doing this?? I considered using the day of the year but 
dont know if this would work that well...





Re: [PHP] resubmitting $POST data to another script

2004-03-03 Thread Charlie Fiskeaux II
Chris Shiflett wrote:

You might strongly consider using foreach() instead for reasons of
performance (1000% or more faster):
http://www.blueshoes.org/en/developer/php_bench/

You could simply:

foreach ($_POST as $name => $value)
{
   ...
}
Hope that helps.
Sure does, thanks!

--

Charlie Fiskeaux II
Media Designer
Cre8tive Group
cre8tivegroup.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Testing Pear install

2004-03-03 Thread DAvid Jackson
Ben Ramsey wrote:

 You can download the PEAR packages yourself, though, drop them into a 
directory in your site (or outside the root of your site), and use 
ini_set() to set your include_path to the directory where your PEAR 
classes reside.  Then you can use PEAR without having to "install" it.
Ben --
It's looks like that's what I'm going to have to do :-(
My church made a poor decision, about which hosting company to go with
Tx,
David
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Phorum 5.0.3-beta released!

2004-03-03 Thread Brian Moon
About Phorum
http://phorum.org/
Phorum is a web based message board written in PHP. Phorum was the first 
PHP based message board to use a database.  Phorum is designed with 
high-availability and visitor ease of use in mind.  Phorum has fresh 
ideas and features that do not follow the same design and bulky features 
of other message boards available.  It works great for sites with 10 
users or 10,000.



After 2 long years, Phorum 5 has hit beta. It is 99.9% feature
compatible with the latest Phorum 3 releases. At this point, we will be 
guaranteeing an upgrade path to future version of Phorum 5. The long 
alpha cycle means that this beta code is in really good shape. Some of 
the users that have already switched believe it is RC quality code.

Here are some things that are not quite compatible with Phorum 3:

* Permissions are much different in Phorum 5. There is no conversion 
script for them yet.

* Phorummail has not yet been developed for Phorum 5.

* Users without cookies will not be able to log in to Phorum 5 in this 
release.

* Float-to-top in threaded view is not supported and will not be supported.

* Colors and such are not set via the admin in Phorum 5. The HTML of the 
templates needs to be edited.

Here are some neat features of Phorum 5 that are not in Phorum 3:

* Access control to the forums is very detailed. Nearly any option can 
be given to a single user or a group of users.

* Phorum 5 uses a template system that separates the HTML from the PHP code.

* Phorum 5 stores all of its messages in a single table.

* Phorum 5 requires no special file permisions for most installs.

* Phorum 5 includes an HTML modlue that will safely allow your users to 
post HTML in their posts.

* The new BBCode module is more robust than the PhorumCode options of 
Phorum 3.

* Terrific new moderation features

* Read message status is now stored in the database and moves with the user.

* And more

Enjoy and please report back any bug reports you find.

Brian Moon
Phorum Dev Team
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] setting request variables

2004-03-03 Thread matthew oatham
Hi, 

I have created a small login system for my website. However if a user logs in 
incorrectly I want to display a error message currently I use the code

echo "You could not be logged in! Either the username and password do not match or 
you have not validated your membership! 
Please try again! ";
include  ("login.php");

However this appears at the top of my website but I want it to appear above the login 
form so I though I could set a variable in the request called "error" or similar then 
on the login page just above the login form check for the presence of the request 
variable "error" and print the appropriate message. So I want to do the following:

SET REQUEST VARIABLE ERROR HERE
include  ("login.php");

But can I set a request variable? i.e in JAVA I would do 
HttpRequest.setAttribute("error", true); etc..

Any help?

Cheers

[PHP] setting request variables

2004-03-03 Thread matthew oatham
Hi, 

I have created a small login system for my website. However if a user logs in 
incorrectly I want to display a error message currently I use the code

echo "You could not be logged in! Either the username and password do not match or 
you have not validated your membership! 
Please try again! ";
include  ("login.php");

However this appears at the top of my website but I want it to appear above the login 
form so I though I could set a variable in the request called "error" or similar then 
on the login page just above the login form check for the presence of the request 
variable "error" and print the appropriate message. So I want to do the following:

SET REQUEST VARIABLE ERROR HERE
include  ("login.php");

But can I set a request variable? i.e in JAVA I would do 
HttpRequest.setAttribute("error", true); etc..

Any help?

Cheers

[PHP] my checkbox array striped ?

2004-03-03 Thread adwinwijaya
Hi all,

I have a script like this:

in html


  
  
  
  
  
  
  


and in process.php I have:

$value){
 $_POST[$key] = trim($value);
 $_POST[$key] = stripTags($value) ;
}
}

print "" ;
print_r($_POST);
print "" ;

?>

and the output will be :

Array
(
[type] => Array
[xyz] =>
[Submit] => GO
)

as you can see the type should be an array ... but it just displaying
Array 
if I remove strip_tags from my script it will work perfectly (it will
display the checkbox array) ...

can someone explain to me why this happen ? I just want to strip tags
every input the user entered ...

thanks

-- 
Best regards,
 adwin

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



[PHP] HELP! printing Arrays

2004-03-03 Thread Labunski
Hello,

// This will print first and sixth line from the text file:
$file = file("people.txt");
 print "$file[0]";
 print "$file[6]";

// But how to print all the lines from [0] to [6] ?
// Hope you understood my problem.


Thank you very much,
sorry for my bad english,
Lab.

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



RE: [PHP] HELP! printing Arrays

2004-03-03 Thread Chris W. Parker
Labunski 
on Wednesday, March 03, 2004 3:31 PM said:

> Hello,
> 
> // This will print first and sixth line from the text file:
> $file = file("people.txt");
>  print "$file[0]";
>  print "$file[6]";

actually that will print the first and seventh line of the file...

> // But how to print all the lines from [0] to [6] ?
> // Hope you understood my problem.

// to print ALL lines
foreach($file as $key => $value)
{
  echo "$key: $value";
}

// to print lines 1-7
for($ictr = 0; $ictr < 6; $ictr++)
{
  echo "{$file[$ictr]}";
}


> sorry for my bad english,
> Lab.

no problem.


hth,
chris.

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



Re: [PHP] my checkbox array striped ?

2004-03-03 Thread Marek Kilimajer
adwinwijaya wrote:
Hi all,

I have a script like this:

in html


  
  
  
  
  
  
  

and in process.php I have:



function stripTags($value){
  if(isset($value))
  return strip_tags($value);
}
if(isset($_POST)){
foreach($_POST as $key=>$value){
 $_POST[$key] = trim($value);
 $_POST[$key] = stripTags($value) ;
}
}

Both trim and stripTags take a string as an argument and return a 
string. So each $value is converted to a strig, if you look into the 
manual, if an array is converted to a string the result is "Array".

You need a recursive function that takes an array as an argument and 
trims and striptags every element of the array, unless the element is an 
array itself, in this case it calls itself with the array element as the 
argument.

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


Re: [PHP] HELP! printing Arrays

2004-03-03 Thread Daniel Clark
foreach($file as $value ){

  print "$value";
}


> // This will print first and sixth line from the text file:
> $file = file("people.txt");
>  print "$file[0]";
>  print "$file[6]";
>
> // But how to print all the lines from [0] to [6] ?
> // Hope you understood my problem.

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



Re: [PHP] HELP! printing Arrays

2004-03-03 Thread Labunski
Thanks! It was very useful!

Lab.

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



Re: [PHP] HELP! printing Arrays

2004-03-03 Thread Labunski
Your script is working perfectly, thanks for teaching me!

Lab.

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



Re: [PHP] HELP! printing Arrays

2004-03-03 Thread Brian V Bonini
On Wed, 2004-03-03 at 18:30, Labunski wrote:
> Hello,
> 
> // This will print first and sixth line from the text file:
> $file = file("people.txt");
>  print "$file[0]";
>  print "$file[6]";
> 
> // But how to print all the lines from [0] to [6] ?
> // Hope you understood my problem.
> 

for($i=0; $i < 6; $i++) {
echo "$file[$i]\n";
}

-- 
Brian V Bonini <[EMAIL PROTECTED]>

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



[PHP] php->rtf/mw word weird characters

2004-03-03 Thread Redmond Militante
hi

i have some 500-1000 word essays stored as data type 'text' in a mysql database.  i'm 
using the following code to generate an ms word-compatible rtf document off the 
database

---snip---
//generate the headers to help a browser choose the correct application
header( "Content-type: application/msword" );
header( "Content-Disposition: inline, filename=test.rtf");
$date = date( "F d, Y" );
// open our template file
$filename = "mjp_rtf.rtf";
$fp = fopen ( $filename, "r" );
//read our template into a variable
$output = fread( $fp, filesize( $filename ) );
fclose ( $fp );
// replace the place holders in the template with our data
$output = str_replace( "<>", $userid, $output );
$mjp_essay1=nl2br($mjp_essay1);
$mjp_essay1 = str_replace( "", "\par", $mjp_essay1 );
$output = str_replace( "<>", $mjp_essay1, $output );
$mjp_essay2=nl2br($mjp_essay2);
$mjp_essay2 = str_replace( "", "\par", $mjp_essay2 );
$output = str_replace( "<>", $mjp_essay2, $output );
// send the generated document to the browser
echo $output;
---snip---

this generates an rtf with a single essay printed on it.  works fine.

i'd now like to integrate the above code into a while loop that fetches multiple 
essays from the mysql db, and prints them out sequentially in a single rtf document.  
the following code creates an rtf document with multiple essay questions off a while 
loop/query, the problem:  there seems to be special ms word characters (for ex., words 
formatted with italics or apostrophes are displayed on the rtf page with extra, weird 
looking ascii characters).

the code

---snip---
header( "Content-type: application/msword" );
header( "Content-Disposition: inline, filename=essays.rtf");
$date = date( "F d, Y" );
//open template file
$filename= "mjp_rtf2.rtf";
$fp=fopen($filename, "r");
//read our template into a variable
$output = fread( $fp, filesize( $filename ) );
fclose ( $fp );
$string = "\page";
//begin while loop to cycle through db
while ($result=mysql_fetch_array($query)){
//Increment the line index by 1
$_GET['lineIndex']++;
$_GET['rowcount']++;
$userid=$result['userid'];  
  if (!($conn = $new_admin_class->db_connect()))
return false;
$result2 = mysql_query( "select *
  from mjp_essay1
  where userid =".$userid."");
  $row2 = mysql_fetch_array($result2); 
//getting info from row in db   
$mjp_essay1[$_GET['rowcount']] = $row2['mjp_essay1'];
$result2 = mysql_query( "select *
  from mjp_essay2
  where userid =".$userid."");
  $row2 = mysql_fetch_array($result2); 
//getting info from row in db   
$mjp_essay2[$_GET['rowcount']] = $row2['mjp_essay2'];
// replace the place holders in the template with our data
$mjp_essay1 = nl2br($mjp_essay1[$_GET['rowcount']]);
$mjp_essay1 = str_replace( "", " \par ", $mjp_essay1 );
$mjp_essay2 = nl2br($mjp_essay2[$_GET['rowcount']]);
$mjp_essay2 = str_replace( "", " \par ", $mjp_essay2 );
$string=$string." Application Data Form - Userid ".$userid."\par Essay 1 \par \par 
\par ".$mjp_essay1." \par \par \par Essay 2 \par \par \par ".$mjp_essay2."\page";
}
$output=str_replace("<>",$string, $output);
// send the generated document to the browser
  echo $output;
}
---snip---

is based on the first snippet of code.  yet the weird ascii characters before special 
formatting and apostrophes appears only in the second snippet of code.  am i missing 
something?  any help would be appreciated.

thanks
redmond








-- 
Redmond Militante
Software Engineer / Medill School of Journalism
FreeBSD 5.2.1-RELEASE-p1 #0: Wed Mar 3 08:20:55 CST 2004 i386
 5:45PM  up  5:45, 3 users, load averages: 0.20, 0.10, 0.15


pgp0.pgp
Description: PGP signature


Re: [PHP] setting request variables

2004-03-03 Thread Tom Rogers
Hi,

Thursday, March 4, 2004, 9:08:19 AM, you wrote:
mo> Hi, 

mo> I have created a small login system for my website. However
mo> if a user logs in incorrectly I want to display a error message
mo> currently I use the code

mo> echo "You could not be logged in! Either the username and
mo> password do not match or you have not validated your membership!
mo> 
mo> Please try again! ";
mo> include  ("login.php");

mo> However this appears at the top of my website but I want it
mo> to appear above the login form so I though I could set a variable
mo> in the request called "error" or similar then on the login page
mo> just above the login form check for the presence of the request
mo> variable "error" and print the appropriate message. So I want to
mo> do the following:

mo> SET REQUEST VARIABLE ERROR HERE
mo> include  ("login.php");

mo> But can I set a request variable? i.e in JAVA I would do
mo> HttpRequest.setAttribute("error", true); etc..

mo> Any help?

mo> Cheers

add something like this to login.php

if(!empty($error)){
  echo ''.$error.'';
}

as it is included it will have $error available to it
-- 
regards,
Tom

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



[PHP] Re: php5

2004-03-03 Thread Vivian Steller
hi again,
i forgot adding the attributes, sorry :)
here it is...

>> I need manipulate the nodes (add and remove) .
>> example
>> I need add more one node
>> > subnet="24"/>
> 
>  // create a new node
> $newInterfaceNode = $doc->createElement("interface");
> // append this node under network
> $newInterfaceNode = $networkNode->appendChild($newInterfaceNode);
> ?>

setAttribute("name", "dmz");
$newInterfaceNode->setAttribute("type", "ethernet");
$newInterfaceNode->setAttribute("device", "eth3");
$newInterfaceNode->setAttribute("ip", "x");
?>

the setAttribute method only works for appended nodes...

you can get a peace of "technical" documentation of the used methods from 
http://www.eecoo.de/downloads/domdocumentation.txt .

i'm happy being able to help you, maybe you'll help us later on;)

bye.

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



Re: [PHP] HELP! printing Arrays

2004-03-03 Thread Ben Ramsey
I know that others have already helped you learn out to print out an 
array, but you can also use print_r($array); to print out the array. 
It's not useful for the end-user of your application, but it can help 
you out as you're programming.

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


[PHP] server side redirects

2004-03-03 Thread matthew oatham
Hi,

I have a page that checks to see if a session exists and if so does a server side 
redirect - i tired using header("Location: membersArea.php"); but I got an error about 
headers already sent, guess this is because I have already output html before this php 
command. So I tried include ("membersArea.php"); this kind of worked but because I am 
using php includes for my website header and footer I got strange results when the 
webpage was rendered. Therefor I used echo ""; This works but are there any drawbacks? i.e. is 
there a more elegant way to deal with my situation? Is this method supported by all 
browsers etc..

Cheers.

Matt

Re: [PHP] HELP! printing Arrays

2004-03-03 Thread Ryan A

On 3/4/2004 1:32:42 AM, Ben Ramsey ([EMAIL PROTECTED]) wrote:
> I know that others have already helped you learn out to print out an
> array, but you can also use print_r($array); to print out the array.
> It's not useful for the end-user of your application, but it can help
> you out as you're
> programming.

Too true, I use it a lot during development, you may have an error or typo
while programming
and getting the values may be wrong, but using print_r() you get the exact
values the script gets
in a pretty easy to read form which you can follow to see if your programs
running right.

Cheers,
-Ryan

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



RE: [PHP] server side redirects

2004-03-03 Thread Chris W. Parker
matthew oatham 
on Wednesday, March 03, 2004 4:25 PM said:

> is there a more elegant way to deal with my
> situation? Is this method supported by all browsers etc..

1. don't output anything before a redirect. i figure, if a redirect is
going to happen there's really no reason to output anything.
2. out output buffering. put ob_start(); as the very first line in your
page.

i prefer method 1 because method 2 requires more memory on the server's
part.


hth,
chris.

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



[PHP] Re: server side redirects

2004-03-03 Thread Ben Ramsey
guess this is because I have already output html before this php command
Exactly right.  Why don't you use the header() function at the top of 
the page before sending any other headers?  It will definitely work that 
way.  And if the problem is because you're doing some evaluation down in 
your page, take that evaluation out and bring it up above the headers, 
as well.  I usually do all my page processing and evaluation at the top 
of my pages before I write any HTML.

As for the meta redirect, I'm not sure of any problems there (others 
will likely know better than I), but I think it's best to have your 
application do the redirect from the server-side rather than the 
client-side.  If your evaluation is high enough in the page to know to 
print the meta redirect tag, then you can probably afford to move it 
just a few lines higher than the  tag and use header() instead. 
Doing things on the server-side is always best and more secure; 
end-users are less likely to be able to screw things up.

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


[PHP] Re: server side redirects

2004-03-03 Thread matthew oatham
Unfortunately I include the session_start();  method in the file header.php
(because I am checking for a value here to determine whether to show a
logout button or not) therefore I cant do the



at the top of the page because the server will not be able to get hold of
the session to see if session_is_registered('userId') evaluates to true!

I suppose I could remove session_start(); from the header.php and hard code
it at the top of every page !

Matt.


- Original Message - 
From: "Ben Ramsey" <[EMAIL PROTECTED]>
Newsgroups: php.general
To: "Matthew Oatham" <[EMAIL PROTECTED]>
Sent: Thursday, March 04, 2004 12:49 AM
Subject: Re: server side redirects


> > guess this is because I have already output html before this php command
>
> Exactly right.  Why don't you use the header() function at the top of
> the page before sending any other headers?  It will definitely work that
> way.  And if the problem is because you're doing some evaluation down in
> your page, take that evaluation out and bring it up above the headers,
> as well.  I usually do all my page processing and evaluation at the top
> of my pages before I write any HTML.
>
> As for the meta redirect, I'm not sure of any problems there (others
> will likely know better than I), but I think it's best to have your
> application do the redirect from the server-side rather than the
> client-side.  If your evaluation is high enough in the page to know to
> print the meta redirect tag, then you can probably afford to move it
> just a few lines higher than the  tag and use header() instead.
> Doing things on the server-side is always best and more secure;
> end-users are less likely to be able to screw things up.
>
> -- 
> Regards,
>   Ben Ramsey
>   http://benramsey.com
>   http://www.phpcommunity.org/wiki/People/BenRamsey
>

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



[PHP] Session dilemma

2004-03-03 Thread Brian Dunning
I have a site with two limitations, neither of which can be changed:

1. The http and https servers are on different domains.

2. There are lots of non-PHP pages so session management requires 
cookies.

Can anyone think of a way to kill the sessions on a single page? When 
the transaction is completed and the page says "Thank you," I'd like 
the session to be already dead on both servers so it doesn't matter 
where they click, they can't reactivate the previous session.

- Brian

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


RE: [PHP] Re: server side redirects

2004-03-03 Thread Chris W. Parker
matthew oatham 
on Wednesday, March 03, 2004 5:05 PM said:

> Unfortunately I include the session_start();  method in the file
> header.php (because I am checking for a value here to determine
> whether to show a logout button or not) therefore I cant do the

[snip]

read my post from 20 mins ago. you can solve this easy. or have you
already tried what i suggested?




c.

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



Re: [PHP] setting request variables

2004-03-03 Thread matthew oatham
but what if I wanted the variable $error to be a message. I want to set a
variable called $error to something like "invalided password" then display
this on the login page.

Cheers

Matt
- Original Message - 
From: "Tom Rogers" <[EMAIL PROTECTED]>
To: "matthew oatham" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Thursday, March 04, 2004 12:24 AM
Subject: Re: [PHP] setting request variables


> Hi,
>
> Thursday, March 4, 2004, 9:08:19 AM, you wrote:
> mo> Hi,
>
> mo> I have created a small login system for my website. However
> mo> if a user logs in incorrectly I want to display a error message
> mo> currently I use the code
>
> mo> echo "You could not be logged in! Either the username and
> mo> password do not match or you have not validated your membership!
> mo> 
> mo> Please try again! ";
> mo> include  ("login.php");
>
> mo> However this appears at the top of my website but I want it
> mo> to appear above the login form so I though I could set a variable
> mo> in the request called "error" or similar then on the login page
> mo> just above the login form check for the presence of the request
> mo> variable "error" and print the appropriate message. So I want to
> mo> do the following:
>
> mo> SET REQUEST VARIABLE ERROR HERE
> mo> include  ("login.php");
>
> mo> But can I set a request variable? i.e in JAVA I would do
> mo> HttpRequest.setAttribute("error", true); etc..
>
> mo> Any help?
>
> mo> Cheers
>
> add something like this to login.php
>
> if(!empty($error)){
>   echo ''.$error.'';
> }
>
> as it is included it will have $error available to it
> -- 
> regards,
> Tom
>
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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



Re: [PHP] my checkbox array striped ?

2004-03-03 Thread Richard Davey
Hello adwinwijaya,

Wednesday, March 3, 2004, 11:27:44 PM, you wrote:

a> as you can see the type should be an array ... but it just displaying
a> Array 
a> if I remove strip_tags from my script it will work perfectly (it will
a> display the checkbox array) ...

a> can someone explain to me why this happen ? I just want to strip tags
a> every input the user entered ...

strip_tags() returns a string, you're passing an array into it, so it
is returning Array. The strip tags function cannot work with arrays,
you need to give it a string.

Here is a technique I use to iterate through a $_POST array, it should
work for you too:



If an element of $_POST is an array this won't work, you would need
to do something like:

array_walk($_POST['array_name'], 'strip')

for that particular array instead.

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

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



[PHP] [4.3.4] Building with sqlite support

2004-03-03 Thread DAvid Jackson
I looked the the configure --help but didn't see sqlite?
Or did I just miss it? How can I build the module for sqlite.
David

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


Re: [PHP] Session dilemma

2004-03-03 Thread Richard Davey
Hello Brian,

Thursday, March 4, 2004, 1:08:47 AM, you wrote:

BD> I have a site with two limitations, neither of which can be changed:

BD> 1. The http and https servers are on different domains.

BD> 2. There are lots of non-PHP pages so session management requires 
BD> cookies.

BD> Can anyone think of a way to kill the sessions on a single page? When
BD> the transaction is completed and the page says "Thank you," I'd like
BD> the session to be already dead on both servers so it doesn't matter
BD> where they click, they can't reactivate the previous session.

You can't do it with a single script, however it CAN be done on a
"single page". See below:

logout.html
blah blah, click here to logout

xt_logout.php
// destroy your cookies for the first domain here
Header("Location: https://www.domain2.com/xt_logout_ssl.php";);
exit;

xt_logout_ssl.php
// destroy your cookies for the SSL domain here
Header("Location: http://www.domain1.com/logged_out.php";);

logged_out.php
Thank you, you have now logged out (etc etc).

Because you are using a Header redirect from one script to another the
site visitor will NEVER see this - it happens "behind" the scenes so
you can walk around your sites cleaning up the cookies as you need and
finally dumping the user back onto a friendly logged-out page.

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

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



Re: [PHP] pop-up windows with a include

2004-03-03 Thread apur kurub ver.1
this case using javascript
with the function window.open()

e.g
the file index.php will popup teste.php while the index.php load

inde.php
..

.

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

- Original Message - 
From: "Andre " <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 03, 2004 6:22 AM
Subject: [PHP] pop-up windows with a include




Hello
I need to open one pop-up windows with a include
For example...


I need de window teste.php show in po-up .
Obrigado
André Caridade

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



Re: [PHP] finding a date in the future based on a selected date

2004-03-03 Thread Jason Wong
On Thursday 04 March 2004 06:00, Andy B wrote:

[snip]

> How would i start going about doing this?? I considered using the day of
> the year but dont know if this would work that well...

Start by looking at "Date and Time functions", you'll find that strtotime() 
would be particularly useful.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
If you have never been hated by your child, you have never been a parent.
-- Bette Davis
*/

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



Re[2]: [PHP] setting request variables

2004-03-03 Thread Tom Rogers
Hi,

Thursday, March 4, 2004, 11:08:06 AM, you wrote:
mo> but what if I wanted the variable $error to be a message. I want to set a
mo> variable called $error to something like "invalided password" then display
mo> this on the login page.

mo> Cheers

mo> Matt
mo> - Original Message - 
mo> From: "Tom Rogers" <[EMAIL PROTECTED]>
mo> To: "matthew oatham" <[EMAIL PROTECTED]>
mo> Cc: <[EMAIL PROTECTED]>
mo> Sent: Thursday, March 04, 2004 12:24 AM
mo> Subject: Re: [PHP] setting request variables


>> Hi,
>>
>> Thursday, March 4, 2004, 9:08:19 AM, you wrote:
>> mo> Hi,
>>
>> mo> I have created a small login system for my website. However
>> mo> if a user logs in incorrectly I want to display a error message
>> mo> currently I use the code
>>
>> mo> echo "You could not be logged in! Either the username and
>> mo> password do not match or you have not validated your membership!
>> mo> 
>> mo> Please try again! ";
>> mo> include  ("login.php");
>>
>> mo> However this appears at the top of my website but I want it
>> mo> to appear above the login form so I though I could set a variable
>> mo> in the request called "error" or similar then on the login page
>> mo> just above the login form check for the presence of the request
>> mo> variable "error" and print the appropriate message. So I want to
>> mo> do the following:
>>
>> mo> SET REQUEST VARIABLE ERROR HERE
>> mo> include  ("login.php");
>>
>> mo> But can I set a request variable? i.e in JAVA I would do
>> mo> HttpRequest.setAttribute("error", true); etc..
>>
>> mo> Any help?
>>
>> mo> Cheers
>>
>> add something like this to login.php
>>
>> if(!empty($error)){
>>   echo ''.$error.'';
>> }
>>
>> as it is included it will have $error available to it
>> -- 
>> regards,
>> Tom
>>
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
>>


well that would be easy, for example

$error = ''; //assume no errors
if(isset($_PHP['password'] && !empty($_POST['username']){
  $sql = "SELECT id FROM members WHERE
  username = '".$_POST['username']."'
  AND password = '".$_POST['password']."'";
  $result = mysql_query($sql);
  if(!$mysql_num_rows($result) > 0){
$error = 'Error: Invalid password';
include('login.php');
exit;
  }
  //password ok
  echo 'Welcome '.$_POST['username'].'';
}else{
 //first pass and $error is still empty
 include('login.php');
}
-- 
regards,
Tom

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



[PHP] Re: merge array

2004-03-03 Thread Max
Thanks for your help.





"Lucian Cozma" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>...

> That should do it:

> 

>  $x = array(3,4,6,8);

> $y = array(10,20,40,10);

> $tmp = $x;

> rsort($tmp);

> $n = $tmp[0];

> 

> $newArr = array();

> $newArr = array_fill(0, $n-1, 0);

> for($i=0;$i $newArr[$x[$i]-1] = $y[$i];

> }

> print_r($newArr);

> ?>

> 

> 

> "Max" <[EMAIL PROTECTED]> wrote in message 

> news:[EMAIL PROTECTED]

> Hello all,

> 

> I have two arrays as follows:

> 

> $x = array(3,4,6,8);

> $y = array(10,20,40,10);

> 

> I need these arrays could be merged with '0' in between.

> 

> Result expected :

> 

> $x = array(1,2,3,4,5,6,7,8);

> $y = array(0,0,10,20,0,40,0,10);

> 

> 

> Can anybody help me ?

> Thanks in advance.

> 

> 

> Max

> 

> --

> PHP General Mailing List (http://www.php.net/)

> To unsubscribe, visit: http://www.php.net/unsub.php

> 

> 

> 



[PHP] session problems

2004-03-03 Thread carlos castillo

Hi, i have the followin problem, i have a site that use sessions,
sometimes when i want to write on the session i get the followin error:

Warning: Unknown(): The session id contains invalid characters, valid
characters are only a-z, A-Z and 0-9 in Unknown on line 0

Warning: Unknown(): Failed to write session data (files). Please verify
that the current setting of session.save_path is correct (D:\PHP\tmp) in
Unknown on line 0

I see the folder D:\PHP\tmp and there is the session file, so i dont
know whats the problem, also the script works ok, the problem is that at
the end of the html show the warnings.

Any clue?, thanks.


Carlos A. Castillo.
Ingeniero de desarrollo
[EMAIL PROTECTED]


Su Aliado Efectivo en Internet
www.imagine.com.co
(57 1)2182064 - (57 1)6163218
Bogotá - Colombia 

- Soluciones web para Internet e Intranet
- Soluciones para redes
- Licenciamiento de Software
- Asesoría y Soporte Técnico


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



[PHP] SMTP ERROR

2004-03-03 Thread carlos castillo

When i try to send a mail i receive the followin error

Warning: mail() [function.mail]: SMTP server response: 503 Comando o
secuencia de comandos inesperados in
E:\wwwroot\helpdesk_imagine\classes\helpdesk.class.php on line 1054

But the mail is sent, it occurs sometimes not always.

Thanks,

Carlos A. Castillo.
Ingeniero de desarrollo
[EMAIL PROTECTED]


Su Aliado Efectivo en Internet
www.imagine.com.co
(57 1)2182064 - (57 1)6163218
Bogotá - Colombia 

- Soluciones web para Internet e Intranet
- Soluciones para redes
- Licenciamiento de Software
- Asesoría y Soporte Técnico


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



[PHP] Re: SMTP ERROR

2004-03-03 Thread Manuel Lemos
Hello,

On 03/03/2004 06:03 PM, Carlos Castillo wrote:
When i try to send a mail i receive the followin error

Warning: mail() [function.mail]: SMTP server response: 503 Comando o
secuencia de comandos inesperados in
E:\wwwroot\helpdesk_imagine\classes\helpdesk.class.php on line 1054
But the mail is sent, it occurs sometimes not always.
This is probably a bug of the mail() function under Windows.

You may want to try this class that comes with a wrapper function named 
smtp_mail(). It emulates the mail() using a direct SMTP connection to 
the SMTP server that you choose. You can enabled debugging in the 
smtp_mail.php wrapper script so you can see what is the problem in case 
any error occurs. If no error occurs, the problem is in the mail() 
function are you are safe by using this replacement function.

http://www.phpclasses.org/mimemessage

You also need this for the actual SMTP delivery.

http://www.phpclasses.org/smtpclass

--

Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] "calling" one php script from another

2004-03-03 Thread Phillip Jackson
http://us4.php.net/switch

if/else/else/else/else is ridiculously hard to read. for more then
if/elseif/else use switch.

~pj

"Jay Blanchard" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[snip]
Does anyone know of a way to jump from one php script to
another without going through the client browser? The closest I have
been able to come to doing that is to use nested frames where the
parent frame can call multiple php scripts, one for each child frame.
[/snip]

You mean like ...

if("dog" == $_POST['animal']){
include("dog.script.php");
or <--not code
header("location: dog.script.php"); exit();
} elseif("cat" == $_POST['animal']){
include("cat.script.php");
or <--not code
header("location: cat.script.php"); exit();
} else {
include("generalpets.script.php");
or <--not code
header("location: generalpets.script.php"); exit();
}

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



[PHP] PHP Sessions and Cookies

2004-03-03 Thread Paul Higgins
I have a couple of questions regarding sessions and cookies:

1)  Is there a way to append information to a cookie?  I have read that it 
is, but I have also read many problems.  Is there any particular way to do 
this?  I ask this because cookies are being generated by two different types 
of scripts.  However, they are both on the same site.  So, I have access to 
them, no problem.  I just want to append information to the same cookie.

2)  If I append the PHP session id to every url, will PHP skip the cookies 
completely?  I know this is more insecure.  This option is only important if 
I cannot append information to the cookie.

Thanks,

Paul

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

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


[PHP] Image

2004-03-03 Thread Kenneth
Hi everyone,
I would like to use the function 'image' in php~I know that I have to
install GD before using itI've downloaded the zlib and lpng files...but
how can I install them??

and may it ask for a simple testing function to test if the GD works?

Thanks,
Kenneth

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



[PHP] Image

2004-03-03 Thread Kenneth
To all,
I have a problem on using the function "image".
I've downloaded the zlib and lpng files...but i don't know how to install
them.
Also, I've heard that for latter version PHP, there is already GD library,
what i have to do is just to uncomment the line"php_gd2.dll", i've followed
this but the image function still can't function.

and I would like to ask how can i test if the GD lib works? may i ask for a
simple function/program to check for that.
Thanks

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



[PHP] convert a strtotime date into a text representation of the date

2004-03-03 Thread Andy B
hi.

i found strtotime and it seems to work but not quite sure if i know how to use it 
right...
here is my code:


i wanted it to take the third saturday of next year (2005) and say do this: saturday 
january 24?? 2005 for the output. All I get for the output though is 
sat/june/20092009?? I'm sort of confused now...

any ideas on what the problem is?





RE: [PHP] convert a strtotime date into a text representation of the date

2004-03-03 Thread Martin Towell
> hi.
> 
> i found strtotime and it seems to work but not quite sure if 
> i know how to use it right...
> here is my code:
>  $time= strtotime("third saturday january 2005");
> echo date("M/D/YY", $time);
> ?>
> 
> i wanted it to take the third saturday of next year (2005) 
> and say do this: saturday january 24?? 2005 for the output. 
> All I get for the output though is sat/june/20092009?? I'm 
> sort of confused now...
> 
> any ideas on what the problem is?

Hiya

You'd want something more like this for the format:
echo date("l F j Y", $time);
but for me, this caused the following output
Saturday June 27 2009
doesn't seem right somehow :/

Martin

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



Re: [PHP] convert a strtotime date into a text representation of the date

2004-03-03 Thread Andy B
You'd want something more like this for the format:
echo date("l F j Y", $time);
but for me, this caused the following output
Saturday June 27 2009
doesn't seem right somehow :/

i know i wonder if i have the strtotime("third saturday january 2005");
written all wrong or something.


makes me think i have the wording wrong because if i do this:

now i get Mar wed 03 2004 and that is the right date for my computer grin...
so i wonder if my wording is wrong...

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



[PHP] Call to undefined function: vadmin_rc4_crypt()

2004-03-03 Thread [EMAIL PROTECTED]
Hi, 

Squirrelmail 1.4.2 serversidefilters plugin version 1.32, apache 1.3.26 and 
php 4.3.4,  qmail/vpopmail/courier-imap, maildrop on debian stable.

When the serversidefilters plugin goes to en/decrypt domain passwords using 
mcrypt, I get  this error message:


Fatal error: Call to undefined function: vadmin_rc4_crypt() 
in /var/www/squirrelmail-1.4.2/plugins/serversidefilter/backend.php on line 
420


(line 420 when encrypting, 423 is when decrypting)

The offending file is at http://feayn.org/backend.txt

Now, lines 420-23 are controlled by 

if ($MCRYPT_ALGO == 'rc4_builtin')

the 'else' to that if seems to open the specified mcrypt module and en/decrypt 
the input using that, bypassing lines 420-423 entirely. But  but I get this 
error regardless of whether I set MCRYPT_ALGO to 'rc4_builtin' or 'blowfish' 
or whatever. 

My questions are:

* Where/how should I define vadmin_rc4_crypt()
* Why does php still die on lines 420-423 when the selection of an MCRYP_ALGO 
other than 'rc4_builtin' should bypass it?

Sorry if this is plainly obvious, I'm totally new to php. Google has not been 
my friend on this one.

Cheers, 
L

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



[PHP] function 'image'

2004-03-03 Thread Kenneth
dear all,

I have a problem on using image function. I've download the zlib and lpng
file as it was told, but i still can't use the image function.
How can I install these files into php??
thanks

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



[PHP] about image

2004-03-03 Thread Kenneth
dear all,
additional to the previous post, I was told that for later version of php,
there is already GD with it, and what should i do is just uncomment the
php_gd2.dll line...i've tried this also, but it still doesn't work, how can
i solve this and use the function imagethanks

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



Re: [PHP] convert a strtotime date into a text representation of the date

2004-03-03 Thread Jason Wong
On Thursday 04 March 2004 12:52, Andy B wrote:
> You'd want something more like this for the format:
> echo date("l F j Y", $time);
> but for me, this caused the following output
> Saturday June 27 2009
> doesn't seem right somehow :/
>
> i know i wonder if i have the strtotime("third saturday january 2005");
> written all wrong or something.

Breaking it up like this:

  $time= strtotime("third saturday", mktime(0,0,0,1,1,2005));
  echo date("l F j Y", $time);

seems to work.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.biz
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *
--
Search the list archives before you post
http://marc.theaimsgroup.com/?l=php-general
--
/*
Some men rob you with a six-gun -- others with a fountain pen.
-- Woodie Guthrie
*/

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



[PHP] Globals Variable question

2004-03-03 Thread Terence
Hi All,

Can someone tell me which is better, or if there's a reason I should use one
and not the other (since both seem to work), and if this is the
correct way to access script variables inside functions (and classes):

Example 1

$GLOBALS['db_name']="website";
function QueryDB() {
 echo $GLOBALS['var'];
}
QueryDB();

Example 2

$db_name="website";
function QueryDB() {
 echo $GLOBALS['var'];
}
QueryDB();


Many thanks

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



[PHP] Image

2004-03-03 Thread Kenneth
hello everyone,
I've some question about using image function.
I've followed the instruction and downloaded the zlib and libjepeg-6b, but
how can i install them??
Some said that for new version of php, what i need to do is just uncommend
the ini-file, but i just find it still doesn't work.
Thanks,
Kennneth

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