Hi everyone .. I need to know how to make the registration process in one of my websites a paid one .. Any ideas or thoughts ? Is there any tools I can use to automate the process .. a payment via paypal to access the registration page maybe . Thanks.
Thanks Rep+ .. It looks like it's the solution ... but how to implement the php code ? is it like securing the registration web page ?
How this works, it is up to how you want to implement it, but a basic overview follows. User signs up free account. User logs in, and decides to sign up premium subscription for "extra" features. You can then take advantage, such as getting their user_id for cross-referencing with user database etc. and implement it in paypal php script. // PHP 4.1 // read the post from PayPal system and add 'cmd' $req = 'cmd=_notify-validate'; foreach ($_POST as $key => $value) { $value = urlencode(stripslashes($value)); $req .= "&$key=$value"; } // post back to PayPal system to validate $header .= "POST /cgi-bin/webscr HTTP/1.0\r\n"; $header .= "Content-Type: application/x-www-form-urlencoded\r\n"; $header .= "Content-Length: " . strlen($req) . "\r\n\r\n"; $fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30); // assign posted variables to local variables $item_name = $_POST['item_name']; $item_number = $_POST['item_number']; $payment_status = $_POST['payment_status']; $payment_amount = $_POST['mc_gross']; $payment_currency = $_POST['mc_currency']; $txn_id = $_POST['txn_id']; $receiver_email = $_POST['receiver_email']; $payer_email = $_POST['payer_email']; $user_id = $_POST['custom']; if (!$fp) { // HTTP ERROR } else { fputs ($fp, $header . $req); while (!feof($fp)) { $res = fgets ($fp, 1024); if (strcmp ($res, "VERIFIED") == 0) { // use the $user_id variable to cross reference with user. } else if (strcmp ($res, "INVALID") == 0) { // log for manual investigation } } fclose ($fp); } ?> PHP:
The problem here is that I don't want premium account update .. I want the registration process to be paid from the beginning .. Is there a method to limit the access to the registration page to people who paid through paypal ?
Like I said, it's up to you how you implement it. There are a few ways you can do it if you want paid subscription. Have the user subscribe to your account using paypal. Then your script sends them a generated password. They then use it to continue signing up. OR You can use paypal PDT, which is like IPN but uses a token. Which you can set custom variables to paypal forms. So the user is signing up, which then sends username,password etc to paypal, then it sends it back to your server to process it.
Why dont you buy a readymade php script or go for opensource like joomla and there are many extensions for this job. see my site has a good system - resalefactory dot com. sorry i am not allowed to post links.