Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #3402 > unrolled thread

This is a total php newbie question

Started byjustaguy <lichunshen84@gmail.com>
First post2011-10-13 15:29 -0700
Last post2011-10-14 06:49 +0000
Articles 19 — 10 participants

Back to article view | Back to comp.lang.php


Contents

  This is a total php newbie question justaguy <lichunshen84@gmail.com> - 2011-10-13 15:29 -0700
    Re: This is a total php newbie question Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-13 20:17 -0400
      Re: This is a total php newbie question Doug Miller <doug_at_milmacdotcom@example.com> - 2011-10-13 21:12 -0400
      Re: This is a total php newbie question justaguy <lichunshen84@gmail.com> - 2011-10-13 17:58 -0700
        Re: This is a total php newbie question Arno Welzel <usenet@arnowelzel.de> - 2011-10-14 09:27 +0200
        Re: This is a total php newbie question Erwin Moller <Since_humans_read_this_I_am_spammed_too_much@spamyourself.com> - 2011-10-14 10:27 +0200
        Re: This is a total php newbie question Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-14 05:45 -0400
          Re: This is a total php newbie question Tim Streater <timstreater@greenbee.net> - 2011-10-14 11:41 +0100
            Re: This is a total php newbie question Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-14 10:19 -0400
        Re: This is a total php newbie question Bill B <me@privacy.net> - 2011-10-15 12:53 -0400
        Re: This is a total php newbie question sheldonlg <sheldonlg@thevillages.net> - 2011-10-18 18:42 -0400
          Re: This is a total php newbie question Bill B <me@privacy.net> - 2011-10-19 07:21 -0400
            Re: This is a total php newbie question Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-19 11:27 -0400
              Re: This is a total php newbie question Bill B <me@privacy.net> - 2011-10-19 12:22 -0400
                Re: This is a total php newbie question Doug Miller <doug_at_milmacdotcom@example.com> - 2011-10-19 15:12 -0400
                Re: This is a total php newbie question Jerry Stuckle <jstucklex@attglobal.net> - 2011-10-20 08:53 -0400
                  Re: This is a total php newbie question Bill B <me@privacy.net> - 2011-10-20 09:46 -0400
            Re: This is a total php newbie question The Natural Philosopher <tnp@invalid.invalid> - 2011-10-19 17:21 +0100
    Re: This is a total php newbie question Denis McMahon <denismfmcmahon@gmail.com> - 2011-10-14 06:49 +0000

#3402 — This is a total php newbie question

Fromjustaguy <lichunshen84@gmail.com>
Date2011-10-13 15:29 -0700
SubjectThis is a total php newbie question
Message-ID<bec63536-fbea-459e-94a3-79f10dc1623d@f13g2000vbv.googlegroups.com>
Hi,

I sort of touched php at a very beginner's level a while ago...

Here' what I intended to do with some php scripts.
Business wise,
b1: take the user to PayPal to make a payment.
b2. take the user back from PayPal to download a program.

Technically with php.
Have a base php script that performs the following task:
Send a form to PayPal
The Action line is tricky...

Another php script addresses the PayPal's Return link.
it  does two things:
a) create another php script on the fly.
In it, it embed a link with a parameter.
b) it expires in 24 hours (remove the current context of the php file
or replace it with the following statement:
"The link has expired.  Please contact info@knowledgenotebook.com for
assistance."

Next.

1) how to create a php file on the fly?
With the content in the following 2)

<?php
$ourFileName = "go2download.html";
$ourFileHandle = fopen($ourFileName, 'w') or die("can't open file");

// place holder;
$content = "";

/* Here's the Quesion,
How could I pass all the content in the following 2) into this
$content var, do it one by one is simply stupid?
Please advise.  Thanks.

*/
fwrite($ourFileHandle, $content);

fclose($ourFileHandle);

?>


2) How to set the link var, note var and display them

<?php
 $link = "http://bla.bla.bal/myProgram.exe";

$note = "Please go to the Knowledge NoteBook website's Download page
for Installation Instructions,

$date1 = new DateTime("now");
$date2 = new DateTime("tomorrow");
$interval = date_diff($date1, $date2);

if ($interval) > 0
{
 $link = "";
 $note = "Sorry, the link has expired.  Please contact
info@knowledgenotebook.com for assistance.";
}

<? print($link); ?>
<? print($note); ?>

?>



3) How to expire or change its content?
Sort of, resolved.


[toc] | [next] | [standalone]


#3403

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-10-13 20:17 -0400
Message-ID<j77v3j$2o9$1@dont-email.me>
In reply to#3402
On 10/13/2011 6:29 PM, justaguy wrote:
>
> Hi,
>
> I sort of touched php at a very beginner's level a while ago...
>
> Here' what I intended to do with some php scripts.
> Business wise,
> b1: take the user to PayPal to make a payment.

