0

I wrote a large registration system in html/php/mysql many years ago. I had to upgrade a lot of code when php was upgraded. I have been having issues with passing php variables in html input. A registration form is mostly painted, then just stops when it hits the statements. I will extract the salient pieces here:

<form name=“regForm” method=“POST” action=“processReg.php”>

Acres of code, which all paints just fine

  <INPUT type=“hidden” name=“regState” value=“<?php echo $personFound; ?>” >
  <INPUT type=“hidden” name=“person_id” value=“<?php echo $person_id; ?>” >
  <INPUT type=“hidden” name=“rs” value=“<?php echo $res; ?>” >

  <INPUT type=“submit” value=“Submit”>
</form>

The submit button is not displayed. I am led to believe that I have some error with the hidden input. I put the code through a syntax checker, which reported no issues. Any clues?

If I remove the surrounding php portion, leaving the variables, the screen finishes painting. The submit button is there, yet blows up when the form action is executed. $res is a php array.

28
  • 4
    What is the resulting HTML page source in the browser? Are there any errors in the PHP logs?
    – David
    Commented Jun 5, 2024 at 18:05
  • 3
    As an aside... Those stylized "smart quotes" are invalid HTML. The browser may be silently correcting them for you, but you should correct them in the code instead.
    – David
    Commented Jun 5, 2024 at 18:06
  • 7
    If $res is really an array then echo $res; makes little sense. See: 3v4l.org/Nut3A Commented Jun 5, 2024 at 18:11
  • 4
    Anyway, as above - use the View Source feature in your browser, or the element inspector, to see what the final result returned by php was. Probably you'll see an error message or something like that, inside one of the html elements. And yeah, you can't echo an array - what would you expect the output to be from doing that, exactly?
    – ADyson
    Commented Jun 5, 2024 at 18:25
  • 4
    I don't want to be negative, but not knowing the URL and not having a login will probably not deter a good hacker if your code is insecure. Since you don't seem to know what's going on in your code, it is clearly not safe. Assume you will get hacked, until you can prove that's not possible. If your code doesn't protect anything, that's worth protecting, then that's fine, otherwise consider yourself warned. Commented Jun 5, 2024 at 19:48

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.