<?php
include('db/dbcon.php');
$get_id=$_GET['id'];
$deal_price = mysqli_real_escape_string($sqli, $_POST['deal_price']);
mysqli_query($sqli, "UPDATE product_detail
SET deal_price = '$deal_price'
WHERE id = '$get_id' ")
or die(mysqli_error());
echo "<script>alert('Successfully Updated'); window.location='sales_rep?status=1.php'</script>";
?>
答案 0 :(得分:0)
1)您应首先检查您使用的变量是否存在
2)同时在public class PayPalWebViewActivity extends AppCompatActivity {
WebView webView;
String urls,intent_value,paypalId,paymentStatus,cancelPayment,currencyCode,country,cmd,title,language,
fn,ln,city,st,zp,add1,add2,bookig_id,pck_id,pck_title,user_id,total,postData;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_pay_pal_web_view);
webView = (WebView) findViewById(R.id.webView_paypal);
paypalId = "info@guideturbo.com";
paymentStatus = "http://www.guideturbo.com/payments/payment_status";
cancelPayment = "http://www.guideturbo.com/payments/payment_status";
currencyCode = "USD";
country = "USA";
cmd = "_xclick";
title = "Ms";
language = "EN";
try {
if (getIntent().getExtras() != null) {
bookig_id = getIntent().getStringExtra("booking_id");
pck_id = getIntent().getStringExtra("package_id");
pck_title = getIntent().getStringExtra("title");
total = getIntent().getStringExtra("total");
fn = getIntent().getStringExtra("fn");
ln = getIntent().getStringExtra("ln");
city = getIntent().getStringExtra("city");
st = getIntent().getStringExtra("state");
add1 = getIntent().getStringExtra("add1");
add2 = getIntent().getStringExtra("add2");
zp = getIntent().getStringExtra("zp");
user_id = getIntent().getStringExtra("user_id");
}
total = total.replace("$","");
urls = "https://www.paypal.com/cgi-bin/webscr?"+"business="+paypalId +"&"+"return="+paymentStatus +"&"+"cancel_return="+cancelPayment +"&"
+"language="+language +"&"+"title="+title +"&"+"first_name="+fn +"&"+"last_name="+ln +"&"+"country="+country +"&"
+"cmd="+cmd +"&"+"amount="+total +"&"+"custom="+bookig_id +"&"+"item_name="+pck_title +"&"+"package_id="+pck_id +"&"
+"user_id="+user_id +"&"+"currency_code="+currencyCode +"&"+"address1="+add1 +"&"+"address2="+add2 +"&"+"city="+city +"&"
+"state="+st +"&"+"zip="+zp;
}catch (Exception e){
e.printStackTrace();
}
webView.getSettings().setJavaScriptEnabled(true);
WebSettings settings = webView.getSettings();
settings.setDomStorageEnabled(true);
webView.getSettings().setBuiltInZoomControls(true);
webView.getSettings().setDisplayZoomControls(false);
webView.setWebViewClient(new MyWebViewClient());
webView.loadUrl(urls);
}
private class MyWebViewClient extends WebViewClient {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
/*view.loadUrl(url);
return true;*/
if(url.contains(urls)){
//do something
view.loadUrl(urls);
}
return true;
}
}
}
$sqli
mysqli_error();