OK

> b2. take the user back from PayPal to download a program.
>

You can't "take the user back".  All you can do is send them to a site. 
  Once they're gone, they're out of your control.  It's up to PayPal to 
send them back (which the user may or may not do).

> Technically with php.
> Have a base php script that performs the following task:
> Send a form to PayPal

Are you going to send them to PayPal or send a form to PayPal?  The two 
are entirely different.

> The Action line is tricky...
>
> Another php script addresses the PayPal's Return link.
> it  does two things:
> a) create another php script on the fly.

Don't even think of this.

> In it, it embed a link with a parameter.

No problem.

> b) it expires in 24 hours (remove the current context of the php file
> or replace it with the following statement:
> "The link has expired.  Please contact info@knowledgenotebook.com for
> assistance."
>

Easy enough to do even without creating a script on the fly.  That's 
what databases are good for.


> Next.
>
> 1) how to create a php file on the fly?
> With the content in the following 2)

As I said before - don't even try. Use a database.

<snip>


> 2) How to set the link var, note var and display them
>
> <?php
>   $link = "http://bla.bla.bal/myProgram.exe";
>

If you want people to subscribe to something, don't let them link to it 
directly.  Otherwise anyone will be able to download it just by knowing 
the location.  Rather, place the file outside of your website's document 
root and serve it with PHP (after validating people's information).

> $note = "Please go to the Knowledge NoteBook website's Download page
> for Installation Instructions,
>
> $date1 = new DateTime("now");
> $date2 = new DateTime("tomorrow");
> $interval = date_diff($date1, $date2);
>
> if ($interval)>  0
> {
>   $link = "";
>   $note = "Sorry, the link has expired.  Please contact
> info@knowledgenotebook.com for assistance.";
> }
>
> <? print($link); ?>
> <? print($note); ?>
>
> ?>
>
>
>

Again, use a database.

> 3) How to expire or change its content?
> Sort of, resolved.
>
>
>

Once again, use a database.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#3404

FromDoug Miller <doug_at_milmacdotcom@example.com>
Date2011-10-13 21:12 -0400
Message-ID<j782b1$hed$1@dont-email.me>
In reply to#3403
On 10/13/2011 8:17 PM, Jerry Stuckle wrote:
> On 10/13/2011 6:29 PM, justaguy wrote:
>>
>> Hi,
>>
>> I sort of touched php at a very beginner's level a while ago...
>>
>> Here' what I intended to do with some php scripts.
>> Business wise,
>> b1: take the user to PayPal to make a payment.
>
> OK
>
>> b2. take the user back from PayPal to download a program.
>>
>
> You can't "take the user back". All you can do is send them to a site.
> Once they're gone, they're out of your control. It's up to PayPal to
> send them back (which the user may or may not do).

That's not entirely correct: PayPal's interface does permit the merchant 
to specify a URL to which PayPal will transfer control once the business 
at PayPal's site is concluded. If the user cancels the transaction at 
PayPal, that won't happen, of course, but if he completes the 
transaction, PayPal will send him back to whatever URL the merchant 
supplied to PayPal as the "return address".

[toc] | [prev] | [next] | [standalone]


#3405

Fromjustaguy <lichunshen84@gmail.com>
Date2011-10-13 17:58 -0700
Message-ID<4b9df8e1-d651-4058-9cd9-a7e3c2231725@e37g2000yqa.googlegroups.com>
In reply to#3403
Sorry, Jerry, you missed my question.

Send the form to PayPay is to interface with PayPal's API
with the form's ACTION line.
And since it's an API, PayPal has a way to let the user click on
"Return to bla bla".

In essence, the task will accomplish two things:
A) link the user/buyer to PayPal to make a payment
B) back to my site with a special URL that give the buyer the info
including the software download link (but this link would expire in 24
hours).

Absolutely no need whatsoever with a database for this, it would be
totally overkill.

Don

