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 8703441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T02:52:08+00:00 2026-06-13T02:52:08+00:00

I’ve got a problem with a webform that uses PHP. I’m sure it’s very

  • 0

I’ve got a problem with a webform that uses PHP. I’m sure it’s very obvious but can’t find the problem.

What I want to do is basically enter a numerical value into a field on a form, which then sends the value to a mysql database, requesting a record linked to that value,

The problem I am getting is that the value is not being taken properly when I hit the ‘submit’ button, but will take the previous value that was submitted a previous query.

For example, I want to retrieve a record that has an ‘id’ of 1. I enter ‘1’ into the field (the id of the field is ‘identry’), but I get an error. The error basically signifies that I have not entered a value into the ‘id’ field for some reason. Then I access the search field again, enter a value of ‘2’, and hit the ‘submit’. I then get a result that it has just accessed record with ‘id’ of ‘1’ (the previous query!!!!)

Any ideas??

This is my code for the form…..

<form id="form1" name="form1" method="post" >
          <table width="400" border="0">
            <tr>
              <td width = "150" ><div align="right">HPOV reference </div></td>   
              <td width = "150"><label>
              <input name= "identry" type="text" id="identry" />
              </label></td>
              <td width = "100"><label>
                <div align="left">
                <input name="Submit" type="submit" onclick="MM_openBrWindow('HPOVwindow.php?id=<?php echo $_POST['identry']; ?>','','toolbar=yes,width=1000,height=1000')" />
                </div>
                </label></td>
            </tr>
          </table>
        </div>
      </form>

I think its how I submit the variables in the first instance but can’t find out how to do this.

  • 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-06-13T02:52:10+00:00Added an answer on June 13, 2026 at 2:52 am

    You’re posting the previous entry when you submit your form.

    PHP can’t handle data on the client side until it’s sent to the server.

    This line: <?php echo $_POST['identry']; ?> is telling PHP to fill the value that was posted to it, which would be the previous entry. What you meant was: document.getElementById("identry").value

    Edit: So the line that enters the value would look something like this:

    <input name="Submit" type="submit" onclick="MM_openBrWindow('HPOVwindow.php?id=" + document.getElementById("identry").value + "','','toolbar=yes,width=1000,height=1000')" /> 
    

    and just try the following:

    <form id="form1" name="form1" method="post" >
              <table width="400" border="0">
                <tr>
                  <td width = "150" ><div align="right">HPOV reference </div></td>   
                  <td width = "150"><label>
                  <input name= "identry" type="text" id="identry" />
                  </label></td>
                  <td width = "100"><label>
                    <div align="left">
                    <input name="Submit" type="submit" onclick="submitForm();" /> 
                    </div>
                    </label></td>
                </tr>
              </table>
            </div>
            <script>
              function submitForm() {
                         window.open('HPOVwindow.php?id=' + document.getElementById("identry").value,'','toolbar=yes,width=1000,height=1000');
                                     return false;
    
    
              }
            </script>
          </form>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
I have a French site that I want to parse, but am running into
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
Seemingly simple, but I cannot find anything relevant on the web. What is the
I want to construct a data frame in an Rcpp function, but when I
I'm trying to create an if statement in PHP that prevents a single post
I have a small JavaScript validation script that validates inputs based on Regex. I
link Im having trouble converting the html entites into html characters, (&# 8217;) i

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.