Re: [PHP] UK Bank Holidays 2

2004-03-06 Thread Shaun

"Ryan A" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> > Ryan:  Well, that's
> > not a very nice way to treat someone on the list,
> > even if it was the second time
> > you'd seen the question in the same day
> > or even if it was a question that is obviously in the manual.  Some
> > people are just at different proficiencies in their learning process and
> > don't
> > yet know to go to the manual for certain questions.  If we treated
> > every newbie like this, then we
> > wouldn't have people coding in PHP!
>
> Hi _uncle_ Ben,
> I have nothing against newbies or newbie questions even though I may read
> questions like which is the
> best shopping cart, best PHP IDE etc 3+ times in a month, or why
> register_globals are better off or why
> "this code does not work" when its just a semicolon missing...although I
> must say the most frequient seems
> to be then ones where people write to the list without even trying to do a
> single word search on google.
> I too was a newbie and compared to some
> guys on the list I still most certainly am. But when you write a question
> that does not get answered the first
> time round...then retry a bit later is just downright irritating. If the
guy
> wrote some code a bit later on to do
> his "holiday thing" and hit a wall...I and a crapload of people here will
be
> most willing to lend a hand if he needed
> help, theres just gotto be a limit. If the guy thought that the first
> message didnt get through then its cool...but by
> the 2 in the subject.COME ON for petes sake.
> Anyway, you have your view on this so..
>
> Cheers,
> -Ryan

Hi All,

Thank you for your replies. To be perfectly honest I wanted to make my post
look like a repost because the first reply I got seemed rather flippant to
me:

[snip]
Can PHP recognise dates that are UK Bank Holidays?
[/snip]

Yes http://catb.org/~esr/faqs/smart-questions.html

I didn't want to start a posting war - ironic now I know - so I just started
a new thread.

Ryan, I may be getting out of my league here, but if the makers of PHP
didn't care about us here in the UK then why was this function created:
gmmktime();

I know reposting like this is wrong but I was just trying to make a point.

Sorry guys

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



RE: [PHP] Let's start a php-advanced list!

2004-03-06 Thread electroteque

This has come up many times before and I really don't think it will work.
Splitting advanced users from beginners means that there will be nobody to
answer the beginner questions which means they will get posted to the
advanced list where the people with the answers are.  It is a
self-defeating separation.  Having everyone in one big lump means that
both camps and all the camps in between learn from each other.

The other question is who decides what is advanced?  Chances are what you
think is advanced may seem trivial to me, or vice-versa.

I agree totally with rusmus here, sorry but what make you so elite ? Where
here together, i'm sure you came here like myself along time ago as a newby,
do your bit and show your "advanced knowledge" by answering questions. If u
dont want anyone emailing you offlist just say so, dont get a huff about it
later ;)

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



Re: [PHP] UK Bank Holidays 2

2004-03-06 Thread Jason Wong
On Saturday 06 March 2004 16:17, Shaun wrote:

[snip]

> Ryan, I may be getting out of my league here, but if the makers of PHP
> didn't care about us here in the UK then why was this function created:
> gmmktime();

What has *that* got to do with UK users? The fact is that for historical 
reasons all timezones are based off GMT (or UTC). Thus any kind of 'portable' 
timekeeping will have to be based off UTC. For instance the mail that you're 
reading will have it's Date: header expressed with reference to UTC. In short 
having functions that help convert local time to and from UTC is a good 
thing. Don't kid yourself into thinking that gmmktime() is there for UK 
users' sake :-)

> I know reposting like this is wrong but I was just trying to make a point.

Which is? In most cases reposting at such a short time interval will only 
annoy a lot people.

-- 
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
--
/*
The probability of an auto lockout varies directly with the intensity of the 
rain
-- Murphy's Laws of Locksmithing n11
*/

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



Re: [PHP] UK Bank Holidays 2

2004-03-06 Thread Shaun

"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Saturday 06 March 2004 16:17, Shaun wrote:
>
> [snip]
>
> > Ryan, I may be getting out of my league here, but if the makers of PHP
> > didn't care about us here in the UK then why was this function created:
> > gmmktime();
>
> What has *that* got to do with UK users? The fact is that for historical
> reasons all timezones are based off GMT (or UTC). Thus any kind of
'portable'
> timekeeping will have to be based off UTC. For instance the mail that
you're
> reading will have it's Date: header expressed with reference to UTC. In
short
> having functions that help convert local time to and from UTC is a good
> thing. Don't kid yourself into thinking that gmmktime() is there for UK
> users' sake :-)
>
> > I know reposting like this is wrong but I was just trying to make a
point.
>
> Which is? In most cases reposting at such a short time interval will only
> annoy a lot people.
>
> -- 
> 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
> --
> /*
> The probability of an auto lockout varies directly with the intensity of
the
> rain
> -- Murphy's Laws of Locksmithing n11
> */

I think its fairly obvious I am not an advanced PHP programmer. That's why I
said I may be getting out of my league!

I guess the point I was trying to make was that I didn't want to continue
the previous thread.

I can see this is a contentious issue, I wont do it again :)

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



RE: [PHP] UK Bank Holidays 2

2004-03-06 Thread electroteque


> I know reposting like this is wrong but I was just trying to make a point.

Which is? In most cases reposting at such a short time interval will only 
annoy a lot people.

I think it was 4 hours apart, one at 7am another at 11am but still .. google first, 
ask list after.

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



Re: [PHP] UK Bank Holidays 2

2004-03-06 Thread Jason Wong
On Saturday 06 March 2004 17:10, electroteque wrote:

NB Your mail client is severely broken in the quoting department.

> > Which is? In most cases reposting at such a short time interval will only
> > annoy a lot people.
>
> I think it was 4 hours apart, one at 7am another at 11am but still ..
> google first, ask list after.

If you feel the need to repost, wait at least one day. This *is* an 
international list and people *do* live, work and play in different 
timezones.

And in any case reposting the exact same question will still annoy people no 
matter what the time interval. If you do repost try to bring something new to 
the table, some signs that you have been doing some work of your own whilst 
waiting for a response to the earlier post.

Something like ...

I've read the manual, chapter X, section Y and haven't found an answer to my 
problem; 

OR: 

I've googled for "abc xyz" and haven't found anything useful.

OR:

I've tried "this", "that" and "other" and I still couldn't get it to work, 
because I was expecting "something" and got "something else" instead. 

... would hopefully convince people that you really did try to solve the 
problem on your own and only used the list as a last resort and wasn't just 
sitting on your backside, twiddling your thumbs and waiting for someone to do 
your work for you.

-- 
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
--
/*
Insufficient facts always invite danger.
-- Spock, "Space Seed", stardate 3141.9
*/

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



[PHP] Am i dreaming or is the php frontpage broken ?

2004-03-06 Thread electroteque
8:45 pm EST, no content is showing in the middle ?

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



[PHP] Newbie

2004-03-06 Thread Amimu Austin
Hi

I am a newbie in PHP and MySQL. I have developed a web databse using PHP and
MySQL. However , I need more info on these product. Any sites you can
recommend.

Amimu

CAFCA Limited
Zimbabwe


-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.

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



Re: [PHP] undefined index -------- please help !!!!!!!!

2004-03-06 Thread Dominique ANOKRE
on line 66 there is :

$date=$_POST["date"];

Thanks

- Original Message -
From: "Chris W. Parker" <[EMAIL PROTECTED]>
To: "Dominique ANOKRE" <[EMAIL PROTECTED]>; "Php List"
<[EMAIL PROTECTED]>
Sent: Friday, March 05, 2004 8:20 PM
Subject: RE: [PHP] undefined index  please help 