>On Oct 13, 8:17 pm, Jerry Stuckle <jstuck...@attglobal.net> wrote:
> On 10/13/2011 6:29 PM, justaguy wrote:
>
>
>
> > Hi,
>
> > I sort of touched php at a very beginner's level a while ago...
>
> > Here' what I intended to do with some php scripts.
> > Business wise,
> > b1: take the user to PayPal to make a payment.
>
> OK
>
> > b2. take the user back from PayPal to download a program.
>
> You can't "take the user back".  All you can do is send them to a site.
>   Once they're gone, they're out of your control.  It's up to PayPal to
> send them back (which the user may or may not do).
>
> > Technically with php.
> > Have a base php script that performs the following task:
> > Send a form to PayPal
>
> Are you going to send them to PayPal or send a form to PayPal?  The two
> are entirely different.
>
> > The Action line is tricky...
>
> > Another php script addresses the PayPal's Return link.
> > it  does two things:
> > a) create another php script on the fly.
>
> Don't even think of this.
>
> > In it, it embed a link with a parameter.
>
> No problem.
>
> > b) it expires in 24 hours (remove the current context of the php file
> > or replace it with the following statement:
> > "The link has expired.  Please contact i...@knowledgenotebook.com for
> > assistance."
>
> Easy enough to do even without creating a script on the fly.  That's
> what databases are good for.
>
> > Next.
>
> > 1) how to create a php file on the fly?
> > With the content in the following 2)
>
> As I said before - don't even try. Use a database.
>
> <snip>
>
> > 2) How to set the link var, note var and display them
>
> > <?php
> >   $link = "http://bla.bla.bal/myProgram.exe";
>
> If you want people to subscribe to something, don't let them link to it
> directly.  Otherwise anyone will be able to download it just by knowing
> the location.  Rather, place the file outside of your website's document
> root and serve it with PHP (after validating people's information).
>
>
>
> > $note = "Please go to the Knowledge NoteBook website's Download page
> > for Installation Instructions,
>
> > $date1 = new DateTime("now");
> > $date2 = new DateTime("tomorrow");
> > $interval = date_diff($date1, $date2);
>
> > if ($interval)>  0
> > {
> >   $link = "";
> >   $note = "Sorry, the link has expired.  Please contact
> > i...@knowledgenotebook.com for assistance.";
> > }
>
> > <? print($link); ?>
> > <? print($note); ?>
>
> > ?>
>
> Again, use a database.
>
> > 3) How to expire or change its content?
> > Sort of, resolved.
>
> Once again, use a database.
>
> --
> ==================
> Remove the "x" from my email address
> Jerry Stuckle
> JDS Computer Training Corp.
> jstuck...@attglobal.net
> ==================

[toc] | [prev] | [next] | [standalone]


#3408

FromArno Welzel <usenet@arnowelzel.de>
Date2011-10-14 09:27 +0200
Message-ID<4E97E477.6000908@arnowelzel.de>
In reply to#3405
justaguy, 2011-10-14 02:58:

> Sorry, Jerry, you missed my question.
> 
> Send the form to PayPay is to interface with PayPal's API
> with the form's ACTION line.
> And since it's an API, PayPal has a way to let the user click on
> "Return to bla bla".
> 
> In essence, the task will accomplish two things:
> A) link the user/buyer to PayPal to make a payment
> B) back to my site with a special URL that give the buyer the info
> including the software download link (but this link would expire in 24
> hours).
> 
> Absolutely no need whatsoever with a database for this, it would be
> totally overkill.

And how can you be sure, that the "special URL" is valid? If there is no
database with verified payments, *everybody* can use generated URLs to
fake valid payments.

Better you look for a provider, who handles payments and downloads for
you - since it seems you neither have experience with PHP nor with
selling stuff online.


-- 
Arno Welzel
http://arnowelzel.de
http://de-rec-fahrrad.de

[toc] | [prev] | [next] | [standalone]


#3411

FromErwin Moller <Since_humans_read_this_I_am_spammed_too_much@spamyourself.com>
Date2011-10-14 10:27 +0200
Message-ID<4e97f297$0$2546$e4fe514c@news2.news.xs4all.nl>
In reply to#3405
On 10/14/2011 2:58 AM, justaguy wrote:
> Sorry, Jerry, you missed my question.
>

Hi justaguy,

[Please don't toppost]


> Send the form to PayPay is to interface with PayPal's API
> with the form's ACTION line.

That is not interfacing with the paypal-api.
That is just posting a form to paypal.
action="https://www.paypal.com/cgi-bin/webscr"


> And since it's an API, PayPal has a way to let the user click on
> "Return to bla bla".

You cannot be sure the payment is finished at this point.

To make things complicated Paypal has all kinds of statuses for the 
payments, including "pending" and stuff.
SOmetimes they have to wait for some other bank to respond.

You simply don't use paypal like you intend to.
Better to use the IPN messaging of Paypal.
(IPN is an unreliable mess, but it gets the job done, sometimes. I just 
filed another bugreport. They told me they will fix in an undisclosed 
period of time. Sure...)


>
> In essence, the task will accomplish two things:
> A) link the user/buyer to PayPal to make a payment
> B) back to my site with a special URL that give the buyer the info
> including the software download link (but this link would expire in 24
> hours).

