Re: [PHP] Continue processing after redirect?

2002-08-16 Thread Rasmus Lerdorf

It has absolutely nothing to do with the browser.  PHP is a server-side
language.  See

   http://www.php.net/manual/en/features.connection-handling.php

-Rasmus

On Sat, 17 Aug 2002, lallous wrote:

> Hello Rasmus,
>
> Now that the topic has been brought,
>
> How much long will the script keep running after the redirection request has
> been made?
>
> Doesn't that behaviour depend from browser to browser ?
>
>
> Thanks,
>
>
> Elias
>
> "Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Sure, in fact, that happens by default unless you explicitly exit or try
> > to output something.
> >
> > On Sat, 17 Aug 2002, Jason Morehouse wrote:
> >
> > > Any ideas if it's possible to keep a script running for a short time
> after a
> > > client has been redireced?
> > >
> > > i.e:
> > >  > > header("Location: http://php.net";);
> > > # contunue running...
> > > mail("[EMAIL PROTECTED]", "Hey", "Hi!");
> > > ?>
> > >
> > > Using Redhat Linux, Apache & PHP 4.2.2.
> > >
> > > Much thanks!
> > > -Jason
> > >
> > >
> > >
> > > --
> > > 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




Re: [PHP] Continue processing after redirect?

2002-08-16 Thread lallous

Hello Rasmus,

Now that the topic has been brought,

How much long will the script keep running after the redirection request has
been made?

Doesn't that behaviour depend from browser to browser ?


Thanks,


Elias

"Rasmus Lerdorf" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Sure, in fact, that happens by default unless you explicitly exit or try
> to output something.
>
> On Sat, 17 Aug 2002, Jason Morehouse wrote:
>
> > Any ideas if it's possible to keep a script running for a short time
after a
> > client has been redireced?
> >
> > i.e:
> >  > header("Location: http://php.net";);
> > # contunue running...
> > mail("[EMAIL PROTECTED]", "Hey", "Hi!");
> > ?>
> >
> > Using Redhat Linux, Apache & PHP 4.2.2.
> >
> > Much thanks!
> > -Jason
> >
> >
> >
> > --
> > 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] Re: Bulk Email [solution found!]

2002-08-16 Thread Paul Roberts

i tried it using the 5th parameter with -odd and the mail got qued but i also need to 
set [EMAIL PROTECTED] (so i get those bounces) but i got <[EMAIL PROTECTED] -odd> for the 
return path in the email. 

i then tried it with the -odd first and it qued the mail but didn't set the return 
path, i also want to set it so it only returns the headers using -Rhdrs so need to set 
3 options when sendmail is called.

can you set multiple options with the 5th parameter? i would have thought it would 
append the stuff in the 5th to the sendmail path set in php.ini but it doesn't seem to 
work that way.

i can do this fine by using popen() and adding the parameters to the path so i can't 
see why it doesn't play with the mail function.

Paul Roberts
http://www.paul-roberts.com
[EMAIL PROTECTED]




- Original Message - 
From: "Manuel Lemos" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Saturday, August 17, 2002 2:36 AM
Subject: [PHP] Re: Bulk Email [solution found!]


> Hello,
> 
> On 08/16/2002 05:37 PM, Daren Cotter wrote:
> > First, a recap of my problem:
> > 
> > I need to send personalized emails to my member list
> > on a daily basis. I use PHP to query the MySQL
> > database, and loop through the results using the
> > mail() function. Problem: very slow, browser/php times
> > out, etc.
> > 
> > Solution:
> > 
> > First, I configure sendmail to use "queueonly" as the
> > DeliveryMethod (see sendmail.cf) instead of
> > "background". Then, when my PHP script runs, mailings
> > simply get queued instead of actually delivered. This
> > is a x10 speed increase. My script queues
> > approximately 1,000 mailings per minute (a x10 speed
> > increase). Then, I modified the
> > /etc/rc.d/init.d/sendmail script to process the queue
> > every 5 minutes, instead of the default one hour. This
> > insures that the mailings actually get sent soon after
> > they're queued, and you won't have to wait for
> > important emails to come through.
> 
> As I mentioned before this solution is set for disaster as you grow into 
> larger number of recipients. The problem is that queuing separate 
> messages for each recipient will fill up your disk. But that is not all. 
> The eventual message bounces that you will get will only aggravate your 
> problem. If you can live without personalization, don't think twice, 
> forget it. If you have doubts, think again.
> 
> 
> 
> > The problem with the above solution used to be this:
> > certain emails generated from my site (welcome emails,
> > password lookup emails, etc) need to be sent
> > IMMEDIATELY, and cannot wait in the queue for 5
> > minutes. The solution for this: not using the built-in
> > mail() command in PHP. I created my own mail script
> > (by modifying something someone else already did)
> > which opens a socket directly with the mail server.
> > Code is below.
> > 
> > // Sends the email directly to the mail server using
> > SMTP. This is done
> > // so sendmail can be setup using the queue method on
> > the server, and
> > // confirmation emails, etc, can be sent immediately
> > to the member.
> > function smtp_mail($to, $from_name, $from_email,
> > $reply_to_email, $subject, $body) {
> > $smtp = fsockopen("your_mail_server_here", 25);
> 
> I am not sure that sending to the local mailer queue via SMTP would be 
> any better than using sendmail itself to put the message there. Anyway, 
> I am afraid that the message will still wait for sendmail to process it
> 
> 
> > if ($smtp == 0)
> > return 0;
> > fputs($smtp,"helo
> > machines_host_and_domain_name_here\r\n");
> > $line = fgets($smtp, 1024);
> > fputs($smtp,"mail from: $from_email\r\n");
> > $line = fgets($smtp, 1024);
> > fputs($smtp,"rcpt to: $to\r\n");
> > $line = fgets($smtp, 1024);
> > fputs($smtp,"data\r\n");
> > $line = fgets($smtp, 1024);
> > fputs($smtp,"From: $from_name <$from_email>\r\n");
> > fputs($smtp,"Reply-To: $reply_to_email\r\n");
> > fputs($smtp,"To: $to\r\n");
> > fputs($smtp,"Subject: $subject\r\n");
> > fputs($smtp,"\r\n");
> > fputs($smtp,"$body\r\n");
> > fputs($smtp,".\r\n");
> > $line = fgets($smtp, 1024);
> > fputs($smtp, "QUIT\r\n");
> > fclose($smtp);
> > return 1;
> > }
> 
> I am afraid this code needs a lot of work or else it will choke on some 
> servers due to multi-line responses, maybe not on the actual sendmail 
> version and configuration you are using, but definetely on some SMTP 
> servers.
> 
> 
> -- 
> 
> Regards,
> Manuel Lemos
> 
> 
> -- 
> 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] session lost when back button hit?

2002-08-16 Thread Justin French

on 17/08/02 4:01 PM, Jean-Christian Imbeault ([EMAIL PROTECTED])
wrote:

>> One (hackish) solution to this is to cause the entrance page to
>> immediately redirect to itself using either PHP's header function, or a
>> meta refresh.  Your goal here is to make it so that hitting back from a
>> secondary page would take you to the post-refreshed entrance page which
>> has the session ID.
> 
> Ok. Can you explain this in more detail? I understand the concept you
> are suggesting but I can't picture how to do this in PHP.

Something like:

If there isn't a session, start one and redirect to the same page WITH the
session id, otherwise just continue the session.

In theory, you should always get a session ID in the URL of startpage.php.

But I can't stress enough, this is all theory -- the code hasn't been tested
at all... nor particularly thought through :)


startpage.php:



...



Justin French


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




[PHP] Re: sessions: what to do when browser won't accept cookies?

2002-08-16 Thread Jean-Christian Imbeault

Jerry wrote:
> 
> I kind of hate it when sites do this, but you could have the first page 
> reload itself if it doesn't have an SID, and add an SID to itself. This 
> way, if they use the back button, the first "first page" they come to 
> has the SID.

But if they it the back button again they would come to the real first 
they came to and that page would reload itself, generating a new SID no?

I did some testing and found that there must be a way.

I turned cookies and javascript off and then visited Amazon.com. I added 
an item to my cart, hit the back button all way back to the entrance and 
then checked my cart ... lo-and-behold the item was in my cart still. 
How did they do that?

Maybe some use of header() on the first page to redirect itslef to page 
with a SID?

Jc


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




Re: [PHP] session lost when back button hit?

2002-08-16 Thread Jean-Christian Imbeault

Alok K. Dhir wrote:
>
> By any chance, is page one the "entrance" page to your application?

Yes.

> I.e. is there a session id in either the query string of the page URL or
> was there one passed to it via a POST?

Nope. Is the is the entrance so there is no nothing passed to it. Users 
just enter the URL in the location bar, for example, and come in.

> Without cookies enabled, there is no way to allow users to use the back
> button to go back to the entrance page while maintaining the session.

Really? I just turned cookies and javascript off and then visited 
Amazon.com. I added an item to my cart, hit the back buttonall way back 
to the entrance and then checked my cart ... lo-and-behold the item was 
in my cart still. How did they do that?

> One (hackish) solution to this is to cause the entrance page to
> immediately redirect to itself using either PHP's header function, or a
> meta refresh.  Your goal here is to make it so that hitting back from a
> secondary page would take you to the post-refreshed entrance page which
> has the session ID.

Ok. Can you explain this in more detail? I understand the concept you 
are suggesting but I can't picture how to do this in PHP.

Thanks for the info!

Jc


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




Re: [PHP] Sessions...

2002-08-16 Thread Tom Rogers

Hi,

Friday, August 16, 2002, 4:13:39 AM, you wrote:
KSM> Am I mistaken to assume that a Session is automatically
KSM> destroyed if a Window Browser is closed?

The session as such is not destroyed only the cookie used to id it if you are using
cookies. If The SID is being passed in the url and that is bookmarked
then the session could be restarted before the timeout occurs in a new
browser.

-- 
regards,
Tom


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




[PHP] Re: Protocol on handling empty checkbox values

2002-08-16 Thread Jean-Christian Imbeault

Dear David you haev just hijacked my thread. When you want to post a 
message please do not just hit the reply button and just change the 
Subject line. If you do that you message will appear in someone else's 
message thread.

It really ruins it for people who use mail/news readers with threads 
enabled and worse, you might not get any answers to your question since 
it might get lost deeps in a totally unrelated mesage thread.

Just a friendly reminder on netiquette. Please don't do it again.

Jc

David Yee wrote:
> Hi all.  For a universal form script I'm writing I want to store a 'Y' in a
> table field if a checkbox is checked and an 'N' if it's not.  The problem is
> that when the form is posted if the checkbox is not checked the checkbox
> variable is not passed.  E.g.
> 
> 
> 
> 
> 
> If the checkbox is checked, I get $_POST['my_checkbox_var'] == 'Y', but if
> not $_POST['my_checkbox_var'] is not even set.  So what I've been doing is
> putting the variable names of the checkbox fields into an array, serializing
> it, and then pass the string as a hidden input on the form.  Then in the
> page that handles the POST I unserialize the array to determine if checkbox
> fields were passed and then handle accordingly.  But I'm wondering is there
> a better way (or at least a standard way) of doing this?
> 
> David
> 


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




Re: [PHP] Protocol on handling empty checkbox values

2002-08-16 Thread Justin French

on 17/08/02 3:19 PM, David Yee ([EMAIL PROTECTED]) wrote:

> Great idea!  Actually after I posted the question I thought of the same
> thing :-).  This is probably the most elegant way.  I am curious though why
> PHP doesn't just create the variable anyways and just assign it a null value
> if the box is not checked.

It's not PHP's fault -- it's the CGI/POST specs.  The browser is not sending
it through, because that's what it was told to do :)

Justin French


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




Re: [PHP] Protocol on handling empty checkbox values

2002-08-16 Thread David Yee

> I'd use an array on some way, but the other option is to see if the var is
> set, else set it to N
>
> if(isset($_POST['my_checkbox_var'])) {
> $_POST['my_checkbox_var'] = 'N';
> }
>
>
> Probably what I'd do is create an array for the possible checkbox values,
> then USE THAT ARRAY to build the form.  Then I can re-use the array on the
> validation script, checking that each element isset()... if they aren't,
set
> them to 'N'.

Yes that's what I was doing- because the form has other elements other than
checkboxes I have to distinguish between the checkboxes and the others and
hence a separate array for checkboxes.

> To throw in a curve-ball, you can set the default value for your MySQL
> column to 'N', which means that any value you DON'T write will be 'N', and
> those you do will be 'Y'.

Great idea!  Actually after I posted the question I thought of the same
thing :-).  This is probably the most elegant way.  I am curious though why
PHP doesn't just create the variable anyways and just assign it a null value
if the box is not checked.

David


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




Re: [PHP] Continue processing after redirect?

2002-08-16 Thread Rasmus Lerdorf

Sure, in fact, that happens by default unless you explicitly exit or try
to output something.

On Sat, 17 Aug 2002, Jason Morehouse wrote:

> Any ideas if it's possible to keep a script running for a short time after a
> client has been redireced?
>
> i.e:
>  header("Location: http://php.net";);
> # contunue running...
> mail("[EMAIL PROTECTED]", "Hey", "Hi!");
> ?>
>
> Using Redhat Linux, Apache & PHP 4.2.2.
>
> Much thanks!
> -Jason
>
>
>
> --
> 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] Bulk Email [solution found!]

2002-08-16 Thread Manuel Lemos

Hello,

