php-general Digest 22 Apr 2002 10:50:53 -0000 Issue 1301

Topics (messages 93917 through 93966):

Re: PHP @ 24-hour programming competition
        93917 by: Martin Towell
        93923 by: Maxim Maletsky

Re: phpLISTMAN
        93918 by: Maxim Maletsky

Re: Better standards in PHP-coding
        93919 by: .ben
        93920 by: Martin Towell
        93921 by: .ben
        93924 by: Maxim Maletsky
        93935 by: Jason Wong

eregi() problem
        93922 by: Gregor Jaksa
        93925 by: Danny Shepherd
        93943 by: Miguel Cruz

PHPTriad
        93926 by: Mantas Kriauciunas

$server_path
        93927 by: Jule Slootbeek
        93928 by: Bogdan Stancescu

setting Apache's $REMOTE_USER externally
        93929 by: Sek-Mun Wong

Mass Mail {?!}
        93930 by: Liam MacKenzie
        93933 by: CDitty
        93942 by: Matthew Walker
        93944 by: Manuel Lemos

[HELP] redirect browser & pass variable !
        93931 by: Joe
        93937 by: Jason Wong
        93940 by: Adrian Ciutureanu
        93941 by: hugh danaher
        93952 by: Joe

Re: some problems about gd in php
        93932 by: zhaoxd
        93936 by: Jason Wong
        93938 by: zhaoxd
        93939 by: Jason Wong

Web Forum donated to PHP community
        93934 by: Jim Hankins

PHPortal anyone?
        93945 by: José León Serna

PHP + Microsoft Access
        93946 by: Tom Mikulecky

Re: ereg size limit???
        93947 by: liljim

Re: Open Download-Box
        93948 by: Martin Thoma
        93951 by: Jason Wong

How to get allocated memory?
        93949 by: Adrian Ciutureanu

Re: Attachments
        93950 by: Jason Wong

Re: [PHP-DB] Re: [PHP] Re: Cross DB application
        93953 by: Richard Ellerbrock
        93965 by: Manuel Lemos

security
        93954 by: Wilbert Enserink
        93955 by: Jason Wong
        93958 by: W. Enserink

Passing Arrays
        93956 by: Boaz Yahav
        93957 by: Matt Williams

need urgent session help, since new php version broke my code
        93959 by: nospam
        93960 by: Danny Shepherd

Database and files
        93961 by: David Russell
        93962 by: Danny Shepherd
        93963 by: Richard Archer
        93964 by: Richard Archer
        93966 by: Danny Shepherd

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 ---
Firstly, since you can take in already written code, if you have a lot of
pre-written generic code, that would be good.

> We're really interested in your opinions - is this feasible or
> are we just plain mad? :)

You've probably both - aren't all programmer mad? <g>


-----Original Message-----
From: Dennis Moore [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 21, 2002 2:45 AM
To: Visontay Peter; [EMAIL PROTECTED]
Subject: Re: [PHP] PHP @ 24-hour programming competition


This sounds interesting... I am not familiar enought with PHP-GTK to give an
informed opinion.  I think your decision should be based on how familiar
with the tools you take into the contest.    Since you are not face with a
lot of time, will your competition be using Visual IDEs to aid the rapid
development?

You may wnat to post to one of the php-gtk-* lists.  They may be able to
address your needs in more detail.

Good luck!!



If you choose to use PHP, please post the results of the contest to the
list.  It should be interesting.



----- Original Message -----
From: "Visontay Peter" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 19, 2002 7:43 PM
Subject: [PHP] PHP @ 24-hour programming competition


> Hi!
>
> I have quite an unusual problem for you :) There will be a 24-hour
> programming competition at our university, where teams of 3 have one
> day to solve a complex problem (which will be revealed on the day
> of the competition). Teams cannot get help from "outside", so no outward
> network / phone communication is available, but you can use anything you
> take there with you (any development tools, books, pre-written software
> etc.)
>
> The language in which you write the software is up to you, the most
> popular choices being C++ and Java - but this year our team are going
> to use PHP (and PHP-GTK).
>
> The big question is: will PHP be enough for the whole project, or will
> we need something else (like external C/Java modules)?
> Last year the task was to write an artificially intelligent soccer game
> based on a client-server architecture: there was a server acting like
> some kind of game controller (referee) and 2D display screen, while
> the automated clients (players) were playing individually according
> to the game's rules and some simulated information on what they 'see'
> at the time.
>
> It's said that it will be something quite different this year -
> but required knowledge includes:
> algorithm theory, information and code theory, artificial intelligence,
> queuing, databases, client-server architectures, computer networks,
> control theory, 2D graphic programming and software ergonomy.
> All this in 24 hours - nice, eh? :)
>
> So the question again - are there any parts of all this where you think
> PHP will not be enough? (Apart from the graphics, for which we'll use
> PHP-GTK). If so, what kind of outside module integration do you
> recommend for us?
> Also, which PHP sites / resources / code libraries do you think we should
> (recursively) download which might help us a lot? (Apart from php.net,
> of course.)
>
> We're really interested in your opinions - is this feasible or
> are we just plain mad? :)
>
> Thanks,
> Peter Visontay
> http://prodigycenter.com/cv/
>
>
>
> --
> 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
--- End Message ---
--- Begin Message ---


It is in a way doable,

What about some game where when, being limited by timer, you type words
on the keyboard and get some questions to answer. The software would
have to "understand" the meaning and try to give you tougher but
relative question each time? Maybe using some RDBMS for that in
conjunction with PHP-GTK for the active interface?

That's an idea, no?

I had to make a puzzle game in PHP once, was painful enough that I still
enjoy playing that game myself ;-)



Sincerely,

Maxim Maletsky
Founder, Chief Developer
[EMAIL PROTECTED]

PHPBeginner.com (Where PHP Begins)
www.phpbeginner.com



