PHP Checkout script

I am trying to create simple checkout system with PHP by using sessions.
I thought using sessions to store cart details on variables and after payment passing it to the MySQL database

checkout.php

<?php
session_start
[size=2]color=#007700;
[/size][/color]
$product_name= “some value”;
[size=2]$product_price= “some value”;
session_registercolor=#007700;
[/size][/color]

session_registercolor=#007700;[/size][/color]
echo(‘<A href=“https://www.nochex.com/nochex.dll/checkout?email=nochex@domain.com&amount=‘.$productprice.’&returnurl=http://www.domain.com/success.php”>Click here to pay with nochex</a>’);
?>

success.php
--------------------------------------
<?
$username=“username”;
$password=“password”;
$database=“your_database”;

mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( “Unable to select database” );

session_startcolor=#007700;[/color]
$query = “INSERT INTO orders VALUES (‘’,$product_name,$product_price)”;

mysql_query($query);
echo(‘Thankyou for choosing our services. Your payment is recieved’);

?>

I need to know if i am doing everything correct.

fixed some erros and made some minor changes, hope it helps you:


<?
session_start();
$product_name= "some value";
$product_price= "some value";
$_SESSION['product_name'] = $product_name;
$_SESSION['product_price'] = $product_price;
$email = urlencode('nochex@domain.com');
$url = urlencode('http://www.domain.com/success.php');
echo('<A href="https://www.nochex.com/nochex.dll/checkout?'.$email.'&amount='.$productprice.'&returnurl='.$url.'">Click here to pay with nochex</a>');
?>


<?
$username="username";
$password="password";
$database="your_database";
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database" );
session_start();
$query = 'INSERT INTO orders VALUES (\\'\\',\\''.$_SESSION['product_name'].'\\',\\''.$_SESSION['product_price'].'\\')';
mysql_query($query);
echo('Thank you for choosing our services. Your payment is recieved');
?>

note that you need I think php 4.1+ for this

Thank you mate. This script rocked my world.

two words :smiley: