need help to creat database


Posted on 16th Feb 2014 07:03 pm by admin

Hello Team, please guys i am stuck from three days with paypal issue for IPN but no luck yet now i wants to do other method. i have used this form to send info to paypal and everything is working ok now what i wants is before i send this form to paypal it will be included to my database, i am not much familiar with it how to do that, here is the code for my checkout page:
Code: [Select]<h2>Checkout</h2>

<?php
if($_SESSION['cart'])
{
?>
<form action="index.php?view=update_cart" method="post">

<table id="items">
<thead>
<tr>
<th>Item</th>
<th>Price</th>
<th>Qty</th>
<th>Subtotal</th>
</tr>
</thead>
<tbody>
<?php foreach($_SESSION['cart'] as $id => $qty):
$product = find_product($id);
?>
<tr>
<td><?php echo $product['title']; ?></td>
<td>&pound;<?php echo number_format($product['price'],2); ?></td>
<td><input type="text" size="2" name="<?php echo $id ?>" maxlength="2" value="<?php echo $qty; ?>" /></td>
<td>&pound;<?php echo number_format($product['price'] * $qty, 2); ?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>

<p style="margin-left:235px"><input type="submit" name="update" value="update" /></p>

</form>

<center><h3>Please Enter Your Detail</h3></center>
<table id="userdetail">
<tr><td align="right">First Name:</td><td><input type="text" name="firstname" /></td></tr>
<tr><td align="right">Last Name:</td><td><input type="text" name="lastname" /></td></tr>
<tr><td align="right">Email:</td><td><input type="text" name="email" /></td></tr>
<tr><td align="right">Address:</td><td><textarea name="address"cols="30" rows="5"></textarea></td></tr>
<tr><td align="right">Telephone No:</td><td><input type="text" name="phone" /></td></tr>
</table>
<center><h3>Your Payment Description</h3></center>
<p><b>Subtotal:</b> &pound;<?php echo number_format($_SESSION['total_price'],2); ?></p>
<p><b>Shipping:</b> &pound; 2.50</p>
<p><b>Grand Total:</b> &pound;<?php echo number_format($_SESSION['total_price']+$shipping,2); ?></p>

<form action="https://www.sandbox.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_cart">
<input type="hidden" name="upload" value="1">
<input type="hidden" name="business" value="myemail_12551_biz@hotmail.com">

<?php
$i = 1;
foreach($_SESSION['cart'] as $id => $qty):
$product = find_product($id);
?>

<input type="hidden" name="item_name_<?php echo $i; ?>" value="<?php echo $product['title']; ?>">
<input type="hidden" name="item_number_<?php echo $i; ?>" value="<?php echo $product['id']; ?>">
<input type="hidden" name="amount_<?php echo $i; ?>" value="<?php echo $product['price']; ?>">
<input type="hidden" name="quantity_<?php echo $i; ?>" value="<?php echo $qty; ?>">

<?php
$i++;
endforeach;
?>
<input type="hidden" name="currency_code" value="GBP">
<input type="hidden" name="lc" value="GB">
<input type="hidden" name="rm" value="2">
<input type="hidden" name="shipping_1" value="2.50">
<input type="hidden" name="return" value="http://www.mysite.com/includes/index.php?view=thankyou">
<input type="hidden" name="cancel_return" value="http://www.mysite.com/">
<input type="hidden" name="notify_url" value="http://www.mysite.com/includes/paypal.php">
<input type="submit" name="pay now" value="pay" />
</form>
<?php
}
else
{
echo '<p>your cart is empty... <a href="index.php">continue shopping</a></p>';
}
?>
this all i wants to add in my datbase.... Please Please Please help me as soon as possible.

No comments posted yet

Your Answer:

Login to answer
123 Like 16 Dislike
Previous forums Next forums
Other forums

Can't shake the "Warning: include()" error
I've just uploaded my site to a new server and where I have PHP include tags in my HTML, the browser

GET vs SUBMIT Button to show sections on one index.php page?
Just curious if one of these ways is better (i.e. more efficient) than the other.

I have a

Looking for help reading a .txt or .ini file and outputting the info.
I have a file called Info.ini and It has the following info:
Code: [General]
Online=0
I wou

Logging and nologging bulk insert
Hi,

oracle version: 10g Enterprise Edition Release 10.2.0.4.0 - 64bit Production

i need help with php header and footer
I have designed a header and footer for my site and they seem to be ok when they are running individ

Why use OOP?
Can someone explain to me why I should use OOP instead of procedure based code.

Im building a

a multi dimensional array with for each
hi, I have been asked to write an array, I have Zone 2,3,4,5,6,7,8 each zone has 3 sections of weigh

Delete HTML file after loading
I have limited experience with php and its been a year or two since I've last used it. I have a sma

Simple PHP/Java Help..
Hi,
I'm trying to build a little program to do with calculating postage. Unfortunately i haven't

Using mysql_real_escape_string for displayed content
On my website users can input data into a textarea and it will store it in the mysql database. But,

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash