2012-05-04 17 views
0

私のフォームはメインの連絡先ページにリダイレクトされています...送信ボタンが押されたにもかかわらず処理されないため、$_POST['contactsent']はフォームが処理されます。PHPフォームスクリプトが処理されていません

HTMLフォームスニペット

<form method="post" action="process.php" id="form1"> 
<input type="hidden" value='yes' name="contactsend" /> 

PHPフォームプロセス

if ($_POST['contactsent'] != 'yes') { 
    header ('Location: /contact'); 
    exit; 
} else { 

    if (is_array($_POST)) { 
     foreach ($_POST as $key => $value) { 
      $_POST[$key] = mysql_real_escape_string(stripslashes($value)); 
     } 
    } 

    $uxRequestType  = $_POST["uxRequestType"]; 
    $uxGlobalLocation = $_POST["uxGlobalLocation"]; 
    $uxFirstName  = strtolower(str_replace("'","''",$_POST["uxFirstName"])); 
    $uxFirstName  = strtoupper(substr($uxFirstName,0,1)).substr($uxFirstName,1); 
    $uxLastName   = strtolower(str_replace("'","''",$_POST["uxLastName"])); 
    $uxLastName   = strtoupper(substr($uxLastName,0,1)).substr($uxLastName,1); 
    $uxEmail   = strtolower(str_replace("'","''",$_POST["uxEmail"])); 
    $uxCity    = strtolower(str_replace("'","''",$_POST["uxCity"])); 
    $uxCity    = strtoupper(substr($uxCity,0,1)).substr($uxCity,1); 
    $uxState   = $_POST["uxState"]; 
    $uxComment   = $_POST["uxComment"]; 

    if ($uxGlobalLocation == "host1"): 
     $SendTo="[email protected]"; 
    elseif ($uxGlobalLocation == "host2"): 
     $SendTo="[email protected]"; 
    else: 
     $SendTo="[email protected]"; 
    endif; 

答えて

3

Contactsendとcontactsent ...誤植?あなたの変数

+0

おかげさまで...ありがとうございます。 – acctman

2

あなたの名前のミス:

if ($_POST['contactsent'] != 'yes') { 

if ($_POST['contactsend'] != 'yes') { 
1

つのキーが "contactSEND" という名前の、他方はcontactSENT

2
<input type="hidden" value='yes' name="contactsend" /> 

ですでなければなりません
if ($_POST['contactsent'] != 'yes') { 

どちらも「連絡先」または「連絡先」にする必要があります

関連する問題