On 08/16/2002 11:22 PM, Jason Wong wrote:
> I run a qmail server. When I send out newsletters, I run a query and extract 
> the mailing addresses I need. Then I build a .qmail file (similar to 
> sendmail's alias file), and finally I send mail to that .qmail (alias). The 
> mail is queued once and all recipients listed in the .qmail file gets a copy. 
> It is a solution that works for me so don't tell me that that is a virtual 
> solution :)
> 
> The fact is that a solution that relies solely on PHP would probably be too 
> slow, unreliable and messy.

I also use qmail but I don't use any .qmail file. I just use 
qmail-inject puting all receipients in BCC. It always takes less than 3 
seconds. What really takes some time is the extraction of addresses from 
a SQL database.


-- 

Regards,
Manuel Lemos


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




[PHP] Re: Continue processing after redirect?

2002-08-16 Thread Jason Morehouse

Sorry... that seems to work by default... what-dadda ya know!

"Jason Morehouse" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Any ideas if it's possible to keep a script running for a short time after
a
> client has been redireced?
>
> i.e:
>  header("Location: http://php.net";);
> # contunue running...
> mail("[EMAIL PROTECTED]", "Hey", "Hi!");
> ?>
>
> Using Redhat Linux, Apache & PHP 4.2.2.
>
> Much thanks!
> -Jason
>
>



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




Re: [PHP] Newbie: Update Multiple Records

2002-08-16 Thread Justin French

Hi,

Print out your data onto a master page, with checkboxes.  The checkboxes
should be an array, with the ID (or some other unique identifier) of each
row.  The array would look something like:

$approve['1'] => 'Y';
$approve['2'] => 'Y';
$approve['3'] => 'Y';
...
$approve['10'] => 'Y';


The array will only contain rows which were checked.

Then on the next page, you loop through the array with a foreach statement,
updating the table to suit:

foreach($approve as $k => $v)
{
$sql = "UPDATE  WHERE id='{$k}'";
$result = mysql_query($sql);
}

Hope this is enough to get you started.


Justin French


on 17/08/02 1:37 PM, Lists ([EMAIL PROTECTED]) wrote:

> Hi everyone,
> 
> I'm a newbie.  I've been searching google and php.net trying to find
> information on how to set up a Master Page to do multiple records updating,
> but have found very little.  I have a table with 10 rows of data from MySQL
> and I'd like the user to check the "Approve" checkbox and for as many as he
> wants to approve and then click "Submit".
> 
> If someone could point me in the right direction, I'd greatly appreciate it!
> 
> Thanks,  Doug
> 


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




[PHP] Continue processing after redirect?

2002-08-16 Thread Jason Morehouse

Any ideas if it's possible to keep a script running for a short time after a
client has been redireced?

i.e:
http://php.net";);
# contunue running...
mail("[EMAIL PROTECTED]", "Hey", "Hi!");
?>

Using Redhat Linux, Apache & PHP 4.2.2.

Much thanks!
-Jason



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




[PHP] Newbie: Update Multiple Records

2002-08-16 Thread Lists

Hi everyone,

I'm a newbie.  I've been searching google and php.net trying to find
information on how to set up a Master Page to do multiple records updating,
but have found very little.  I have a table with 10 rows of data from MySQL
and I'd like the user to check the "Approve" checkbox and for as many as he
wants to approve and then click "Submit".

If someone could point me in the right direction, I'd greatly appreciate it!

Thanks,  Doug


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




Re: [PHP] Bulk Email [solution found!]

2002-08-16 Thread Justin French

on 17/08/02 12:22 PM, Jason Wong ([EMAIL PROTECTED]) wrote:

> It's a bit harsh to say it's not a real solution just because it relies on
> some specifics. There's no harm in taking advantage of your situation and use
> whatever resources you can to complete your job.

True.  Point taken :)


> I run a qmail server. When I send out newsletters, I run a query and extract
> the mailing addresses I need. Then I build a .qmail file (similar to
> sendmail's alias file), and finally I send mail to that .qmail (alias). The
> mail is queued once and all recipients listed in the .qmail file gets a copy.
> It is a solution that works for me so don't tell me that that is a virtual
> solution :)

nice!!

> The fact is that a solution that relies solely on PHP would probably be too
> slow, unreliable and messy.

True.


>> Simple fact is that a LOT of PHP
>> programmers are on shared servers, and their hosts would NOT want 50,000
>> emails queued up on disk.  No way!!
> 
> But you would have 50,000 mails going out anyway regardless of what solution
> you come up with. You mentioned sparklist in previous posts. Assuming that
> they allow customised mailings, how would you get 50,000 pieces of info to
> them so that they can perform the mailing?

The difference with sparklist over running something on a shared host is
that Sparklist is a dedicated mailinglist company, so their servers are
geared up for this one task.  The problem with aiming to achieve this is on
a shared server with 100-200 other websites is that the server is geared
towards hosting sites, not bulk mail.

Given a dedicated server, all is well, but my *guess* is that many of the
developers on here are on shared servers (at least those in the
newbie-beginner-intermediate levels).

I haven't looked into sparklist too heavily... US$50/month is a little
steep.  Their minimum per month is 50,000 emails, and i'm likely to only
send 1000-2000, but they do offer customised emails.


>> I'd expect doing this frequently on a shared server would be the fastest
>> way to get your account shut down.
> 
> I would recommend getting a dedicated server. They start from USD100/month and
> can easily cope with 10-20 sites so cost per site is only $5-10. Of course
> that opens another can of worms because you would have to deal with server
> administration etc.


This will be something i look into over the next year.  I have about 15
sites hosted on a reseller account... it'd be nice to move them into my own
server when the $'s add up... (haven't seen much in the way of dedicated
servers for under US$300 though...).


Justin French



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




Re: [PHP] Bulk Email [solution found!]

2002-08-16 Thread Justin French

on 17/08/02 12:08 PM, Daren Cotter ([EMAIL PROTECTED]) wrote:

> I highly doubt there are very many websites that need
> to send 50,000+ emails daily that are still existing
> on shared servers.

The problem would still likely be there for mailing lists of 2000 people.  I
just don't want people to see your post and think "woo-hoo", I've found the
answer to all my problems!!

This is *a* solution, but not the best for the majority of developers.


Justin French




> In any case, no, this is not a solution for people
> like that. The first step they need to take is a
> dedicated server.
> 
> I posted my comments because after a very long time of
> research, I have found no better way of doing what I'm
> doing.


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




Re: [PHP] Bulk Email [solution found!]

2002-08-16 Thread Jason Wong

On Saturday 17 August 2002 09:45, Justin French wrote:
> I wouldn't call this a real solution, since it relies heavily on specific
> server requirements and config changes. 

It's a bit harsh to say it's not a real solution just because it relies on 
some specifics. There's no harm in taking advantage of your situation and use 
whatever resources you can to complete your job.

I run a qmail server. When I send out newsletters, I run a query and extract 
the mailing addresses I need. Then I build a .qmail file (similar to 
sendmail's alias file), and finally I send mail to that .qmail (alias). The 
mail is queued once and all recipients listed in the .qmail file gets a copy. 
It is a solution that works for me so don't tell me that that is a virtual 
solution :)

The fact is that a solution that relies solely on PHP would probably be too 
slow, unreliable and messy.

> Simple fact is that a LOT of PHP
> programmers are on shared servers, and their hosts would NOT want 50,000
> emails queued up on disk.  No way!!

But you would have 50,000 mails going out anyway regardless of what solution 
you come up with. You mentioned sparklist in previous posts. Assuming that 
they allow customised mailings, how would you get 50,000 pieces of info to 
them so that they can perform the mailing?

> I'd expect doing this frequently on a shared server would be the fastest
> way to get your account shut down.

I would recommend getting a dedicated server. They start from USD100/month and 
can easily cope with 10-20 sites so cost per site is only $5-10. Of course 
that opens another can of worms because you would have to deal with server 
administration etc.

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

/*
There's something different about us -- different from people of Europe,
Africa, Asia ... a deep and abiding belief in the Easter Bunny.
-- G. Gordon Liddy
*/


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




Re: [PHP] Bulk Email [solution found!]

2002-08-16 Thread Manuel Lemos

Hello,

On 08/16/2002 10:45 PM, Justin French wrote:
> I wouldn't call this a real solution, since it relies heavily on specific
> server requirements and config changes.  Simple fact is that a LOT of PHP
> programmers are on shared servers, and their hosts would NOT want 50,000
> emails queued up on disk.  No way!!
> 
> I'd expect doing this frequently on a shared server would be the fastest way
> to get your account shut down.

Yes, very true. Actually on shared servers, most ISP would not allow you 
  to send messages to that many recipients even if you use just send one 
message in Bcc for all because in the end it will consume much bandwidth.

Some people think that working around the problem by sending just to a 
few hundred at a time will solve the problem, but they are just fooling 
themselves because it will still consume the same, if not more, bandwidth.

Another problem why shared server hosting companies forbid bulk-mailing 
is that they can't be sure if what people is sending is really solicited 
e-mail, even if you sware that it is. There is always the risk of having 
their IP ranges blacklisted by anti-spammers and they do not want to 
deal with that.

Many people are resorting to ADSL/cable lines for bulk-mail (solicited 
or not). Because of that, many ISP have included the IPs of those 
connection in the Dial-Up List which is basically used by many mail 
server administrators to refuse messages as they may be from hit-and-run 
spammers.

If you are really sending solicited e-mail, eitheir you use a server 
that you absolutely control or hire e-mail delivery hosting services 
that are meant for that purpose, despit they currently are not very cheap.

Regards,
Manuel Lemos

