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


Groups > comp.lang.php > #3412

Re: This is a total php newbie question

From Jerry Stuckle <jstucklex@attglobal.net>
Newsgroups comp.lang.php
Subject Re: This is a total php newbie question
Date 2011-10-14 05:45 -0400
Organization A noiseless patient Spider
Message-ID <j790bt$2pj$1@dont-email.me> (permalink)
References <bec63536-fbea-459e-94a3-79f10dc1623d@f13g2000vbv.googlegroups.com> <j77v3j$2o9$1@dont-email.me> <4b9df8e1-d651-4058-9cd9-a7e3c2231725@e37g2000yqa.googlegroups.com>

Show all headers | View raw


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
==================

Back to comp.lang.php | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

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

csiph-web