FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » This is a total php newbie question
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: This is a total php newbie question [message #175627 is a reply to message #175626] Fri, 14 October 2011 00:17 Go to previous messageGo to previous message
Jerry Stuckle is currently offline  Jerry Stuckle
Messages: 2598
Registered: September 2010
Karma:
Senior Member
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(at)knowledgenotebook(dot)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(at)knowledgenotebook(dot)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(at)attglobal(dot)net
==================
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Mass Twitter Account Creator (PHP)
Next Topic: declaring private variable in class
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sat Nov 23 18:09:32 GMT 2024

Total time taken to generate the page: 0.04688 seconds