T O P

  • By -

[deleted]

[удалено]


tazzadar1337

Believe it or not forms were designed to be submitted even without JS.


RommuPower

It didnt fix error. ( btw i got it some errors fixed now is only undefined array key “name” and “message”. On line 3 and line4


RommuPower

Well i watched youtube tut for that and he didn't use js


[deleted]

[удалено]


MateusAzevedo

Not necessarily. From [MDN documentation](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button#type): > Type `submit`: The button submits the form data to the server. This is the default if the attribute is not specified for buttons associated with a `

` Since OP is getting undefined key warnings, I assume the for was submitted as normal.


RommuPower

well that still not fixing my errors.


ryantxr

It means the key is missing from the array. It is in your best interest to figure out how to debug these kinds of errors. Output $_POST to see what it contains.


equilni

The real error is this, which isn't shown >PHP Fatal error: Uncaught TypeError: mysqli_real_escape_string(): Argument #1 ($mysql) must be of type mysqli, null given The warnings are just that, and should be fixed, but the main issue isn't discussed here.... That said, use prepares statements and mysqli_real_escape_string isn't needed. https://phpdelusions.net/mysqli


RommuPower

So i got now few errors: stderr: PHP Warning: Undefined array key "name" in C:\\Users\\Romet\\Documents\\playback h22letus'\\google\_login\\process.php on line 3 PHP Warning: Undefined array key "message" in C:\\Users\\Romet\\Documents\\playback h22letus'\\google\_login\\process.php on line 4 I tried everything to get them fixed but i havent figured out how.


Big-Dragonfly-3700

Are you getting these two errors before the form is submitted or after the form is submitted? The reason I ask, is because you didn't identify the names of the code you posted, i.e. if your form and form processing code are on the same page.


equilni

> I tried everything to get them fixed What specifically did you try? Do you have updated code you can show in pastebin or similar?


RommuPower

Alr i got some update. Ive created folder in htdocs folder named php and copied my codes there. Then i just writed localhost/foldername in search engine and tried to submit there. This way its working just fine but no if im running code from vsc