You won't know if the payment succeeded when they arrive back at your site.


>
> Absolutely no need whatsoever with a database for this, it would be
> totally overkill.

If a database is difficult/overkill in your book, I advise you to stay 
away from the IPN-messaging I mentioned above.

Maybe your best solution is to contact Paypal and ask them if they have 
some preconfigured system for you.

Good luck.
Erwin Moller

>
> Don
>
>> On Oct 13, 8:17 pm, Jerry Stuckle<jstuck...@attglobal.net>  wrote:
>> On 10/13/2011 6:29 PM, justaguy wrote:
>>
>>
>>
>>> Hi,
>>
>>> I sort of touched php at a very beginner's level a while ago...
>>
>>> Here' what I intended to do with some php scripts.
>>> Business wise,
>>> b1: take the user to PayPal to make a payment.
>>
>> OK
>>
>>> b2. take the user back from PayPal to download a program.
>>
>> You can't "take the user back".  All you can do is send them to a site.
>>    Once they're gone, they're out of your control.  It's up to PayPal to
>> send them back (which the user may or may not do).
>>
>>> Technically with php.
>>> Have a base php script that performs the following task:
>>> Send a form to PayPal
>>
>> Are you going to send them to PayPal or send a form to PayPal?  The two
>> are entirely different.
>>
>>> The Action line is tricky...
>>
>>> Another php script addresses the PayPal's Return link.
>>> it  does two things:
>>> a) create another php script on the fly.
>>
>> Don't even think of this.
>>
>>> In it, it embed a link with a parameter.
>>
>> No problem.
>>
>>> b) it expires in 24 hours (remove the current context of the php file
>>> or replace it with the following statement:
>>> "The link has expired.  Please contact i...@knowledgenotebook.com for
>>> assistance."
>>
>> Easy enough to do even without creating a script on the fly.  That's
>> what databases are good for.
>>
>>> Next.
>>
>>> 1) how to create a php file on the fly?
>>> With the content in the following 2)
>>
>> As I said before - don't even try. Use a database.
>>
>> <snip>
>>
>>> 2) How to set the link var, note var and display them
>>
>>> <?php
>>>    $link = "http://bla.bla.bal/myProgram.exe";
>>
>> If you want people to subscribe to something, don't let them link to it
>> directly.  Otherwise anyone will be able to download it just by knowing
>> the location.  Rather, place the file outside of your website's document
>> root and serve it with PHP (after validating people's information).
>>
>>
>>
>>> $note = "Please go to the Knowledge NoteBook website's Download page
>>> for Installation Instructions,
>>
>>> $date1 = new DateTime("now");
>>> $date2 = new DateTime("tomorrow");
>>> $interval = date_diff($date1, $date2);
>>
>>> if ($interval)>    0
>>> {
>>>    $link = "";
>>>    $note = "Sorry, the link has expired.  Please contact
>>> i...@knowledgenotebook.com for assistance.";
>>> }
>>
>>> <? print($link); ?>
>>> <? print($note); ?>
>>
>>> ?>
>>
>> Again, use a database.
>>
>>> 3) How to expire or change its content?
>>> Sort of, resolved.
>>
>> Once again, use a database.
>>
>> --
>> ==================
>> Remove the "x" from my email address
>> Jerry Stuckle
>> JDS Computer Training Corp.
>> jstuck...@attglobal.net
>> ==================
>


-- 
"That which can be asserted without evidence, can be dismissed without 
evidence."
-- Christopher Hitchens

[toc] | [prev] | [next] | [standalone]


