/    Sign up×
Community /Pin to ProfileBookmark

How to Implement: Paypal integration ?- subcription payament

This is payment.php ->PAYPAL WEBSITE(where customer pays thru subcription payment -> acctdet.php (where username & password is generated).

After submiting to paypal(if customer paid only) how can redirect from that paypal page to acctdet.php.
where i have to do this ? How to do this ?


————————————————————

payment.php:

[code=php]<?
session_cache_limiter(‘must-revalidate’);
session_start();
?>
<html>
<head><title>System</title>
</head>
<!–body bgcolor=”lavenderblush”–>
<body bgcolor=”seashell”>
<?
echo “<center><b><font face=’verdana’ color=’brown’ size=’4′>Welcome </font></b></center><br>”;
?>
<?
$n=$_SESSION[‘no_server’];
//echo $n;
$i=1;
while($i<=$n)
{
//$ip=$_POST[‘ip_add’];

//$ip[$i]=$_POST[‘ip_add’][$i];
$ip[$i]= $_POST[‘ip_add’.$i];

$op[$i]=$_POST[‘op_system’.$i];
$rootpass[$i]=$_POST[‘root_pass’.$i];
//echo $rootpass[$i];
$addnotes[$i]=$_POST[‘add_notes’.$i];
$esc[$i]=$_POST[‘esc_proced’.$i];
//echo $ip[$i];echo $op[$i];echo $rootpass[$i];echo $addnotes[$i];echo $esc[$i];
$_SESSION[‘ipaddress’.$i]=$ip[$i];
//$session[ip.$i]=$ip[$i];
//echo $_SESSION[‘ipaddress’.$i];
$_SESSION[‘opsystem’.$i]=$op[$i];
//echo $_SESSION[‘opsystem’.$i];
$_SESSION[‘rootpass’.$i]=$rootpass[$i];
//echo $_SESSION[‘rootpass’.$i];
$_SESSION[‘add_notes’.$i]=$addnotes[$i];
$_SESSION[‘esc_prodced’.$i]=$esc[$i];
$i++;
}
?>[/code]

<form method=”post” action=”serverinfo.php” name=”form1″>
<table border=’1′ align=’center’ width=’100%’>
<tr>
<td align=”center”>
<table border=”1″ align=”center” width=”100%”>
<tr>
<td align=”center” colspan=”2″><font face=’verdana’ color=’black’ size=’3′><b>Payment Details</b></font></td>
</tr>

<tr>
<td align=”right”><font face=’verdana’ color=’black’ size=’2′>Number of Servers you selected :</font></td>
<td align=”left”><font face=’verdana’ color=’black’ size=’2′><input type=”servers” name=”fullname” size=”35″ value=”<? echo $_SESSION[‘no_server’]; ?>”></font></td>
</tr>
<?
$fee=”50″;
$fee=$fee*$_SESSION[‘no_server’];
$_SESSION[‘fee’]=$fee;
?>
<tr>
<td align=”right”><font face=’verdana’ color=’black’ size=’2′>Recurring Fee :</font></td>
<td align=”left”><font face=’verdana’ color=’black’ size=’2′><input type=”text” name=”fee” size=”35″ value=”<? echo “$”.$fee; ?>”></font></td>
</tr>
<tr><td colspan=”2″>&nbsp;</td></tr>
<tr><td colspan=”2″ align=”center”>Click <a href=”paypal.php”>Here for Payment.</td></tr>
<!–tr><td colspan=”2″ align=”center”>
<form action=”https://www.paypal.com/cgi-bin/webscr” method=”post”>
<input type=”hidden” name=”cmd” value=”_xclick_subscriptions”>
<input type=”hidden” name=”business” value=”[email protected]”>
<input type=”hidden” name=”no_shipping” value=”1″>
<input type=”image” src=”http://www.payapal.com/en_us/i/bin/x-click-but20.gif” border=”0″ name=”submit” alt=”Make Payment with Paypal-Its fasr,free and secure!”>
<input type=”hidden” name=”a3″ value=”5.00″>
<input type=”hidden” name=”p3″ value=”1″>
<input type=”hidden” name=”t3″ value=”M”>
<input type=”hidden” name=”src” value=”1″>
<input type=”hidden” name=”sra” value=”1″>
</td></tr–>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>


——————————————————-

acctdet.php :

[code=php]<?
session_start();
?>
<html>
<head><title>System</title>
<?
function randompass()
{
$char=”abcdefghijkmnopqrstuvwxyz023456789″;
srand((double)microtime()*1000000);
$i=0;
$pass=”;
while($i<=10)
{
$num=rand()%33;
$tmp=substr($char,$num,1);
$pass=$pass.$tmp;
$i++;
}
return $pass;

}
?>
<script language=”javascript”>
function winclose()
{
document.location=”thanks.php”;
}
</script>
</head>
<!–body bgcolor=”lavenderblush”–>
<body bgcolor=”seashell”>
<?
echo “<center><b><font face=’verdana’ color=’brown’ size=’4′>Welcome to System</font></b></center><br>”;
?>[/code]

<form method=”post” action=”” name=”form1″>
<table border=’1′ align=’center’ width=’100%’>
<tr>
<td align=”center”>
<table border=”1″ align=”center” width=”60%”>
<tr>
<td align=”center” colspan=”2″><font face=’verdana’ color=’black’ size=’3′><b>Account Details</b></font></td>
</tr>
<tr><td colspan=”2″>&nbsp;</td></tr>
<tr>
<td align=”right”><font face=’verdana’ color=’black’ size=’2′>Your Username :</font></td>
<td align=”left”><font face=’verdana’ color=’black’ size=’2′><b><? echo $_SESSION[‘mail’]; ?></b></font></td>
</tr>
<?
$password=randompass();
$_
SESSION[‘passwd’]=$password;
?>
<tr>
<td align=”right”><font face=’verdana’ color=’black’ size=’2′>Password :</font></td>
<td align=”left”><font face=’verdana’ color=’black’ size=’2′><b><? echo $password; ?></b></font></td>
</tr>
<tr><td colspan=”2″>&nbsp;</td></tr>
<tr><td colspan=”2″ align=”center”><input type=”button” name=”close” value=”Exit” onclick=”winclose();”></td></tr>
</table>
</td>
</tr>
</table>

[code=php]<?
include(“include.php”);

$fname=$_SESSION[‘fullname’];//echo $fname;
$orgname=$_SESSION[‘orgname’];//echo $orgname;
$address=$_SESSION[‘address’];//echo $address;
$city=$_SESSION[‘city’];//echo $city;
$state=$_SESSION[‘state’];//echo $state;
$pincode=$_SESSION[‘pincode’];//echo $pincode;
$country=$_SESSION[‘country’];//echo $country;
$mail=$_SESSION[‘mail’];//echo $mail;
$noserver=$_SESSION[‘no_server’];//echo $no_server;
$fee=$_SESSION[‘fee’];//echo $fee;
$n=$_SESSION[‘no_server’];
$dateentry=date(“Y”.”-“.”m”.”-“.”d”);
//echo $dateentry;
//echo $n;
$i=1;
while($i<=$n)
{
$ip[$i]=$_SESSION[‘ipaddress’.$i];
$op[$i]=$_SESSION[‘opsystem’.$i];
//echo $_SESSION[‘rootpass’.$i];
$rootpass[$i]=$_SESSION[‘rootpass’.$i];
$addnotes[$i]=$_SESSION[‘add_notes’.$i];
$esc[$i]=$_SESSION[‘esc_prodced’.$i];
//echo $ip[$i];echo $op[$i];echo $rootpass[$i];echo $addnotes[$i];echo $esc[$i];

$query1=”insert into server_info(email,server_no,server_ip,op_system,root_pass,add_notes,esc_proced,status) values(‘$mail’,’$i’,’$ip[$i]’,’$op[$i]’,’$rootpass[$i]’,’$addnotes[$i]’,’$esc[$i]’,’yes’)”;
$result1=mysql_query($query1);
$i++;
}

$maxquery=”select max(id) from personal_details”;
$maxresult=mysql_query($maxquery);
$j=mysql_result($maxresult,”id”);
$j=$j+1;

$query=”insert into personal_details(id,full_name,org_name,street_name,city,state,postal_code,country,email,password) values(‘$j’,’$fname’,’$orgname’,’$address’,’$city’,’$state’,’$pincode’,’$country’,’$mail’,’$password’)”;
$result=mysql_query($query);

$query2=”insert into payment_det(email,no_servers,total_fee,date_entry) values(‘$mail’,’$noserver’,’$fee’,’$dateentry’)”;
$result2=mysql_query($query2);

if((!$result)||(!$result1)||(!$result2))
{
echo “some error”;
}
else
{
echo “successfully inserted”;
}

?>[/code]

</form>
</body>
</html>

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@balloonbuffoonJan 06.2006 — Have a look here:

[URL]http://www.web-bureau.com/modules/free-php-paypal-ipn-script.php[/URL]

Or google "php paypal ipn tutorial" or "php paypal ipn script", anything along that lines will give you pages with information on what you're trying to do.

--Steve
×

Success!

Help @pats 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.19,
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,
)...