Dominique ANOKRE 
on Friday, March 05, 2004 12:19 PM said:

> Undefined index: numcpte in c:\inetpub\wwwroot\rech_haut.php on line
> 66
>
> For information, i have not this error when the file recherche.php is
> a simple file without frames !!!
>
> Please help!!

what is on line 66!?!?

--
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] when is a PDF not a PDF?

2004-03-06 Thread Rick Fleischer
The simple example from http://www.php.net/pdf (hard-wired to paper.pdf)
just displayed the pdf data as a dump.  I can ftp the file and it's OK.  My
hard-wired version is shown below.

 

// Thanks,
// Rick

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



Re: [PHP] undefined index -------- please help !!!!!!!!

2004-03-06 Thread John Nichel
Dominique ANOKRE wrote:
on line 66 there is :

$date=$_POST["date"];

Thanks
$_POST['date'] isn't set.

if ( isset ( $_POST['date'] ) ) {
$date = $_POST['date'];
}
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] odd, sporatic upload problem ...

2004-03-06 Thread Raditha Dissanayake
Hi,

The most likely reason that one guy can't upload when everyone else can 
is because he is behind a proxy that limits the size of post data. 

Kenn Murrah wrote:

Greetings.

I have an odd (to me) problem  ... from most computers, the upload 
code (shown, in part, below) works just fine  but from at least 
one computer, if the user uploads a small file (under 1meg), it works 
properly . but if he uploads a larger file he gets either a "page not 
found" (Internet Explorer) or "no data" (Netscape) error  other 
users can upload files of any size, with no problem 

Does anyone have any ideas?
The code (though I'm not at all sure it's relevent) is below:
$customer_trimmed = eregi_replace("[^[:alnum:]\.]","",$customer) ;
$customer_shortened = substr($customer_trimmed,0,18);
$customer_trimmed = $customer_shortened;
$folder_name = $customer_trimmed . date("mdyHis");
$old_umask = umask();
mkdir('/home/upco/uploads/' . $folder_name, 0777);
//umask($old_umask);
$dest_dir = '/home/upco/uploads/' . $folder_name;


--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Let's start a php-advanced list!

2004-03-06 Thread Brian V Bonini
On Sat, 2004-03-06 at 01:57, Galen wrote:
> Who runs the php official mailing lists? Can we ask them to start a 
> php-advanced list? Give it a description like "Ready to take you coding 
> to the next level? Got questions about high-level PHP code? This is the 
> list for you." Redirect people asking questions like "What is SQL" and 
> "What's wrong with this code" or "How do I " (which 
> a search in the manual would have found the function to do this) to the 
> php-general list. That would leave our group free to discuss meaty 
> things and really get somewhere.

It should be obvious why this will not work. And, why should this be an
issue? You are free to participate and choose what discussions you want
to be a part of (unless your delete key is broken) as well as discuss
whatever topics you want (OT), advanced, intermediate, or beginner.

SO what's your real point? Are you annoyed by questions that you think
are beneath you or what?
-- 
Brian V Bonini <[EMAIL PROTECTED]>

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



php-general Digest 6 Mar 2004 14:08:01 -0000 Issue 2630

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

php-general Digest 6 Mar 2004 14:08:01 - Issue 2630

Topics (messages 179621 through 179646):

Re: UK Bank Holidays 2
179621 by: Tom Rogers
179625 by: Ben Ramsey
179627 by: Ryan A
179631 by: Shaun
179633 by: Jason Wong
179634 by: Shaun
179635 by: electroteque
179636 by: Jason Wong

Re: FIle Upload problems
179622 by: Andre Cerqueira
179623 by: Brian V Bonini
179624 by: Jason Wong
179644 by: Brian V Bonini

Re: php/mysql run on  Microsoft Personal Web Server 4.0 ?
179626 by: Five

Let's start a php-advanced list!
179628 by: Galen
179629 by: Rasmus Lerdorf
179630 by: Jason Wong
179632 by: electroteque
179646 by: Brian V Bonini

Am i dreaming or is the php frontpage broken ?
179637 by: electroteque

Newbie
179638 by: Amimu Austin
179645 by: Brian V Bonini

Re: undefined index  please help 
179639 by: Dominique ANOKRE
179641 by: John Nichel

when is a PDF not a PDF?
179640 by: Rick Fleischer

Re: odd, sporatic upload problem ...
179642 by: Raditha Dissanayake

How to write this correctly?
179643 by: Labunski

Administrivia:

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

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

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


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

Saturday, March 6, 2004, 12:03:15 PM, you wrote:
TR> Hi,

TR> Saturday, March 6, 2004, 10:39:13 AM, you wrote:
S>> Hi,

S>> How can PHP recognise dates that are UK Bank Holidays?

S>> Thanks for your help


TR> Well first question is:
TR> What are the rules for a bank holiday in the UK
TR> is it  the first monday of a month, after christmas day , new year
TR> etc..

TR> If there is such a rule PHP can usually dig it out. If they are
TR> decided by committee then you are on your own :)

TR> -- 
TR> regards,
TR> Tom


This may help you

http://www.dti.gov.uk/er/bankhol.htm

Probably the best way to tackle this is to store the info in a table
as it looks like it is decided by rules, committee and the Queen

-- 
regards,
Tom
--- End Message ---
--- Begin Message ---
WTF? isnt this the second time today this has appeared on the list?

Dude, other than the people in the UK nobody cares about
UK bank holidays...search google for this query and maybe someone from
there has written something for it..or read the manual a couple of times and
you'll see that the bottom question is a real dumb one.
Ryan:  Well, that's not a very nice way to treat someone on the list, 
even if it was the second time you'd seen the question in the same day 
or even if it was a question that is obviously in the manual.  Some 
people are just at different proficiencies in their learning process and 
don't yet know to go to the manual for certain questions.  If we treated 
every newbie like this, then we wouldn't have people coding in PHP!

Shaun: Consequently, the question was a valid one that the manual could 
not answer, and the short answer is, "no."  PHP does not have an 
intrensic way of telling on what dates UK banking holidays fall (mainly 
because not everyone coding PHP lives in the UK).  You will need to 
write your own function for this.  The easiest way would be to just look 
at a calendar for several years in advance and just plug all the dates 
into an array and test the array to see if today's day is in there.  If 
it is, then today is a banking holiday.

Hope that helps.

--
Regards,
 Ben Ramsey
 http://benramsey.com
 http://www.phpcommunity.org/wiki/People/BenRamsey
--- End Message ---
--- Begin Message ---
> Ryan:  Well, that's
> not a very nice way to treat someone on the list,
> even if it was the second time
> you'd seen the question in the same day
> or even if it was a question that is obviously in the manual.  Some
> people are just at different proficiencies in their learning process and
> don't
> yet know to go to the manual for certain questions.  If we treated
> every newbie like this, then we
> wouldn't have people coding in PHP!

Hi _uncle_ Ben,
I have nothing against newbies or newbie questions even though I may read
questions like which is the
best shopping cart, best PHP IDE etc 3+ times in a month, or why
register_globals are better off or why
"this code does not work" when its just a semicolon missing...although I
must say the most frequient seems
to be then ones where people write to the list without even trying to do a
single word search on google.
I too was a newbie and compared to some
guys on the list I still most certainly am. But when you write a question
that does not get answered the first
time round...then retry a bit later is just downright irritating. If the guy
wrote some code a bit later on to do
his "holiday thing" and hit a wall...I and a crapload of people here will b

Re: [PHP] Newbie

2004-03-06 Thread Brian V Bonini
On Fri, 2004-03-05 at 06:55, Amimu Austin wrote:
> Hi
> 
> I am a newbie in PHP and MySQL. I have developed a web databse using PHP and
> MySQL. However , I need more info on these product. Any sites you can
> recommend.