#3412

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-10-14 05:45 -0400
Message-ID<j790bt$2pj$1@dont-email.me>
In reply to#3405
On 10/13/2011 8:58 PM, justaguy wrote:
>> On Oct 13, 8:17 pm, Jerry Stuckle<jstuck...@attglobal.net>  wrote:
>> On 10/13/2011 6:29 PM, justaguy wrote:
>>
>>
>>
>>> Hi,
>>
>>> I sort of touched php at a very beginner's level a while ago...
>>
>>> Here' what I intended to do with some php scripts.
>>> Business wise,
>>> b1: take the user to PayPal to make a payment.
>>
>> OK
>>
>>> b2. take the user back from PayPal to download a program.
>>
>> You can't "take the user back".  All you can do is send them to a site.
>>    Once they're gone, they're out of your control.  It's up to PayPal to
>> send them back (which the user may or may not do).
>>
>>> Technically with php.
>>> Have a base php script that performs the following task:
>>> Send a form to PayPal
>>
>> Are you going to send them to PayPal or send a form to PayPal?  The two
>> are entirely different.
>>
>>> The Action line is tricky...
>>
>>> Another php script addresses the PayPal's Return link.
>>> it  does two things:
>>> a) create another php script on the fly.
>>
>> Don't even think of this.
>>
>>> In it, it embed a link with a parameter.
>>
>> No problem.
>>
>>> b) it expires in 24 hours (remove the current context of the php file
>>> or replace it with the following statement:
>>> "The link has expired.  Please contact i...@knowledgenotebook.com for
>>> assistance."
>>
>> Easy enough to do even without creating a script on the fly.  That's
>> what databases are good for.
>>
>>> Next.
>>
>>> 1) how to create a php file on the fly?
>>> With the content in the following 2)
>>
>> As I said before - don't even try. Use a database.
>>
>> <snip>
>>
>>> 2) How to set the link var, note var and display them
>>
>>> <?php
>>>    $link = "http://bla.bla.bal/myProgram.exe";
>>
>> If you want people to subscribe to something, don't let them link to it
>> directly.  Otherwise anyone will be able to download it just by knowing
>> the location.  Rather, place the file outside of your website's document
>> root and serve it with PHP (after validating people's information).
>>
>>
>>
>>> $note = "Please go to the Knowledge NoteBook website's Download page
>>> for Installation Instructions,
>>
>>> $date1 = new DateTime("now");
>>> $date2 = new DateTime("tomorrow");
>>> $interval = date_diff($date1, $date2);
>>
>>> if ($interval)>    0
>>> {
>>>    $link = "";
>>>    $note = "Sorry, the link has expired.  Please contact
>>> i...@knowledgenotebook.com for assistance.";
>>> }
>>
>>> <? print($link); ?>
>>> <? print($note); ?>
>>
>>> ?>
>>
>> Again, use a database.
>>
>>> 3) How to expire or change its content?
>>> Sort of, resolved.
>>
>> Once again, use a database.
>>
> Sorry, Jerry, you missed my question.
>
> Send the form to PayPay is to interface with PayPal's API
> with the form's ACTION line.
> And since it's an API, PayPal has a way to let the user click on
> "Return to bla bla".
>
> In essence, the task will accomplish two things:
> A) link the user/buyer to PayPal to make a payment
> B) back to my site with a special URL that give the buyer the info
> including the software download link (but this link would expire in 24
> hours).
>
> Absolutely no need whatsoever with a database for this, it would be
> totally overkill.
>
> Don
>

<top posting fixed>

Yes, I'm familiar with how it works.  You can use PayPal's API to send 
the data to PayPal (and get a result back) or you can direct the person 
to PayPal and hope they click on the "Return to...." link.

And a database is the best way to do this.  If you think it's overkill 
you don't understand how to use databases correctly.

Also - please don't top post.  Thanks.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#3416

FromTim Streater <timstreater@greenbee.net>
Date2011-10-14 11:41 +0100
Message-ID<timstreater-101126.11412214102011@news.individual.net>
In reply to#3412
I'll give up top-posting if you learn how to snip. Deal?

In article <j790bt$2pj$1@dont-email.me>,
 Jerry Stuckle <jstucklex@attglobal.net> wrote:

[snip large amounts]

> Also - please don't top post.  Thanks.

-- 
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

[toc] | [prev] | [next] | [standalone]


#3418

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-10-14 10:19 -0400
Message-ID<j79gde$4nl$1@dont-email.me>
In reply to#3416
On 10/14/2011 6:41 AM, Tim Streater wrote:
> I'll give up top-posting if you learn how to snip. Deal?
>
> In article <j790bt$2pj$1@dont-email.me>,
> Jerry Stuckle <jstucklex@attglobal.net> wrote:
>
> [snip large amounts]
>
>> Also - please don't top post. Thanks.
>

Stuff it, top-posting troll.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#3425

FromBill B <me@privacy.net>
Date2011-10-15 12:53 -0400
Message-ID<j7cdpe$ljh$2@dont-email.me>
In reply to#3405
On 10/13/2011 8:58 PM, justaguy wrote:
> Sorry, Jerry, you missed my question.
>
> Send the form to PayPay is to interface with PayPal's API
> with the form's ACTION line.
> And since it's an API, PayPal has a way to let the user click on
> "Return to bla bla".

You can do this either by naming the return URL from with PayPal, or by 
adding a hidden field to your form.

I think, from your overall description, that you will want to read up on 
the PayPal Listener Script, which listens for data sent from PayPal to 
your server with information about the purchase.

There is a ton of documentation about this on PayPal, albeit in the most 
disorganized manner you could imagine. Have a look in http://www.x.com.

Bill B

[toc] | [prev] | [next] | [standalone]


#3459