> -----Original Message-----
> From: Martin Towell [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 22, 2002 1:39 AM
> To: Visontay Peter; [EMAIL PROTECTED]
> Subject: RE: [PHP] PHP @ 24-hour programming competition
> 
> Firstly, since you can take in already written code, if you have a lot
of
> pre-written generic code, that would be good.
> 
> > We're really interested in your opinions - is this feasible or
> > are we just plain mad? :)
> 
> You've probably both - aren't all programmer mad? <g>
> 
> 
> -----Original Message-----
> From: Dennis Moore [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, April 21, 2002 2:45 AM
> To: Visontay Peter; [EMAIL PROTECTED]
> Subject: Re: [PHP] PHP @ 24-hour programming competition
> 
> 
> This sounds interesting... I am not familiar enought with PHP-GTK to
give an
> informed opinion.  I think your decision should be based on how
familiar
> with the tools you take into the contest.    Since you are not face
with a
> lot of time, will your competition be using Visual IDEs to aid the
rapid
> development?
> 
> You may wnat to post to one of the php-gtk-* lists.  They may be able
to
> address your needs in more detail.
> 
> Good luck!!
> 
> 
> 
> If you choose to use PHP, please post the results of the contest to
the
> list.  It should be interesting.
> 
> 
> 
> ----- Original Message -----
> From: "Visontay Peter" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, April 19, 2002 7:43 PM
> Subject: [PHP] PHP @ 24-hour programming competition
> 
> 
> > Hi!
> >
> > I have quite an unusual problem for you :) There will be a 24-hour
> > programming competition at our university, where teams of 3 have one
> > day to solve a complex problem (which will be revealed on the day
> > of the competition). Teams cannot get help from "outside", so no
outward
> > network / phone communication is available, but you can use anything
you
> > take there with you (any development tools, books, pre-written
software
> > etc.)
> >
> > The language in which you write the software is up to you, the most
> > popular choices being C++ and Java - but this year our team are
going
> > to use PHP (and PHP-GTK).
> >
> > The big question is: will PHP be enough for the whole project, or
will
> > we need something else (like external C/Java modules)?
> > Last year the task was to write an artificially intelligent soccer
game
> > based on a client-server architecture: there was a server acting
like
> > some kind of game controller (referee) and 2D display screen, while
> > the automated clients (players) were playing individually according
> > to the game's rules and some simulated information on what they
'see'
> > at the time.
> >
> > It's said that it will be something quite different this year -
> > but required knowledge includes:
> > algorithm theory, information and code theory, artificial
intelligence,
> > queuing, databases, client-server architectures, computer networks,
> > control theory, 2D graphic programming and software ergonomy.
> > All this in 24 hours - nice, eh? :)
> >
> > So the question again - are there any parts of all this where you
think
> > PHP will not be enough? (Apart from the graphics, for which we'll
use
> > PHP-GTK). If so, what kind of outside module integration do you
> > recommend for us?
> > Also, which PHP sites / resources / code libraries do you think we
should
> > (recursively) download which might help us a lot? (Apart from
php.net,
> > of course.)
> >
> > We're really interested in your opinions - is this feasible or
> > are we just plain mad? :)
> >
> > Thanks,
> > Peter Visontay
> > http://prodigycenter.com/cv/
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


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

The problem with PHP is that it would be a limited Mailing List. 

Imagine having a database of 100.000 subscribers (as my previous company
had 600.000). Can you handle it with PHP? We used Ezmlm. Over night, on
different server that seats away from our main bandwidth hub, with
limited bandwidth usage and it was doing it's work every Sunday Night.

PHP won't work easily because it is generally activated via browser. So,
the maximum amount of subscribers you can handle with the list written
entirely in PHP would be something like 1-4.000 or so still waiting for
a while to finish sending. It could be useful still, but I think it is
rather more painful than useful to you and your user.