php.net
mysql.com
-- 
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: FIle Upload problems

2004-03-06 Thread Brian V Bonini
> Do yourself a favour, study the example in the manual, get it working, 
> understand how it works, 

Lighten up Francis, it was 10pm at night after a 14 hour day and 62 hour
week. 

I appreciate the help but can do without the cynicism.


-- 
Brian V Bonini <[EMAIL PROTECTED]>

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



[PHP] How to write this correctly?

2004-03-06 Thread Labunski
// or example I have some link:

About people

// so this function will output the content of people.txt file:

if ($action=="people"){
function output() {
$file = file("data/people.txt");
foreach($file as $value ) {
$output .= "$value";
}
return $output;
}
$content = output();
}else{
error ();
}

// How can I improve this function so, that it will work automaticly with
other links (below) too.

Factories
Beautiful pictures
Zoo
Contact us

P.S.
I have tried to improve If tag and the name of .txt file this way:
if ($action=="$action"){
function output() {
$file = file("data/".$action.".txt");

.. but the syntax is incorrect.
What to do?

Thanks,
Roman

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



Re: [PHP] How to write this correctly?

2004-03-06 Thread Brian V Bonini
On Sat, 2004-03-06 at 08:50, Labunski wrote:
> // or example I have some link:
> 
> About people
> 
> // so this function will output the content of people.txt file:
> 
> if ($action=="people"){
> function output() {
> $file = file("data/people.txt");
> foreach($file as $value ) {
> $output .= "$value";
> }
> return $output;
> }
> $content = output();
> }else{
> error ();
> }
> 
> // How can I improve this function so, that it will work automaticly with
> other links (below) too.
> 
> Factories
> Beautiful pictures
> Zoo
> Contact us
> 
> P.S.
> I have tried to improve If tag and the name of .txt file this way:
> if ($action=="$action"){
> function output() {
> $file = file("data/".$action.".txt");
> 
> .. but the syntax is incorrect.
> What to do?

function output($data_file)
{
$file = file("data/$data_file.txt");

foreach($file as $value ) {
$output .= "$value";
}

return $output;
}


switch($action) {
  case "people":
 output('people');
 break;
  case "industry":
 output('industry');
 break;
  case "art"
 output('art')
 break;
  case "animals":
 output('animal');
 break;
  case "contact":
 output('contact');
 break;
}



-- 
Brian V Bonini <[EMAIL PROTECTED]>

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



Re: [PHP] UK Bank Holidays 2

2004-03-06 Thread Ryan A
Wowee..Now isnt this a nice response with people taking sides and
everything. :-)
Shaun,

> Ryan, I may be getting out of my league here, but if the makers of PHP
> didn't care about us here in the UK then why was this function created:
> gmmktime();

I didnt say they didnt care about you in the UK, or any particular place,
I'm not in the
states (or from there) but from Sweden, read the below part and tell me how
it sounds:

"Hi, anybody know how php calculates Swedish postal holidays?"

The above will get me a couple of replies on reading smart questions or some
asking:
where the  is Sweden?
( :-p maybe..depending on the lists mood)

Now this would get me answers:
Hi,
I have searched the archives and google for a function that lists Swedish
postal holidays,
I found nothing, anybody know if anybody wrote such a function?

(a couple of hours later)

Ok, since you guys didnt answer (or I got smartass answers)
I have noted down all the holidays, put then into an array (or the DB) and
now am
doing this to calcalute it blah blah blah...but the results I am getting is
blah blah blh heres
my code..any ideas on what i am doing wrong?


If you read the above you immd know that the person who wrote the above has
searched
and is trying to solve their problem, not hopeing we will write the code for
you, correct me if
I am wrong (anybody on the list) but the list is for people who have taken
the first step/s and
then need help, there are exceptions of course, like for instance someone
says: "I forgot the
function that does this: (description here) can someone remind me please?"
or "sometime back
(insert topic here) was discussed...I need to use that solution anybody
remember what it was?
I couldnt find it in the archives" etc etc

To block quote Jason Wong:

> And in any case reposting the exact same question will still annoy people
> no
> matter what the time interval. If you do repost try to bring something new
> to
> the table, some signs that you have been doing some work of your own
> whilst
> waiting for a response to the earlier post.

And for the record, I didnt "single you out" the post was just
irritating...the rest of you
who dont agree..thats your opinion..and the rest of you who got pissed at
me...bite me.

Cheers,
-Ryan





On 3/6/2004 10:29:47 AM, Jason Wong ([EMAIL PROTECTED]) wrote:
> On Saturday 06 March 2004 17:10, electroteque wrote:
>
> NB Your mail client is severely broken in the quoting department.
>
> > > Which is? In most cases reposting at such a short time interval will
> only
> > > annoy a lot people.
> >
> > I think it was 4 hours apart, one at 7am another at 11am but still ..
> > google first, ask list after.
>
> If you feel the need to repost, wait at least one day. This *is* an
> international list and people *do* live, work and play in different
> timezones.
>
> And in any case reposting the exact same question will still annoy people
> no
> matter what the time interval. If you do repost try to bring something new
> to
> the table, some signs that you have been doing some work of your own
> whilst
> waiting for a response to the earlier post.
>
> Something like ...
>
> I've read the manual, chapter X, section Y and haven't found an answer to
> my
> problem;
>
> OR:
>
> I've googled for "abc xyz" and haven't found anything useful.
>
> OR:
>
> I've tried "this", "that" and "other" and I still couldn't get it to work,
>
> because I was expecting "something" and got

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



Re: [PHP] Let's start a php-advanced list!

2004-03-06 Thread Ryan A
> This has come up many times before and I really don't think it will work.
> Splitting advanced users from beginners means that there will be nobody to
> answer the beginner questions which means they will get posted to the
> advanced list where the people with the answers are.  It is a
> self-defeating separation.  Having everyone in one big lump means that
> both camps and all the camps in between learn from each other.

>The other question is who decides what is advanced?  Chances are what you
>think is advanced may seem trivial to me, or vice-versa.

>-Rasmus

True, When I started learning PHP one of the guys who answered most of the
questions
for me and a lot of people was Capt John Holmes, now that dude knows a
load of
php (I mean that as a complement). If there was an advanced list he would
probably be
in it and very unlikely that he would also be in the "newbie" list to help
which would have
made my learning curve that much harder. Some other guys who are really
helpful and
advanced are Jason, Chris, Chris, David to name a few..take all of them out
and put them
in the advanced list...and the newbies, not-so-newbies etc will follow just
coz we have no
choice when we run into problems. If only newbies and average knowledge
dudes are in
the "not advance list" it wont work coz the blind leading the blind does not
work.

My $0.2

Cheers,
-Ryan

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



Re: [PHP] UK Bank Holidays 2

2004-03-06 Thread Raditha Dissanayake

And for the record, I didnt "single you out" the post was just
irritating...the rest of you
who dont agree..thats your opinion..and the rest of you who got pissed at
me...bite me.
Cheers,
-Ryan
 

What come all the way from Sri Lanka to Sweden just to bite you? Good 
thing the authors of PHP didn't try to add support for Sri Lankan 
holidays they would have given up on the language. We have 30+ and 
there's no guarantee that if March 6 2004 is a holiday (which in fact it 
is) march 06 2005 will be a holiday too. (Some holidays have a 28 day cycle)

--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Scripts for customer - service provider web available?

2004-03-06 Thread Denis L. Menezes
Hello friends.

I am in a hurry to make a website where suppliers can advertise their
products and services and customers can place their requirements so the
requirements can be matched with the service providers.
Also vistors should be able to seek suppliers and customers.

Can anyone tell me where I could find a ready made scripts program that does
the above?

Thanks
denis

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



[PHP] PHP and Apache Using up all memory

2004-03-06 Thread Juan E Suris
Hi!

I have a problem with PHP and Apache, where Apache uses up a huge amount of memory. 
What happens is that I have a PHP script that creates a file on the fly and sends it 
directly to the broswer (as an attachment, so that the user can save it). The problem 
is that when the file is big and the client download speed is slow, the Apache process 
uses up as much memory as the file size. My guess here is that PHP keeps writing data 
as fast as it can, and Apache caches it in memory until the user can download it all.

Is there any way to avoid this?

My apologies if this is an obvious question.

Thanks,
Juan 

[PHP] Question of Charset

2004-03-06 Thread edwardspl
Dear All,

How to control php ( programms on Linux System ) convert the charset of
unicode from MS-SQL 2000 ?

Very thank for your help !

Edward.

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



[PHP] Changing Default Charset

2004-03-06 Thread Junaid Saeed Uppal
Hello There,

I am on a shared account server ( virtual hosting ) given by my provider. I
want to change my charset that php uses to utf-8 but the default setting is
some other charset. Can I put some local directives in the directory of my
proggie to force php to use charset( UTF-8 ) instead of the regular charset
defined in php.ini


Regards

~uppal

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



Re: [PHP] UK Bank Holidays 2

2004-03-06 Thread Ryan A

On 3/6/2004 5:36:01 PM, Raditha Dissanayake ([EMAIL PROTECTED]) wrote:
> >And for the record, I didnt "single you out" the post was just
> >irritating...the rest of you
> >who dont agree..thats your opinion..and the rest of you who got pissed
> at
> >me...bite me.
> >
> >Cheers,
> >-Ryan
> >
> >
> What come all the way from Sri Lanka to Sweden just to bite you? Good
> thing the authors of PHP
> didn't try to add support for Sri Lankan
> holidays they would have given up on the language. We have 30+ and
> there's
> no guarantee that if March 6 2004 is a holiday (which in fact it
> is) march 06 2005 will be a holiday too. (Some holidays have a 28 day
> cycle)
>
>
> --
> Raditha Dissanayake.

Hey Raditha,
I think you misunderstood what I meant by:

>...the rest of you who dont agree..thats your opinion..the rest of you who
got pissed at me...bite me

No matter, have a nice day.
Cheers,
-Ryan

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



Re: [PHP] Scripts for customer - service provider web available?

2004-03-06 Thread Ryan A
Hey,
I have seen quite a few of these on Hotscripts and other script archive
sites..
they are mostly listed under auctions and classifieds.
Check out hotscripts and after that google if you dont find what you are
looking for.

Cheers,
-Ryan


On 3/6/2004 6:03:20 PM, Denis L. Menezes ([EMAIL PROTECTED]) wrote:
> Hello friends.
>
> I am in a hurry to make a website where suppliers can advertise their
> products and services and customers can place their requirements so the
> requirements can be matched with the service providers.
> Also vistors should be able to seek suppliers and customers.
>
> Can anyone tell me where I could find a ready made scripts program that
> does
> the above?
>
> Thanks
> denis
>
> --
> 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] Let's start a php-advanced list!

2004-03-06 Thread Jason Davidson
I definately agree with Rasmus, seperation will only cuase migration to
the advanced list anyways, you need 'advanced' users helping the
'less-advanced' users.  This is the purpose of the list. 

Jason

Rasmus Lerdorf <[EMAIL PROTECTED]> wrote:
> 
> On Fri, 5 Mar 2004, Galen wrote:
> 
> >  From my earlier post, I've had a number of people email me, on and off
> > list, that there isn't much in the way of an "advanced" php mailing
> > list. It also sounds like at least a few people are quite interested in
> > the possibility.
> >
> > Who runs the php official mailing lists? Can we ask them to start a
> > php-advanced list? Give it a description like "Ready to take you coding
> > to the next level? Got questions about high-level PHP code? This is the
> > list for you." Redirect people asking questions like "What is SQL" and
> > "What's wrong with this code" or "How do I " (which
> > a search in the manual would have found the function to do this) to the
> > php-general list. That would leave our group free to discuss meaty
> > things and really get somewhere.
> >
> > Anybody else interested in this type of list?
> 
> This has come up many times before and I really don't think it will work.
> Splitting advanced users from beginners means that there will be nobody to
> answer the beginner questions which means they will get posted to the
> advanced list where the people with the answers are.  It is a
> self-defeating separation.  Having everyone in one big lump means that
> both camps and all the camps in between learn from each other.
> 
> The other question is who decides what is advanced?  Chances are what you
> think is advanced may seem trivial to me, or vice-versa.
> 
> -Rasmus
> 
> -- 
> 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] How to write this correctly?

