Jump to content

ysqlPay Pal Integration in my website HELP!


ychan

Recommended Posts

Hi Guys

Anyone knows how to include paypal payment in my code?

here is my code, i already created sandbox acccount my problem is how can i add that paypal integration

such as API, and other stuffs thanks! in Advance!

<?php

include_once "includes/header.php";

include "includes/db_connect.php";

include "includes/paging.php";

if(!isset($_SESSION['user_id']) && !isset($_SESSION['user_name']) && !isset($_SESSION['user_fname']) && !isset($_SESSION['user_lname']) && !isset($_SESSION['user_email']) && !isset($_SESSION['user_type']))

{

header("location:signin.php");

}

 

?>

<link rel="stylesheet" type="text/css" href="css/style.css" />

<script language="javascript" type="text/javascript" src='js/scw1.js'></script>

<script type="text/javascript" src="js/common.js"></script>

<script type="text/javascript" src="js/renter.js"></script>

<!--body content-->

<div class="body-content-bg">

<?php include_once "includes/index_left_menu.php"; ?>

<div class="regisrer-bg">

<div class="regisrer-head">Contact Form</div>

<div class="register">

<?php

$prod_refid=$_REQUEST['refid'];

$ctype=$_REQUEST['ctype'];

$productsql="select * from products where prod_refid='$prod_refid'";

$resquery = @mysql_query($productsql);

$resproduct_fetch=mysql_fetch_array($resquery);

$image_path="products/";

$thumb_path="products/thumb/";

 

$product_id=$resproduct_fetch['product_id'];

$prod_refid=$resproduct_fetch['prod_refid'];

$prod_category=$resproduct_fetch['prod_category'];

$prod_subcategory=$resproduct_fetch['prod_subcategory'];

$product_image=$resproduct_fetch['product_image'];

$product_name=$resproduct_fetch['product_name'];

$prod_country=$resproduct_fetch['prod_country'];

$price_range=$resproduct_fetch['price_range'];

$pamount = number_format($price_range, 2, '.', '');

$prod_userid=$resproduct_fetch['prod_userid'];

$prod_usertype=$resproduct_fetch['prod_usertype'];

$prod_desc=$resproduct_fetch['prod_desc'];

$prod_minduration=$resproduct_fetch['prod_minduration'];

$prod_maxduration=$resproduct_fetch['prod_maxduration'];

$prod_avail_days=$resproduct_fetch['prod_avail_days'];

$prod_paymethod=$resproduct_fetch['prod_paymethod'];

 

$prod_qty=$resproduct_fetch['prod_qty'];

 

$user_sql=mysql_query("select country,state,city,firstname,lastname from userregister where userid ='".$prod_userid."' and status='1'");

$userfetch=mysql_fetch_array($user_sql);

 

?>

<form action="save_contactrenter.php" name="contactrenter" id="contactrenter" method="post">

<table width="80%" border="0" cellspacing="0" cellpadding="0" align="center">

 

<tr>

<td align="center" valign="top" style="padding-bottom:10px; height:30px;"> 

 

<?php

if(isset($_REQUEST['merr']))

{

echo "<font color='red'><b> Please Try again later.. </b></font>";

 

}

else if(isset($_REQUEST['succs']))

{

 

echo "<font color='#F95E00'><b>Your request has been sent successfully. Please wait renter will contact you soon...</b></font>";

 

//echo "<meta http-equiv='refresh' content='10;URL=index.php'>";

}

?>

 

</td>

</tr>

 

<tr>

<td align="right" valign="top" style="padding-bottom:2px; "><font color="#FF0000">*</font>  Mandatory Fields   </td>

</tr>

 

<tr>

<td align="left" valign="top" style="padding-bottom:30px;"><div class="profile-inner-head">Product Details</div></td>

</tr>

 

 

 

<tr>

<td align="left" valign="top" style="padding:0px 20px 10px 20px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="30%" align="left" valign="middle"><b>Product Name</b> </td>

<td width="5%" align="left" valign="middle"><b>:</b> </td>

<td width="50%" align="left" valign="middle"><?php echo $product_name;?><input type="hidden" name="product_name" id="product_name" onblur="Trim(this.id); return check_field(this.id,this.value)" onkeypress="return alpha(event);" value="<?php echo $product_name;?>" size="25" readonly="readonly" disabled="disabled"/>

<?php //echo $product_name;?>

</td>

<td width="15%" align="left" valign="middle"><div class="register_rgt" style="font-size:11px;color:#FF3366;display:none; padding-left:20px;" id="product_name_err"></div></td>

</tr>

</table></td>

</tr>

 

 

<tr>

<td align="left" valign="top" style="padding:0px 20px 10px 20px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="30%" align="left" valign="middle"><b>Product Category </b></td>

<td width="5%" align="left" valign="middle"><b>:</b> </td>

<td width="30%" align="left" valign="middle">

<?php

$sel_qry=mysql_query("select * from ecom_category where ecat_status=0 and ecat_id=$prod_category");

 

$count=mysql_num_rows($sel_qry);

 

