Beste mensen
Ik krijg nu 1 fout
in mijn script
http://ikleerhacken.nl
Als je eenmaal een goed koopt en je gaat naar het aankoop gedeelte krijg je deze error:
Dit is het script:Notice: Undefined variable: order in /home/digitax/public_html/ikleerhacken.nl/aankopen.php on line 34
PHP Code:
<?php
error_reporting(E_ALL);
include("common.php");
require_once 'Mollie/Wallie.php';
require('Mollie/class.micropayment-mollie.php');
$regel;
$m = new micropayment();
$molliePartnerID = 184351; // Fill in your own Mollie Partner ID!
$m->setPartnerID($molliePartnerID);
$wallie = new Mollie_Wallie($molliePartnerID);
$error = "";
$my_sFirstName = "";
$my_sLastName = "";
$my_clientEmail ="";
$my_clientIp ="";
$q1 = "select * from cart, items where cart.OrderID = '".GetCartId()."' and cart.ItemID = items.ItemID order by items.ItemName";
$r1 = mysql_query($q1) or die(mysql_error());
$col = "white";
$rows = "";
$order_total = 0;
$discount = "select discount FROM korting";
$disc = mysql_query($discount) or die(mysql_error());
while($a1 = mysql_fetch_array($r1)){
if($col == "white"){
$col = "dddddd";
}else{
$col = "white";
}
$a1['ItemTotal'] = ( $a1['ItemPrice'] * $a1['ItemQty'] );
$rows .= "<tr bgcolor=\"$col\">\n\t<td class=BlackLink>".$a1['ItemName']."</td>\n<td align=right>$aset[currency_sign] $a1[ItemPrice]</td>\t\n\t<td align=center>$a1[ItemQty]</td>\n\t<td align=right>$aset[currency_sign] $a1[ItemTotal]</td>\n</tr>\n\n";
$order = $order + ( $a1['ItemPrice'] * $a1['ItemQty'] );
$showdiscount = ($order * $disc) / 100;
$order_total = $order - $showdiscount;
}
$order_total = number_format($order_total, 2, ".", ",");
if(isset($_POST['submit_out']) || isset($_POST['submit_out_x'])){
$my_sFirstName = strip_trim($_POST['sFirstName']);
$my_sLastName = strip_trim($_POST['sLastName']);
$my_clientEmail = strip_trim($_POST['clientEmail']);
$my_clientIp = $_SERVER['REMOTE_ADDR'];
if(empty($my_sFirstName)){
$error = "<span class=RedLink>Gelieve je voornaam in te geven</span>";
}elseif(empty($my_sLastName)){
$error = "<span class=RedLink>Gelieve je naam in te geven</span>";
}elseif(empty($my_clientEmail) || !ereg("@", $my_clientEmail)){
$error = "<span class=RedLink>Gelieve je e-mail adres in te geven</span>";
}
if(empty($error)){
$q1 = "insert into orders_info set
FirstName = '$my_sFirstName',
LastName = '$my_sLastName',
email = '$my_clientEmail',
ip = '$my_clientIp',
order_date = '$t',
order_total = '$order_total' ";
mysql_query($q1) or die(mysql_error());
$order_id = mysql_insert_id();
$q2 = "update cart set OrderID = '$order_id' where OrderID = '".GetCartId()."' ";
mysql_query($q2) or die(mysql_error());
$check = "select * from newsletter where nEmail = '$my_clientEmail'";
$result = mysql_query($check);
if(mysql_num_rows($result) == 0 ) {
$q3 = "insert into newsletter set
nEmail = '$my_clientEmail' ";
mysql_query($q3);
}
$payment_option = $_POST['payment_option'];
if($payment_option == '2') {
//redirect to paypal
header("location:https://www.paypal.com/xclick?business=$aset[PayPalEmail]&item_name=OrderID $order_id&first_name=$my_sFirstName&last_name=$my_sLastName&email=$my_clientEmail&item_number=1&custom=$order_id&amount=$order_total¤cy_code=$aset[currency_id]¬ify_url=$site_url/download_link.php&return=$site_url/bedankt.php");
exit();
} elseif($payment_option == '3') {
$prijs = $order_total;
$amount = str_replace(".", "", $prijs);
$siteReportUrl = $site_url/aankopen.php;
$siteReturnUrl = $site_url/bedankt.php;
if ($wallie->createPayment($amount, $siteReportUrl, $siteReturnUrl)) {
// Payment created, You could(/should) save the payment information in your database
// Get the url of the chosen bank to redirect the user to,
// to complete the payment
header('location: ' . $wallie->getWallieUrl());
}
else {
// show message that the payment could not be created
// the function $wallie->getStatus() returns the status
// message that Mollie returns
echo $wallie->getStatus();
}
if (isset($_GET['payment_type']) and $_GET['payment_type'] == 'wallie' and isset($_GET['transaction_id']) and isset($_GET['amount'])) {
// Check if payment is OK.
$checkPayment = $wallie->checkPayment($_GET['transaction_id'], $_GET['amount']);
// Mollie makes sure a transaction can only
// be used one time!
if ($checkPayment == true) {
// Get the amount of money the user has payed
$paymentAmount = $wallie->getAmount();
header('location: ' . $site_url/download_link.php);
// Set in your database the paymentstatus to OK.
}
}
}elseif($payment_option == '4'){
?>
<form action="bellen_pay.php" method="post" name="myForm">
<input type="hidden" name="order_total" value="<? echo $order_total; ?>" />
<input type="submit" value="Ga door naar betaalpagina" />
</form>
<script type='text/javascript'>document.myForm.submit();</script>
<?
}
}
}
require_once("templates/hoofdtemplate.php");
include_once("templates/afrekenen.php");
include_once("templates/voetnoot.php");
?>
- php foutjes
-
11-11-2010, 18:51 #1
- Berichten
- 1.025
- Lid sinds
- 14 Jaar
php foutjes
-
-
11-11-2010, 18:56 #2
- Berichten
- 55
- Lid sinds
- 15 Jaar
Re: php foutjes
PHP Code:$order = $order + ( $a1['ItemPrice'] * $a1['ItemQty'] );
Buiten de while even: (met buiten bedoel ik er voor)
PHP Code:$order = 0;
PHP Code:$order += $a1['ItemPrice'] * $a1['ItemQty'];
Oplossing is dus: Defineren voor je het gebruiktLaatst aangepast door S Yilmaz : 11-11-2010 om 18:57 Reden: (met buiten bedoel ik er voor)
Plaats een
- + Advertentie
- + Onderwerp
Marktplaats
Webmasterforum
- Websites algemeen
- Sitechecks
- Marketing
- Domeinen algemeen
- Waardebepaling
- CMS
- Wordpress
- Joomla
- Magento
- Google algemeen
- SEO
- Analytics
- Adsense
- Adwords
- HTML / XHTML
- CSS
- Programmeren
- PHP
- Javascript
- JQuery
- MySQL
- Ondernemen algemeen
- Belastingen
- Juridisch
- Grafisch ontwerp
- Hosting Algemeen
- Hardware Info
- Offtopic