2004-03-06 Thread joel boonstra
On Sat, Mar 06, 2004 at 09:34:26AM -0500, Brian V Bonini wrote:
> > What to do?
> 
> function output($data_file)
> {
> $file = file("data/$data_file.txt");
> 
> foreach($file as $value ) {
> $output .= "$value";
> }
> 
> return $output;
> }
> 
> 
> switch($action) {
>   case "people":
>  output('people');
>  break;
>   case "industry":
>  output('industry');
>  break;
>   case "art"
>  output('art')
>  break;
>   case "animals":
>  output('animal');
>  break;
>   case "contact":
>  output('contact');
>  break;
> }

Hrm... why the switch() statement?  I can see the need for validating
user-submitted data, but to make it a little more flexible, maybe
something like this:

   

To add more valid actions, you can just extend the array of valid
actions, rather than adding clauses to the switch statement.

joel

-- 
[ joel boonstra | gospelcom.net ]

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



Re: [PHP] when is a PDF not a PDF?

2004-03-06 Thread Jeff Harris
On Mar 6, 2004, "Rick Fleischer" claimed that:

|The simple example from http://www.php.net/pdf (hard-wired to paper.pdf)
|just displayed the pdf data as a dump.  I can ftp the file and it's OK.  My
|hard-wired version is shown below.
|
|
|
|// Thanks,
|// Rick

IF you're using IE, this might help you:
http://marc.theaimsgroup.com/?l=php-general&m=106001984503131&w=2

HTH
Jeff
-- 
Registered Linux user #304026.   |  52FC 20BD 025A 8C13 5FC6
gpg key: B0890FED|  68C6 9CF9 46C2 B089 0FED
Responses to this message should conform to RFC 1855.
[http://www.faqs.org/rfcs/rfc1855.html]

A: Because it messes up the conversation.
Q: Why is top posting bad?
A: Top posting.
Q: What's the most annoying thing on mailing lists?

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



[PHP] extra breaks in sent out emails

2004-03-06 Thread Scott Taylor
I am entering some text into a webpage, then using $_POST on the next 
page to recieve it.  It then should email the $_POST to an email 
address.  The problem that I am encountering is that I am getting an 
extra line break on every line.

If I enter

a
b
into the textarea (which is the variable through POST) and do a 
character count it only shows 3 - the a, the \n, the b.  Yet in the 
email address it comes out as:

a

b

Why is this?

BTW: I am on a windows computer but the server is a unix server.

Best Regards,

Scott

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


[PHP] Re: extra breaks in sent out emails

2004-03-06 Thread Ben Ramsey
Could you post the code you're using to write your $_POST variable to 
the e-mail message?  I seem to remember coming across a problem like 
this in the past, and I'd like to see your code to see if it jogs my memory.

Thanks.

BTW, it shouldn't have anything to do with the fact that you're entering 
the data into a form from a Windows computer and processing it with a 
script on a UNIX machine.



Scott Taylor wrote:

I am entering some text into a webpage, then using $_POST on the next 
page to recieve it.  It then should email the $_POST to an email 
address.  The problem that I am encountering is that I am getting an 
extra line break on every line.

If I enter

a
b
into the textarea (which is the variable through POST) and do a 
character count it only shows 3 - the a, the \n, the b.  Yet in the 
email address it comes out as:

a

b

Why is this?

BTW: I am on a windows computer but the server is a unix server.

Best Regards,

Scott
--
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] UK Bank Holidays 2

2004-03-06 Thread Ben Ramsey
Ryan A wrote:
Wowee..Now isnt this a nice response with people taking sides and
everything. :-)
Ryan, I want to officially apologize since it appears that I started 
this mess.  To me, it just appeared that you were flaming someone, and 
while perhaps for good cause (since he posted two threads to the list 
about the same topic only a matter of a few hours apart), I just felt it 
was uncalled for on the list.  However, I didn't mean to start a war or 
to act as a sort of police.  So, I'm sorry.

--
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] UK Bank Holidays 2

2004-03-06 Thread Ryan A
> Ryan, I want to officially apologize since it appears that I started
> this mess.  To me, it just appeared that you were flaming someone, and
> while perhaps for good cause (since he posted two threads to the list
> about the same topic only a matter of a few hours apart), I just felt it
> was uncalled for on the list.  However, I
> didn't mean to start a war or
> to act as a sort of police.  So, I'm sorry.

Hey,
Apology not necessary, we help each other out here and like everything in
life there's
a difference of opinion sometimes...among friends, acquaintances,
relationships etc

No offense taken and no hard feelings.

Cheers,
-Ryan

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



[PHP] domain.org/?page=pageName method

2004-03-06 Thread Barýþ
A general thing to do while coding a site is to
include header.php at the top of the file (and
footer.php at the end of file). Another method is to
put these header and footer files together in
index.php and including the desired page between them.
We get the desired page from the query string:
domain.org/?page=pageName
$page = $_GET['pagename'];
include $page.'.php';
Is there any important difference between these two
methods? What can you say about the advanteges or
disadvanteges of one to the other?
Assume that including undesired pages is prohibited. I
mean don't write about page=../../secretpage

Thanks...

__
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] How to write this correctly?

2004-03-06 Thread Brian V Bonini
On Sat, 2004-03-06 at 16:17, joel boonstra wrote:

> Hrm... why the switch() statement?

Ir seemed close to what he already had going.

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



Re: [PHP] Changing Default Charset

2004-03-06 Thread Brian V Bonini
On Sat, 2004-03-06 at 12:19, Junaid Saeed Uppal wrote:
> Hello There,
> 
> I am on a shared account server ( virtual hosting ) given by my provider. I
> want to change my charset that php uses to utf-8 but the default setting is
> some other charset. Can I put some local directives in the directory of my
> proggie to force php to use charset( UTF-8 ) instead of the regular charset
> defined in php.ini


header('Content-type: text/html; charset=UTF-8');


-- 
Brian V Bonini <[EMAIL PROTECTED]>

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



[PHP] Mail fifth parameter

2004-03-06 Thread Enrico Comini


 I have to send a email to a server where is very important the
"Return-Path" to match the identity.