Fromsheldonlg <sheldonlg@thevillages.net>
Date2011-10-18 18:42 -0400
Message-ID<j7kvbv$khe$1@dont-email.me>
In reply to#3405
On 10/13/2011 8:58 PM, justaguy wrote:
> Sorry, Jerry, you missed my question.
>
> Send the form to PayPay is to interface with PayPal's API
> with the form's ACTION line.
> And since it's an API, PayPal has a way to let the user click on
> "Return to bla bla".
>
> In essence, the task will accomplish two things:
> A) link the user/buyer to PayPal to make a payment
> B) back to my site with a special URL that give the buyer the info
> including the software download link (but this link would expire in 24
> hours).
>
> Absolutely no need whatsoever with a database for this, it would be
> totally overkill.

Here is a scenario:
1 - User does this and gets a page with a link to a download which does 
the download.
2 - He doesn't click the that link on that page until 25 hours later. 
Note, he has not closed his browser or that page.

How are you going to know that more than 24 hours have passed?  You need 
to do something that will be similar to a timed logout.

Something to think about.

-- 
Shelly

[toc] | [prev] | [next] | [standalone]


#3462

FromBill B <me@privacy.net>
Date2011-10-19 07:21 -0400
Message-ID<j7mbqj$sq5$2@dont-email.me>
In reply to#3459
On 10/18/2011 6:42 PM, sheldonlg wrote:
> Here is a scenario:
> 1 - User does this and gets a page with a link to a download which does
> the download.
> 2 - He doesn't click the that link on that page until 25 hours later.
> Note, he has not closed his browser or that page.
>
> How are you going to know that more than 24 hours have passed? You need
> to do something that will be similar to a timed logout.
>
> Something to think about.

I do not know the answer to that specific question, but it raises, for 
me, the question of how much extreme testing ought to be done to test 
the limits of code and browser behavior.

Is there a generally accepted standard, does it vary by circumstance, 
does anyone have personal practices that have served them well?

Bill B

[toc] | [prev] | [next] | [standalone]


#3463

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-10-19 11:27 -0400
Message-ID<j7mq9c$sbg$1@dont-email.me>
In reply to#3462
On 10/19/2011 7:21 AM, Bill B wrote:
> On 10/18/2011 6:42 PM, sheldonlg wrote:
>> Here is a scenario:
>> 1 - User does this and gets a page with a link to a download which does
>> the download.
>> 2 - He doesn't click the that link on that page until 25 hours later.
>> Note, he has not closed his browser or that page.
>>
>> How are you going to know that more than 24 hours have passed? You need
>> to do something that will be similar to a timed logout.
>>
>> Something to think about.
>
> I do not know the answer to that specific question, but it raises, for
> me, the question of how much extreme testing ought to be done to test
> the limits of code and browser behavior.
>
> Is there a generally accepted standard, does it vary by circumstance,
> does anyone have personal practices that have served them well?
>
> Bill B

You test enough to ensure your code works properly.  One of the reasons 
a database will help you tremendously.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#3465

FromBill B <me@privacy.net>
Date2011-10-19 12:22 -0400
Message-ID<j7mtfr$jgo$1@dont-email.me>
In reply to#3463
On 10/19/2011 11:27 AM, Jerry Stuckle wrote:
> On 10/19/2011 7:21 AM, Bill B wrote:
>> On 10/18/2011 6:42 PM, sheldonlg wrote:
>>> Here is a scenario:
>>> 1 - User does this and gets a page with a link to a download which does
>>> the download.
>>> 2 - He doesn't click the that link on that page until 25 hours later.
>>> Note, he has not closed his browser or that page.
>>>
>>> How are you going to know that more than 24 hours have passed? You need
>>> to do something that will be similar to a timed logout.
>>>
>>> Something to think about.
>>
>> I do not know the answer to that specific question, but it raises, for
>> me, the question of how much extreme testing ought to be done to test
>> the limits of code and browser behavior.
>>
>> Is there a generally accepted standard, does it vary by circumstance,
>> does anyone have personal practices that have served them well?
>>
>> Bill B
>
> You test enough to ensure your code works properly. One of the reasons a
> database will help you tremendously.
>

Jerry I was asking in the context of practices that you, for example, 
might use that would, for you, embody what "test enough" means. I design 
serious games that use computer simulation as the underlying engine. The 
decision a player is responding to might expect an answer between 5 and 
10. For testing I would answer 500,000 just to see how the engine reacts 
to the number.

I was looking for some practices that were more specific, if you are 
inclined to share them (and "no" is a real plausible answer).

Bill B

[toc] | [prev] | [next] | [standalone]


#3466

