Я начал работать с PFBC вчера, и я не могу понять, как передать переменные URL $ _GET, и я прочитал все документы, которые были бесполезны. Другая вещь, которую я не вижу в документации, это примеры скрытых полей, потому что я пытался передавать переменные таким образом, но безрезультатно. Я могу видеть из var dump, что переменные GET выбираются при загрузке страницы, но я не могу подобрать их после 'submit'. В моем скрипте ниже все переменные отображаются нормально, кроме $ ids. Я пытался поместить переменную GET в сеансы, не работал .... скрытые поля, не работал, и способ, перечисленный ниже, не работал ... для тех, кто знаком с этим классом, его торт, так что некоторые руководство здесь поможет тонну. Я использую pfbc2.2-php5, который не имеет почти документации старого. Мой код:
<!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>