-1

html code php code

this is what happen when i try to click the submit button, the code will print i want to input the data from form to database i'm using xampp

Your Common Sense
  • 156,878
  • 40
  • 214
  • 345
Kenchi
  • 15
  • 1
  • Please add your code as text and not as images and provide a clear, concise question stating the problem – Professor Abronsius Feb 12 '23 at 11:41
  • FYI- Your code is wide open to SQL injection. Always use `prepared statements` with bound parameters when using user supplied data in your sql – Professor Abronsius Feb 12 '23 at 11:43
  • using `$_REQUEST` rather than `$_POST` means somebody can craft a url in the browser address bar to easily try attacking your app – Professor Abronsius Feb 12 '23 at 11:45
  • _Never_ store passwords in plain text! You should only store password hashes generated using [password_hash()](https://www.php.net/manual/en/function.password-hash.php) and to verify a password againts a hash, use [password_verify()](https://www.php.net/manual/en/function.password-verify.php). – M. Eriksson Feb 12 '23 at 11:54

1 Answers1

0

If your xampp Apache server and MySQL server are turned on, you should be accessing the web pages with "localhost/proj/" not with the file directory.

Daniel Don
  • 232
  • 3
  • 9
  • sorry i'm newbie but i just want to create registration form and connect it to my database but every time i click the submit button the code on my php is printed – Kenchi Feb 12 '23 at 11:51
  • when i open in to localhost/proj/registration.php "Warning: Undefined array key "firstname" in C:\xampp\htdocs\proj\registration.php on line 7" this what happen – Kenchi Feb 12 '23 at 11:52