I have once started such project followed by your very ideas: "no such
software in PHP - Let's write one!!!" But then, I got discouraged just
as I thought about it deeper. Look at Source-Forge for RealList - that
is my tentative (if you'll find it though).

A good extended interface to ezmlm could be a good idea though. I don't
like the one they have now.


Summary:
Whatever you write in PHP regarding emails, unless you connect it to
other languages like Ruby, Perl or Python that can run it in background
(consider PHP-GTK as well, still more than just PHP) your list will only
handle a small amount of subscribers and, not automatically (unless user
has the access to server what would also mean he can install something
other than your ML).

My 0.02 EuroCents.


Disclaimer:
Please note that I wasn't trying to be extra-precise here, so don't pick
on the words. The idea of this was rather important to explain.


 Sincerely,

Maxim Maletsky
Founder, Chief Developer
[EMAIL PROTECTED]

PHPBeginner.com (Where PHP Begins)
www.phpbeginner.com




> -----Original Message-----
> From: Randum Ian [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, April 21, 2002 9:38 PM
> To: PHP
> Subject: [PHP] phpLISTMAN
> 
> Hi there,
> 
> I am trying to find a Mailing List Manager on the net that is written
in PHP
> that access a database of emails, and other information, in order to
manage
> and maintain a list of subscribers.
> 
> I have now decided to write my own, both to fill a possible niche in
the PHP
> code world, and also to further my understanding of PHP. I am asking
your
> help in providing me with a list of things that need to implemented
into
> this code in order to provide something that people want to use. I am
> willing to make this code widely available to who ever wants it, and
> eventually code something that will be useable by other people in the
PHP
> world.
> 
> I have thought of the following, and if people could suggest/add to
this
> list I would greatly appreciate it!
> 
> Control Panel
> -Add User
> -Delete User
> -Validate Email
> -Send Mail (HTML/Text)
> -Archive Mail
> 
> HTML Generator
> -Subscription Box
> -Unsubscribe Box
> -Statistics
> 
> Can anybody help me with this project codenamed "phpLISTMAN"???
> 
> Kind Regards, Ian.
> ---
> Randum Ian
> DJ / Reviewer / Webmaster, DancePortal (UK) Limited
> [EMAIL PROTECTED]
> http://www.danceportal.co.uk
> DancePortal.co.uk - Global dance music media
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
I prefer the following:

function doThing()
{
        strFoo = 'bar';
}

nice and tidy.

at the end of the day, as long as code is commented, consistant in layout
style, and works... that's enough.  aint it?

 .b

> -----Original Message-----
> From: Frank [mailto:[EMAIL PROTECTED]]
> Sent: 21 April 2002 02:52
> To: [EMAIL PROTECTED]
> Subject: [PHP] Better standards in PHP-coding
>
>
>
> "The nice thing about standards is that there are so many to
> choose between".
>
> Subject: Uses of block markers in coding
>
> GNU recommends a standard with block-markers aligned under each
> other and a
> number of people - including myself - find it senseless and
> counter-progressive to keep up an older standard resting from old
> days and
> doing the programmer a disfavor.
>
> Too many programmers continue to use a style that originates back to the
> days where dumb terminals with one-line memory and line-editors
> was common.
>
> Those days it could take long time to submit a line to the mainframe. I
> have tried it myself and in worst-case situations it could take
> up to half
> a minute to submit a line.
>
> So naturally we put more things into one line. Statements like
>
> if (tempratureM1>=tempratureSTP) {cout << "Warning! Cooling needed";
> log(tempratureM1, "Warning);};
>
> all in one line.
>
> When editors became a little faster people started to write:
>
> if (tempratureM1>=tempratureSTP)  {
>    cout << "Warning! Cooling needed"; log(tempratureM1, "Warning); }
>
> which is nicer to look at but would take many seconds more as one
> more line
> has to be submitted.
>
> - - -
>
> Nowadays few people have any problems with waiting for a CR.
>
> But for mysterious reasons a rest from the old forced "standard" remains
> among people who use C(++) like languages.
>
> It is still standard to write
>
> if (some_expression) {
>    statements;
>    ...
> }
>
> What the "{" - the marking of the beginning of a block that should be
> indented - is doing in the end of the line nobody has yet been able to
> explain me.
>
> Why, then, are functions not written as
>
> function foo(parameter1, foo(parameter1, parameter2, ... parameterN) {
>   statements
>   ...
> }
>
> ?
>
> In other block-structured languages you of course align
> block-markers under
> each other, allowing for easy scan.
>
> if expression
> begin
>    statement;
>    ...
>    ...
> end;
>
> I have yet to see anybody write
>
> if expression begin
>    statement;
>    ...
>    ...
> end;
>
> - - -
>
> Does it matter? Oh, yes it does. A lot. As teacher I know from experience
> that programmers has a harder time tracking their own block with a number
> of "{"s dancing far out of sight in the right side of the screen. This is
> not a matter of experience. No experience can ever make it
> equally fast to
> control structures based on vertically aligned block-markers contra those
> where the marker can be found anywhere on a line.
>
> As an amusing result of the weird practice it has been necessary to
> recommend a standard where the { }-pair is always used, even though there
> is only one statement following an if:
>
> if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114) {
>    oneStatement;
> }
>
> instead of simply
>
> if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)
>    oneStatement;
>
>
> Why the need for the extra "{ }"s?
>
> Of course because the the difference between
>
> if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)
>    oneStatement;
>
> (correct) and
>
> if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)  {
>    oneStatement;
>
> (wrong) is easily overlooked because of the block marker put away
> to the right!
>
>
> But nobody overlooks the difference betweeen
>
> if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)
>    oneStatement;
>
> and
>
> if ($myvarirable1*myvariable2 >= myvariable3*myvariable4+114)
>    {
>    oneStatement;
>
>
> where the missing "}" shines in the eyes.
>
> - - -
>
> We can only hope that some major standard-setters for PHP should make a
> rational decision about what standard to choose and not just keep
> "what we
> are used to" for the disadvantage of future generations of programmers.
>
> http://www.gnu.org/prep/standards.htm
> http://cs.nmhu.edu/personal/curtis/cs1htmlfiles/essentialssec6.htm
>
>
> Best regards
>
> SFM
> U5com Co Ltd.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
(Just got back from the weekend)

Just my 2c worth

IMHO, as long as the code is indented "properly", it doesn't matter where
the braces are, just be consistant. Personally, I prefer to put the opening
brace on a new line, but I can just as easily read other people's code when
the opening brace is on the same line (as long as it's indented properly).

As for indenting - I prefer using spaces and this ensures that my code will
look the same in someone else's editor as it does in mine. There are people
here, in the company, that use tabs and have set their tabs to be 4 spaces,
I have my tabs set to 8 spaces - really plays havoc when they indent quite a
distant :(

Also, with one line statements, I prefer to place it on the same line as the
statement that requires it (ie, function, if/else, while, do, etc). But,
again, as long as the coder is constant, I find it just as readable when the
statement is on a new line, surrounded by braces or not.

So what I'm basically saying is - choose a style that suits you, and be
_consistant_ with it - oh, and make sure you indent your code, there's
nothing worse than trying to read code that's not indented, or indented all
over the place!

Martin


-----Original Message-----
From: Tom Rogers [mailto:[EMAIL PROTECTED]]
Sent: Sunday, April 21, 2002 9:10 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Better standards in PHP-coding


Hi
I like the following form, not sure how much time gets wasted in parsing 
but it's easy > for me < to follow :)

while(something):
         if(something else):
                 yada;
         else:
                 forget it;
         endif;
endwhile;

Tom


At 11:51 AM 21/04/2002, Frank wrote:

>"The nice thing about standards is that there are so many to choose
between".
>
>Subject: Uses of block markers in coding
snip


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
> From: Martin Towell [mailto:[EMAIL PROTECTED]]

<snip>

> So what I'm basically saying is - choose a style that suits you, and be
> _consistant_ with it - oh, and make sure you indent your code, there's
> nothing worse than trying to read code that's not indented, or 
> indented all
> over the place!
> 
> Martin

hear, hear!

 .b
--- End Message ---
--- Begin Message ---

I think standardization within the company is what important.

I prefer tabs because when I have to delete a part of the line, I just
hit back button once - not four times.

But anyhow, programming style is the personal preference for every
programmer. There recommendations and team-wise standards, but that has
nothing to do with the general idea.


Sincerely,

Maxim Maletsky
Founder, Chief Developer
[EMAIL PROTECTED]

PHPBeginner.com (Where PHP Begins)
www.phpbeginner.com




> -----Original Message-----
> From: Martin Towell [mailto:[EMAIL PROTECTED]]
> Sent: Monday, April 22, 2002 1:57 AM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] Better standards in PHP-coding
> 
> (Just got back from the weekend)
> 
> Just my 2c worth
> 
> IMHO, as long as the code is indented "properly", it doesn't matter
where
> the braces are, just be consistant. Personally, I prefer to put the
opening
> brace on a new line, but I can just as easily read other people's code
when
> the opening brace is on the same line (as long as it's indented
properly).
> 
> As for indenting - I prefer using spaces and this ensures that my code
will
> look the same in someone else's editor as it does in mine. There are
people
> here, in the company, that use tabs and have set their tabs to be 4
spaces,
> I have my tabs set to 8 spaces - really plays havoc when they indent
quite a
> distant :(
> 
> Also, with one line statements, I prefer to place it on the same line
as the
> statement that requires it (ie, function, if/else, while, do, etc).
But,
> again, as long as the coder is constant, I find it just as readable
when the
> statement is on a new line, surrounded by braces or not.
> 
> So what I'm basically saying is - choose a style that suits you, and
be
> _consistant_ with it - oh, and make sure you indent your code, there's
> nothing worse than trying to read code that's not indented, or
indented all
> over the place!
> 
> Martin
> 
> 
> -----Original Message-----
> From: Tom Rogers [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, April 21, 2002 9:10 PM
> To: [EMAIL PROTECTED]
> Subject: Re: [PHP] Better standards in PHP-coding
> 
> 
> Hi
> I like the following form, not sure how much time gets wasted in
parsing
> but it's easy > for me < to follow :)
> 
> while(something):
>          if(something else):
>                  yada;
>          else:
>                  forget it;
>          endif;
> endwhile;
> 
> Tom
> 
> 
> At 11:51 AM 21/04/2002, Frank wrote:
> 
> >"The nice thing about standards is that there are so many to choose
> between".
> >
> >Subject: Uses of block markers in coding
> snip
> 
> 
> --
> 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


--- End Message ---
--- Begin Message ---
On Monday 22 April 2002 08:07, Maxim Maletsky wrote:
> I think standardization within the company is what important.
>
> I prefer tabs because when I have to delete a part of the line, I just
> hit back button once - not four times.

I prefer an editor which allows me to tab using spaces and to delete the 
appropriate number of spaces when backspacing :)

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

/*
Logic is the chastity belt of the mind!
*/
--- End Message ---
--- Begin Message ---
if (!eregi("^[[:alpha:]]$", $HTTP_POST_VARS["vpis_ime"]))
  echo "wrong char";

why does this always return "wrong char" no matter what value is in vpis_ime
... i tried "blah", "242234" "bla242h" .. every single time i get "wrong
char". im using PHP 4.1.2

basicly is what i want is to check string if it contains only charaters from
a to z and chars _ - [ ] . Can somebody write me a working function ?

thx in advance


--- End Message ---
--- Begin Message ---
Try:

if (!eregi('^[a-z_\-]{0,}$', $_POST['vpis_ime']))
  echo "wrong char";

That'll sort it for everything except [ and ], which I can't find any way of
checking for :-( Anyone else have any ideas?

HTH anyway.

Danny.

----- Original Message -----
From: "Gregor Jaksa" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 22, 2002 1:04 AM
Subject: [PHP] eregi() problem


> if (!eregi("^[[:alpha:]]$", $HTTP_POST_VARS["vpis_ime"]))
>   echo "wrong char";
>
> why does this always return "wrong char" no matter what value is in
vpis_ime
> ... i tried "blah", "242234" "bla242h" .. every single time i get "wrong
> char". im using PHP 4.1.2
>
> basicly is what i want is to check string if it contains only charaters
from
> a to z and chars _ - [ ] . Can somebody write me a working function ?
>
> thx in advance

--- End Message ---
--- Begin Message ---
On Mon, 22 Apr 2002, Gregor Jaksa wrote:
> if (!eregi("^[[:alpha:]]$", $HTTP_POST_VARS["vpis_ime"]))
>   echo "wrong char";
> 
> why does this always return "wrong char" no matter what value is in vpis_ime
> ... i tried "blah", "242234" "bla242h" .. every single time i get "wrong
> char". im using PHP 4.1.2

The only thing that will match that regex is a single alpha character.

Try "^[[:alpha:]]+$" (I added a plus) to match one or more.

miguel

--- End Message ---
--- Begin Message ---
Hey PHP General List,

  Im using PHPTriad as webserver. And i am having some problems. It
  goes ok but sometimes after mutch requests. server freezes nobody
  can access it until i restart apache. What could be wrong? Well i
  have cam page that refreshes every 5 seconds it shows my cam. Maybe
  that makes too mutch requests. Any suggestions? thanks

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

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

--- End Message ---
--- Begin Message ---
Hey guys,
i'm trying to write a  script that gets a path for a pic from mysql and then 
shows the picture.
so i added the data in teh database like so $server_path/pics/pic001.jpg and 
then when i get the final oputput the HTML says:
<img src=$server_path/pics/pic001.jpg> and it won't show the picture, is this 
because i'm using Mozilla 0.9.9 or is it from something else?

Jule
-- 
Jule Slootbeek
[EMAIL PROTECTED]
http://blindtheory.cjb.net
--- End Message ---
--- Begin Message ---
Well, you should first ask yourself if the SRC value is correct - and 
apparently it isn't, if that's indeed it. You should make sure you get 
$server_path parsed by PHP. OTOH, why $server_path? HTML uses "/" as the 
"document root", you don't need that. IOW, you should remove 
$server_path altogether and see if it works - it should.

HTH

Bogdan

Jule Slootbeek wrote:

>Hey guys,
>i'm trying to write a  script that gets a path for a pic from mysql and then 
>shows the picture.
>so i added the data in teh database like so $server_path/pics/pic001.jpg and 
>then when i get the final oputput the HTML says:
><img src=$server_path/pics/pic001.jpg> and it won't show the picture, is this 
>because i'm using Mozilla 0.9.9 or is it from something else?
>
>Jule
>



--- End Message ---
--- Begin Message ---
(re-post into php.general)

I think this is an Apache question more than PHP, but I'll give it a
whirl.

Aside from the new apache_setenv in 4.2RC3+ (and I haven't tried), is
there a way to set $REMOTE_USER from PHP?

Let me explain:

I have an external (ie, custom) authentication process (hate basic auth)
but I want the web logs to reflect the user visits (ie, I think from
memory REMOTE_USER is the var that gets logged)

In any case, after authentication, I'd like to set $REMOTE_USER and fool
Apache into thinking that it's done a basic auth and will now log users
as per basic auth.

I've worked on an iPlanet server that's achieved this, but not without a
custom built NSAPI module (in this case would be Apache API)

I know it's pretty specific but if you can help at all I'd appreciate
it... My next step is hacking out an apache module, but that's a..
ahh... not so preferred approach ;-)

Regds,
Sek-Mun
<<<
Sek-Mun Wong
Connecting Space
Sydney, Australia



--- End Message ---
--- Begin Message ---
Hey all, 
I was just wondering if someone's written a script that will let me send lots of 
emails to an address, but with a small pause inbetween emails.

And no I'm not using this for spam, I need to test a SMTP server that I'm developing.

Thanks for your help!
--- End Message ---
--- Begin Message ---
How about something like this.....

<?

$Total_emails = 100;
$i = 1;

if($Total_emails != $i){
// send email code

$i++;
}

?>

This should be all you need.  I used something similar to crash my work's 
email system by accident.  :)  Whoops.

CDitty

At 12:40 PM 4/22/2002 +1000, Liam MacKenzie wrote:
>Hey all,
>I was just wondering if someone's written a script that will let me send 
>lots of emails to an address, but with a small pause inbetween emails.
>
>And no I'm not using this for spam, I need to test a SMTP server that I'm 
>developing.
>
>Thanks for your help!

--- End Message ---
--- Begin Message ---
I'd recommend this script with a few changes.

<?

$Emails = array(<Get your list of emails into the array somehow>);

for($i=0; $i<count($Emails); $i++) {
        // send email code
        usleep(<delay in microseconds>);
}

?>

Matthew Walker
Senior Software Engineer
ePliant Marketing
 

-----Original Message-----
From: CDitty [mailto:[EMAIL PROTECTED]] 
Sent: Sunday, April 21, 2002 8:47 PM
To: Liam MacKenzie; PHP
Subject: Re: [PHP] Mass Mail {?!}

How about something like this.....

<?

$Total_emails = 100;
$i = 1;

if($Total_emails != $i){
// send email code

$i++;
}

?>

This should be all you need.  I used something similar to crash my
work's 
email system by accident.  :)  Whoops.

CDitty

At 12:40 PM 4/22/2002 +1000, Liam MacKenzie wrote:
>Hey all,
>I was just wondering if someone's written a script that will let me
send 
>lots of emails to an address, but with a small pause inbetween emails.
>
>And no I'm not using this for spam, I need to test a SMTP server that
I'm 
>developing.
>
>Thanks for your help!


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



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.345 / Virus Database: 193 - Release Date: 4/9/2002
 
--- End Message ---
--- Begin Message ---
Hello,

Liam Mackenzie wrote:
> 
> Hey all,
> I was just wondering if someone's written a script that will let me send lots of 
>emails to an address, but with a small pause inbetween emails.
> 
> And no I'm not using this for spam, I need to test a SMTP server that I'm developing.

You may want to try this class:

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

Anyway, why are you writing a new SMTP server? I mean what would it
provide that no other SMTP server provides? Does it send personalized
mass-mailing messages?

Regards
Manuel Lemos

--- End Message ---
--- Begin Message ---
I am using header function to redirect browser.

{  header("Location: http://www.XXX.edu/index.php";);
  exit;}

Although it can redirect the browser but variable had not pass to next page.

So can anyone teach me how to pass variable and redirect browser at same
time?

Thx !

Joe


--- End Message ---
--- Begin Message ---
On Monday 22 April 2002 10:46, Joe wrote:
> I am using header function to redirect browser.
>
> {  header("Location: http://www.XXX.edu/index.php";);
>   exit;}
>
> Although it can redirect the browser but variable had not pass to next
> page.
>
> So can anyone teach me how to pass variable and redirect browser at same
> time?

The easiest way is to pass the variables along with the url:

  header("Location: http://www.XXX.edu/index.php?var1=doo&var2=dah";

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

/*
May you have many beautiful and obedient daughters.
*/
--- End Message ---
--- Begin Message ---
{  header("Location: http://www.XXX.edu/index.php?variable=$variable";);
  exit;}

"Joe" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am using header function to redirect browser.
>
> {  header("Location: http://www.XXX.edu/index.php";);
>   exit;}
>
> Although it can redirect the browser but variable had not pass to next
page.
>
> So can anyone teach me how to pass variable and redirect browser at same
> time?
>
> Thx !
>
> Joe
>
>


--- End Message ---
--- Begin Message ---
> {  header("Location:
http://www.XXX.edu/index.php?variable=$variable&second_variable=$second_vari
able");
>   exit;}
You'll get to transfer about 255 characters using this method.
hugh
----- Original Message -----
From: "Adrian Ciutureanu" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Sunday, April 21, 2002 11:06 PM
Subject: [PHP] Re: [HELP] redirect browser & pass variable !


> {  header("Location: http://www.XXX.edu/index.php?variable=$variable";);
>   exit;}
>
> "Joe" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > I am using header function to redirect browser.
> >
> > {  header("Location: http://www.XXX.edu/index.php";);
> >   exit;}
> >
> > Although it can redirect the browser but variable had not pass to next
> page.
> >
> > So can anyone teach me how to pass variable and redirect browser at same
> > time?
> >
> > Thx !
> >
> > Joe
> >
> >
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

--- End Message ---
--- Begin Message ---
I can do it now.....
Thanks all of you !

Joe

"Hugh Danaher" <[EMAIL PROTECTED]>
???????:000b01c1e9c5$02ccf460$[EMAIL PROTECTED]
> > {  header("Location:
>
http://www.XXX.edu/index.php?variable=$variable&second_variable=$second_vari
> able");
> >   exit;}
> You'll get to transfer about 255 characters using this method.
> hugh
> ----- Original Message -----
> From: "Adrian Ciutureanu" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Sunday, April 21, 2002 11:06 PM
> Subject: [PHP] Re: [HELP] redirect browser & pass variable !
>
>
> > {  header("Location: http://www.XXX.edu/index.php?variable=$variable";);
> >   exit;}
> >
> > "Joe" <[EMAIL PROTECTED]> wrote in message
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > > I am using header function to redirect browser.
> > >
> > > {  header("Location: http://www.XXX.edu/index.php";);
> > >   exit;}
> > >
> > > Although it can redirect the browser but variable had not pass to next
> > page.
> > >
> > > So can anyone teach me how to pass variable and redirect browser at
same
> > > time?
> > >
> > > Thx !
> > >
> > > Joe
> > >
> > >
> >
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
>


--- End Message ---
--- Begin Message ---
Thank you all,I have solved the problem.
:)
            zhaoxd
----- Original Message ----- 
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, April 19, 2002 7:08 PM
Subject: Re: [PHP] some problems about gd in php


> On Friday 19 April 2002 18:57, zhaoxd wrote:
> > The version of php is php-4.1.2,the latest version,apache-1.3.24,also
> > latest.
>  
> > I have installed gd-1.8.4 in apache server without any problems.To check if
> > the gd can work,I write some codes in php like this:
>  <?
> 
> [snip]
> 
> > Is this a compiling problem?The compiling command of php is:
> 
> > 
> 
> > ./configure --with-mysql=/usr/local/mysql --with-apache=../apache_1.3.24
> > --enable-track-vars --with-gd=../gd-1.8.4 --with-png-dir=../libpng
> > --with-zlib-dir=../zlib
>  
> 
> 1) If this was a recompile:
>  a) Presumably there were no errors during configure/make/install?
>  b) Did you restart the webserver? 
> 
> 2) What do you get using phpinfo()?
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> 
> /*
> Nice guys finish last.
> -- Leo Durocher
> */
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 
--- End Message ---
--- Begin Message ---
On Monday 22 April 2002 10:54, zhaoxd wrote:
> Thank you all,I have solved the problem.

What fixed the problem then?

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

/*
"There was no difference between the behavior of a god and the operations of
pure chance..."
-- Thomas Pynchon, _Gravity's Rainbow_
*/
--- End Message ---
--- Begin Message ---
recompile php from scratch.
: P
                            zhaoxd
----- Original Message ----- 
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 22, 2002 12:51 PM
Subject: Re: [PHP] some problems about gd in php


> On Monday 22 April 2002 10:54, zhaoxd wrote:
> > Thank you all,I have solved the problem.
> 
> 
> What fixed the problem then?
> 
> -- 
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
> 
> /*
> "There was no difference between the behavior of a god and the operations of
> pure chance..."
> -- Thomas Pynchon, _Gravity's Rainbow_
> */
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 


--- End Message ---
--- Begin Message ---
On Monday 22 April 2002 13:02, zhaoxd wrote:
> recompile php from scratch.

I should've suggest that earlier. When I had to recompile PHP with support 
for gd, ttf, png etc I had the same problem which was only solved by doing a 
clean installation. Now whenever I recompile, I do it from scratch.

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

/*
One family builds a wall, two families enjoy it.
*/
--- End Message ---
--- Begin Message ---
Greetings.  As thanks to all the great folks within the PHP community, I've
setup a free web based forum (no annoying advertising pop ups) based on what
else,  a php web based forum package.  I hope you find it useful.  Our way
of saying thanks for all the great help we've had from here.  It's one of
the few communities of folks that are truely helpful and the response time
has amazed me!  It's no wonder that PHP is taking the Internet by storm!
I'm taking my first sit down instructor led course in PHP in June, counting
the days!  http://www.opensourcehosting.com/phpBB2/index.php?c=5  Enjoy and
let me know what you'd like to see in the way of additional forums under
this General Category.


Best regards,

Jim Hankins




--- End Message ---
--- Begin Message ---
Hello:
    I've just discovered this php product

   http://dev.4arrow.com

And I would like to know if anyone is using it and his/her opinion.

Best Regards.
----------------------------------------------------
QaDRAM Studio, RAD Development for the WEB
http://studio.qadram.com

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

I have to interface an MSAccess database and Apache server on a linux
box thru PHP. The only way I found to do that is to use ODBC with some
specific drivers (I tried Openlink). This solution needs sort of server
running on a Windows station, it serves requests to the Access database
file.

The problem is that I would like to do this WITHOUT any Windows station,
to achieve good reliability (we can't have a Windows station running
just for that). Also the database can't be ported to any other format
because there are some programs written in VB-Access that need it as is.

So what I need is sort of sql driver for accessing mdb files on a
unix/linux box. Does-it exist? I searched a lot on the web but with no
succes.

Any suggestions are welcome
Thanx in advance

Some details:
- The Access database file (mdb) is located on a Unix box in a shared
folder

Tom

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


"Sp" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I am trying to validate my input with ereg but I get the error "Warning:
> REG_BADBR" when I try over 255 characters.  Is there anyway around this?
>
> Works
> =====
> if(eregi('^[A-Za-z]{1,255}$', "test sentence"))
>   echo "valid input";
>
> Doesn't Work
> ============
> if(eregi('^[A-Za-z]{1,256}$', "test sentence"))
>   echo "valid input";


First off, you're using eregi (case insensitive), but defining a-zA-Z (a
through z, case insensitive) in your characters class. You could just use
ereg and leave the character class as it is, or drop the A-Z from the eregi
version.

Secondly, I'd amend your code to:
^[a-z]+$

And thirdly, I'd just use a combination of ereg / preg_* functions and
strlen.

if(preg_match("/^[a-z]+$/i", $string) && strlen($string) < 255)
{
    echo "Whatever.";
}

I'm not sure why you're getting that error, but then again, I haven't
bothered reading up about it :)

James


--- End Message ---
--- Begin Message ---
> this is a problem of IE, not of PHP.

Year, but since I controll IE with PHP, I thought someone has a
php-workaround.

Martin

--- End Message ---
--- Begin Message ---
On Monday 22 April 2002 16:39, Martin Thoma wrote:
> > this is a problem of IE, not of PHP.
>
> Year, but since I controll IE with PHP, I thought someone has a
> php-workaround.

You don't control IE, MS does.

Some versions of IE insist on trying to display the file regardless of what 
the headers tell it to do, and regardless of whether or not it has the plugin 
to display such a file. It's a bug which seems to have been fixed, then 
broken, then fixed, then broken, ...!

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

/*
To add insult to injury.
                -- Phaedrus
*/
--- End Message ---
--- Begin Message ---
I get the "PHP Fatal error:  Allowed memory size of N bytes exhausted" and I
want to check free memory at some point in a script. How can I do that?


--- End Message ---
--- Begin Message ---
On Monday 22 April 2002 02:33, Jason Soza wrote:
> Hmm... Okay, I used this script I found on hotscripts - it copies the
> entire file to the specified directory:
>
>       echo "<p><center>Trying to upload to: "
>          . $upload_path . $filename . "</center></p>\n";
>
>       if ( file_exists($upload_path.$filename) ) {
>          echo "<p><font color='red'><center>"
>             . $message["fileexists"]."</font></center></p>";
>
>       } else {
>          if( move_uploaded_file($HTTP_POST_FILES['userfile']['tmp_name'],
>                    $upload_path.$filename) ) {
>             echo "<p><center>" . $message["complete"]."</center></p>";
>          } else {
>             echo "<p><font color='red'><center>"
>                . $message["incomplete"]."</font></center></p>";
>          }
>
> Now why would this work but the e-mail scripts not?

1) Did *you* write both the php & perl scripts? Just checking, if you wrote 
both, then you might have made the same mistake in both ;-) If they're by 
independent authors then the chances of the same mistake are slightly lower.

