2012-01-15 14 views
0

昨日私はPFBCで作業を始めました。URL $ _GET変数を渡す方法がわからず、利用できないすべてのドキュメントを読みました。私がドキュメントに見当たらないもう一つのことは、変数をそのように渡すことを試みたので、隠されたフィールドの例です。私はvar dumpから、GET変数がページのロード時に選択されているのを見ることができますが、私は 'submit'のときにそれらを選ぶことはできません。以下の私のスクリプトでは、すべての変数は$ idsを除いて正常に表示されます。私はGET変数をセッションに入れようとしましたが、仕事はありませんでした...隠されたフィールドはうまくいかず、以下に列挙された方法がうまくいかなかったのです。ここの指針は1トンを助けるだろう。私はpfbc2.2-php5を使っていますが、これは古いもののほとんどのドキュメントを持っていません。私のコードは:PHPフォームビルダークラス非表示フィールド

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 
<title>Step One: Physician Feedback</title> 
<link rel="stylesheet" type="text/css" href="MachForm/data/form_1/css/view.css" media="all" /> 
</head> 
<body id="main_body" > 
<img id="top" src="MachForm/images/top.png" alt="" /> 
<div id="form_container"> 
    <div id="form_container" style="background-color: #004F79; height:45px;"></div> 
    <div style="padding:30px;"> 
    <div class="form_description"> 
     <h2>Step One: Physician Feedback</h2> 
     <p></p> 
    </div> 
    <?php 
session_start(); 
error_reporting(E_ALL); 
include("PFBC/Form.php"); 
if (isset($_POST["form"])) { 
    if (Form::isValid($_POST["form"])) { 
     /*The form's submitted data has been validated. Your script can now proceed with any 
     further processing required.*/ 
     $ids  = $_GET["nums"]; 
     $name  = $_POST['name']; 
     $title  = $_POST['title']; 
     $dept  = $_POST['dept']; 
     $phone  = $_POST['phone']; 
     $tech  = $_POST['tech']; 
     $latex  = $_POST['latex']; 
     $eliminate = $_POST['eliminate']; 
     $stock  = $_POST['stock']; 
     $urgent = $_POST['urgent']; 
     $reason = $_POST['reason']; 
     $date  = $_POST['date+']; 
     echo $ids; 
     //header("Location: " . $_SERVER["PHP_SELF"]); 
    } else { 
     /*Validation errors have been found. We now need to redirect back to the 
     script where your form exists so the errors can be corrected and the form 
     re-submitted.*/ 
     header("Location: " . $_SERVER["PHP_SELF"]); 
    } 
    exit(); 
} 
?> 
    <?php 
$options = array(
    "Order as needed", 
    "Shelf Stock", 
    "Consignment" 
); 
$options1 = array(
    "Urgent", 
    "High", 
    "Medium", 
    "Low" 
); 
$options2 = array(
    "Lower Cost Item", 
    "Needed for new procedure", 
    "Reduces Length of Stay", 
    "Improves Safety", 
    "Reduces Procedure Time" 
); 
$form  = new Form("anything", 700); 
$form->addElement(new Element_Hidden("form", "anything")); 
$form->configure(array(
    "view" => new View_Grid(array(
     2, 
     2, 
     2, 
     2, 
     1, 
     1, 
     1 
    )) 
)); 
$form->addElement(new Element_Textbox("Name:", "name", array(
    "required" => 1 
))); 
$form->addElement(new Element_Textbox("Title:", "title", array(
    "required" => 1 
))); 
$form->addElement(new Element_Textbox("Department:", "dept", array(
    "required" => 1 
))); 
$form->addElement(new Element_Textbox("Phone:", "phone", array(
    "required" => 1 
))); 
$form->addElement(new Element_YesNo("Is this new technology:", "tech", array(
    "required" => 1 
))); 
$form->addElement(new Element_YesNo("Does this product contain latex:", "latex", array(
    "required" => 1 
))); 
$form->addElement(new Element_YesNo("Is the current technology being eliminated:", "eliminate", array(
    "required" => 1 
))); 
$form->addElement(new Element_Radio("What is the stocking preference:", "stock", $options, array(
    "inline" => 1, 
    "required" => 1 
))); 
$form->addElement(new Element_Radio("How urgent is this request:", "urgent", $options1, array(
    "inline" => 1, 
    "required" => 1 
))); 
$form->addElement(new Element_Select("Primary Rationale For this request:", "reason", $options2, array(
    "required" => 1 
))); 
$form->addElement(new Element_Date("Date:", "date+")); 
$form->addElement(new Element_Button); 
$form->render(); 
//var_dump(get_defined_vars()); 
?> 
</div> 
</div> 
<img id="bottom" src="MachForm/images/bottom.png" alt="" /> 
</body> 
</html> 
+0

このクラスでは非常に簡単です。なぜ私がとても苦労していたのか分かりません。これらの行を追加して、背面のPOSTをピックアップしてください。よく働く。私はこのクラスが本当に好きです。 $ hide = $ _GET ['nums']; $ form-> addElement(new Element_Hidden( "hidden"、 "$ hide")); –

答えて

0

このクラスは非常に簡単です。なぜ私がとても苦労していたのか分かりません。これらの行を追加して、背面のPOSTをピックアップしてください。よく働く。私はこのクラスが本当に好きです。 $ hide = $ _GET ['nums']; $ form-> addElement(新しいElement_Hidden( "hidden"、 "$ hide"));

関連する問題