In Drupal, when the user signs up
/user/register
"I would like the user for Both roles to have a "field" to enter thier "PAYPAL" email ID.
The paypal email ID should go into the MYSQL database,and into the Correct Database Field for That User."
The Table Fields,and Names are located in the script below,
The script below is used as the deposit into user account.
URLs
/content/deposit-amount
/node/22/edit
<?php
error_reporting(0);
global $user;
$id=$user->uid;
$uemail=$user->mail;
$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 ('[login to view URL]', 80, $errno, $errstr, 30);
if($_POST['payment_status']=='Completed')
{
$con = mysql_connect("localhost","flexden","");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("flexden_drpl1", $con);
$query="select * from users where uid='$user->uid'";
$res=mysql_query($query);
while($out=mysql_fetch_array($res,MYSQL_BOTH))
{
$old_amount=$out['balance'];
$user_email=$out['mail'];
$user=$out['name'];
}
$res=mysql_query($query);
$new_amount=$old_amount+$_POST['mc_gross'];
//$user=$_POST['first_name'];
$user_pemail=$_POST['payer_email'];
$amount=$_POST['mc_gross'];
$status=$_POST['payment_status'];
$date=$_POST['payment_date'];
$res="INSERT INTO user_payments (user_name,user_email,old_balance,dep_amount,new_balance,payment_status,payment_date,Paypal_email) VALUES ('$user', '$user_email','$old_amount','$amount','$new_amount','$status','$date','$user_pemail')";
mysql_query($res);
$res_amt="update users set balance='$new_amount' where uid='$id'";
mysql_query($res_amt);
mysql_close($con);
echo 'Thank you for Your Payment';
}
else
{
//////////////////////////////////////////////////////////////////
Task 2
//////////////////////////////////////////////////////////////////
Next Task is to Make the node teasers structure look like the attached screenschot,
[login to view URL]
///////////////////////////////////////////////////////////////////
Task 3
///////////////////////////////////////////////////////////////////
Please Look at [login to view URL]!