> on 17/08/02 6:37 AM, Daren Cotter ([EMAIL PROTECTED]) wrote:
> 
> 
>>I have found a solution to my bulk email problem. I'm
>>posting my solution simply because I spent nearly a
>>year finding it, and I KNOW there's many other people
>>in my same situation.
>>
>>First, a recap of my problem:
>>
>>I need to send personalized emails to my member list
>>on a daily basis. I use PHP to query the MySQL
>>database, and loop through the results using the
>>mail() function. Problem: very slow, browser/php times
>>out, etc.
>>
>>Solution:
>>
>>First, I configure sendmail to use "queueonly" as the
>>DeliveryMethod (see sendmail.cf) instead of
>>"background". Then, when my PHP script runs, mailings
>>simply get queued instead of actually delivered. This
>>is a x10 speed increase. My script queues
>>approximately 1,000 mailings per minute (a x10 speed
>>increase). Then, I modified the
>>/etc/rc.d/init.d/sendmail script to process the queue
>>every 5 minutes, instead of the default one hour. This
>>insures that the mailings actually get sent soon after
>>they're queued, and you won't have to wait for
>>important emails to come through.
>>
>>The problem with the above solution used to be this:
>>certain emails generated from my site (welcome emails,
>>password lookup emails, etc) need to be sent
>>IMMEDIATELY, and cannot wait in the queue for 5
>>minutes. The solution for this: not using the built-in
>>mail() command in PHP. I created my own mail script
>>(by modifying something someone else already did)
>>which opens a socket directly with the mail server.
>>Code is below.
>>
>>// Sends the email directly to the mail server using
>>SMTP. This is done
>>// so sendmail can be setup using the queue method on
>>the server, and
>>// confirmation emails, etc, can be sent immediately
>>to the member.
>>function smtp_mail($to, $from_name, $from_email,
>>$reply_to_email, $subject, $body) {
>>$smtp = fsockopen("your_mail_server_here", 25);
>>if ($smtp == 0)
>>return 0;
>>fputs($smtp,"helo
>>machines_host_and_domain_name_here\r\n");
>>$line = fgets($smtp, 1024);
>>fputs($smtp,"mail from: $from_email\r\n");
>>$line = fgets($smtp, 1024);
>>fputs($smtp,"rcpt to: $to\r\n");
>>$line = fgets($smtp, 1024);
>>fputs($smtp,"data\r\n");
>>$line = fgets($smtp, 1024);
>>fputs($smtp,"From: $from_name <$from_email>\r\n");
>>fputs($smtp,"Reply-To: $reply_to_email\r\n");
>>fputs($smtp,"To: $to\r\n");
>>fputs($smtp,"Subject: $subject\r\n");
>>fputs($smtp,"\r\n");
>>fputs($smtp,"$body\r\n");
>>fputs($smtp,".\r\n");
>>$line = fgets($smtp, 1024);
>>fputs($smtp, "QUIT\r\n");
>>fclose($smtp);
>>return 1;
>>}
>>
>>Function is called as follows:
>>
>>if (!smtp_mail("recipient_email_here",
>>$EMAIL_FROM_NAME, $EMAIL_FROM_EMAIL,
>>$EMAIL_FROM_REPLY_TO, $SIGNUP_VALIDATION_SUBJECT,
>>"Test Body")) {
>>print "error: mail not sent";
>>} else {
>>print "it worked!";
>>}
>>
>>Hope this helps others!
>>
>>__
>>Do You Yahoo!?
>>HotJobs - Search Thousands of New Jobs
>>http://www.hotjobs.com
> 
> 



-- 

Regards,
Manuel Lemos


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




Re: [PHP] Bulk Email [solution found!]

2002-08-16 Thread Justin French

I wouldn't call this a real solution, since it relies heavily on specific
server requirements and config changes.  Simple fact is that a LOT of PHP
programmers are on shared servers, and their hosts would NOT want 50,000
emails queued up on disk.  No way!!

I'd expect doing this frequently on a shared server would be the fastest way
to get your account shut down.

Justin French



on 17/08/02 6:37 AM, Daren Cotter ([EMAIL PROTECTED]) wrote:

> I have found a solution to my bulk email problem. I'm
> posting my solution simply because I spent nearly a
> year finding it, and I KNOW there's many other people
> in my same situation.
> 
> First, a recap of my problem:
> 
> I need to send personalized emails to my member list
> on a daily basis. I use PHP to query the MySQL
> database, and loop through the results using the
> mail() function. Problem: very slow, browser/php times
> out, etc.
> 
> Solution:
> 
> First, I configure sendmail to use "queueonly" as the
> DeliveryMethod (see sendmail.cf) instead of
> "background". Then, when my PHP script runs, mailings
> simply get queued instead of actually delivered. This
> is a x10 speed increase. My script queues
> approximately 1,000 mailings per minute (a x10 speed
> increase). Then, I modified the
> /etc/rc.d/init.d/sendmail script to process the queue
> every 5 minutes, instead of the default one hour. This
> insures that the mailings actually get sent soon after
> they're queued, and you won't have to wait for
> important emails to come through.
> 
> The problem with the above solution used to be this:
> certain emails generated from my site (welcome emails,
> password lookup emails, etc) need to be sent
> IMMEDIATELY, and cannot wait in the queue for 5
> minutes. The solution for this: not using the built-in
> mail() command in PHP. I created my own mail script
> (by modifying something someone else already did)
> which opens a socket directly with the mail server.
> Code is below.
> 
> // Sends the email directly to the mail server using
> SMTP. This is done
> // so sendmail can be setup using the queue method on
> the server, and
> // confirmation emails, etc, can be sent immediately
> to the member.
> function smtp_mail($to, $from_name, $from_email,
> $reply_to_email, $subject, $body) {
> $smtp = fsockopen("your_mail_server_here", 25);
> if ($smtp == 0)
> return 0;
> fputs($smtp,"helo
> machines_host_and_domain_name_here\r\n");
> $line = fgets($smtp, 1024);
> fputs($smtp,"mail from: $from_email\r\n");
> $line = fgets($smtp, 1024);
> fputs($smtp,"rcpt to: $to\r\n");
> $line = fgets($smtp, 1024);
> fputs($smtp,"data\r\n");
> $line = fgets($smtp, 1024);
> fputs($smtp,"From: $from_name <$from_email>\r\n");
> fputs($smtp,"Reply-To: $reply_to_email\r\n");
> fputs($smtp,"To: $to\r\n");
> fputs($smtp,"Subject: $subject\r\n");
> fputs($smtp,"\r\n");
> fputs($smtp,"$body\r\n");
> fputs($smtp,".\r\n");
> $line = fgets($smtp, 1024);
> fputs($smtp, "QUIT\r\n");
> fclose($smtp);
> return 1;
> }
> 
> Function is called as follows:
> 
> if (!smtp_mail("recipient_email_here",
> $EMAIL_FROM_NAME, $EMAIL_FROM_EMAIL,
> $EMAIL_FROM_REPLY_TO, $SIGNUP_VALIDATION_SUBJECT,
> "Test Body")) {
> print "error: mail not sent";
> } else {
> print "it worked!";
> }
> 
> Hope this helps others!
> 
> __
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com


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




Re: [PHP] question about executing a bash shell script...

2002-08-16 Thread Jason Wong

On Saturday 17 August 2002 04:35, Kelly Meeks wrote:
> Hi folks,
>
> I'm learning shell scripting via linux, and have written a script that
> creates the core files necessary for a users website from a master set of
> files.
>
> Works from the shell just fine (bash makethesite.sh username pathtoputfiles
> pathtogetfiles)
>
> Trying to execute this via php, and it literally does nothing.
>
> If I try something like:
> $bashoutput=shell_exec('bash makethesite.sh username pathtoputfiles
> pathtogetfiles'); echo $bashoutput;
>
> I get nothing output, and the script doesn't execute.

What does the php logs say? You should set error_reporting to E_ALL.

> Any ideas?

The user that the webserver (assuming apache) is usually nobody or apache and 
may not have the necessary permissions to execute your script. Also try 
specifying the complete path to bash.

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

/*
Those who educate children well are more to be honored than parents, for
these only gave life, those the art of living well.
-- Aristotle
*/


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




[PHP] Re: Bulk Email [solution found!]

2002-08-16 Thread Manuel Lemos

Hello,

On 08/16/2002 05:37 PM, Daren Cotter wrote:
> First, a recap of my problem:
> 
> I need to send personalized emails to my member list
> on a daily basis. I use PHP to query the MySQL
> database, and loop through the results using the
> mail() function. Problem: very slow, browser/php times
> out, etc.
> 
> Solution:
> 
> First, I configure sendmail to use "queueonly" as the
> DeliveryMethod (see sendmail.cf) instead of
> "background". Then, when my PHP script runs, mailings
> simply get queued instead of actually delivered. This
> is a x10 speed increase. My script queues
> approximately 1,000 mailings per minute (a x10 speed
> increase). Then, I modified the
> /etc/rc.d/init.d/sendmail script to process the queue
> every 5 minutes, instead of the default one hour. This
> insures that the mailings actually get sent soon after
> they're queued, and you won't have to wait for
> important emails to come through.

As I mentioned before this solution is set for disaster as you grow into 
larger number of recipients. The problem is that queuing separate 
messages for each recipient will fill up your disk. But that is not all. 
The eventual message bounces that you will get will only aggravate your 
problem. If you can live without personalization, don't think twice, 
forget it. If you have doubts, think again.



> The problem with the above solution used to be this:
> certain emails generated from my site (welcome emails,
> password lookup emails, etc) need to be sent
> IMMEDIATELY, and cannot wait in the queue for 5
> minutes. The solution for this: not using the built-in
> mail() command in PHP. I created my own mail script
> (by modifying something someone else already did)
> which opens a socket directly with the mail server.
> Code is below.
> 
> // Sends the email directly to the mail server using
> SMTP. This is done
> // so sendmail can be setup using the queue method on
> the server, and
> // confirmation emails, etc, can be sent immediately
> to the member.
> function smtp_mail($to, $from_name, $from_email,
> $reply_to_email, $subject, $body) {
>   $smtp = fsockopen("your_mail_server_here", 25);

I am not sure that sending to the local mailer queue via SMTP would be 
any better than using sendmail itself to put the message there. Anyway, 
I am afraid that the message will still wait for sendmail to process it


>   if ($smtp == 0)
>   return 0;
>   fputs($smtp,"helo
> machines_host_and_domain_name_here\r\n");
>   $line = fgets($smtp, 1024);
>   fputs($smtp,"mail from: $from_email\r\n");
>   $line = fgets($smtp, 1024);
>   fputs($smtp,"rcpt to: $to\r\n");
>   $line = fgets($smtp, 1024);
>   fputs($smtp,"data\r\n");
>   $line = fgets($smtp, 1024);
>   fputs($smtp,"From: $from_name <$from_email>\r\n");
>   fputs($smtp,"Reply-To: $reply_to_email\r\n");
>   fputs($smtp,"To: $to\r\n");
>   fputs($smtp,"Subject: $subject\r\n");
>   fputs($smtp,"\r\n");
>   fputs($smtp,"$body\r\n");
>   fputs($smtp,".\r\n");
>   $line = fgets($smtp, 1024);
>   fputs($smtp, "QUIT\r\n");
>   fclose($smtp);
>   return 1;
> }

I am afraid this code needs a lot of work or else it will choke on some 
servers due to multi-line responses, maybe not on the actual sendmail 
version and configuration you are using, but definetely on some SMTP 
servers.


-- 

Regards,
Manuel Lemos


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




Re: [PHP] secure files acess

2002-08-16 Thread Justin French

Pass the file through a PHP script, using header() to set the mime-type,
then passing the file through.

Pretty sure there's examples (and documentation of the problems with IE)in
the manual:

php.net/header


Justin French


on 17/08/02 6:36 AM, David Buerer ([EMAIL PROTECTED]) wrote:

> I have a bunch of files which need to be kept secure. I need to allow a user
> access to them them based on a criteria which I can programmatically
> determine.
> 
> My question, is how can I allow the user to download or view only one file
> on my computer without allowthem to just enter the URL into their browser of
> the file and view it?
> 


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




Re: [PHP] Protocol on handling empty checkbox values

2002-08-16 Thread Justin French

I'd use an array on some way, but the other option is to see if the var is
set, else set it to N

if(isset($_POST['my_checkbox_var'])) {
$_POST['my_checkbox_var'] = 'N';
}


Probably what I'd do is create an array for the possible checkbox values,
then USE THAT ARRAY to build the form.  Then I can re-use the array on the
validation script, checking that each element isset()... if they aren't, set
them to 'N'.


To throw in a curve-ball, you can set the default value for your MySQL
column to 'N', which means that any value you DON'T write will be 'N', and
those you do will be 'Y'.


Justin French





on 17/08/02 4:24 AM, David Yee ([EMAIL PROTECTED]) wrote:

> Hi all.  For a universal form script I'm writing I want to store a 'Y' in a
> table field if a checkbox is checked and an 'N' if it's not.  The problem is
> that when the form is posted if the checkbox is not checked the checkbox
> variable is not passed.  E.g.
> 
> 
> 
> 
> 
> If the checkbox is checked, I get $_POST['my_checkbox_var'] == 'Y', but if
> not $_POST['my_checkbox_var'] is not even set.  So what I've been doing is
> putting the variable names of the checkbox fields into an array, serializing
> it, and then pass the string as a hidden input on the form.  Then in the
> page that handles the POST I unserialize the array to determine if checkbox
> fields were passed and then handle accordingly.  But I'm wondering is there
> a better way (or at least a standard way) of doing this?
> 
> David
> 


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




Re: [PHP] Moving Files - Stupid Error

2002-08-16 Thread Justin French

The function move_uploaded_file() is what you want, not copy().

http://php.net/move_uploaded_file


Of course, there are full working examples in the manual, found doing a
simple whole-site search on "file upload".

http://www.php.net/manual/en/features.file-upload.php


Justin French



on 17/08/02 2:53 AM, Steve Keller ([EMAIL PROTECTED]) wrote:

> ack to the tmp directory to look for the file. Here's a
> sample error:
> 
> Warning: Unable to create '/test/data/test.txt': No such file or directory
> in /usr/local/www/vhosts/healthtvchannel.org/htdocs/test/upload.php on line 17
> 
> That's with using:
> 
> copy("{$UploadedFile}","/test/data/".$UploadedFile_name);
> 
> $UploadedFile being the name I'm using. Both variables seem to be returning
> correctly. $UploadedFile returns the temp name, and $UploadedFile_name
> returns the actual name. The file is also far under the maximum file size.
> The /test/data has Nobody write permissions, I know because I'm writing to
> a file in it with another script, and there's no file in there with the
> same file name to cause overwriting ownership conflicts.


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




[PHP] Re: HTML-based mail with PHP

2002-08-16 Thread Manuel Lemos

Hello,

On 08/16/2002 12:54 PM, Liam Gibbs wrote:
> I'm having trouble with some HTML-based mail with PHP.
> It's not the regular thing where I can't get it to use
> the tags instead of just printing them. That part's
> fine; it comes out HTML-based.
> 
> My problem is the way it's not accessing a certain
> image. I get a broken link instead of an image at the
> top of my e-mail. I had it print the URL at which it
> should find the image, and then cut and paste that in
> my browser, and the image comes up fine. But, as far
> as putting it in the e-mail, it's not working out.

Unless you put absolute URLs for the image tags, you will need to embed 
the image files in the message. That is done with multipart/related 
messages.

Here you may find a ready to use PHP component that solves that problem 
in a half-dozen lines:

http://www.phpclasses.org/mimemessage


-- 

Regards,
Manuel Lemos


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




[PHP] Re: array and a class

2002-08-16 Thread Pafo

solved it  thx anyway
"Pafo" <[EMAIL PROTECTED]> skrev i meddelandet
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> i got my nice looking class like this:
> 
> class Relic {
>   var $RelicName;
>   var $RelicType;
>   var $RelicRealm;
>   var $RelicOwner;
>
>  function PrintInfo() {
>print "$this->RelicName  :  $this->RelicType  :  $this->RelicRealm  :
> $this->RelicOwner";
>  }
>
>  function CheckForPrint() {
>if ($this->RelicName == "" || $this->RelicType == "" ||
$this->RelicRealm
> == "" || $this->RelicOwner == "") {
>return false;
>} else {
>return true;
>}
>  }
>
>  function Clean() {
>$this->RelicName = "";
>$this->RelicType = "";
>$this->RelicRealm = "";
>$this->RelicOwner = "";
>  }
>
>  function SetName($name) {
>  $this->RelicName = $name;
>  }
>
>  function SetType($type) {
>$this->RelicType = $type;
>  }
>
>  function SetRealm($realm) {
>$this->RelicRealm = $realm;
>  }
>
>  function SetOwner($owner) {
>$this->RelicOwner = $owner;
>  }
>
>  function DebugPrint() {
>print $this->RelicName;
>  }
> }
>
> $temp = new Relic();
> $temp->SetName("test");
> $temp->DebugPrint();
> ?>
>
> but the thing is i want an array that is based on my class, so i want to
use
> $relicarray[1]->DebugPrint();
> how does it work,, anyone that can give me a working example, cause i cant
> find any  :/
>
> regards
> patrick
>
>



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




[PHP] silly arrays

2002-08-16 Thread Pafo

i got a php-script like this, just to make sure that it works before i try
to implement it:


debug


'***' OUTPUT
'**'
i = 0; $this->i < count($this->RelicName); $this->i++) {
   print "$this->RelicName[$this->i]  :  $this->RelicType[$this->i]  :
$this->RelicRealm[$this->i]  :  $this->RelicOwner[$this->i]";
   }
 }

 function SetName($name) {
 $this->RelicName[] = $name;
 }

 function SetType($type) {
   $this->RelicType[] = $type;
 }

 function SetRealm($realm) {
   $this->RelicRealm[] = $realm;
 }

 function SetRelicOwner($owner) {
   $this->RelicOwner[] = $owner;
 }

}

$temp = new Relic();
$temp->SetName("olle");
$temp->SetType("melee");
$temp->SetRealm("Hibernia");
$temp->SetRelicOwner("Albion");
$temp->SetName("bertil");
$temp->SetType("melee");
$temp->SetRealm("Albion");
$temp->SetRelicOwner("Hibernia");
$temp->SetName("sture");
$temp->SetType("magic");
$temp->SetRealm("Midgard");
$temp->SetRelicOwner("Midgard");
$temp->PrintInfo();
?>




the function PrintInfo prints out this:
'***' OUTPUT
'**'

Array[0] : Array[0] : Array[0] : Array[0]
Array[1] : Array[1] : Array[1] : Array[1]
Array[2] : Array[2] : Array[2] : Array[2]

heh,, not exacly what i wanted  :/

regards
patrick



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




Re: [PHP] Replace

2002-08-16 Thread Jason Reid

str_replace is your friend in this situation

Jason Reid
[EMAIL PROTECTED]
--
AC Host Canada
www.achost.ca

- Original Message - 
From: "Alexander Lindstedt" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, August 16, 2002 6:05 PM
Subject: [PHP] Replace


> If i want to find just a word in a variable, and then replace just that
> specific word... is there any simple way to do this?
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 



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




[PHP] Re: Replace

2002-08-16 Thread Bogdan Stancescu

Have you tried searching string functions on http://www.php.net ?

Bogdan

Alexander Lindstedt wrote:
> If i want to find just a word in a variable, and then replace just that
> specific word... is there any simple way to do this?
> 
> 


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




[PHP] Replace

2002-08-16 Thread Alexander Lindstedt

If i want to find just a word in a variable, and then replace just that
specific word... is there any simple way to do this?



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




[PHP] Re: [PHP-DEV] Trying to input a webpage - need help

2002-08-16 Thread Markus Fischer

On Fri, Aug 16, 2002 at 08:02:17PM -0400, Ken Meyer wrote : 
> I am trying to write a script that will read a page from
> another website. So long at the page is accessed via a "GET",
> this is no problem; I just need to open the page using fopen,
> readfile or file_get_contents. The problem is that I need to
> access a page that requires a "POST". Any suggestions as to how
> I could do this?

You can either use the curl extension (see manual) or
"Snoopy" (see sourceforge), a browser client class.

- Markus

ps: php-general@ is the right list to post such questions.
-- 
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc
"Finally, if someone actually flying a plane is relying on
a freakin' webcam to land, we're all in trouble."
- A /. poster.

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




[PHP] Re: ###PLEASE HELP### - delete a line from a text file

2002-08-16 Thread Bogdan Stancescu

Hi Nick!

First off, *please* read a netiquette guide before posting -- I hate 
seeing a conational of mine posting a message like yours ("###PLEASE 
HELP###" and "I am waiting for an answer" are extremely rude - you're 
not paying for support on this mailing list, so you can't demand 
anything). Other than that, I'd point out cleaning up your code before 
posting because we don't have to read through your "slickiness" -- but 
that may be a matter of personal opinion.

Your problem resides exactly in your code's slickiness - which 
incidentally doesn't make it any faster. Try this conventional code instead:

function delete_user($sterge_user, $path) {
   [1]
   $fisierul=$orig=file($path);
   for($i=0;$i i have a text file with some of this elements:
>  
> name:adress:telephone:email:password
> 
> i want to delete this line using for identifier the 'name' only.
> 
> // $sterge_user="name"; this is the value sent by form witch will be the identifier
> // $path="some_of_my_files"; the file used here allready set with 777 chmod
> 
> function delete_user($sterge_user, $path){
> $i = 0;
> $fisierul = file($path);
> $fp = fopen($path, "w");
> while (!sizeof($fisierul))
>  {
> $data = fgetcsv ($fisierul, 4096, ":");
>  if ($data[0]==$sterge_user)
> {
>for ($i=0; $i<=sizeof($data);){$data[i]="";++$i;}
> }
>  fwrite($fp, $data);
>   }
> fclose($fp);
> }
> 
> I am waiting for an answer, please
> 
> Nick
> 



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




[PHP] Re: Upgraded to PHP 4.2.2 and completely lost all GET and POST variables

2002-08-16 Thread Justin Garrett

http://www.php.net/ChangeLog-4.php

As of version 4.2 register_globals defaults to off.  You can turn it on in
your php.ini file, but it is recommended to use the new super global arrays
instead.

Justin

"James Daily" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
> RE: phpsecurityadmin-2002-07-24.zip and PHP 4.2.2
>
> PLATFORM: win 98
>
> BACKGROUND: in order to use the above classes i had to
> upgrade to PHP 4.2.2
>
> PROBLEM: when i upgraded to 4.2.2, all my old scripts
> lost the GET or POST info being passed.
>
> COMMENTS: everything except the phpsecurityadmin classes
> worked as expected under PHP 4.0.
>
> after upgrade, phpsecurityadmin classes work but any old
> scripts that are accepting data from previous page via
> GET or POST do not.
>
> i can manually parse the GET query string, but this is foolish
> and time consuming.
>
> it's as if the automatic variables are not getting assigned
> the data being passed.
>
> QUESTION: has anybody else run across this and
> what was the resolution?
>
> -
> James Daily
> Phone : 816 943 9891
> Email : [EMAIL PROTECTED] (or hit reply button)
> Web   : http://tellmama.com/
> Philosophy:
> 4 2  1000
> ( cos(ø - r) - sin ø ) * ( r  - 2r  cos(2ø + 2.4) + 0.9) + 0.62r) < 0
>
> Education is a progressive discovery of our own ignorance.
>Will Durant
>



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




Re: [PHP] Upgraded to PHP 4.2.2 and completely lost all GET and POSTvariables

2002-08-16 Thread Rasmus Lerdorf

Did you bother reading the documentation and release notes before
upgrading?

Edit your php.ini file and turn register_globals on.

-Rasmus

On Fri, 16 Aug 2002, james daily wrote:

>
> RE: phpsecurityadmin-2002-07-24.zip and PHP 4.2.2
>
> PLATFORM: win 98
>
> BACKGROUND: in order to use the above classes i had to
> upgrade to PHP 4.2.2
>
> PROBLEM: when i upgraded to 4.2.2, all my old scripts
> lost the GET or POST info being passed.
>
> COMMENTS: everything except the phpsecurityadmin classes
> worked as expected under PHP 4.0.
>
> after upgrade, phpsecurityadmin classes work but any old
> scripts that are accepting data from previous page via
> GET or POST do not.
>
> i can manually parse the GET query string, but this is foolish
> and time consuming.
>
> it's as if the automatic variables are not getting assigned
> the data being passed.
>
> QUESTION: has anybody else run across this and
> what was the resolution?
>
> -
> James Daily
> Phone : 816 943 9891
> Email : [EMAIL PROTECTED] (or hit reply button)
> Web   : http://tellmama.com/
> Philosophy:
> 4 2  1000
> ( cos(ø - r) - sin ø ) * ( r  - 2r  cos(2ø + 2.4) + 0.9) + 0.62r) < 0
>
> Education is a progressive discovery of our own ignorance.
>Will Durant
>
>
> --
> 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] Upgraded to PHP 4.2.2 and completely lost all GET and POST variables