FromDoug Miller <doug_at_milmacdotcom@example.com>
Date2011-10-19 15:12 -0400
Message-ID<j7n7ef$tt2$1@dont-email.me>
In reply to#3465
On 10/19/2011 12:22 PM, Bill B wrote:
> On 10/19/2011 11:27 AM, Jerry Stuckle wrote:
>> On 10/19/2011 7:21 AM, Bill B wrote:
>>> On 10/18/2011 6:42 PM, sheldonlg wrote:
>>>> Here is a scenario:
>>>> 1 - User does this and gets a page with a link to a download which does
>>>> the download.
>>>> 2 - He doesn't click the that link on that page until 25 hours later.
>>>> Note, he has not closed his browser or that page.
>>>>
>>>> How are you going to know that more than 24 hours have passed? You need
>>>> to do something that will be similar to a timed logout.
>>>>
>>>> Something to think about.
>>>
>>> I do not know the answer to that specific question, but it raises, for
>>> me, the question of how much extreme testing ought to be done to test
>>> the limits of code and browser behavior.
>>>
>>> Is there a generally accepted standard, does it vary by circumstance,
>>> does anyone have personal practices that have served them well?
>>>
>>> Bill B
>>
>> You test enough to ensure your code works properly. One of the reasons a
>> database will help you tremendously.
>>
>
> Jerry I was asking in the context of practices that you, for example,
> might use that would, for you, embody what "test enough" means. I design
> serious games that use computer simulation as the underlying engine. The
> decision a player is responding to might expect an answer between 5 and
> 10. For testing I would answer 500,000 just to see how the engine reacts
> to the number.

Test boundary conditions and invalid input. If the answer is supposed to 
be between 5 and 10, I might test using these values in addition to the 
obvious 5 thru 10: "A", " ", "5A", "5 ", " 5", 4, 11, 105, 0, -1, -5, 
-10, 2^16, 2^16 + 5, 2^32, and 2^32 + 5.

[toc] | [prev] | [next] | [standalone]


#3468

FromJerry Stuckle <jstucklex@attglobal.net>
Date2011-10-20 08:53 -0400
Message-ID<j7p5k0$vqk$1@dont-email.me>
In reply to#3465
On 10/19/2011 12:22 PM, Bill B wrote:
> On 10/19/2011 11:27 AM, Jerry Stuckle wrote:
>> On 10/19/2011 7:21 AM, Bill B wrote:
>>> On 10/18/2011 6:42 PM, sheldonlg wrote:
>>>> Here is a scenario:
>>>> 1 - User does this and gets a page with a link to a download which does
>>>> the download.
>>>> 2 - He doesn't click the that link on that page until 25 hours later.
>>>> Note, he has not closed his browser or that page.
>>>>
>>>> How are you going to know that more than 24 hours have passed? You need
>>>> to do something that will be similar to a timed logout.
>>>>
>>>> Something to think about.
>>>
>>> I do not know the answer to that specific question, but it raises, for
>>> me, the question of how much extreme testing ought to be done to test
>>> the limits of code and browser behavior.
>>>
>>> Is there a generally accepted standard, does it vary by circumstance,
>>> does anyone have personal practices that have served them well?
>>>
>>> Bill B
>>
>> You test enough to ensure your code works properly. One of the reasons a
>> database will help you tremendously.
>>
>
> Jerry I was asking in the context of practices that you, for example,
> might use that would, for you, embody what "test enough" means. I design
> serious games that use computer simulation as the underlying engine. The
> decision a player is responding to might expect an answer between 5 and
> 10. For testing I would answer 500,000 just to see how the engine reacts
> to the number.
>
> I was looking for some practices that were more specific, if you are
> inclined to share them (and "no" is a real plausible answer).
>
> Bill B

Good testing practices are pretty much the same no matter what language 
you're working with.  You test with valid and invalid values, and even 
if there is an answer at all.  Check for combinations (valid and 
invalid) of answers.  Ensure numeric answers are numeric, etc.

Good testing is not dependent on the platform or the language.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

[toc] | [prev] | [next] | [standalone]


#3469

