FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


PHP script authorization monthly





Talk2Tom11
I need to find a script to do the following....


I have a site with a protected area. the users need to pay monthly in order to be able to access this secure section. I already have an account with authorize.net and have my Zen cart hooked up so that all the billing process for the zen cart can go through the authorize.net. I am looking to have this monthly service go through authorize.net as well...


if anyone has any idea how I would start, or if they know of a place where i can get a php script for this, I would appreciate it a lot! Thanks for you time.
salman_500
hmmmm....

welll what i understand is you want paying members to pay monthly..... well im not familiar with autherize.net... but what you can do is disable the account after a month until payment is made...

maybe when the account is made... you can make a field 'time' ... fill it with the value "time() + 2592000" at the time of first payment ... and then on the index or login or maybe the config page that when the time() value exceeds the value entered after the end of a month... a message is displayed 'payment expired' or somthing....

well ... i hope that helped ... if not... clearly state what you want done ..
Talk2Tom11
salman_500 wrote:
hmmmm....

welll what i understand is you want paying members to pay monthly..... well im not familiar with autherize.net... but what you can do is disable the account after a month until payment is made...

maybe when the account is made... you can make a field 'time' ... fill it with the value "time() + 2592000" at the time of first payment ... and then on the index or login or maybe the config page that when the time() value exceeds the value entered after the end of a month... a message is displayed 'payment expired' or somthing....

well ... i hope that helped ... if not... clearly state what you want done ..



I really like this idea... it has helped me a lot.... the only thing is... can you explain to me a little bit more about this value "time() + 2592000" and how exactly i would go about using it.

Thanks
warallthetm
I suggest you use it with paypal because paypal has a nice feature called ipn, they provide an api in php on thier site, you may want to check it out
Talk2Tom11
warallthetm wrote:
I suggest you use it with paypal because paypal has a nice feature called ipn, they provide an api in php on thier site, you may want to check it out



I would... and would really prefer to do it that way... but my client does not have and does not want to get a paypal account. However authorize.net does provide and api for their site as well.
salman_500
well its very simple to do wat i mentioned above...

like when a person registers... make a field in your users table "expiry" maybe ....

and when the person registers... use hidden field to enter "time() + 2592000" into the expiry field...

on your login page... make it so that when a person enters.. check whether the username exists... then if it does.. check the "expiry" field if the account has expired"

Code:

<?php
// username checks here ........
// After username confirmed assign it to $loggedinuser

$username = $loggedinuser

$checkexpiry = mysql_query("SELECT expiry FROM users WHERE username = '$username'") or die (mysle_error());
$expiry = mysql_fetch_array($checkexpiry);

$expiredate = $expiry['expiry'];
$datenow = time();

if ($expiry < $datenow) {
echo "Your account has expired from premiuim members area. Pay again to re-charge your account for another 30 days";
}


This is a manual way to do stuff... but it is possible ....if i made any errors here... plz fix em... i am out of touch... :p

hope it helps !
Related topics
error in my PHP script
Phoenix free PHP scripts
how can i make a php script for enter username and password?
Inserting data to MYSQL with a PHP script
Running a "Hello World" php script
[PHP] Running Cron Jobs Via PHP Script
Simple PHP script not working
PHP Script- How can we install it
I need a VERY simple php script
PHP Script needed
Logging systeem php script
Preventing bad PHP script calls
array check box on php script using $_POST
How to change extension php to html but the php script still
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.