2002-08-16 Thread james daily


RE: phpsecurityadmin-2002-07-24.zip and PHP 4.2.2

PLATFORM: win 98

BACKGROUND: in order to use the above classes i had to
upgrade to PHP 4.2.2

PROBLEM: when i upgraded to 4.2.2, all my old scripts
lost the GET or POST info being passed.

COMMENTS: everything except the phpsecurityadmin classes
worked as expected under PHP 4.0.

after upgrade, phpsecurityadmin classes work but any old
scripts that are accepting data from previous page via
GET or POST do not.

i can manually parse the GET query string, but this is foolish
and time consuming.

it's as if the automatic variables are not getting assigned
the data being passed.

QUESTION: has anybody else run across this and
what was the resolution?

-
James Daily
Phone : 816 943 9891
Email : [EMAIL PROTECTED] (or hit reply button)
Web   : http://tellmama.com/
Philosophy:
4 2  1000
( cos(ø - r) - sin ø ) * ( r  - 2r  cos(2ø + 2.4) + 0.9) + 0.62r) < 0

Education is a progressive discovery of our own ignorance.
   Will Durant


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




[PHP] odbc sql php

2002-08-16 Thread Saci

This question is more on odbc sql than on php, since I'm sure everthing is
working on php side

I have a php form who fills on ODBC database ( Visual Foxpro) , everthing is
working except with one detail, I have a text area field on  my form and
when the user fill this area with to many characters the sql query  isn't
accepted, I found that the problem is due to the length of the data.

The field is a memo field who means they can accept any length,

This works ok
UPDATE catalogo SET MATERIAL = 'A12' WHERE KEYUNICA = 3941

But this crash

UPDATE catalogo SET MATERIAL =
'A123456789B123456789C123456789D123456789E123456789F123456789G123456789H1234
56789I123456789J123456789K123456789L123456789M123456789N123456789O123456789P
123456789q123456789r123456789s123456789t123456789u123456789v123456789x123456
789y123456789z123456789a123456789b123456789' WHERE KEYUNICA = 3941


The question is How is the write way to write a query when I need to updated
a field of type memo  with information from a Textarea or even any big array
of letters ?

Any tip ?




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




[PHP] ###PLEASE HELP### - delete a line from a text file

2002-08-16 Thread radio x

i have a text file with some of this elements:
 
name:adress:telephone:email:password

i want to delete this line using for identifier the 'name' only.

// $sterge_user="name"; this is the value sent by form witch will be the identifier
// $path="some_of_my_files"; the file used here allready set with 777 chmod

function delete_user($sterge_user, $path){
$i = 0;
$fisierul = file($path);
$fp = fopen($path, "w");
while (!sizeof($fisierul))
 {
$data = fgetcsv ($fisierul, 4096, ":");
 if ($data[0]==$sterge_user)
{
   for ($i=0; $i<=sizeof($data);){$data[i]="";++$i;}
}
 fwrite($fp, $data);
  }
fclose($fp);
}

I am waiting for an answer, please

Nick



[PHP] HELP! php.ini file not read (was Php.ini on Solaris?)

2002-08-16 Thread Randall Perry

Ok, to answer my own question...

Apparently php.ini doesn't get read until Apache is restarted. Restarting
apache did the trick.


-- 
Randy Perry
sysTame
Mac Consulting/Sales

phn 772.589.6449
mobile email[EMAIL PROTECTED]



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




[PHP] Re: progress bar for uploading files

2002-08-16 Thread Peter J. Schoenster

On 16 Aug 2002 at 12:38, Philip Hallstrom wrote:

> This wouldn't work for uploading files however since the long part of
> the process is the act of uploading the file and until that completes
> your "save.php" (or whatever) isn't called.
> 
> So in regards to file uploading it has to be done with Javascript.  What
> you do below is great for scripts that just take a long time though.

Yes, heck, I forgot about that. I fork the other script ... I don't see how I can do 
that with the file upload as it is the script itself being called ...  umm   I 
don't 
see off the top of my bald head how to do that fork with the file-upload. But there is 
a mod_perl module which does this. It might give some clues to someone 
who will pursue this (not me :)

http://theoryx5.uwinnipeg.ca/CPAN/data/Apache-UploadMeter/UploadMeter.html

Peter



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




Re: [PHP] select distinct mysql

2002-08-16 Thread Analysis & Solutions

On Thu, Aug 15, 2002 at 01:12:59PM +0300, kale wrote:
> 
> SELECT *, DISTINCT name FROM history ORDER date DESC, time DESC LIMIT 10
>
> but this not work. how can I do this?  I use a mysql server.

That's because your query string syntax is all messed up.

Put a mysql_error() call in your script after the mysql_query() call.  It 
will tell you what the error is.  
   http://www.php.net/manual/en/function.mysql-error.php.

(Or, of course, you can execute the query directly from your MySQL client
command line.)

If you're unclear about what the error message is saying, read the MySQL 
manual on how to write SELECT statements.
   http://www.mysql.com/doc/en/SELECT.html

--Dan
 
-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




RE: [PHP] Re: progress bar for uploading files

2002-08-16 Thread Daniel Masson


I ... Had to do something like that recently .. Sending files through
ftp_put(); i just send the file .. And when user clicks 'Send' button
... A pop-up appears and gets the file size of the remote file and
comparing with de local size you can build a progress bar  This
pop-up uses the tag that Peter said HTTP-REFRESH so you can see how the
file size increases every n seconds ... It worked for me .. I hope this
can help !!

=> Daniel


This wouldn't work for uploading files however since the long part of
the process is the act of uploading the file and until that completes
your "save.php" (or whatever) isn't called.

So in regards to file uploading it has to be done with Javascript.  What
you do below is great for scripts that just take a long time though.

-philip

On Fri, 16 Aug 2002, Peter J. Schoenster wrote:

> On 16 Aug 2002 at 23:40, electroteque wrote:
>
> > hi guys i was wondering if there was anyway to have a progress bar 
> > for uploading images ?
>
> TMTOWDI, but here is a way I did something similar. I was spidering 
> remote sites and to get user's data and store in a database and the 
> user could not continue until the spider spun it's web.
>
> I accpeted the data I needed and then returned a page with the 
> HTTP-REFRESH tag in it with something like this
>
> http://yoursite.com/verify_upload?process_id=X&action=check_up
> load"&timer=X>
>
> So it refreshes every 10 seconds and checks to see if process X  has 
> finished, if so then redirect to the next step,  if not then just 
> return but upgrade the timer so you can increase your counter (perhaps

> a percentage in a table cell).
>
>
> Peter
>
>
>
>
>
> --
> 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