FromBill B <me@privacy.net>
Date2011-10-20 09:46 -0400
Message-ID<j7p8o6$l5i$1@dont-email.me>
In reply to#3468
On 10/20/2011 8:53 AM, Jerry Stuckle wrote:
> On 10/19/2011 12:22 PM, Bill B wrote:
>> On 10/19/2011 11:27 AM, Jerry Stuckle wrote:
>>> On 10/19/2011 7:21 AM, Bill B wrote:
>>>> On 10/18/2011 6:42 PM, sheldonlg wrote:
>>>>> Here is a scenario:
>>>>> 1 - User does this and gets a page with a link to a download which
>>>>> does
>>>>> the download.
>>>>> 2 - He doesn't click the that link on that page until 25 hours later.
>>>>> Note, he has not closed his browser or that page.
>>>>>
>>>>> How are you going to know that more than 24 hours have passed? You
>>>>> need
>>>>> to do something that will be similar to a timed logout.
>>>>>
>>>>> Something to think about.
>>>>
>>>> I do not know the answer to that specific question, but it raises, for
>>>> me, the question of how much extreme testing ought to be done to test
>>>> the limits of code and browser behavior.
>>>>
>>>> Is there a generally accepted standard, does it vary by circumstance,
>>>> does anyone have personal practices that have served them well?
>>>>
>>>> Bill B
>>>
>>> You test enough to ensure your code works properly. One of the reasons a
>>> database will help you tremendously.
>>>
>>
>> Jerry I was asking in the context of practices that you, for example,
>> might use that would, for you, embody what "test enough" means. I design
>> serious games that use computer simulation as the underlying engine. The
>> decision a player is responding to might expect an answer between 5 and
>> 10. For testing I would answer 500,000 just to see how the engine reacts
>> to the number.
>>
>> I was looking for some practices that were more specific, if you are
>> inclined to share them (and "no" is a real plausible answer).
>>
>> Bill B
>
> Good testing practices are pretty much the same no matter what language
> you're working with. You test with valid and invalid values, and even if
> there is an answer at all. Check for combinations (valid and invalid) of
> answers. Ensure numeric answers are numeric, etc.
>
> Good testing is not dependent on the platform or the language.
>

Thank you, Jerry.

[toc] | [prev] | [next] | [standalone]


#3464

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2011-10-19 17:21 +0100
Message-ID<j7mtdm$ji6$1@news.albasani.net>
In reply to#3462
Bill B wrote:
> On 10/18/2011 6:42 PM, sheldonlg wrote:
>> Here is a scenario:
>> 1 - User does this and gets a page with a link to a download which does
>> the download.
>> 2 - He doesn't click the that link on that page until 25 hours later.
>> Note, he has not closed his browser or that page.
>>
>> How are you going to know that more than 24 hours have passed? You need
>> to do something that will be similar to a timed logout.
>>
>> Something to think about.
> 
> I do not know the answer to that specific question, but it raises, for 
> me, the question of how much extreme testing ought to be done to test 
> the limits of code and browser behavior.
> 
its simple: you set a cookie and time it to expire.

If they come back with a valid cooklie, they are still 'in a  live session'

Pretty sure this is all wrapped up inside the php session structures.


Ye. You can do all that with PHP sessions. All in the manual.

> Is there a generally accepted standard, does it vary by circumstance, 
> does anyone have personal practices that have served them well?
> 
Sessions.

> Bill B

[toc] | [prev] | [next] | [standalone]


#3407

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2011-10-14 06:49 +0000
Message-ID<4e97db86$0$28690$a8266bb1@newsreader.readnews.com>
In reply to#3402
On Thu, 13 Oct 2011 15:29:02 -0700, justaguy wrote:

> Here' what I intended to do with some php scripts. Business wise,
> b1: take the user to PayPal to make a payment. b2. take the user back
> from PayPal to download a program.

You need to look at the paypal api's. I believe they provide php code 
examples.

> 1) how to create a php file on the fly?

You can create a php file on the fly by writing php commands to a file.

> With the content in the following 2)

The content will be whatever you write to the file.

------------------------------------------------

Describe the problem:

You wish a customer to be able to make a paypal payment, after which you 
will provide a download link to some content for a period of x hours.

Is this correct?

So you have two issues to resolve:

a) Handling the paypal payment
b) Making the restricted content available for a time limited period

For (a)

Handling the paypal payment is fairly easy once you understand the paypal 
apis, although the paypal apis are not always easy to work with. You 
should read the paypal developer documentation.

For (b)

Maintain a database of identity / purchased_file_name / expiry time. I'd 
set identity up as a non unique index, as a person may have purchased 
multiple files at different times.

When someone logs in, access the database and use it to generate a list 
of links for those files that they currently have download access to.

Keep the paid for content files outside of the webroot. When they click 
on a file, use readfile to deliver it with the relevant content headers. 
You should only need a single "delivery" script to handle this.

You may wish to periodically prune expired links from the database. If 
the website is lightly used, you could do this every time the table is 
accessed. For a more heavily used website, you might want to consider a 
cron job for this.

Note that I haven't considered how you verify that someone visiting your 
site 6 hours after paying for a file is the person that paid for it. You 
didn't ask about that. Nor have I mentioned sessions ... but you will 
probably want to use sessions to keep track of users.

Rgds

Denis McMahon

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.php


csiph-web