Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7193679
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:13:05+00:00 2026-05-28T20:13:05+00:00

For some reason, if a mistake is made on my form the url variables

  • 0

For some reason, if a mistake is made on my form the url variables disappear and there must be a way to keep them. I am newer to PHP and very new to PHP Form Builder Class so I can’t figure this out. My form page looks like:

<?php
require_once '../site_globals/FirePHP.class.php';
ob_start();
?>
<!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 Two: Physician Supervisor Feedback</title>
<link rel="stylesheet" type="text/css" href="../css/view.css" media="all" />
</head>
<body id="main_body" >
<img id="top" src="../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 Two: Physician Supervisor Feedback</h2>
      <p></p>
    </div>
    <?php
session_start();
$hide  = $_GET['id'];
$hide1 = $_GET['hash'];
include '../site_globals/dbc.php';
error_reporting(0);
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.*/
        $name       = filter($_POST['name']);
        $title      = filter($_POST['title']);
        $email      = filter($_POST['email']);
        $fina       = filter($_POST['fina']);
        $status     = filter($_POST['status']);
        $comments   = filter($_POST['comments']);
        $date       = filter($_POST['date+']);
        $hidden     = filter($_POST['hidden']);
        $hiddenhash = filter($_POST['hiddenhash']);
        //Run first query to input POSTS into table
        $query_1    = "UPDATE usc_table SET name_2='$name', title_2='$title', email='$email', financial='$fina', status_2='$status', comments='$comments', date_2='$date' WHERE submission_id='$hidden'";
        $things = mysql_query($query_1) or die(mysql_error());
        //Run second query to update feedback column in submissions
        $query_2 = "UPDATE submissions SET feedback=3 WHERE submission_id=$hidden";
        mysql_query($query_2) or die(mysql_error());
        INCLUDE '../site_hospital01/pdfmaker_2.php';
        echo "Thank You, Your Feedback Has Been Submitted.";
    } 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.*/
        $hide    = $_GET['id'];
        $hide1   = $_GET['hash'];
        $firephp = FirePHP::getInstance(true);
        $firephp->log("$hide", 'Iterators');
        $pageURL = $_SERVER['REQUEST_URI'] . "?id=" . $hide . "&&hash=" . $hide1;
        header("Location: " . $pageURL);
    }
    exit();
}
?>
 <?php
$hide     = $_GET['id'];
$hide1    = $_GET['hash'];
$options  = array(
    "Order as needed",
    "Shelf Stock",
    "Consignment"
);
$options1 = array(
    "Approved",
    "Denied"
);
$form     = new Form("anything", 700);
$form->addElement(new Element_Hidden("form", "anything"));
$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("Email:", "email", array(
    "required" => 1
)));
$form->addElement(new Element_YesNo("Do you have a financial interest in the manufacturer of this product:", "fina", array(
    "required" => 1
)));
$form->addElement(new Element_Radio("Status of this request:", "status", $options1, array(
    "inline" => 1,
    "required" => 1
)));
$form->addElement(new Element_Textarea("Comments:", "comments", array(
    "required" => 0
)));
$form->addElement(new Element_Date("Date:", "date+"));
$form->addElement(new Element_Hidden("hidden", "$hide"));
$form->addElement(new Element_Hidden("hiddenhash", "$hide1"));
$form->addElement(new Element_Button);
$form->render();
//var_dump(get_defined_vars());
?>
 </div>
</div>
<img id="bottom" src="../images/bottom.png" alt="" />
</body>

</html>
<?php
ob_end_flush();
?> 

It is live at http://supplychex.com/site_hospital01/feedback_2.php?id=&&hash=

Any ideas on how to keep the URL Variables available after the form submission if there are errors? I’ve tried several things and they disappear every time. I’m hoping someone smarter than me can tell me how they would handle this. Ive tried redirecting the page to every suggested URL on this site meant to keep url variables in place and frustratingly they still disappear. I’ve thought about hidden fields but the form is not being posted since there are errors. Help….

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T20:13:06+00:00Added an answer on May 28, 2026 at 8:13 pm

    I think that the usage of Form Builder class is unnecessary, revise the code starting from 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.*/ and manually code the form. Then add a value="<?php echo $_POST['whatever']; ?> to each element you wish to keep.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For some reason I never see this done. Is there a reason why not?
For some reason, my jQuery isn't working properly, and I can't spot the mistake,
For some reason whenever i click on my pin the app crashes. there are
This class should read some lines from a data and from them to variables
For some reason when I attempt to make a request to an Ajax.net web
For some reason when I create a new namespace in Visual Studio 2008 its
For some reason, when I try to install SQL Server 2008 Express , I
For some reason, lately the *.UDL files on many of my client systems are
For some reason, Section 1 works but Section 2 does not. When run in
For some reason beyond me I can't access the mysql server on a machine.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.