Re: [PHP] problem with mail()

2002-08-16 Thread Analysis & Solutions

On Wed, Aug 14, 2002 at 10:04:46AM -0700, Gui Guy wrote:
> 
> ...: SYSERR(nobody): Can't create transcript file ./xfg7E9Jlr03988:
> Permission denied
> : SYSERR(nobody): Cannot create ./dfg7E9Jlr03988: Permission denied
> 
> Does it mean that php is trying to send mail from user nobody?

Good guess!  Sounds like a file permissions thing.  What directory are
those files being created in?  Provide "nobody" with adequate permissions
on that directory.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] secure files acess

2002-08-16 Thread Robert Cummings

David Buerer wrote:
> 
> Thankyou Robert, THat is a great and easy way to do it.
> 
> What if I need to initiate a download to the user?

If you set the mime type properly the browser will
automatically make it a download versus displaying it.

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




RE: [PHP] secure files acess

2002-08-16 Thread David Buerer

Thankyou Robert, THat is a great and easy way to do it.

What if I need to initiate a download to the user?

-Original Message-
From: Robert Cummings [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 16, 2002 2:06 PM
To: David Buerer
Cc: '[EMAIL PROTECTED]'
Subject: Re: [PHP] secure files acess


David Buerer wrote:
> 
> I have a bunch of files which need to be kept secure. I need to allow a
user
> access to them them based on a criteria which I can programmatically
> determine.
> 
> My question, is how can I allow the user to download or view only one file
> on my computer without allowthem to just enter the URL into their browser
of
> the file and view it?

Have a php script authenticate the user, then if authenticated, use the
reafile() function to output it to the user directly. Since PHP can see
more than just the web space the files just need to reside outside of
the websapce.

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'



RE: [PHP] secure files acess

2002-08-16 Thread Daniel Masson

Hi there !!!

I had the same problem once ...

This will save you !!

http://www.zend.com/zend/trick/tricks-august-2001.php


I have a bunch of files which need to be kept secure. I need to allow a
user access to them them based on a criteria which I can
programmatically determine.

My question, is how can I allow the user to download or view only one
file on my computer without allowthem to just enter the URL into their
browser of the file and view it?


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




Re: [PHP] secure files acess

2002-08-16 Thread Robert Cummings

Robert Cummings wrote:
> 
> David Buerer wrote:
> >
> > I have a bunch of files which need to be kept secure. I need to allow a user
> > access to them them based on a criteria which I can programmatically
> > determine.
> >
> > My question, is how can I allow the user to download or view only one file
> > on my computer without allowthem to just enter the URL into their browser of
> > the file and view it?
> 
> Have a php script authenticate the user, then if authenticated, use the
> reafile() function to output it to the user directly. Since PHP can see
  ^

readfile() even :p

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




Re: [PHP] secure files acess

2002-08-16 Thread Robert Cummings

David Buerer wrote:
> 
> I have a bunch of files which need to be kept secure. I need to allow a user
> access to them them based on a criteria which I can programmatically
> determine.
> 
> My question, is how can I allow the user to download or view only one file
> on my computer without allowthem to just enter the URL into their browser of
> the file and view it?

Have a php script authenticate the user, then if authenticated, use the
reafile() function to output it to the user directly. Since PHP can see
more than just the web space the files just need to reside outside of
the websapce.

Cheers,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




[PHP] secure files acess

2002-08-16 Thread David Buerer

I have a bunch of files which need to be kept secure. I need to allow a user
access to them them based on a criteria which I can programmatically
determine.

My question, is how can I allow the user to download or view only one file
on my computer without allowthem to just enter the URL into their browser of
the file and view it?



Re: [PHP] question about executing a bash shell script...

2002-08-16 Thread Robert Cummings

Kelly Meeks wrote:
> 
> Hi Robert,
> 
> Thanks so much for the prompt reply.
> 
> Actually, I'm not trying to execute a php script, I'm trying to execute a
> shell (bash) script.
> 
> This works at the command line:
> bash makethesite.sh param1 param2 param3
> 
> This doesn't work via php
> $bashresult=shell_exec('bash makethesite.sh param1 param2 param3');
> echo $bashresult;

You are trying to execute a bash script from PHP though. When you invoke
the php engine it usually changes directory (to the root defined in the
php.ini I think). To stop this so that it will remain in the current
directory so that when you run bash it will see the bash script in the
current directory, you need to use the -C command line option. I believe
your environment is inherited by php and subsequently bash and so if
you don't use the -C option bash will be looking in the wrong directory.

Cheers,
Rob.

> 
> Doesn't execute the script, nothing in $bashresult
> 
> Kelly
> - Original Message -
> From: "Robert Cummings" <[EMAIL PROTECTED]>
> To: "Kelly Meeks" <[EMAIL PROTECTED]>
> Cc: <[EMAIL PROTECTED]>
> Sent: Friday, August 16, 2002 4:44 PM
> Subject: Re: [PHP] question about executing a bash shell script...
> 
> > Kelly Meeks wrote:
> > >
> > > Hi folks,
> > >
> > > I'm learning shell scripting via linux, and have written a script that
> creates the core files necessary for a users website from a master set of
> files.
> > >
> > > Works from the shell just fine (bash makethesite.sh username
> pathtoputfiles pathtogetfiles)
> > >
> > > Trying to execute this via php, and it literally does nothing.
> > >
> > > If I try something like:
> > > $bashoutput=shell_exec('bash makethesite.sh username pathtoputfiles
> pathtogetfiles');
> > > echo $bashoutput;
> > >
> > > I get nothing output, and the script doesn't execute.
> >
> >
> > I'm asuming you are executing something like the following:
> >
> > php myPhpScript.php
> >
> > The following will probably give you the desired results...
> >
> > php -qC myPhpScript.php
> >
> > This prevents PHP from switching out of the current directory.
> >
> > HTH,
> > Rob.
> > --
> > .-.
> > | Robert Cummings |
> > :-`.
> > | Webdeployer - Chief PHP and Java Programmer  |
> > :--:
> > | Mail  : mailto:[EMAIL PROTECTED] |
> > | Phone : (613) 731-4046 x.109 |
> > :--:
> > | Website : http://www.webmotion.com   |
> > | Fax : (613) 260-9545 |
> > `--'
> >

-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




Re: [PHP] question about executing a bash shell script...

2002-08-16 Thread Kelly Meeks

Hi Robert,

Thanks so much for the prompt reply.

Actually, I'm not trying to execute a php script, I'm trying to execute a
shell (bash) script.

This works at the command line:
bash makethesite.sh param1 param2 param3

This doesn't work via php
$bashresult=shell_exec('bash makethesite.sh param1 param2 param3');
echo $bashresult;

Doesn't execute the script, nothing in $bashresult

Kelly
- Original Message -
From: "Robert Cummings" <[EMAIL PROTECTED]>
To: "Kelly Meeks" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, August 16, 2002 4:44 PM
Subject: Re: [PHP] question about executing a bash shell script...


> Kelly Meeks wrote:
> >
> > Hi folks,
> >
> > I'm learning shell scripting via linux, and have written a script that
creates the core files necessary for a users website from a master set of
files.
> >
> > Works from the shell just fine (bash makethesite.sh username
pathtoputfiles pathtogetfiles)
> >
> > Trying to execute this via php, and it literally does nothing.
> >
> > If I try something like:
> > $bashoutput=shell_exec('bash makethesite.sh username pathtoputfiles
pathtogetfiles');
> > echo $bashoutput;
> >
> > I get nothing output, and the script doesn't execute.
>
>
> I'm asuming you are executing something like the following:
>
> php myPhpScript.php
>
> The following will probably give you the desired results...
>
> php -qC myPhpScript.php
>
> This prevents PHP from switching out of the current directory.
>
> HTH,
> Rob.
> --
> .-.
> | Robert Cummings |
> :-`.
> | Webdeployer - Chief PHP and Java Programmer  |
> :--:
> | Mail  : mailto:[EMAIL PROTECTED] |
> | Phone : (613) 731-4046 x.109 |
> :--:
> | Website : http://www.webmotion.com   |
> | Fax : (613) 260-9545 |
> `--'
>


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




RE: [PHP] question about executing a bash shell script...

2002-08-16 Thread James E Hicks III

try something like:
$bashoutput=shell_exec('/usr/bin/bash makethesite.sh username pathtoputfiles
pathtogetfiles');

if that doesn't work can you use the system() function instead?

James


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




Re: [PHP] question about executing a bash shell script...

2002-08-16 Thread Robert Cummings

Kelly Meeks wrote:
> 
> Hi folks,
> 
> I'm learning shell scripting via linux, and have written a script that creates the 
>core files necessary for a users website from a master set of files.
> 
> Works from the shell just fine (bash makethesite.sh username pathtoputfiles 
>pathtogetfiles)
> 
> Trying to execute this via php, and it literally does nothing.
> 
> If I try something like:
> $bashoutput=shell_exec('bash makethesite.sh username pathtoputfiles pathtogetfiles');
> echo $bashoutput;
> 
> I get nothing output, and the script doesn't execute.


I'm asuming you are executing something like the following:

php myPhpScript.php

The following will probably give you the desired results...

php -qC myPhpScript.php

This prevents PHP from switching out of the current directory.

HTH,
Rob.
-- 
.-.
| Robert Cummings |
:-`.
| Webdeployer - Chief PHP and Java Programmer  |
:--:
| Mail  : mailto:[EMAIL PROTECTED] |
| Phone : (613) 731-4046 x.109 |
:--:
| Website : http://www.webmotion.com   |
| Fax : (613) 260-9545 |
`--'

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




[PHP] Bulk Email [solution found!]

2002-08-16 Thread Daren Cotter

I have found a solution to my bulk email problem. I'm
posting my solution simply because I spent nearly a
year finding it, and I KNOW there's many other people
in my same situation.

First, a recap of my problem:

I need to send personalized emails to my member list
on a daily basis. I use PHP to query the MySQL
database, and loop through the results using the
mail() function. Problem: very slow, browser/php times
out, etc.

Solution:

First, I configure sendmail to use "queueonly" as the
DeliveryMethod (see sendmail.cf) instead of
"background". Then, when my PHP script runs, mailings
simply get queued instead of actually delivered. This
is a x10 speed increase. My script queues
approximately 1,000 mailings per minute (a x10 speed
increase). Then, I modified the
/etc/rc.d/init.d/sendmail script to process the queue
every 5 minutes, instead of the default one hour. This
insures that the mailings actually get sent soon after
they're queued, and you won't have to wait for
important emails to come through.

The problem with the above solution used to be this:
certain emails generated from my site (welcome emails,
password lookup emails, etc) need to be sent
IMMEDIATELY, and cannot wait in the queue for 5
minutes. The solution for this: not using the built-in
mail() command in PHP. I created my own mail script
(by modifying something someone else already did)
which opens a socket directly with the mail server.
Code is below.

// Sends the email directly to the mail server using
SMTP. This is done
// so sendmail can be setup using the queue method on
the server, and
// confirmation emails, etc, can be sent immediately
to the member.
function smtp_mail($to, $from_name, $from_email,
$reply_to_email, $subject, $body) {
$smtp = fsockopen("your_mail_server_here", 25);
if ($smtp == 0)
return 0;
fputs($smtp,"helo
machines_host_and_domain_name_here\r\n");
$line = fgets($smtp, 1024);
fputs($smtp,"mail from: $from_email\r\n");
$line = fgets($smtp, 1024);
fputs($smtp,"rcpt to: $to\r\n");
$line = fgets($smtp, 1024);
fputs($smtp,"data\r\n");
$line = fgets($smtp, 1024);
fputs($smtp,"From: $from_name <$from_email>\r\n");
fputs($smtp,"Reply-To: $reply_to_email\r\n");
fputs($smtp,"To: $to\r\n");
fputs($smtp,"Subject: $subject\r\n");
fputs($smtp,"\r\n");
fputs($smtp,"$body\r\n");
fputs($smtp,".\r\n");
$line = fgets($smtp, 1024);
fputs($smtp, "QUIT\r\n");
fclose($smtp);
return 1;
}

Function is called as follows:

if (!smtp_mail("recipient_email_here",
$EMAIL_FROM_NAME, $EMAIL_FROM_EMAIL,
$EMAIL_FROM_REPLY_TO, $SIGNUP_VALIDATION_SUBJECT,
"Test Body")) {
print "error: mail not sent";
} else {
print "it worked!";
}

Hope this helps others!

__
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

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




[PHP] question about executing a bash shell script...

2002-08-16 Thread Kelly Meeks

Hi folks,

I'm learning shell scripting via linux, and have written a script that creates the 
core files necessary for a users website from a master set of files.  

Works from the shell just fine (bash makethesite.sh username pathtoputfiles 
pathtogetfiles)

Trying to execute this via php, and it literally does nothing. 

If I try something like:
$bashoutput=shell_exec('bash makethesite.sh username pathtoputfiles pathtogetfiles');
echo $bashoutput;

I get nothing output, and the script doesn't execute.

Any ideas?

Kelly 





Re: [PHP] SQL Injection/Data Balidation

2002-08-16 Thread Edwin @

Oops! Sorry! I meant to say "apostrophe" and not "single quotes"...

And sorry 'bout this additional post...

Regards,

- E

>Actually, I DID read the articles before I replied.
>
>If you read it again, the basic problem is not about any "extended 
>SQLServer functionality"--it's about how ASP works AND how the database 
>server was configured AND how Window$ works.
>
>Sorry, but the attacks mentioned CANNOT be done on any of the database 
>servers that I've used. And with PHP, Apache, Linux combination, they just 
>don't apply.
>
>Hey, don't get me wrong. I really appreciate any security info but 
>personally I don't think they apply here...
>
>- E
>
>HINT: PHP doesn't use another "'" (single quote) character to escape 
>another single quote character--it's just basically stupid to do so.
>
>HINT 2: Configure your database server to have, for example, (1) a database 
>username/password that can only SELECT -- enough for dynamically generated 
>pages (2) a username/password that can only do INSERT or UPDATE, etc. Why 
>would I make a username/password for my web pages that can delete important 
>table or the entire database itself?
>
>>
>>If you'll thoroughly read the articles, most of those attacks that don't
>>involve the use of extended SQLServer functionality, CAN be done on
>>other RDBMS's. And if nothing else, you'll see the ingenuity of the
>>attackers.
>>
>>Hey, take what you liked, and leave the rest lay.
>>--
>>
>>If You want to buy computer parts, see the reviews at:
>>http://www.cnet.com/
>>**OR EVEN BETTER COMPILATIONS**!!
>>http://sysopt.earthweb.com/userreviews/products/
>
>
>
>
>_
>Charle con sus amigos online usando MSN Messenger: http://messenger.msn.com
>
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php




_
Charle con sus amigos online usando MSN Messenger: http://messenger.msn.com


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




[PHP] Re: progress bar for uploading files

2002-08-16 Thread Philip Hallstrom

This wouldn't work for uploading files however since the long part of the
process is the act of uploading the file and until that completes your
"save.php" (or whatever) isn't called.

So in regards to file uploading it has to be done with Javascript.  What
you do below is great for scripts that just take a long time though.

-philip

On Fri, 16 Aug 2002, Peter J. Schoenster wrote:

> On 16 Aug 2002 at 23:40, electroteque wrote:
>
> > hi guys i was wondering if there was anyway to have a progress bar for
> > uploading images ?
>
> TMTOWDI, but here is a way I did something similar. I was spidering remote sites and 
>to get user's data and store in a database and the user could not continue until
> the spider spun it's web.
>
> I accpeted the data I needed and then returned a page with the HTTP-REFRESH tag in 
>it with something like this
>
> http://yoursite.com/verify_upload?process_id=X&action=check_upload"&timer=X>
>
> So it refreshes every 10 seconds and checks to see if process X  has finished, if so 
>then redirect to the next step,  if not then just return but upgrade the timer so you
> can increase your counter (perhaps a percentage in a table cell).
>
>
> Peter
>
>
>
>
>
> --
> 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] SQL Injection/Data Balidation

2002-08-16 Thread Edwin @

Actually, I DID read the articles before I replied.

If you read it again, the basic problem is not about any "extended SQLServer 
functionality"--it's about how ASP works AND how the database server was 
configured AND how Window$ works.

Sorry, but the attacks mentioned CANNOT be done on any of the database 
servers that I've used. And with PHP, Apache, Linux combination, they just 
don't apply.

Hey, don't get me wrong. I really appreciate any security info but 
personally I don't think they apply here...

- E

HINT: PHP doesn't use another "'" (single quote) character to escape another 
single quote character--it's just basically stupid to do so.

HINT 2: Configure your database server to have, for example, (1) a database 
username/password that can only SELECT -- enough for dynamically generated 
pages (2) a username/password that can only do INSERT or UPDATE, etc. Why 
would I make a username/password for my web pages that can delete important 
table or the entire database itself?

>
>If you'll thoroughly read the articles, most of those attacks that don't
>involve the use of extended SQLServer functionality, CAN be done on
>other RDBMS's. And if nothing else, you'll see the ingenuity of the
>attackers.
>
>Hey, take what you liked, and leave the rest lay.
>--
>
>If You want to buy computer parts, see the reviews at:
>http://www.cnet.com/
>**OR EVEN BETTER COMPILATIONS**!!
>http://sysopt.earthweb.com/userreviews/products/




_
Charle con sus amigos online usando MSN Messenger: http://messenger.msn.com


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




[PHP] AllTheWeb.com design contest

2002-08-16 Thread Andrei Zmievski

I wanted to pass along the details of a contest that I thought you might
find interesting.

AlltheWeb is the public search engine of Fast Search & Transfer and
currently it is one of the largest search engines in the industry with over
2.1 billion pages in the web index.  Recently, AlltheWeb.com announced the
first ever design contest to personalize the look and feel of
www.alltheweb.com and invites all web designers and technically minded
people to submit an entry using CSS.

Below is some information about the contest and if you have any questions,
please feel free to [EMAIL PROTECTED]

---

AlltheWeb is looking for the most innovative and creative designs using
AlltheWeb Alchemist.  AlltheWeb Alchemist renders AlltheWeb in the most
basic HTML tags, with no layout, design, positioning or formatting rules.
This enables designers to get creative and work some CSS magic to transform
the site from its bare bones into a work of art.

Designs will be judged in one of three categories:
1.  "Simple, Yet Beautiful" (the most minimalistic design)
2.  "To CSS Infinity and Beyond" (the best use of CSS technology)
3.  "So 22nd Century" (the most innovative, best looking design)

The winning design in each category will win a $750 gift certificate to
Amazon.com and the CSS files will be posted on the AlltheWeb site for use by
AlltheWeb users.  Second and third place winners will also win gift
certificates and have their designs posted for use.

The contest is open to the general public.   All submissions must be
received by September 22.

More details and submission form for the contest can be found at
http://www.alltheweb.com/contest.

We're looking for some great entries and would very much appreciate your
support in getting the word out to the design community about the contest.

If you have any technical questions, feel free to contact Frode Lundgren at
[EMAIL PROTECTED]

--

-Andrei   http://www.gravitonic.com/

"It's an emergent property of connected human minds that
they create things for one another's pleasure and to conquer
their uneasy sense of being too alone." -- Eben Moglen

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




Re: [PHP] SQL Injection/Data Balidation

2002-08-16 Thread Randy Johnson

I didn't see that, what a waste of paper

Randy
- Original Message -
From: "Edwin @" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, August 16, 2002 1:14 PM
Subject: Re: [PHP] SQL Injection/Data Balidation


> Yeah, I'm scared...
>
> Please excuse me but may I say that it seems like you've sent some wrong
> info to the wrong mailing list?
>
> I use PHP NOT ASP, I use MySQL or PostgreSQL or Oracle but NOT M$ SQL
> Server. And IIS? Of course, some people use it (perhaps) because of some
> unavoidable circumstances but I don't--I use Apache NOT IIS.
>
> Of course, there's nothing bad about being cautious... However, please
send
> some links (or documents) that are more relevant...
>
> Thanks anyway, now *I* have something to scare my friends... ;)
>
> - E
>
> >
> >Please CC me as I'm on digest:
> >--
> >
> >Are there any libraries for data validation available? If one reads
> >papers like these:
> >
> > http://www.nextgenss.com/papers/advanced_sql_injection.pdf
> > http://www.nextgenss.com/papers/more_advanced_sql_injection.pdf
> >
> >It becomes apparent that sites using databases are incredibly open to
> >attack because of the ingenuity of the attackers. I think there should
> >be a PHPGuardLib or something. After reading those articles, I plan on
> >filtering ALL input for semi-cololons and 'chr(' character strings. In
> >the cases where I want to accept apostrophes, I'm going to be very
> >careful.
> >
> >Also, are there any attacks to email programs on linux that can be done
> >through input forms?
> >
> >PS, for those who think escaping user input only on apostrophes, THINK
> >AGAIN! And read the aticles above.
> >--
> >
> >If You want to buy computer parts, see the reviews at:
> >http://www.cnet.com/
> >**OR EVEN BETTER COMPILATIONS**!!
> >http://sysopt.earthweb.com/userreviews/products/
> >
> >--
> >PHP General Mailing List (http://www.php.net/)
> >To unsubscribe, visit: http://www.php.net/unsub.php
>
>
>
>
> _
> MSN Hotmail è il provider email più grande al mondo. cosa aspetti a farti
un
> account? http://www.hotmail.it
>
>
> --
> 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] Extending PHP 4.0

2002-08-16 Thread MET

Does anyone know how to build the first_module example shown at Zend
(http://www.zend.com/apidoc/) ?  I'd like to start coding extensions
(preferably not directly into the PHP binary because of my hosting
situation) but I just don't understand the explanation of compiling
them.

Any one know how?

~ Matthew

 
/**
 
  Matthew Metnetsky
 
  [EMAIL PROTECTED]
 
**/


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




Re: [PHP] Protocol on handling empty checkbox values

2002-08-16 Thread James Green

On Fri, 2002-08-16 at 19:24, David Yee wrote:
> Hi all.  For a universal form script I'm writing I want to store a 'Y' in a
> table field if a checkbox is checked and an 'N' if it's not.  The problem is
> that when the form is posted if the checkbox is not checked the checkbox
> variable is not passed.  E.g.
> 
> 
> 
> 
> 
> If the checkbox is checked, I get $_POST['my_checkbox_var'] == 'Y', but if
> not $_POST['my_checkbox_var'] is not even set.  So what I've been doing is
> putting the variable names of the checkbox fields into an array, serializing
> it, and then pass the string as a hidden input on the form.  Then in the
> page that handles the POST I unserialize the array to determine if checkbox
> fields were passed and then handle accordingly.  But I'm wondering is there
> a better way (or at least a standard way) of doing this?

I'll assume here that you're dynamically building the table and thus the
checkboxes, which is why you cannot know whether a checkbox exists on
the form or not.

If this is true, I would get a variable $loop, set it to 0, then on
outputting every checkbox, append this value to the checkbox's name.
Then you have predicatable checkbox names.

When you have finished drawing the checkboxes, note in a hidden input
field the $loop value so you know what maximum possible checkbox number
is.

On receiveing the POST, do a for loop, and perform an if
(isset($_POST["checkbox_number_$loop"])) then you know if it's set or
not.

I think that just about covers it. Apologies if I have
misread/misinterpreted what you have asked.

James Green





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




[PHP] Re: tricky preg_replace and how to escape the \{occurencenumber}

2002-08-16 Thread B.C. Lance

hm...

this should work, notice the double quotes

echo preg_replace('/(.+?)(\..+?)/e', '"\1"."1"."\2"', $fn);

Lallous wrote:
> Oh well,
> 
> I could have solved it w/ too many other methods, but how can I escape the
> \{occurence} as in my case?
> 


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




[PHP] Protocol on handling empty checkbox values

2002-08-16 Thread David Yee

Hi all.  For a universal form script I'm writing I want to store a 'Y' in a
table field if a checkbox is checked and an 'N' if it's not.  The problem is
that when the form is posted if the checkbox is not checked the checkbox
variable is not passed.  E.g.





If the checkbox is checked, I get $_POST['my_checkbox_var'] == 'Y', but if
not $_POST['my_checkbox_var'] is not even set.  So what I've been doing is
putting the variable names of the checkbox fields into an array, serializing
it, and then pass the string as a hidden input on the form.  Then in the
page that handles the POST I unserialize the array to determine if checkbox
fields were passed and then handle accordingly.  But I'm wondering is there
a better way (or at least a standard way) of doing this?

David


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




[PHP] test

2002-08-16 Thread Dan McCullough

test

=

"Theres no such thing as a problem unless the servers are on fire!"


__
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

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




Re: [PHP] Apache2

2002-08-16 Thread Bob Lockie


>Upgraded to Apache2, and now most of my php scripts won't work. No error msg
>att all, just that nothing happens.
>
>Guess I missed some standard security setting, got any clues to this newbie?

What does phpinfo() say?
What does "httpd -l" say?




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




Re: [PHP] Apache2

2002-08-16 Thread Rasmus Lerdorf

It will be a while before Apache 2 is properly supported.  Switch back to
Apache 1.3.x for now.  We are working on it and PHP 4.3 should be
significantly better with Apache 2.

-Rasmus

On Fri, 16 Aug 2002, Björn Hilliges wrote:

> Upgraded to Apache2, and now most of my php scripts won't work. No error msg
> att all, just that nothing happens.
>
> Guess I missed some standard security setting, got any clues to this newbie?
>
> Thanks
> Björn Hilliges, Sweden.
>
>
>
> --
> 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] array and a class

2002-08-16 Thread Pafo

i got my nice looking class like this:
RelicName  :  $this->RelicType  :  $this->RelicRealm  :
$this->RelicOwner";
 }

 function CheckForPrint() {
   if ($this->RelicName == "" || $this->RelicType == "" || $this->RelicRealm
== "" || $this->RelicOwner == "") {
   return false;
   } else {
   return true;
   }
 }

 function Clean() {
   $this->RelicName = "";
   $this->RelicType = "";
   $this->RelicRealm = "";
   $this->RelicOwner = "";
 }

 function SetName($name) {
 $this->RelicName = $name;
 }

 function SetType($type) {
   $this->RelicType = $type;
 }

 function SetRealm($realm) {
   $this->RelicRealm = $realm;
 }

 function SetOwner($owner) {
   $this->RelicOwner = $owner;
 }

 function DebugPrint() {
   print $this->RelicName;
 }
}

$temp = new Relic();
$temp->SetName("test");
$temp->DebugPrint();
?>

but the thing is i want an array that is based on my class, so i want to use
$relicarray[1]->DebugPrint();
how does it work,, anyone that can give me a working example, cause i cant
find any  :/

regards
patrick



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




Re: [PHP] Re: php and classes

2002-08-16 Thread Pafo

the problem is that i dont have access to php.ini  :/
on a shared webhotel  :(

regards
patrick

"Jason Wong" <[EMAIL PROTECTED]> skrev i meddelandet
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> On Friday 16 August 2002 11:40, Pafo wrote:
> > nm, now it works,, forgot the silly ()
>
> Always set error reporting to FULL, and always error log to a file (see
> settings in php.ini). That way you probably could have figured out what
the
> problem was by examining the logs.
>
> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> Your fly might be open (but don't check it just now).
> */
>



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




[PHP] Apache2

2002-08-16 Thread Björn Hilliges

Upgraded to Apache2, and now most of my php scripts won't work. No error msg
att all, just that nothing happens.

Guess I missed some standard security setting, got any clues to this newbie?

Thanks
Björn Hilliges, Sweden.



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




Re: [PHP] Keyword & exact phrase search

2002-08-16 Thread Jason Wong

On Thursday 15 August 2002 23:50, David Buerer wrote:
> Because to my knowledge the limitation of a TEXT field is 64K. I need to
> store entire documents in the database which far exceed the 64K limitation.
> Given that criteria, the only option is to use blob fields which have an
> upper limit of roughly 4GB.

TEXT fields in MySQL can store the same amount as their BLOB counterparts.

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

/*
Rule of Defactualization:
Information deteriorates upward through bureaucracies.
*/


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




[PHP] Re: Invoking sendmail with PHP

2002-08-16 Thread Gui Guy

On a unix box, you can supply the arguments to the sendmail command in
php.ini file, when you specify the sendmail path.

"Daren Cotter" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> To recap, my problem is:
>
> I need some mailings sent immediately (confirmation
> emails, welcome emails, password lookup emails, etc),
> while others simply get thrown into the queue, and get
> sent the next time the queue processes.
>
> I contacted a sendmail guru, and he told me that if
> Sendmail is run with the -odb arguments, the mail will
> process immediately, while if it's run with the -odd
> arguments, it will only be queued.
>
> So the question is, using PHP, how do I invoke
> sendmail with the different arguments separately?
>
> __
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com



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




Re: [PHP] SQL Injection/Data Balidation

2002-08-16 Thread Edwin @

Yeah, I'm scared...

Please excuse me but may I say that it seems like you've sent some wrong 
info to the wrong mailing list?

I use PHP NOT ASP, I use MySQL or PostgreSQL or Oracle but NOT M$ SQL 
Server. And IIS? Of course, some people use it (perhaps) because of some 
unavoidable circumstances but I don't--I use Apache NOT IIS.

Of course, there's nothing bad about being cautious... However, please send 
some links (or documents) that are more relevant...

Thanks anyway, now *I* have something to scare my friends... ;)

- E

>
>Please CC me as I'm on digest:
>--
>
>Are there any libraries for data validation available? If one reads
>papers like these:
>
>   http://www.nextgenss.com/papers/advanced_sql_injection.pdf
>   http://www.nextgenss.com/papers/more_advanced_sql_injection.pdf
>
>It becomes apparent that sites using databases are incredibly open to
>attack because of the ingenuity of the attackers. I think there should
>be a PHPGuardLib or something. After reading those articles, I plan on
>filtering ALL input for semi-cololons and 'chr(' character strings. In
>the cases where I want to accept apostrophes, I'm going to be very
>careful.
>
>Also, are there any attacks to email programs on linux that can be done
>through input forms?
>
>PS, for those who think escaping user input only on apostrophes, THINK
>AGAIN! And read the aticles above.
>--
>
>If You want to buy computer parts, see the reviews at:
>http://www.cnet.com/
>**OR EVEN BETTER COMPILATIONS**!!
>http://sysopt.earthweb.com/userreviews/products/
>
>--
>PHP General Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php




_
MSN Hotmail è il provider email più grande al mondo… cosa aspetti a farti un 
account? http://www.hotmail.it


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




RE: [PHP] session lost when back button hit?

2002-08-16 Thread Alok K. Dhir


By any chance, is page one the "entrance" page to your application?
I.e. is there a session id in either the query string of the page URL or
was there one passed to it via a POST?

Without cookies enabled, there is no way to allow users to use the back
button to go back to the entrance page while maintaining the session.

One (hackish) solution to this is to cause the entrance page to
immediately redirect to itself using either PHP's header function, or a
meta refresh.  Your goal here is to make it so that hitting back from a
secondary page would take you to the post-refreshed entrance page which
has the session ID.

Good luck.

> -Original Message-
> From: 
> [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED]
> .net] On Behalf Of Jean-Christian Imbeault
> Sent: Friday, August 16, 2002 10:43 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP] session lost when back button hit?
> 
> 
> I have two pages, page one links to page two via a form button. The 
> browser does not accept cookies.
> 
> On page two I create a session variable with:
> 
> $_SESSION["id"] = 1;
> 
> But if I hit the back button to go back to page one 
> $_SESSION["id"] is 
> not set. If I hit the reload button on page one it is still not set.
> 
> How can I get a session var to stay set when someone hits the 
> back button?
> 
> Jc
> 
> PS I have session.auto_start ON and enabled trans-sid
> 
> 
> -- 
> 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] Re: sessions: what to do when browser won't accept cookies?

