View Full Version : Need some help with some code

12-13-2008, 09:02 PM
Hey there,

I need some help with some code. What this does is that it says if ccardno is typed in it will be a succesful purches. If not it says that the ccardno is missing and the purches isnt gonna happen. Now i have a form the user have to submit and currently the card number is the only thing there has to be typed. Id like some in there to be typed and come up with a message wether its typed or not. I cant imagine i just have to copy it all and change ccardno. How do it go about this the easiest way? Thanks in advance :)




{ $SESSION['cart']=array
( 'total' => 0,
'items' => array()

$cart = $_SESSION['cart'];
if (isset($_GET['ccardno']) && isset($_GET['total']))
{ $ccardno = $_GET['ccardno'];
$total = intval($_GET['total']);
{ $ccardno = "(mangler!)";
$total = 0;

if ($ccardno != "(mangler!)")
{ $cart=array('total'=>0, 'items'=>array());


if ($ccardno=="(mangler!)")
{ $out.="Vi kan ikke afslutte handlen. Kreditkortnummer mangler.<br />";
{ $out.="Tak for støtten. Der overføres nu " . $total . " kr. "
."fra kreditkort nr. " . $ccardno . ".<br /><br>";
$out .= "<a href=\"spillet.php\">Klik her for at vende tilbage til siden</a><br />";


Dunno if this code is sufficient enough. If not i can supply the code if needed :)