/    Sign up×
Community /Pin to ProfileBookmark

Product Activation

I need a script that will enable me to send a url such as;
[url]http://dpank.com/pro-act/activation.php?UserName=TEST1&Serial=TEST2[/url]
and it will look to see if there is a file called TEST1 with TEST2 as the data inside if that is true it will some how say that else it will create the file named TEST1 with TEST2 as the data inside. TEST1 and TEST2 will be variable any probs email me @ [email][email protected][/email]

Thanks In Advance Daniel Quinney

to post a comment
PHP

9 Comments(s)

Copy linkTweet thisAlerts:
@ShrineDesignsFeb 16.2005 — example[code=php]<?php
$dir = '/path/to/';

if(isset($_GET['user']) && isset($_GET['serial']))
{
if(file_exists($dir . $_GET['user']))
{
// ...
}
else
{
$fp = fopen($dir . $_GET['user'], 'wb');
fwrite($fp, $_GET['serial']);
fclose($fp);
}
}
?>[/code]
Copy linkTweet thisAlerts:
@DquinneyauthorFeb 16.2005 — i get the error

Warning: fopen(/pro-act/Admin): failed to open stream: No such file or directory in /home/dpank75/public_html/pro-act/new.php on line 12

Warning: fwrite(): supplied argument is not a valid stream resource in /home/dpank75/public_html/pro-act/new.php on line 13

Warning: fclose(): supplied argument is not a valid stream resource in /home/dpank75/public_html/pro-act/new.php on line 14
Copy linkTweet thisAlerts:
@DquinneyauthorFeb 16.2005 — <?php

$dir = '/pro-act/';

if(isset($_GET['user']) && isset($_GET['serial']))

{

if(file_exists($dir . $_GET['user']))

{

// ...

}

else

{

$fp = fopen($dir . $_
GET['user'], 'wb');

fwrite($fp, $_GET['serial']);

fclose($fp);

}

}

?>
Copy linkTweet thisAlerts:
@ShrineDesignsFeb 16.2005 — try using an absolute path [i]/home/dpank75/public_html/pro-act/[/i]
Copy linkTweet thisAlerts:
@DquinneyauthorFeb 16.2005 — Also i need it to print 'Error' if there is a file already called USER1. Else prink 'Ok'

Thanks For The Help Daniel Quinney
Copy linkTweet thisAlerts:
@ShrineDesignsFeb 16.2005 — replace // ...with exit('Error');after fclose($fp);add echo 'Ok';
Copy linkTweet thisAlerts:
@DquinneyauthorFeb 16.2005 — does'nt work always sayes 'error'

[URL=http://dpank.com/chicago/new.php?user=admin&serial=1478]http://dpank.com/chicago/new.php?user=admin&serial=1478[/URL]
Copy linkTweet thisAlerts:
@ShrineDesignsFeb 16.2005 — try http://dpank.com/pro-act/activation.php?UserName=MrMaGoo&Serial=foobar
Copy linkTweet thisAlerts:
@DquinneyauthorFeb 16.2005 — it does not do any think any more,
×

Success!

Help @Dquinney spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.29,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...