2002-08-16 Thread SHEETS,JASON (Non-HP-Boise,ex1)

Good idea but remember some people turn off javascript and cookies :)

Make your site as accessible as you can, using Jerry's suggestion is a good
idea and then accept some people will be bent on not being able to use your
site by disabling as much functionality in their browsers as they can or
they use old browsers that don't support the functionality you are using.

Jason

-Original Message-
From: Jerry [mailto:[EMAIL PROTECTED]] 
Sent: Friday, August 16, 2002 10:20 AM
To: [EMAIL PROTECTED]
Subject: [PHP] Re: sessions: what to do when browser won't accept cookies?

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Jean-Christian Imbeault) wrote:
> How can I get around the problem of not having the SID in the URL of the 
> first page to my site the user comes to? It kind of a chicken-or-the-egg 
> problem ...

I kind of hate it when sites do this, but you could have the first page 
reload itself if it doesn't have an SID, and add an SID to itself. This 
way, if they use the back button, the first "first page" they come to 
has the SID.

You might then be able to use window.forward() in Javascript first, 
before giving them an SID. If they used the back button to get to you, 
window.forward() moves forward to a page that has an SID (which should 
look exactly like the page they thought they wanted that didn't have an 
SID). If they didn't use the back button to get to you, window.forward 
shouldn't do anything.

