2015-08-26 22 views
0

我執行了一個購物車整合到我的網站,現在我試圖只使用一種形式由客戶(個人信息)填寫,但我面臨一個問題,因爲我想用兩個不同的提交按鈕取決於客戶選擇的支付平臺。有人知道一個簡單的解決方案嗎?我很欣賞先進的。HTML表單分爲兩個不同的提交

回答

1

你必須通過name屬性與按鈕標籤一樣,name屬性的不同值 -

<button type="submit" name="button1">Button 1</button> 

<button type="submit" name="button2">Button 2</button> 

在PHP代碼 -

<?php 
if(isset($_POST['button1])) 
{ 
// here we will add code of button 1 
} 

if(isset($_POST['button2])) 
{ 
// here we will add code of button 2 
} 

?> 

請試試這個.....

0

使用多步形式pattern.You可以通過搜索谷歌找到大量的例子。