2) Just to really confirm that the upload process is not the problem can you 
try sending a local existing file using your scripts?

3) In your scripts I can't see where the attachments (ie the files) gets 
encoded to base64. Have I missed something?

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

/*
Who are you?
*/
--- End Message ---
--- Begin Message ---
On Sun, 21 Apr 2002 00:54:39 +0200, Manuel Lemos wrote:

> Hello,
> 
> Richard Ellerbrock wrote:
>> > If you want to hear experiences of people that tried Metabase, try
>> > asking in Metabase mailing list (
>> > http://groups.yahoo.com/group/metabase-dev/ ) or BinaryCloud mailing
>> > lists ( http://binarycloud.tigris.org/servlets/ProjectMailingListList
>> > ). I think Alex Black (BinaryCloud project leader) has tried both
>> > MySQL and Oracle with Metabase.
>> 
>> I have done MySQL (MyISAM, INNODB), PostgreSQL and Oracle 9i with AdoDB
>> - see http://iptrack.sourceforge.net. Works just fine for me. The
>> hardest part was to get around limitations of certain databases - like
>> Oracle does no support record count. This is not impossible to get
>> around, but
> 
> If you would have used Metabase you would not have that problem because
> Metabase has a function that you may call any time after you execute a
> select query that returns the number of rows contained in the result
> set. That is a standard feature of Metabase that works with every
> database including Oracle.

Please take a moment to also discuss the limitations in between the
marketing hype - this "feature" is also not unique to your class. The
Oracle driver does not support native record count (as do many other
drivers, I forget which ones), so this needs to be emulated. The only way
is to read in the entire result set and emulate record count. This fails
for large result sets - please tell me how you intend doing this with a
couple of million records? This method is also not optimal as you always
land up reading the entire result set even if you do not wish to do so - a
record paging application comes to mind.

The only logical way is to do a select count(*) from table where ..., but
this is not transaction safe. Other alternatives would be to modify your
code not to depend on record count at all - this is what I did.
--- End Message ---
--- Begin Message ---
Hello,

Richard Ellerbrock wrote:
> >> I have done MySQL (MyISAM, INNODB), PostgreSQL and Oracle 9i with AdoDB
> >> - see http://iptrack.sourceforge.net. Works just fine for me. The
> >> hardest part was to get around limitations of certain databases - like
> >> Oracle does no support record count. This is not impossible to get
> >> around, but
> >
> > If you would have used Metabase you would not have that problem because
> > Metabase has a function that you may call any time after you execute a
> > select query that returns the number of rows contained in the result
> > set. That is a standard feature of Metabase that works with every
> > database including Oracle.
> 
> Please take a moment to also discuss the limitations in between the
> marketing hype - this "feature" is also not unique to your class. The

There is absolutely no commercial interests behind Metabase. So there is
no marketing statement and even less hype. Metabase does exactly what is
described because I needed it to do that for my own applications,
especially in the beginning 3 years ago because I wanted to provide
smooth transition between MySQL applications that rely on these features
and databases like Oracle for which these features can be emulated.


> Oracle driver does not support native record count (as do many other
> drivers, I forget which ones), so this needs to be emulated. The only way
> is to read in the entire result set and emulate record count. This fails
> for large result sets - please tell me how you intend doing this with a
> couple of million records? This method is also not optimal as you always

Please tell me when in a Web application you need to read a whole result
set with million rows?


> land up reading the entire result set even if you do not wish to do so - a
> record paging application comes to mind.

If you want to just to read a range of rows of a whole an arbitrary
sized result set, you can use a feature of Metabase that with a single
call made before executing any SELECT query it tells to restrict to a
specified range of rows. It is like MySQL LIMIT except that it works
with all supported databases, including Oracle.

You know, Metabase was specifically though to address Web development
needs. If you look around in other platforms you see that Metabase
provides features that are not provided anywhere else, not even for
Java. Think for instance about sequences...


 
> The only logical way is to do a select count(*) from table where ..., but
> this is not transaction safe. Other alternatives would be to modify your
> code not to depend on record count at all - this is what I did.

Yes, that is the recommended way to do it. That is extensively
recommended in Metabase manual and tutorial.

Still Metabase provides that feature because the large majority of PHP
users comes from a low end database background like MySQL.

Regards,
Manuel Lemos
--- End Message ---
--- Begin Message ---
Hi all,



I'm building a site where customers can store their personal information. I'm thinking 
of storing their creditcardno's also.
Can you give me some general tips with regard to security. What is the way to go here? 

thx. Wilbert

-------------------------
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-------------------------
--- End Message ---
--- Begin Message ---
On Monday 22 April 2002 17:16, Wilbert Enserink wrote:

> I'm building a site where customers can store their personal information.
> I'm thinking of storing their creditcardno's also. Can you give me some
> general tips with regard to security. What is the way to go here?

This has been discussed in some depth within the last month or so. Searching 
the archives for "credit card" should yield some results. You may also want 
to search the php-db archives as well.

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

/*
Let the machine do the dirty work.
                -- "Elements of Programming Style", Kernighan and Ritchie
*/
--- End Message ---
--- Begin Message ---
thx Jason. I found it!
regards!


----- Original Message -----
From: "Jason Wong" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 22, 2002 11:29 AM
Subject: Re: [PHP] security


> On Monday 22 April 2002 17:16, Wilbert Enserink wrote:
>
> > I'm building a site where customers can store their personal
information.
> > I'm thinking of storing their creditcardno's also. Can you give me some
> > general tips with regard to security. What is the way to go here?
>
> This has been discussed in some depth within the last month or so.
Searching
> the archives for "credit card" should yield some results. You may also
want
> to search the php-db archives as well.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Let the machine do the dirty work.
> -- "Elements of Programming Style", Kernighan and Ritchie
> */
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

------------------------- 
Pas de Deux 
Van Mierisstraat 25 
2526 NM Den Haag 
tel 070 4450855 
fax 070 4450852 
http://www.pdd.nl 
[EMAIL PROTECTED] 
-------------------------
--- End Message ---
--- Begin Message ---
Suppose i have a multiple select posted to a script by a form.
now i have to send this array again with a new form to a new
script.
 
How do i do this?
 
thanks
 
berber
--- End Message ---
--- Begin Message ---
On Monday 22 April 2002 11:40 am, Boaz Yahav wrote:
> Suppose i have a multiple select posted to a script by a form.
> now i have to send this array again with a new form to a new
> script.
>  
> How do i do this?
>  
> thanks
>  
> berber


Hi Berber

you could serialize the array into a hidden field on the next form.

matt
--- End Message ---
--- Begin Message ---
Hi all
 
all the links in my page link to not existing html pages.
i redirect the 404 to a php script. when users had disabeled cookies,
i parsed the request_uri for phpsessid and then set 
$HTTP_GET_VARS['PHPSESSID']=the parsed one.
when i after that called session_start(), php was using the id from
$HTTP_GET_VARS['PHPSESSID'].
after upgrade to the latest php version this does not work anymore. i
get a new PHPSESSID on every 
request. is there any way to keep the sessionid with these redirects?
 
*extremecryforhelpsincepageisbrokenfornoncookieusers*
 
Sebastian
 
 
--- End Message ---
--- Begin Message ---
Well, since you fail to mention which versions of PHP you were using before
and after the upgrade it's a little difficult to diagnose your problem.

You should really have checked the change log
(http://www.php.net/ChangeLog-4.php) before upgrading anyway (a lot changed
in the 4.0.x -> 4.1.x releases - including some variable names)

HTH

Danny.

----- Original Message -----
From: "nospam" <[EMAIL PROTECTED]>
To: "'Php-General" <[EMAIL PROTECTED]>
Sent: Monday, April 22, 2002 11:02 AM
Subject: [PHP] need urgent session help, since new php version broke my code


> Hi all
>
> all the links in my page link to not existing html pages.
> i redirect the 404 to a php script. when users had disabeled cookies,
> i parsed the request_uri for phpsessid and then set
> $HTTP_GET_VARS['PHPSESSID']=the parsed one.
> when i after that called session_start(), php was using the id from
> $HTTP_GET_VARS['PHPSESSID'].
> after upgrade to the latest php version this does not work anymore. i
> get a new PHPSESSID on every
> request. is there any way to keep the sessionid with these redirects?
>
> *extremecryforhelpsincepageisbrokenfornoncookieusers*
>
> Sebastian
>
>
>

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

I have a database. It receives from my users files - which could be word 
documents, Adobe PDF files, text docs, anything...

I store these in a BLOB field of the database.

On a certain page, I include a link to these files which have been saved 
into the blob. The link is <a 
href="getattachment.php?Fileid=65)">Document</a>.

Now when people link to this (to go to gatattachment.php?fileid=65) the 
getattachment does the following:

Finds out the attachment mime type

Sends a:

Header("Content-type: <mime-type>");
Header("Header("Content-Disposition: attachment; filename=\"File65.doc\"" );
Stream the contents of the blob to the browser.

Where the Attachment Filename changes depending on the fileid, and the mime 
type (eg. Excel files would be xls)

Now when I click the link, I get garbled content on my browser (no matter 
which browser i use - IE, Konqueror, Opera, etc). If I change the headers 
to echos, teh I get teh correct results.

What am I doing wrong?

Thanks

David R
--- End Message ---
--- Begin Message ---
----- Original Message -----
From: "David Russell" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 22, 2002 11:19 AM
Subject: [PHP] Database and files

> I have a database. It receives from my users files - which could be word
> documents, Adobe PDF files, text docs, anything...
>
> I store these in a BLOB field of the database.
>
If you get multiple requests for files, expect the db to fall over very
quickly - what's wrong with storing them on the filesystem and having a list
of them in the db?

[SNIP]

> Finds out the attachment mime type
>
> Sends a:
>
> Header("Content-type: <mime-type>");
> Header("Header("Content-Disposition: attachment;
filename=\"File65.doc\"" );
> Stream the contents of the blob to the browser.
>
WTF is up with Header("Header(" ??
Surely this should be Header("Content-Disposition: attachment;
filename=\"File65.doc\"" );

Here's how I do it

header("content-type: $mime");
header("content-disposition: attachment; filename=\"$displayName\"");
echo $data;

One thing - note that that the header names and the actual mimetype are in
lower case. Got weird results with anything different.

HTH

Danny

--- End Message ---
--- Begin Message ---
At 12:19 PM +0200 22/4/02, David Russell wrote:

>Header("Header("Content-Disposition: attachment; filename=\"File65.doc\"" );

That's not right. Must be a typo.

Make sure there is no output before the header function calls.

I use:

header("Content-type: application/octet-stream; name=\"$fname\"");
header("Content-Disposition: attachment; filename=\"fname\"");
header("Content-transfer-encoding: binary");

 ...R.
--- End Message ---
--- Begin Message ---
At 11:25 AM +0100 22/4/02, Danny Shepherd wrote:

>If you get multiple requests for files, expect the db to fall over very
>quickly - what's wrong with storing them on the filesystem and having a list
>of them in the db?

If your DB falls over, get a better one. You wouldn't do this with
Access, but MySQL or PostgreSQL will handle this with no problems.

And storing them in the file system requires the web server process to
have write access to the directory in which the files are stored. And
so will any other users on that server. Security nightmare.


>One thing - note that that the header names and the actual mimetype are in
>lower case. Got weird results with anything different.

Interesting tip. I'll try that out on Mac IE which never did download
properly, IIRC.

 ...R.
--- End Message ---
--- Begin Message ---
----- Original Message -----
From: "Richard Archer" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, April 22, 2002 11:40 AM
Subject: Re: [PHP] Database and files


> At 11:25 AM +0100 22/4/02, Danny Shepherd wrote:
>
> >If you get multiple requests for files, expect the db to fall over very
> >quickly - what's wrong with storing them on the filesystem and having a
list
> >of them in the db?
>
> If your DB falls over, get a better one. You wouldn't do this with
> Access, but MySQL or PostgreSQL will handle this with no problems.

I've tried it in MySQL  - it didn't work - after inserting aprox 8Mbs of
data the MySQL server died with a 'server has gone away' message. And more
than 2-3 users symltaneously requesting files of only a few hundred kb
really seemed to kill performance.

> And storing them in the file system requires the web server process to
> have write access to the directory in which the files are stored. And
> so will any other users on that server. Security nightmare.

Having other users on your server is the security mightmare :) If you setup
the webserver to have its own user ('apache' instead of 'nobody') and only
allow the apache user access to those files, that should lessen the problem.

 >One thing - note that that the header names and the actual mimetype are in
> >lower case. Got weird results with anything different.
>
> Interesting tip. I'll try that out on Mac IE which never did download
> properly, IIRC.


--- End Message ---

Reply via email to