For referral follow link fpdf.org.
How to create PDF
StandardFor referral follow link fpdf.org.
To Recover Saved backup :
step 1 : Go to “tmp” directory first :
cd /tmp
step 2 : write following command and press enter :
mysql -uroot -pXXXX database_name < backup_name.sql
step 1 : create an PayPal account on “https://manager.paypal.com/”.
after creating account on paypal,follow steps to make some account setting.
1) Go to service settings->SetUp.
2) To check it in TEST mode set transaction mode – TEST.
3) PayPal Sandbox email address : (your sandbox email you got at step-2).
4) Go to service settings->Customize.
5) Choose layout C.
step 2 : To test your paypal account create your debit card number by creating account on “https://www.sandbox.paypal.com/”.
step 3 : Create a database table for paypal payments by using following sql query command :
CREATE TABLE `payments` ( `order_id` varchar(50) DEFAULT NULL, `payer_id` varchar(50) DEFAULT NULL, `token` varchar(50) DEFAULT NULL, `secure_token` varchar(50) DEFAULT NULL, `secure_token_id` varchar(50) DEFAULT NULL, `pnref` varchar(50) DEFAULT NULL, `ppref` varchar(50) DEFAULT NULL, `transaction_id` varchar(50) DEFAULT NULL, `bill_to_name` varchar(50) DEFAULT NULL, `bill_to_firstname` varchar(50) DEFAULT NULL, `bill_to_lastname` varchar(50) DEFAULT NULL, `bill_to_country` varchar(50) DEFAULT NULL, `bill_to_email` varchar(50) DEFAULT NULL, `address_to_ship` varchar(50) DEFAULT NULL, `ship_to_city` varchar(50) DEFAULT NULL, `state_to_ship` varchar(50) DEFAULT NULL, `ship_to_zip` varchar(50) DEFAULT NULL, `ship_to_country` varchar(50) DEFAULT NULL, `amt` varchar(50) DEFAULT NULL, `feeamt` varchar(50) DEFAULT NULL, `result` varchar(50) DEFAULT NULL, `resp_msg` varchar(50) DEFAULT NULL, `type` varchar(50) DEFAULT NULL, `tendor` varchar(50) DEFAULT NULL, `method` varchar(50) DEFAULT NULL, `payment_type` varchar(50) DEFAULT NULL, `tax` varchar(50) DEFAULT NULL, `acct` varchar(50) DEFAULT NULL, `proccvv2` varchar(50) DEFAULT NULL, `cvv2match` varchar(50) DEFAULT NULL, `auth_code` varchar(50) DEFAULT NULL, `iavs` varchar(50) DEFAULT NULL, `card_type` varchar(50) DEFAULT NULL, `procavs` varchar(50) DEFAULT NULL, `card_exp_date` varchar(50) DEFAULT NULL, `trans_time` varchar(50) DEFAULT NULL, `correlation_id` varchar(50) DEFAULT NULL, `pending_reason` varchar(50) DEFAULT NULL, `avsdata` varchar(50) DEFAULT NULL, `avsaddr` varchar(50) DEFAULT NULL, `created_date` datetime DEFAULT NULL, `updated_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP ) ENGINE=InnoDB DEFAULT CHARSET=latin1 )
step 4 : Use the following code for intraction with your PayPal :
function gen_token($x)
{
$_rand_src = array(
array(48,57) //digits
, array(97,122) //lowercase chars
, array(65,90) //uppercase chars
);
srand ((double) microtime() * 1000000);
$random_password = “”;
for($i=0;$i<$x;$i++){
$i1=rand(0,sizeof($_rand_src)-1);
$random_password .= chr(rand($_rand_src[$i1][0],$_rand_src[$i1][1]));
}
return $random_password;
}
$secure_token_id = gen_token(36);
$f_cost = $-XXX; //Set your Product cost.
$amt = $f_cost;
$user = “XXXX”; //PayPal username
$vendor = “XXX”; //PayPal vendor
$partner = “PayPal”;
$pswd = “XXXXXX”; //PayPal password
$mode = “LIVE”;
$host_add = “https://pilot-payflowpro.paypal.com”; //In LIVE mode url should be “https://payflowpro.paypal.com”
$post_data = “USER=”.$user.
“&VENDOR=”.$vendor.
“&PARTNER=”.$partner.
“&PWD=”.$pswd.
“&CREATESECURETOKEN=Y”.
“&SECURETOKENID=”.$secure_token_id.
“&TRXTYPE=S”.
“&AMT=”.$amt;
//echo $post_data;
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $host_add);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_POSTFIELDS, $post_data);
$resp = curl_exec($ch);
if(!$resp)
{
echo “<p>To order, please contact us.</p>”;
}
parse_str($resp, $arr);
if($arr[‘result’] != 0)
{
echo “<p>To order, please contact us.</p>”;
}
if($resp && $arr[‘result’] == 0)
{
//print_r($arr);
echo ”;
}
step 5 : To switch to LIVE mode folow steps :
1)Replace transaction mode->LIVE by following above step-1->2 step.
2)Remove sandbox email entered at above step-1->3 step.
3)Replace value of php variable “$host_add” used at step-4 to “https://payflowpro.paypal.com”.
Call function of parent file from inside iframe source file :parent.calling_function_name();
Call function of iframe source file from outside parent file :
document.getElementById(“iframe_id”).contentWindow.calling_function_name();
Set style of html-tag by class of iframe source file from outside parent file :
document.getElementById(“iframe_id”).contentWindow.document.getElementsByClassName(‘classname’)[0].style.display = “none”;
Get content of outside parent file :
$(“#htmml_id” , parent.document).html();
Get content of iframe file from parent file:
$(‘#iframe_id’).contents().find(‘#html_tag_id’).html();
Output will be like:
<div class=”news_list_div_title “>
<div style=”width:100%“>Hello</div>
<div>CSS</div>
<div>World !</div>
</div>