Jump to content
php.lv forumi

Nenostrādā MySQL


Rihijs

Recommended Posts

Sveiki man ir viens tāds skripts, kur piemēramcilvēks kautko nopērk un uz spiežot uz pirkšanas lapu viņa datiem būtu jānosutas uz mysql datubāzi un jāparādās PayPal buy now pogai Nesaprotu kāpēc, bet nenosūtās dati uz mysql serveri un līdz ar to arī neparādās Poga, jo Mysql darbība ir pirms pogas... rekur kods:

<?php
include ("includes/database/database.inc.php"); $myDb->connect(); $query = "INSERT INTO yob_buyref (customer, amount, refset, pemail, ip) VALUES('$user','1','$refset', '$pemail','$purchaseip')"; mysql_query($query) or die(mysql_error()); $myDb->close();?>

<center>
<form action="https://www.paypal.com/cgi-bin/webscr" method="post">
<input type="hidden" name="cmd" value="_xclick">
<input type="hidden" name="business" value="">
<input type="hidden" name="item_name" value="<?= $purchaseitemname;?>">
<input type="hidden" name="amount" value="<?= $purchaseitemprice;?>">
<input type="hidden" name="no_shipping" value="0">
<input type="hidden" name="no_note" value="1">
<input type="hidden" name="currency_code" value="USD">
<input type="hidden" name="lc" value="MX">
<input type="hidden" name="bn" value="PP-BuyNowBF">
<input type="image" src="https://www.paypal.com/en_US/i/btn/x-click-but6.gif" border="0" name="submit" alt="Make payments with PayPal - it's fast, free and secure!">
<img alt="" border="0" src="https://www.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1">
</form>
</center>

Link to comment
Share on other sites

Ko nozīmē "Mysql darbība ir pirms pogas"?

Vai tu saproti kā darbojas POST pieprasījums? Skripts, uz kuru norāda action formas vērtība, izsaucas uz submit pogas nospiešanu. Tavā gadījumā tur izsauksies tas "https://www.paypal.com/cgi-bin/webscr" skripts, nevis tavējais php. Tu esi pārliecināts, ka zini, ko dari?

Link to comment
Share on other sites

pirmkaart es teiktu izkaarto kodu... un iesaku atdaliit arii mainiigos no string virknes querijaa

piemeeram...

<?php
 include ("includes/database/database.inc.php");
 $myDb->connect();
 $query = "INSERT INTO yob_buyref (customer, amount, refset, pemail, ip)
		VALUES('".$user."','1','".$refset."', '".$pemail."','".$purchaseip."')";
 mysql_query($query) or die(mysql_error());
 $myDb->close();
?>

 

otrkaart, ja esi paarliecinaats ka tam skriptam vispaar iedod nepiecieshamo informaaciu, tad izvadi vismaz print_r($_REQUEST); un paskaties vai tur kaut kas ir....

 

treshkaart.. peec mainiigo nosaukumiem un sekojoshaa koda liekas ka patieshaam nezini ko dari... t.i. piekriitu bubu

 

<input type="hidden" name="amount" value="<?=$purchaseitemprice; ?>">

 

... amount (daudzums) taa nav cena (price)... vai arii paypal tur kaut ko ne taa dara? :D

Link to comment
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...