2011-11-30 106 views
2

我有一種形式,當submited張貼到遠程URL使用捲曲形式發佈到它自我和所有的作品,但我知道需要發送表單數據到頁面讓人分裂來自代碼的表單代碼沒有起作用。如何將此代碼拆分爲2頁

我的當前代碼工作是。

<?php 
if (!empty($_POST['btnApply_x'])) { 
    $post['AffiliateID'] = '0000'; 
    $post['AffiliatePW'] = '00000'; 
    $post['ReqMode'] = 'TEST'; 
    $post['ReqLoanAmount'] = $_POST['slidval']; 
    $post['ReqConsent'] = 1; 
    $post['ReqIPAddress'] = $_SERVER['REMOTE_ADDR']; 
    $post['AppTitle'] = $_POST['ddlTitle']; 
    $post['AppFirstName'] = $_POST['txtFirstname']; 
    $post['AppLastName'] = $_POST['txtSurname']; 
    $post['AppEmail'] = $_POST['txtEmail']; 
    $post['AppDOBDay'] = $_POST['ddlDay']; 
    $post['AppDOBMonth'] = $_POST['ddlMonth']; 
    $post['AppDOBYear'] = $_POST['ddlYear']; 
    // $post['date_of_birth'] = $_POST['ddlDay'] . '/' . $_POST['ddlMonth'] . '/' . $_POST['ddlYear']; 
    $post['AppHomePhone'] = $_POST['txtHomePhone']; 
    $post['AppWorkPhone'] = $_POST['txtWorkPhone']; 
    $post['AppMobilePhone'] = $_POST['txtMobile']; 
    // $post['BankDebitCard'] = $_POST['ddlDMPlan']; 
    $post['BankDebitCard'] = $_POST['ddlPrimaryDebitCard']; 
    $post['AppHomeStatus'] = $_POST['ddlHomeType']; 
    $post['btnnext_x'] = $_POST['btnnext_x']; 
    $post['btnnext_y'] = $_POST['btnnext_y']; 
    $post['AppHouseNumber'] = $_POST['txtHouseNumber']; 
    $post['AppStreet'] = $_POST['txtStreetName']; 
    $post['AppTown'] = $_POST['txtTownCity']; 
    $post['AppPostCode'] = $_POST['txtPostCode']; 
    $post['AppCounty'] = $_POST['ddlCounty']; 
    $post['AppAddressYears'] = $_POST['ddlTimeAtAddress']; 
    $post['EmpIncomeType'] = $_POST['ddlPrimaryIncome']; 
    $post['EmpEmployerName'] = $_POST['txtEmployerName']; 
    $post['EmpTimeAtEmployer'] = $_POST['ddlTimeWithEmployer']; 
    $post['EmpNetMonthlyPay'] = $_POST['txtAfterTax']; //needs changing 
    // $post['following_pay_day'] = $_POST['ddlFollowingPayDay'] . '/' . $_POST['ddlFollowingPayMonth'] . '/' . $_POST['ddlFollowingPayYear']; 
    $post['EmpPayFrequency'] = $_POST['ddlPayFrequency']; 
    $post['EmpDirectPayment'] = $_POST['ddlPaidIntoBankAccount']; //change this 
    // $post['next_pay_day'] = $_POST['ddlNextPayDay'] . '/' . $_POST['ddlNextPayMonth'] . '/' . $_POST['ddlNextPayYear']; 
    $post['EmpNextPayDay'] = $_POST['ddlNextPayDay']; 
    $post['EmpNextPayMonth'] = $_POST['ddlNextPayMonth']; 
    $post['EmpNextPayYear'] = $_POST['ddlNextPayYear']; 
    $post['EmpFollowingPayDay'] = $_POST['ddlFollowingPayDay']; 
    $post['EmpFollowingPayMonth'] = $_POST['ddlFollowingPayMonth']; 
    $post['EmpFollowingPayYear'] = $_POST['ddlFollowingPayYear']; 
    $post['EmpNINumber'] = $_POST['txtNationalInsurance']; 
    $post['BankAccount'] = $_POST['txtAccountNumber']; 
    $post['BankSortcode'] = $_POST['txtSortCode']; 
    // $post['chkTerms'] = $_POST['chkTerms']; 
    $post['ReqMarketingOptIn'] = $_POST['chkMarketing']; 
    // rint_r($post); 
    $post['ReqAgent'] = ''; 
    $post['ReqDomain'] = ''; 
    $post['AppAddressMonths'] = 1; 
    $post['ReqTotalTimeout'] = 60; 
    $post['ReqLenderTimeout'] = 60; 
    $postvars = str_replace('&amp;', '&', (http_build_query($post))); 

    $ch = curl_init('https://000.co.uk/requestservice.asmx/Requestv4'); 
    curl_setopt($ch, CURLOPT_POST , 1); 
    curl_setopt($ch, CURLOPT_POSTFIELDS , $postvars); 
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 
    curl_setopt($ch, CURLOPT_HEADER , 0); // DO NOT RETURN HTTP HEADERS 
    curl_setopt($ch, CURLOPT_VERBOSE , 0); 
    curl_setopt($ch, CURLOPT_RETURNTRANSFER , 1); // RETURN THE CONTENTS OF THE CALL 
    $Rec_Data = curl_exec($ch); 

    $redirect = cut_str($Rec_Data, '<RedirectURL>', '</RedirectURL>'); 
    if (empty($redirect)) { 
     echo $Rec_Data; //change this line to reflect any changes/error messages to be displayed 
    } else { 
     header('location:' . $redirect); 
    } 
} 