$row=mysql_fetch_array($sel_qry);

 

echo $row['em_category'];

 

/*<select name="product_category" id="product_category" style="width:175px;" onchange="list_subcategory(this.value);" disabled="disabled">if($count>0)

{

echo "<option value='0'>--------Select category --------</option>";

while($row=mysql_fetch_array($sel_qry))

{

 

if($prod_category==$row['ecat_id'])

{

echo "<option value='$row[ecat_id]' selected >$row[em_category]</option>";

}

else

{

echo "<option value='$row[ecat_id]'>$row[em_category]</option>";

}

}

}

else

{

echo "<option value=''>No categories found</option>";

}</select>*/

 

?>

 

<input type="hidden" name="product_category2" id="product_category2" value="<?php echo $prod_category;?>" />

</td>

<td width="35%" align="left" valign="middle"><div class="register_rgt" style="font-size:11px;color:#FF3366;display:none; padding-left:20px;" id="product_category_err"></div></td>

</tr>

</table></td>

</tr>

 

 

<tr>

<td align="left" valign="top" style="padding:0px 20px 10px 20px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="30%" align="left" valign="middle"><b>Subcategory</b> </td>

<td width="5%" align="left" valign="middle"><b>:</b> </td>

<td width="30%" align="left" valign="middle" >

<?php

$sel_qry2=mysql_query("select * from ecom_subcategory where esubcat_status=0 and esubcat_id='$prod_subcategory'");

$count2=mysql_num_rows($sel_qry2);

$row2=mysql_fetch_array($sel_qry2);

 

echo $row2['em_subcategory'];

/*<select name="product_subcategory" id="product_subcategory" style="width:175px;" onchange="list_technical(this.value);" disabled="disabled">if($count2>0)

{

echo "<option value='0'>--------------- Select category ----------------</option>";

while($row2=mysql_fetch_array($sel_qry2))

{

 

if($prod_subcategory==$row2['esubcat_id'])

{

echo "<option value='$row2[esubcat_id]' selected >$row2[em_subcategory]</option>";

}

else

{

echo "<option value='$row2[esubcat_id]'>$row2[em_subcategory]</option>";

}

}

}

else

{

echo "<option value=''>No Subcategories found</option>";

}</select>*/

 

?>

 

<input type="hidden" name="product_subcategory2" id="product_subcategory2" value="<?php echo $prod_subcategory;?>" />

</td>

<td width="35%" align="left" valign="middle"><div class="register_rgt" style="font-size:11px;color:#FF3366;display:none; padding-left:20px;" id="product_subcategory_err"></div></td>

</tr>

</table></td>

</tr>

 

<tr>

<td align="left" valign="top" style="padding:0px 20px 10px 20px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="30%" align="left" valign="middle"><b>Renter </b> <font color="#FF0000">*</font> </td>

<td width="5%" align="left" valign="middle"><b>:</b> </td>

<td width="30%" align="left" valign="middle"><?php echo $userfetch['firstname']." ".$userfetch['lastname'];?><input type="hidden" name="renter_name" id="renter_name" onblur="Trim(this.id); return check_field(this.id,this.value)" onkeypress="return alpha(event);" value="<?php echo $userfetch['firstname']." ".$userfetch['lastname'];?>" size="25" readonly="readonly" disabled="disabled"/>

</td>

<td width="35%" align="left" valign="middle"><div class="register_rgt" style="font-size:11px;color:#FF3366;display:none; padding-left:20px;" id="renter_name_err"></div></td>

</tr>

</table></td>

</tr>

 

<tr>

<td align="left" valign="top" style="padding-bottom:30px;"><div class="profile-inner-head">Your Request</div></td>

</tr>

 

 

<tr>

<td align="left" valign="top" style="padding:0px 20px 10px 20px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="30%" align="left" valign="middle"><b>Recipient(s) </b> <font color="#FF0000">*</font> </td>

<td width="5%" align="left" valign="middle"><b>:</b> </td>

<td width="30%" align="left" valign="middle"><?php echo $_SESSION['user_fname']." ".$_SESSION['user_lname'];?><input type="hidden" name="recipient_name" id="recipient_name" onblur="Trim(this.id); return check_field(this.id,this.value)" onkeypress="return alpha(event);" value="<?php echo $_SESSION['user_fname']." ".$_SESSION['user_lname'];?>" size="25" readonly="readonly" disabled="disabled"/>

</td>

<td width="35%" align="left" valign="middle"><div class="register_rgt" style="font-size:11px;color:#FF3366;display:none; padding-left:20px;" id="recipient_name_err"></div></td>

</tr>

</table></td>

</tr>

 

<!--<tr>

<td align="left" valign="top" style="padding:10px 20px 10px 20px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="30%" align="left" valign="middle"><b>Type of Request</b> <font color="#FF0000">*</font> </td>

<td width="5%" align="left" valign="middle"><b>:</b> </td>

<td width="30%" align="left" valign="middle">

<select name="request_type" id="request_type" style="width:175px;" onchange="return check_field(this.id,this.value)">

<option value="0">---- Choose Request ----</option>