If I use mail("[EMAIL PROTECTED]", "object", $message,"From:
[EMAIL PROTECTED]".
"Reply-To:[EMAIL PROTECTED]"
."Return-Path: [EMAIL PROTECTED]);

I see in the received message that return-path Is not that I want.

I try to use the fifth parameter ( "[EMAIL PROTECTED])  but I am in
safe mode then I see the warning : the fifth parameter is disabled in safe
mode.
There is a workaround for this problem ? safe_mode = on is impossible for
this server !

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



Re: [PHP] Mail fifth parameter

2004-03-06 Thread Jason Davidson
check your logs  sendmail mangles the headers, in particular
return-path.. this is a horrible thing, i had a hell of a time with
almost the same problem.. investigate sendmail.

Jason

"Enrico Comini" <[EMAIL PROTECTED]> wrote:
> 
> 
> 
>  I have to send a email to a server where is very important the
> "Return-Path" to match the identity.
> 
> If I use mail("[EMAIL PROTECTED]", "object", $message,"From:
> [EMAIL PROTECTED]".
> "Reply-To:[EMAIL PROTECTED]"
> ."Return-Path: [EMAIL PROTECTED]);
> 
> I see in the received message that return-path Is not that I want.
> 
> I try to use the fifth parameter ( "[EMAIL PROTECTED])  but I am in
> safe mode then I see the warning : the fifth parameter is disabled in safe
> mode.
> There is a workaround for this problem ? safe_mode = on is impossible for
> this server !
> 
> -- 
> 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] Mail fifth parameter

2004-03-06 Thread Marek Kilimajer
Enrico Comini wrote:
 I have to send a email to a server where is very important the
"Return-Path" to match the identity.
If I use mail("[EMAIL PROTECTED]", "object", $message,"From:
[EMAIL PROTECTED]".
"Reply-To:[EMAIL PROTECTED]"
."Return-Path: [EMAIL PROTECTED]);
I see in the received message that return-path Is not that I want.

I try to use the fifth parameter ( "[EMAIL PROTECTED])  but I am in
safe mode then I see the warning : the fifth parameter is disabled in safe
mode.
There is a workaround for this problem ? safe_mode = on is impossible for
this server !
You need to connect to smtp server (port 25) and send the mail this way. 
There are classes that will help you, e.g. smtp_mail class from 
http://phpclasses.org/mimemessage

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


Re: [PHP] Let's start a php-advanced list!

2004-03-06 Thread Galen
Hello All,

You do make some excellent points. Maybe an advanced list isn't the 
greatest idea. But at least listen to what I had envisioned:

My goal was to provide an area that fosters stretching PHP. Big 
projects, unusual projects, weird hacks... all kinds of advanced stuff. 
I have thought that providing an "advanced" area might make people more 
likely to post stuff like "Look at this..." and provide some intriguing 
discussion and such. Not that it's impossible with php-general, but 
reading 150 posts (or at least the subject) makes it easy for that type 
of thing to get lost.

Obviously, the community doesn't think this is a good idea, and I do 
see validity in many of your points, so I'll drop this topic unless 
someone else wants to pursue it.

-Galen

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


Re: [PHP] Let's start a php-advanced list!

2004-03-06 Thread Jason Davidson
Sounds like you want to have more of a discussion list rather than help
list.. which is not a bad idea, regardless of expertise.

Jason

Galen <[EMAIL PROTECTED]> wrote:
> 
> Hello All,
> 
> You do make some excellent points. Maybe an advanced list isn't the 
> greatest idea. But at least listen to what I had envisioned:
> 
> My goal was to provide an area that fosters stretching PHP. Big 
> projects, unusual projects, weird hacks... all kinds of advanced stuff. 
> I have thought that providing an "advanced" area might make people more 
> likely to post stuff like "Look at this..." and provide some intriguing 
> discussion and such. Not that it's impossible with php-general, but 
> reading 150 posts (or at least the subject) makes it easy for that type 
> of thing to get lost.
> 
> Obviously, the community doesn't think this is a good idea, and I do 
> see validity in many of your points, so I'll drop this topic unless 
> someone else wants to pursue it.
> 
> -Galen
> 
> -- 
> 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] Let's start a php-advanced list!

2004-03-06 Thread Marc Greenstock
Interesting topic,

However I don't necessarily agree that newbie's wont get their question 
answered.

There are a lot of helpfully people out there, a lot of them are 
advanced in their programing but find the satisfaction of helping, or 
mentoring someone into advanced programming who is less advanced. I know 
that when i started I posted messages at phpbuilder in the newbie area. 
I found more often than not I would get a response from someone who 
cared, and would treat a newbie for what he or she is rather than a just 
a plain old idiot.

My point is; yes advanced users would be separated from beginners, but 
most of the questions asked in the beginners list would be answered by 
advanced programmers looking for a bit of 'fuzzy wazzies' :)

Two thumbs up for the idea.

Marc

Ryan A wrote:
This has come up many times before and I really don't think it will work.
Splitting advanced users from beginners means that there will be nobody to
answer the beginner questions which means they will get posted to the
advanced list where the people with the answers are.  It is a
self-defeating separation.  Having everyone in one big lump means that
both camps and all the camps in between learn from each other.


The other question is who decides what is advanced?  Chances are what you
think is advanced may seem trivial to me, or vice-versa.


-Rasmus


True, When I started learning PHP one of the guys who answered most of the
questions
for me and a lot of people was Capt John Holmes, now that dude knows a
load of
php (I mean that as a complement). If there was an advanced list he would
probably be
in it and very unlikely that he would also be in the "newbie" list to help
which would have
made my learning curve that much harder. Some other guys who are really
helpful and
advanced are Jason, Chris, Chris, David to name a few..take all of them out
and put them
in the advanced list...and the newbies, not-so-newbies etc will follow just
coz we have no
choice when we run into problems. If only newbies and average knowledge
dudes are in
the "not advance list" it wont work coz the blind leading the blind does not
work.
My $0.2

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


[PHP] imagecreatejpeg locks php

2004-03-06 Thread kringla
First, some ranting about safe_mode.

Results from ini_get with safe_mode=On
[memory_limit] => Array
(
 [global_value] => 8M
 [local_value] => 8M
 [access] => 7
)
And the manual says:
PHP_INI_ALL - 7 - Entry can be set anywhere
So I figure I have access to change memory_limit?

But when I do that with ini_set("memory_limit", "32M") the memory change 
is ignored. I still have just 8M to play with. If i turn of safe mode, I 
am able to change the memory limit. Please tell me if this is correct 
behaviour or not.

My problem is that i uploaded an image, and when I try 
imagecreatefromjpeg, php dies with a warning about runing out of memory. 
I then turn off safe mode, restart apache which takes very long time, 
hit imagecreatefromjpg; and it then works. But not with 8M in safe_mode.

Is there any method in Linux to monitor the resource usage of 
php+apache. Yes, I have checked with top, ps, procmeter3 and free, but 
all seems fine and dandy. Absolutely normal. So is there some kind of 
'php internal memory usage' measure i can do?

I would like to be able to resize big images without any hangs in php 
after call to imagecreatefromjpeg(...). Is functions in php supposed to 
'stop and hang' the parsing of php-files until apache is restarted when 
they exceed their memory boundaries. I don't think so. Looks to me like 
gd have to do some asertions or something.

So I took some time and make all function calls call-by-reference and 
removed all stupid stuff like $image = adslashes($source_image); that 
allocated new variables (yes,  i still call addslashes...) to lower the 
memory usage. Maybe it did, but I still am unable to resize images 
bigger than 200 kb.

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


[PHP] preg_split - spliting string

2004-03-06 Thread Bambero
Hi
I need to split a string by the: , (comma) separator, but when the comma 
is beetwen ""
it should be skipped.

Ex:
test ts sasa, assas "sasa,asaas" dasdas, da
=> test ts sasa
=> assas "sasa,asaas" dasdas
=> da
Thx
Bambero
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] How to write this correctly?

2004-03-06 Thread Tom Rogers
Hi,

Saturday, March 6, 2004, 11:50:04 PM, you wrote:
L> // or example I have some link:

L> About people

L> // so this function will output the content of people.txt file:

L> if ($action=="people"){
L> function output() {
L> $file = file("data/people.txt");
L> foreach($file as $value ) {
L> $output .= "$value";
L> }
L> return $output;
L> }
L> $content = output();
L> }else{
L> error ();
L> }

L> // How can I improve this function so, that it will work automaticly with
L> other links (below) too.

L> Factories
L> Beautiful pictures
L> Zoo
L> Contact us

L> P.S.
L> I have tried to improve If tag and the name of .txt file this way:
L> if ($action=="$action"){
L> function output() {
L> $file = file("data/".$action.".txt");

L> .. but the syntax is incorrect.
L> What to do?

L> Thanks,
L> Roman


do something like this:

function output($action){
  $output = ''; //if no file we return an empty string
  $fname = 'data/'.$action.'.txt';
  if(file_exists($fname){
$file = file($fname);
foreach($file as $value ) {
  $output .= "$value";
}
  }
  return $output;
}
if(isset($_REQUEST['action'])){
  $out = output($_REQUEST['action']);
}

-- 
regards,
Tom

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



php-general Digest 7 Mar 2004 02:14:35 -0000 Issue 2631

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

php-general Digest 7 Mar 2004 02:14:35 - Issue 2631

Topics (messages 179647 through 179675):

Re: How to write this correctly?
179647 by: Brian V Bonini
179658 by: joel boonstra
179665 by: Brian V Bonini
179675 by: Tom Rogers

Re: UK Bank Holidays 2
179648 by: Ryan A
179650 by: Raditha Dissanayake
179655 by: Ryan A
179662 by: Ben Ramsey
179663 by: Ryan A

Re: Let's start a php-advanced list!
179649 by: Ryan A
179657 by: Jason Davidson
179670 by: Galen
179671 by: Jason Davidson
179672 by: Marc Greenstock

Scripts for customer - service provider web available?
179651 by: Denis L. Menezes
179656 by: Ryan A

PHP and Apache Using up all memory
179652 by: Juan E Suris

Question of Charset
179653 by: edwardspl.ita.org.mo

Changing Default Charset
179654 by: Junaid Saeed Uppal
179666 by: Brian V Bonini

Re: when is a PDF not a PDF?
179659 by: Jeff Harris

extra breaks in sent out emails
179660 by: Scott Taylor
179661 by: Ben Ramsey

domain.org/?page=pageName method
179664 by: Barýþ

Mail fifth parameter
179667 by: Enrico Comini
179668 by: Jason Davidson
179669 by: Marek Kilimajer

imagecreatejpeg locks php
179673 by: kringla

preg_split - spliting string
179674 by: Bambero

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 ---
On Sat, 2004-03-06 at 08:50, Labunski wrote:
> // or example I have some link:
> 
> About people
> 
> // so this function will output the content of people.txt file:
> 
> if ($action=="people"){
> function output() {
> $file = file("data/people.txt");
> foreach($file as $value ) {
> $output .= "$value";
> }
> return $output;
> }
> $content = output();
> }else{
> error ();
> }
> 
> // How can I improve this function so, that it will work automaticly with
> other links (below) too.
> 
> Factories
> Beautiful pictures
> Zoo
> Contact us
> 
> P.S.
> I have tried to improve If tag and the name of .txt file this way:
> if ($action=="$action"){
> function output() {
> $file = file("data/".$action.".txt");
> 
> .. but the syntax is incorrect.
> What to do?

function output($data_file)
{
$file = file("data/$data_file.txt");

foreach($file as $value ) {
$output .= "$value";
}

return $output;
}


switch($action) {
  case "people":
 output('people');
 break;
  case "industry":
 output('industry');
 break;
  case "art"
 output('art')
 break;
  case "animals":
 output('animal');
 break;
  case "contact":
 output('contact');
 break;
}



-- 
Brian V Bonini <[EMAIL PROTECTED]>
--- End Message ---
--- Begin Message ---
On Sat, Mar 06, 2004 at 09:34:26AM -0500, Brian V Bonini wrote:
> > What to do?
> 
> function output($data_file)
> {
> $file = file("data/$data_file.txt");
> 
> foreach($file as $value ) {
> $output .= "$value";
> }
> 
> return $output;
> }
> 
> 
> switch($action) {
>   case "people":
>  output('people');
>  break;
>   case "industry":
>  output('industry');
>  break;
>   case "art"
>  output('art')
>  break;
>   case "animals":
>  output('animal');
>  break;
>   case "contact":
>  output('contact');
>  break;
> }

Hrm... why the switch() statement?  I can see the need for validating
user-submitted data, but to make it a little more flexible, maybe
something like this:

   

To add more valid actions, you can just extend the array of valid
actions, rather than adding clauses to the switch statement.

joel

-- 
[ joel boonstra | gospelcom.net ]
--- End Message ---
--- Begin Message ---
On Sat, 2004-03-06 at 16:17, joel boonstra wrote:

> Hrm... why the switch() statement?

Ir seemed close to what he already had going.
--- End Message ---
--- Begin Message ---
Hi,

Saturday, March 6, 2004, 11:50:04 PM, you wrote:
L> // or example I have some link:

L> About people

L> // so this function will output the content of people.txt file:

L> if ($action=="people"){
L> function output() {
L> $file = file("data/people.txt");
L> foreach($file as $value ) {
L> $output .= "$value";
L> }
L> return $output;
L> }
L> $content = output();
L> }else{
L> error ();
L> }

L> // How can I improve this function so, that it will work automaticly with
L> other links (below) too.

L> Factories
L> Beautiful pictures
L> Zoo
L> Contact us

L> P.S.
L> I have tried to improve If tag and the name of .txt file this way:
L> if ($action=="$action"){
L> function output() {
L> $file = file("data/".$action.".txt");

L> .. but the syntax is incorrect.

[PHP] Need Help in shoppin cart

2004-03-06 Thread New Session
Sir,
I am a web developer, I had made many sites like shooping cart, mangement
leads etc.
 Iam comfortable in PHP as well as in ASP & iam ready to make sites in just
$500.Sites made by me are running successfully and doing great job .I can
make site having following facilities.

 Admin Panel:

 Nice & easy Admin Panel able to make Superuser or subusers.
 Able to log the subusers activites.
 Order management.
 Newsletter management.
 Products management.
 Categories management
 Auto mail generation in case of stock out of order.
 Shipping management.
 Multiples photos for each products.
 CMT management(To dynamically add page later on, or for dynamic contents).
 Bulk Upload(CSV).
 FedEx, Freight, or UPS Shipping
 Sales Tax Integration.
 etc as per client request.

 Front End:

 Nice user friendly Front end with search facility .
 Secure Socket Layer enabled.
 Online linkpoint integration(Credit Card processing).
 Authorization  enabled.
 Drop Down Floating dynamic menus
 Ability to register for fast checkout processing.
 Subscribe for newsletter.
 Product Purchase & Total Shopping cost on every page.
 Ability to track order status
 Auto mail generation on change in order status.
 etc as per client request.

Below are the description of the applications I had made:-

1. The site selling vehicles. It would involve a comprehensive zip search on
dealers within the locality from which a visitor submits   a request. The
concerned dealers would get the request on their corresponding  dash boards
to pursue the leads.The site has a simple backend for adding / modifying /
deleting vehicle categories and descriptions.

2.  The site can help you fulfill your goal of buying or selling your dream
property.

3.  The site is integrated with our online content management tool, thereby
giving the site owner complete control over the content  management.

4.  Site features SSL eCommerce and an interactive JavaScript quote form.

5.  The site has a front end of one page and further access is only
available to their retailers. It consists of a very complex admin panel in
the backend which is capable of Creating accounts for new retailers and fix
a profit % for each retailer. which would  mean that when a retailer logs in
he'd see a price list with the profit % added to the base price. This list
would appear different to  each retailer, as pertaining to his
profile.Administrator can set a different product list for different
retailers. This means that a retailer interested in a particular category/s
of product would only see that category/s and not others. This facilitates
quick order  placement.Administrator has a facility of being notified by
email after each order placement. He can also have generated, various
summary and detailed reports.

6.  The site offers it's wholesale dealers a facility to register with it
and place orders. There is a full fledged backend administration panel
associated with the site, for managing the orders.

7.  The site is a totally back-end driven site. The site admin can create
new links and pages on the fly and populate them from the DB. The admin
panel features an DB import and export tool which is useful to import-export
a large huge amount of data at one go.

8.  The site administrator can send regular preformtted HTML news letters to
the registered clients through the site. The news letters can be fully
customized through a web admin panel.

9.  An online store for great educational products for children. The site
offers a complete online shopping cart capable of accepting payments online.

10.  A shopping cart of artwork. It provides an easy way for art-dealers to
contact various customers.
The site contains variety of categories under which the artworks are
displayed. All payments are via SSL under Linkpoint.


Thanks

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



Re: [PHP] Need Help in shoppin cart

2004-03-06 Thread Ryan A
This is sooo low down I think he has to look up to see the snakes belly.

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



Re: [PHP] UK Bank Holidays 2

2004-03-06 Thread Raditha Dissanayake
Hi my mail was intended as a joke :-) to defuse the tension that was 
building up.

Ryan A wrote:

On 3/6/2004 5:36:01 PM, Raditha Dissanayake ([EMAIL PROTECTED]) wrote:
 

And for the record, I didnt "single you out" the post was just
irritating...the rest of you
who dont agree..thats your opinion..and the rest of you who got pissed
 

at
   

me...bite me.

Cheers,
 

Hey Raditha,
I think you misunderstood what I meant by:
 

...the rest of you who dont agree..thats your opinion..the rest of you who
   

got pissed at me...bite me

No matter, have a nice day.
Cheers,
-Ryan
 



--
Raditha Dissanayake.
---
http://www.radinks.net/ftp/applet/
An applet that breaks all the rules. Reads, Writes and deletes files on 
your hard disk. Uploads what's left to a third party server.

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


Re: [PHP] PHP and Apache Using up all memory

2004-03-06 Thread Raditha Dissanayake
Hi Juan,

What you can do is to switch off output buffering. If it is a really 
large file you might want to generate the file offline and deliver it 
using the more conventional hyperlink.

all the best

Juan E Suris wrote:

Hi!

I have a problem with PHP and Apache, where Apache uses up a huge amount of memory. What happens is that I have a PHP script that creates a file on the fly and sends it directly to the broswer (as an attachment, so that the user can save it). The problem is that when the file is big and the client download speed is slow, the Apache process uses up as much memory as the file size. My guess here is that PHP keeps writing data as fast as it can, and Apache caches it in memory until the user can download it all.

Is there any way to avoid this?

My apologies if this is an obvious question.

Thanks,
Juan 
 



--
Raditha Dissanayake.
---
http://www.radinks.net/ftp/applet/
An applet that breaks all the rules. Reads, Writes and deletes files on 
your hard disk. Uploads what's left to a third party server.

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


Re: [PHP] domain.org/?page=pageName method

2004-03-06 Thread Raditha Dissanayake
Hi,
I think this is largely a matter of personal opinion. However even 
though you have taken every precaution against illegal content there is 
always a chance of someone getting throughwtih the

domain.org/?page=pageName approach. So perhaps it's a little bit more risky.

Barýþ Mert wrote:

A general thing to do while coding a site is to
include header.php at the top of the file (and
footer.php at the end of file). Another method is to
put these header and footer files together in
index.php and including the desired page between them.
We get the desired page from the query string:
domain.org/?page=pageName
$page = $_GET['pagename'];
include $page.'.php';
Is there any important difference between these two
methods? What can you say about the advanteges or
disadvanteges of one to the other?
Assume that including undesired pages is prohibited. I
mean don't write about page=../../secretpage
Thanks...

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



--
Raditha Dissanayake.
---
http://www.radinks.net/ftp/applet/
An applet that breaks all the rules. Reads, Writes and Deletes files on 
your hard disk. Uploads what's left to a third party server.

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


Re: [PHP] Need Help in shoppin cart

2004-03-06 Thread John Nichel
New Session wrote:
Sir,
I am a web developer, I had made many sites like shooping cart, mangement
leads etc.


Perhaps you can design me an application that will eliminate stupid email?

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Mail fifth parameter

2004-03-06 Thread Raditha Dissanayake
It's an often overlooked fact that you can pass additional headers in 
the fourth parameter. I do belive you should use \n and not \r\n
then your code will look like

mail("[EMAIL PROTECTED]", "object", $message,
"From: [EMAIL PROTECTED] ".
"Reply-To:[EMAIL PROTECTED]".
"Return-Path: [EMAIL PROTECTED]);




Enrico Comini wrote:

I have to send a email to a server where is very important the
"Return-Path" to match the identity.
If I use mail("[EMAIL PROTECTED]", "object", $message,"From:
[EMAIL PROTECTED]".
"Reply-To:[EMAIL PROTECTED]"
."Return-Path: [EMAIL PROTECTED]);
I see in the received message that return-path Is not that I want.

I try to use the fifth parameter ( "[EMAIL PROTECTED])  but I am in
safe mode then I see the warning : the fifth parameter is disabled in safe
mode.
There is a workaround for this problem ? safe_mode = on is impossible for
this server !
 



--
Raditha Dissanayake.
---
http://www.radinks.net/ftp/applet/
An applet that breaks all the rules. Reads, Writes and Deletes files on 
your hard disk. Uploads what's left to a third party server.

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


Re: [PHP] Mail fifth parameter

2004-03-06 Thread Jason Davidson
\r\n is good :)
J

Raditha Dissanayake <[EMAIL PROTECTED]> wrote:
> 
> It's an often overlooked fact that you can pass additional headers in 
> the fourth parameter. I do belive you should use \n and not \r\n
> then your code will look like
> 
> mail("[EMAIL PROTECTED]", "object", $message,
>   "From: [EMAIL PROTECTED] ".
>   "Reply-To:[EMAIL PROTECTED]".
>   "Return-Path: [EMAIL PROTECTED]);
> 
> 
> 
> 
> 
> 
> Enrico Comini wrote:
> 
> > I have to send a email to a server where is very important the
> >"Return-Path" to match the identity.
> >
> >If I use mail("[EMAIL PROTECTED]", "object", $message,"From:
> >[EMAIL PROTECTED]".
> >"Reply-To:[EMAIL PROTECTED]"
> >."Return-Path: [EMAIL PROTECTED]);
> >
> >I see in the received message that return-path Is not that I want.
> >
> >I try to use the fifth parameter ( "[EMAIL PROTECTED])  but I am in
> >safe mode then I see the warning : the fifth parameter is disabled in safe
> >mode.
> >There is a workaround for this problem ? safe_mode = on is impossible for
> >this server !
> >
> >  
> >
> 
> 
> -- 
> Raditha Dissanayake.
> ---
> http://www.radinks.net/ftp/applet/
> An applet that breaks all the rules. Reads, Writes and Deletes files on 
> your hard disk. Uploads what's left to a third party server.
> 
> -- 
> 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] Mail fifth parameter

2004-03-06 Thread joel boonstra
On Sun, Mar 07, 2004 at 09:51:28AM +0600, Raditha Dissanayake wrote:
> It's an often overlooked fact that you can pass additional headers in 
> the fourth parameter. I do belive you should use \n and not \r\n
> then your code will look like
> 
> mail("[EMAIL PROTECTED]", "object", $message,
>   "From: [EMAIL PROTECTED] ".
>   "Reply-To:[EMAIL PROTECTED]".
>   "Return-Path: [EMAIL PROTECTED]);

As mentioned in another post, the Return-Path header can and usually is
overwritten by sendmail when it does the actual sending.  

In addition to a previous suggestion, one way to reliably set that
header is to use phpmailer (http://phpmailer.sourceforge.net/) which has
the option of using an smtp server rather than sendmail directly.

joel

-- 
[ joel boonstra | gospelcom.net ]

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



Re: [PHP] PHP and Apache Using up all memory

2004-03-06 Thread Juan E Suris
Right now I am genereating the file offline and using a hyperlink, but that
creates double the disk I/O. It reads some files (which the big file is
based on), writes the big file, and reads the big file (to deliver it when
the user clicks the hyperlink). If I could just create the file and deliver
it as I create it, I would save the write/read to/from disk of the big file.

Output buffering is off in php.ini:
output_buffering = Off

So that does not seem to be it. Maybe the problem should be address on
Apache instead of PHP?
Thanks,
Juan

- Original Message - 
From: "Raditha Dissanayake" <[EMAIL PROTECTED]>
To: "Juan E Suris" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Saturday, March 06, 2004 11:44 PM
Subject: Re: [PHP] PHP and Apache Using up all memory


> Hi Juan,
>
> What you can do is to switch off output buffering. If it is a really
> large file you might want to generate the file offline and deliver it
> using the more conventional hyperlink.
>
> all the best
>
> Juan E Suris wrote:
>
> >Hi!
> >
> >I have a problem with PHP and Apache, where Apache uses up a huge amount
of memory. What happens is that I have a PHP script that creates a file on
the fly and sends it directly to the broswer (as an attachment, so that the
user can save it). The problem is that when the file is big and the client
download speed is slow, the Apache process uses up as much memory as the
file size. My guess here is that PHP keeps writing data as fast as it can,
and Apache caches it in memory until the user can download it all.
> >
> >Is there any way to avoid this?
> >
> >My apologies if this is an obvious question.
> >
> >Thanks,
> >Juan
> >
> >
>
>
> -- 
> Raditha Dissanayake.
> ---
> http://www.radinks.net/ftp/applet/
> An applet that breaks all the rules. Reads, Writes and deletes files on
> your hard disk. Uploads what's left to a third party server.
>
>

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



Re: [PHP] preg_split - spliting string

2004-03-06 Thread Burhan Khalid
Bambero wrote:
Hi
I need to split a string by the: , (comma) separator, but when the comma 
is beetwen ""
it should be skipped.

Ex:
test ts sasa, assas "sasa,asaas" dasdas, da
=> test ts sasa
=> assas "sasa,asaas" dasdas
=> da
If this is a CSV file, you can try fgetcsv.

From http://www.php.net/fgetcsv

"Similar to fgets() except that fgetcsv() parses the line it reads for 
fields in CSV format and returns an array containing the fields read. 
The optional third delimiter parameter defaults as a comma, and the 
optional enclosure defaults as a double quotation mark. Both delimiter 
and enclosure are limited to one character. If either is more than one 
character, only the first character is used.

Note: The enclosure parameter was added in PHP 4.3.0."

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


[PHP] Re: extra breaks in sent out emails

2004-03-06 Thread Scott Taylor
on Page One

   
   
   a
   b
   
   
On Page Two:

   $to = $row['email_address'];
  
   $body = stripslashes(trim($_POST['email_body']));
 
   mail($to, $subject, $body, $headers);



What I really don't understand is why there are any line breaks at all, 
because the trim is supposed to take out all \r & \n 's.  Is there 
another type of line break?

Best Regards,

Scott Taylor

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