As a fall-back, you would probably want to have a warning on the front 
page that says, if the front page has no SID, that if they used the back 
button get here, use the forward button to go back or they might lose 
their session data.

This depends on your audience, of course. If you did that to me as a 
general browser, I probably wouldn't ever visit your site again :*)

Note that some sites do come right out and tell you not to use your back 
button to get around. You might just do this, and if they use their back 
button anyway, they get a new session.

Jerry
-- 
http://www.hoboes.com/jerry/
"Give a man a fish and you feed him for a day. Teach him to fish, and you've
depleted the lake."--It Isn't Murder If They're Yankees
(http://www.hoboes.com/jerry/Murder/)

-- 
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] progress bar for uploading files

2002-08-16 Thread Peter J. Schoenster

On 16 Aug 2002 at 23:40, electroteque wrote:

> hi guys i was wondering if there was anyway to have a progress bar for
> uploading images ?

TMTOWDI, but here is a way I did something similar. I was spidering remote sites and 
to get user's data and store in a database and the user could not continue until 
the spider spun it's web.

I accpeted the data I needed and then returned a page with the HTTP-REFRESH tag in it 
with something like this

http://yoursite.com/verify_upload?process_id=X&action=check_upload"&timer=X>
 

So it refreshes every 10 seconds and checks to see if process X  has finished, if so 
then redirect to the next step,  if not then just return but upgrade the timer so you 
can increase your counter (perhaps a percentage in a table cell).


Peter





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




[PHP] Moving Files - Stupid Error

2002-08-16 Thread Steve Keller

Hey all, I need a little help with moving a file on the server after an 
upload.

Our company site is hosted, so I don't have full access to the 
configuration files, but I can do a PHP_info dump if you need more 
clarification. Using 4.0.1pl2.

What I'm doing is uploading a file from a form, and that goes through just 
fine. I can print the file name to a database, along with the size.

The trouble is, no matter how I try to move it from the tmp directory, I 
get the same error. I've tried referencing it by the name given in the 
form, I've tried referencing it by $_Files. No matter how I call it, it 
never seems to go back to the tmp directory to look for the file. Here's a 
sample error:

Warning: Unable to create '/test/data/test.txt': No such file or directory 
in /usr/local/www/vhosts/healthtvchannel.org/htdocs/test/upload.php on line 17

That's with using:

 copy("{$UploadedFile}","/test/data/".$UploadedFile_name);

$UploadedFile being the name I'm using. Both variables seem to be returning 
correctly. $UploadedFile returns the temp name, and $UploadedFile_name 
returns the actual name. The file is also far under the maximum file size. 
The /test/data has Nobody write permissions, I know because I'm writing to 
a file in it with another script, and there's no file in there with the 
same file name to cause overwriting ownership conflicts.

So where am I being stupid?

Here's the full code:


");
 $filename = $UploadedFile_name;
 print "$filename was uploaded successfuly\n";
 $realname = $UploadedFile_name;
 print "realname is $realname\n";
 print "copying file to uploads dir\n";
 copy("{$UploadedFile}","/test/data/".$UploadedFile_name);
?>






--
S. Keller
UI Engineer
The Health TV Channel, Inc.
(a non - profit organization)
3820 Lake Otis Pkwy.
Anchorage, AK 99508
907.770.6200 ext.220
907.336.6205 (fax)
Email: [EMAIL PROTECTED]
Web: www.healthtvchannel.org


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




Re: [PHP] tricky preg_replace and how to escape the \{occurencenumber}

2002-08-16 Thread Jason Wong

On Friday 16 August 2002 22:12, lallous wrote:

> Actually the interpreter will evaluate the '\1'. '1' . '\2' into one string
> before passing it to preg_replace
> So it will yield up as I originally wrote it, and it won't work.

Hmm, you're right. The interpreter is smarter than I thought :-/

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

/*
"Why should we subsidize intellectual curiosity?"
 -Ronald Reagan
*/


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




RE: [PHP] Re: progress bar for uploading files

2002-08-16 Thread Jay Blanchard

I had a rather weird thought, but it is Friday after all :^]

How about setting a small IFRAME in the upload diaog box? Then you could do
a couple of things;

a.) Place a small animated GIF in the IFRAME that moves left to right or
from side to side until the upload completes.

2.) Use the GD library and do something similar in the IFRAME.

Now, there are some issues such as calcing the time it takes to upload or
measuring the amount of the file upload and updating the IFRAME image
accordingly, and maybe some other little details that I am not thinking
about, but it just a weird little thought. I'd love to see some solutions
based on this though, and maybe when I get a little time next week I'll give
it a go.

HTH!

Jay

***
* Texas PHP Developers Conf  Spring 2003  *
* T Bar M Resort & Conference Center  *
* New Braunfels, Texas*
* San Antonio Area PHP Developers Group   *
* Interested? Contact [EMAIL PROTECTED] *
***

Rasmus, how much would it cost to get you or someone like you to come to
this? :^]



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




Re: [PHP] Credit Card Transactions and Micropayment

2002-08-16 Thread Analysis & Solutions

Sascha:

On Wed, Aug 14, 2002 at 04:06:39PM +0200, Sascha Braun wrote:
> 
> Are there some ways of using a micropayment system together with PHP?

What do you mean by "micropayment?"  Paying for small fees?  How small are 
you talking about?


> Maybe something where Customers can see the Amount of Money they have to 
> pay, and then they do a phonecall to e specific number and then the page 
> redirects teh customer to a downloads page where the user can receive 
> his picturepackage.

Sounds like an overly complex process.  Why not do it all automatically
with a well designed payment script?

--Dan

PS:  Please turn on line wrapping in your email program.

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




RE: [PHP] Re: progress bar for uploading files

2002-08-16 Thread Brian V Bonini

Bet this would be perfect for combining Flash and PHP.

> -Original Message-
> From: Philip Hallstrom [mailto:[EMAIL PROTECTED]]
> Sent: Friday, August 16, 2002 11:57 AM
> To: electroteque
> Cc: [EMAIL PROTECTED]
> Subject: [PHP] Re: progress bar for uploading files
>
>
> You're best bet would be to make an animated gif that looks like a progres
> bar (or twirling icon or whatever).
>
> Then when the users hits submit, "turn it on"... in the same way you do
> image rollovers, etc...
>
> Then it will spin until the form is submitted...
>
> On Fri, 16 Aug 2002, electroteque wrote:
>
> > hi guys i was wondering if there was anyway to have a progress bar for
> > uploading images ?
> >
> >
> >
> > --
> > 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




[PHP] Re: sessions: what to do when browser won't accept cookies?

2002-08-16 Thread Jerry

In article <[EMAIL PROTECTED]>,
 [EMAIL PROTECTED] (Jean-Christian Imbeault) wrote:
> How can I get around the problem of not having the SID in the URL of the 
> first page to my site the user comes to? It kind of a chicken-or-the-egg 
> problem ...

I kind of hate it when sites do this, but you could have the first page 
reload itself if it doesn't have an SID, and add an SID to itself. This 
way, if they use the back button, the first "first page" they come to 
has the SID.