<option value="1" <?php if($ctype==1) echo"selected='selected'";?> >Question</option>

<option value="2" <?php if($ctype==2) echo"selected='selected'";?>>Quote</option>

</select>

</td>

<td width="35%" align="left" valign="middle"><div class="register_rgt" style="font-size:11px;color:#FF3366;display:none; padding-left:20px;" id="request_type_err"></div></td>

</tr>

</table></td>

</tr>-->

 

 

 

<?php $tomorrow = mktime(0,0,0,date("m"),date("d")+1,date("Y"));

//$tomorrow = mktime(0,0,0,date("d")+1,date("m"),date("Y"));

?>

<tr>

<td align="left" valign="top" style="padding:0px 20px 10px 20px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="30%" align="left" valign="middle"><b>Start Date</b> <font color="#FF0000">*</font> </td>

<td width="5%" align="left" valign="middle"><b>:</b> </td>

<td width="35%" align="left" valign="middle"><input type="text" name="fdate" id="fdate" onclick="scwShow(document.getElementById('fdate'),this,'f1');" readonly="true" value="<?php echo date("d-m-Y");?>" >

<img src="images/calender.png" onclick="scwShow(document.getElementById('fdate'),this,'f1');" />

</td>

<td width="30%" align="left" valign="middle"><div class="register_rgt" style="font-size:11px;color:#FF3366;display:none; padding-left:20px;" id="fdate_err"></div></td>

</tr>

</table></td>

</tr>

 

<tr>

<td align="left" valign="top" style="padding:0px 20px 10px 20px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="30%" align="left" valign="middle"><b>End Date</b> <font color="#FF0000">*</font> </td>

<td width="5%" align="left" valign="middle"><b>:</b> </td>

<td width="35%" align="left" valign="middle"><input type="text" name="tdate" id="tdate" value="<?php echo date("d-m-Y", $tomorrow); ?>" onclick="scwShow(document.getElementById('tdate'),this);" readonly="true" >

 

<img src="images/calender.png" onclick="scwShow(document.getElementById('tdate'),this);" /> </td>

<td width="30%" align="left" valign="middle"><div class="register_rgt" style="font-size:11px;color:#FF3366;display:none; padding-left:20px;" id="tdate_err"></div></td>

</tr>

</table></td>

</tr>

 

<tr>

<td align="left" valign="top" style="padding:0px 20px 10px 20px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="30%" align="left" valign="middle"><b>Number of Qty</b> <font color="#FF0000">*</font> </td>

<td width="5%" align="left" valign="middle"><b>:</b> </td>

<td width="30%" align="left" valign="middle"><input type="text" name="product_qty" id="product_qty" onblur="Trim(this.id); return check_field(this.id,this.value);" onkeypress="return checkIt(event);" value="" size="10" /> <b>Items</b>

</td>

<td width="35%" align="left" valign="middle"><div class="register_rgt" style="font-size:11px;color:#FF3366;display:none; padding-left:20px;" id="product_qty_err"></div></td>

</tr>

</table></td>

</tr>

 

<tr>

<td align="left" valign="top" style="padding:0px 20px 10px 20px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="35%" align="left" valign="middle"><b>Describe Your Need </b> <font color="#FF0000">*</font> </td>

<td width="5%" align="left" valign="middle"><b>:</b> </td>

<td width="30%" align="left" valign="middle">

<!-- <textarea name="description" id="description" rows="6" cols="27" onblur="return check_qty('<?php echo $prod_qty;?>');" ></textarea>-->

 

<textarea name="description" id="description" rows="6" cols="27" ></textarea>

</td>

<td width="30%" align="left" valign="middle"><div class="register_rgt" style="font-size:11px;color:#FF3366;display:none; padding-left:20px;" id="description_err"></div></td>

</tr>

</table></td>

</tr>

 

<tr>

<td align="left" valign="top" style="padding:0px 20px 10px 20px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="10%" align="left" valign="middle"> </td>

<td width="60%" align="left" valign="middle"><input type="checkbox" name="req_terms" id="req_terms" onblur=" return check_field(this.id,this.value)" />

I accept that renter contacting me by telephone </td>

<td width="30%" align="left" valign="middle" ><span class="register_rgt" style="font-size:11px; color:#FF3366; display:none;padding-left:5px;" id="req_terms_err"></span></td>

</tr>

</table></td>

</tr>

 

<tr>

<td align="left" valign="top" style="padding:0px 20px 10px 20px;"><table width="100%" border="0" cellspacing="0" cellpadding="0">

<tr>

<td width="35%" align="left" valign="top"> </td>

<td width="65%">

<input type="hidden" name="refid" id="refid" class="register-input" value="<?php echo $_REQUEST['refid'];?>" />

<input type="hidden" name="actual_qty" id="actual_qty" class="register-input" value="<?php echo $prod_qty;?>" />

<input name="request_submit" id="request_submit" type="submit" value="" onclick="return request_quoteform();" style=" width:94px; height:30px;background:url(images/submit.png); border:0px; cursor:pointer; float:left;" />

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.