function cut_str($str, $left, $right) 
{ 
    $str = substr (stristr ($str, $left), strlen ($left)); 
    $leftLen = strlen (stristr ($str, $right)); 
    $leftLen = $leftLen ? - ($leftLen) : strlen ($str); 
    $str = substr ($str, 0, $leftLen); 
    return $str; 
} 

?> 
<form target="_blank" action='' method="POST" > 
<input type='hidden' value='' name='AffiliateID' /><input type='hidden' value='' name='AffiliatePW' /><input type='hidden' value='' name='ReqMode' /><input type='hidden' value='' name='ReqTotalTimeout' /><input type='hidden' value='' name='ReqLenderTimeout' /><input type='hidden' value='' name='ReqLoanAmount' /><input type='hidden' value='' name='AppTitle' /><input type='hidden' value='' name='AppFirstName' /><input type='hidden' value='' name='AppLastName' /><input type='hidden' value='' name='AppEmail' /><input type='hidden' value='' name='AppDOBDay' /><input type='hidden' value='' name='AppDOBMonth' /><input type='hidden' value='' name='AppDOBYear' /><input type='hidden' value='' name='AppHomePhone' /><input type='hidden' value='' name='AppWorkPhone' /><input type='hidden' value='' name='AppMobilePhone' /><input type='hidden' value='' name='AppPostCode' /><input type='hidden' value='' name='AppHouseNumber' /><input type='hidden' value='' name='AppStreet' /><input type='hidden' value='' name='AppTown' /><input type='hidden' value='' name='AppCounty' /><input type='hidden' value='' name='EmpIncomeType' /><input type='hidden' value='' name='EmpEmployerName' /><input type='hidden' value='' name='EmpTimeAtEmployer' /><input type='hidden' value='' name='EmpNetMonthlyPay' /><input type='hidden' value='' name='EmpPayFrequency' /><input type='hidden' value='' name='EmpDirectPayment' /><input type='hidden' value='' name='EmpNextPayDay' /><input type='hidden' value='' name='EmpNextPayMonth' /><input type='hidden' value='' name='EmpNextPayYear' /><input type='hidden' value='' name='EmpFollowingPayDay' /><input type='hidden' value='' name='EmpFollowingPayMonth' /><input type='hidden' value='' name='EmpFollowingPayYear' /><input type='hidden' value='' name='EmpNINumber' /><input type='hidden' value='' name='BankAccount' /><input type='hidden' value='' name='BankSortcode' /><input type='hidden' value='' name='BankDebitCard' /><input type='hidden' value='' name='AppAddressYears' /><input type='hidden' value='' name='AppAddressMonths' /><input type='hidden' value='' name='AppHomeStatus' /><input type='hidden' value='' name='ReqConsent' /><input type='hidden' value='' name='ReqIPAddress' /><input type='hidden' value='' name='ReqAgent' /><input type='hidden' value='' name='ReqMarketingOptIn' /><input type='hidden' value='' name='ReqDomain' /> 
<input type="submit" value="Invoke" class="button"> 

我需要做的是有一個公正的形式和prosses形式

+0

我相信隨地吐痰被[內容政策](http://stackexchange.com/legal/content-policy)禁止:D或者至少它應該...它很噁心:p – ChrisR

+0

對不起,我的拼寫錯誤採取它firefox spellcheck劑量不在這個網站上工作 – user1053865

回答

1

在您的表單頁面,才使表單動作場點到你的進程頁:

<form action='your_process_page.php' method="POST"> 

,並將所有的處理代碼到該頁面。

+0

這樣一個白癡我試過,但忘記關閉?> – user1053865