You might then be able to use window.forward() in Javascript first, 
before giving them an SID. If they used the back button to get to you, 
window.forward() moves forward to a page that has an SID (which should 
look exactly like the page they thought they wanted that didn't have an 
SID). If they didn't use the back button to get to you, window.forward 
shouldn't do anything.

As a fall-back, you would probably want to have a warning on the front 
page that says, if the front page has no SID, that if they used the back 
button get here, use the forward button to go back or they might lose 
their session data.

This depends on your audience, of course. If you did that to me as a 
general browser, I probably wouldn't ever visit your site again :*)

Note that some sites do come right out and tell you not to use your back 
button to get around. You might just do this, and if they use their back 
button anyway, they get a new session.

Jerry
-- 
http://www.hoboes.com/jerry/
"Give a man a fish and you feed him for a day. Teach him to fish, and you've
depleted the lake."--It Isn't Murder If They're Yankees
(http://www.hoboes.com/jerry/Murder/)

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




Re: [PHP] Variable

2002-08-16 Thread Analysis & Solutions

On Wed, Aug 14, 2002 at 08:23:18AM +, Remon Redika wrote:
>
>   
>   
>   
> 
> $Namak = $namasa;
> $Namak = $Namak.$namadu;
> $Namak = $Namak.$namati; 

Is that REALLY what you want to do?  There are no spaces between the
names.  Try:

   $Namak = "$namsa $namadu $namati";

But, that's probably not the problem.  I suspect none of the three 
variables are being set because you have register_globals turned off.

Use the $_POST or $_GET variables.

Read the manual on these topics for more information.

--Dan

-- 
   PHP classes that make web design easier
SQL Solution  |   Layout Solution   |  Form Solution
sqlsolution.info  | layoutsolution.info |  formsolution.info
 T H E   A N A L Y S I S   A N D   S O L U T I O N S   C O M P A N Y
 4015 7 Av #4AJ, Brooklyn NY v: 718-854-0335 f: 718-854-0409

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




Re: [PHP] Session variable in query

2002-08-16 Thread Justin French

not entirely sure what you mean, but perhaps this is what you're after???

$sql = "SELECT * FROM tablename WHERE username='{$_SESSION['userid']}'";

Justin French


on 17/08/02 2:08 AM, Christian Ista ([EMAIL PROTECTED]) wrote:

> Hello,
> 
> Is it possible to use a session variable in a query (mysql_query)
> without passé by an temp variable ?
> 
> Bye
> 
> 
> --
> 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] PHP Java Extension

2002-08-16 Thread Girish Nath


Hi

I wanted to learn some new stuff and experiment with the PHP Java extension,
what are the possibilities, what's cool about it, what are you guys using it
for and where can i find some tutorials for it ? Had a look at php.net but
can't find much info suitable for a newbie to this particular extension.

Thanks :)


Girish




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




[PHP] Session variable in query

2002-08-16 Thread Christian Ista

Hello,

Is it possible to use a session variable in a query (mysql_query)
without passé by an temp variable ?

Bye


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




[PHP] Re: progress bar for uploading files

2002-08-16 Thread Philip Hallstrom

You're best bet would be to make an animated gif that looks like a progres
bar (or twirling icon or whatever).

Then when the users hits submit, "turn it on"... in the same way you do
image rollovers, etc...

Then it will spin until the form is submitted...

On Fri, 16 Aug 2002, electroteque wrote:

> hi guys i was wondering if there was anyway to have a progress bar for
> uploading images ?
>
>
>
> --
> 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] HTML-based mail with PHP

2002-08-16 Thread Liam Gibbs

Now, this may be more of an e-mail question than a PHP
question. For that, I apologize.

I'm having trouble with some HTML-based mail with PHP.
It's not the regular thing where I can't get it to use
the tags instead of just printing them. That part's
fine; it comes out HTML-based.

My problem is the way it's not accessing a certain
image. I get a broken link instead of an image at the
top of my e-mail. I had it print the URL at which it
should find the image, and then cut and paste that in
my browser, and the image comes up fine. But, as far
as putting it in the e-mail, it's not working out.

Any ideas?

__
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

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




[PHP] Re: How retrieve database data from email?

2002-08-16 Thread Bogdan Stancescu

Bogdan Stancescu wrote:
> Add a line reading
> stocks: | /usr/bin/php /path/to/your/script.php

Sorry, it should be
stocks: "| /usr/bin/php /path/to/your/script.php"

Also, first make sure php works from command line and check its location.

Bogdan


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




[PHP] Re: using PHP on forms submitted to other sites - HELP

2002-08-16 Thread Kondwani Spike Mkandawire


"Dan McCullough" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> We have a client that has a form that submits to a payment processor to
handle the cc processing.
> The visitor gets what he wants and then comes to a verification page on
our clients site.  He
> wants to buy it so he clicks the submit button and hes gone, to the
payment processors site.  We
> want to send a notification that someone has placed an order, not that
they got to the payment
> page.  So I have tried using onSubmit on the form and then placing the
function name in there, but
> that doesnt work, its a function written in PHP to send a mail alert.  Any
thoughts we dont want
> the alert going to the guy until the visitor actually hits the submit
button, and once it leaves
> the return notification from the processor is very limited, so I can't
send it on the return from
> teh processor.
>
> Help please :)
>

try this...








> =
> 
> "Theres no such thing as a problem unless the servers are on fire!"
>
>
> __
> Do You Yahoo!?
> HotJobs - Search Thousands of New Jobs
> http://www.hotjobs.com



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




[PHP] Re: How retrieve database data from email?

2002-08-16 Thread Bogdan Stancescu

I'm not very proficient with e-mail configuration, so if someone finds 
I'm saying something wrong, don't think twice before correcting it. 
AFAIK, you can create an alias typically in /etc/aliases - or 
/etc/sendmail/aliases, as I've heard for newer versions of sendmail. In 
any case, the file has to be there already because that's where you have 
the root/webmaster/postmaster aliases defined.

Add a line reading
stocks: 
| /usr/bin/php /path/to/your/script.php

I'm not sure if sendmail should be restarted after this, so you'd better 
do it just to make sure.

You'll obviously need root access to do these. After this point, you 
don't anymore.

In /path/to/your/script.php, you'll receive the whole e-mail message 
from standard input, so you'll have to check out those functions here 
http://www.php.net/manual/en/features.commandline.php

Then all you have to do is parse the incoming mail message - I'm sure 
you'll be able to google out plenty of functions/classes to do that - 
drop me an e-mail if you don't find any and I'll send you mine.

Bogdan

Lallous wrote:
> How and where can I add an alias and associate PHP with that alias?
> 
> 
> Elias
> "Bogdan Stancescu" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> 
>>You can set up php to run from console if it doesn't already, and add an
>>alias to your mail server ("stocks") which would parse the incoming mail
>>and do the appropriate deeds.
>>
>>Bogdan
>>
>>M wrote:
>>
>>>Hello People:
>>>
>>>I have my pages built in PHP / Mysql, all working ok, but now I need
>>>solve a problem I don't know how to solve or even how search about. Case
>>>this problem was already discussed in this list, I would be grateful if
>>>someone pass to me correct date so I can search about.
>>>
>>>My problem is very simple: I have customers who dont want enter into
>>>html pages to retrieve some info (suppose info are stock values), but
>>>rather they want to send email with formatted query into mail subject
>>>(or at least in body) , and then receive response again by email.
>>>
>>>For instance, customer could send this for [EMAIL PROTECTED]
>>>
>>>to: [EMAIL PROTECTED]
>>>subject: name=ibm, year=2001
>>>body: (empty)
>>>
>>>In response, he should receive an email with all IBM stock prices day by
>>>day.
>>>
>>>That't all, I hope this will have solution, but I can't figure how email
>>>could communicate automatically with PHP/Mysql.
>>>
>>>Thanks
>>>
>>>Miguel
>>>
>>>
>>
>>
> 
> 



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




Re: [PHP] session lost when back button hit?

2002-08-16 Thread Jean-Christian Imbeault

Daniel Masson wrote:
> 
> make ser youre using session_start() before performing any action on
> sessions, also make sure you´re registering properly the variables.

Did you see my PS at the end of my question?

> PS I have session.auto_start ON and enabled trans-sid

I don't need seesion_start() and I don't need to register the variable 
since I am setting it directly with $_SESSION["id"] = 1

If I am wrong about this please correct me, I'm still new to sessions.

Jc


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




[PHP] sessions: what to do when browser won't accept cookies?

2002-08-16 Thread Jean-Christian Imbeault

I'm finding myself in a strange situation. I am trying to build a a web 
site that will use sessions and work even if a user decides not to 
accept cookies.

So far the site design is working fine by using the trans-sid 
functionality of PHP. But I have this on case where things break down.

1- user comes to the top page of my site
2- I try and start a session. user refuses to accept cookies
3- user click on links to visit my site, session works before SID is 
passed along in the URL
4 user clicks back button all the way back to my top page
5 session is lost because the SID is not in the URL of the top page ...

How can I get around the problem of not having the SID in the URL of the 
first page to my site the user comes to? It kind of a chicken-or-the-egg 
problem ...

Thanks for any and all suggestions!

Jc


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




RE: [PHP] session lost when back button hit?

2002-08-16 Thread Daniel Masson


HI

make ser youre using session_start() before performing any action on
sessions, also make sure you´re registering properly the variables.


-Mensaje original-
De: Jean-Christian Imbeault [mailto:[EMAIL PROTECTED]] 
Enviado el: viernes, 16 de agosto de 2002 9:43
Para: [EMAIL PROTECTED]
Asunto: [PHP] session lost when back button hit?


I have two pages, page one links to page two via a form button. The 
browser does not accept cookies.

On page two I create a session variable with:

$_SESSION["id"] = 1;

But if I hit the back button to go back to page one $_SESSION["id"] is 
not set. If I hit the reload button on page one it is still not set.

How can I get a session var to stay set when someone hits the back
button?

Jc

PS I have session.auto_start ON and enabled trans-sid


-- 
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] SQL Injection/Data Balidation

2002-08-16 Thread Dennis Gearon

Please CC me as I'm on digest:
--

Are there any libraries for data validation available? If one reads
papers like these:

http://www.nextgenss.com/papers/advanced_sql_injection.pdf
http://www.nextgenss.com/papers/more_advanced_sql_injection.pdf

It becomes apparent that sites using databases are incredibly open to
attack because of the ingenuity of the attackers. I think there should
be a PHPGuardLib or something. After reading those articles, I plan on
filtering ALL input for semi-cololons and 'chr(' character strings. In
the cases where I want to accept apostrophes, I'm going to be very
careful.

Also, are there any attacks to email programs on linux that can be done
through input forms?

PS, for those who think escaping user input only on apostrophes, THINK
AGAIN! And read the aticles above.
-- 

If You want to buy computer parts, see the reviews at:
http://www.cnet.com/
**OR EVEN BETTER COMPILATIONS**!!
http://sysopt.earthweb.com/userreviews/products/

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




RE: [PHP] OO code and private functions

2002-08-16 Thread Cal Evans

not yet (Zend engine 2.0 I believe has this)  Currently the convention is to
name private functions _* (variables the same) This denotes to other coders
that you intended this to be a private function.

=C=

*
* Cal Evans
* The Virtual CIO
* http://www.calevans.com
*


-Original Message-
From: Richard Black [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 16, 2002 9:24 AM
To: Php-General
Subject: [PHP] OO code and private functions


Can I make a function private in PHP, so that it can only be called from
within an object of that class???

Just discovering the wonders of OO PHP... :-)

==
Richard Black
Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
Tel: 0141 435 3504
Email: [EMAIL PROTECTED]


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



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




[PHP] using PHP on forms submitted to other sites - HELP

2002-08-16 Thread Dan McCullough

We have a client that has a form that submits to a payment processor to handle the cc 
processing. 
The visitor gets what he wants and then comes to a verification page on our clients 
site.  He
wants to buy it so he clicks the submit button and hes gone, to the payment processors 
site.  We
want to send a notification that someone has placed an order, not that they got to the 
payment
page.  So I have tried using onSubmit on the form and then placing the function name 
in there, but
that doesnt work, its a function written in PHP to send a mail alert.  Any thoughts we 
dont want
the alert going to the guy until the visitor actually hits the submit button, and once 
it leaves
the return notification from the processor is very limited, so I can't send it on the 
return from
teh processor.

Help please :)

=

"Theres no such thing as a problem unless the servers are on fire!"


__
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com

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




[PHP] session lost when back button hit?

2002-08-16 Thread Jean-Christian Imbeault

I have two pages, page one links to page two via a form button. The 
browser does not accept cookies.

On page two I create a session variable with:

$_SESSION["id"] = 1;

But if I hit the back button to go back to page one $_SESSION["id"] is 
not set. If I hit the reload button on page one it is still not set.

How can I get a session var to stay set when someone hits the back button?

Jc

PS I have session.auto_start ON and enabled trans-sid


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




Re: [PHP] OO code and private functions

2002-08-16 Thread Joseph W. Goff

Not currently, but this will be added in the Zend2 engine.  You can find out
about this on the Zend website.
- Original Message -
From: "Richard Black" <[EMAIL PROTECTED]>
To: "Php-General" <[EMAIL PROTECTED]>
Sent: Friday, August 16, 2002 9:24 AM
Subject: [PHP] OO code and private functions


> Can I make a function private in PHP, so that it can only be called from
> within an object of that class???
>
> Just discovering the wonders of OO PHP... :-)
>
> ==
> Richard Black
> Systems Programmer, DataVisibility Ltd - http://www.datavisibility.com
> Tel: 0141 435 3504
> Email: [EMAIL PROTECTED]
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


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




  1   2   >