![]() Topic awaiting preservation: PHP code not working, pulling hair out (Page 1 of 1) |
|
---|---|
Bipolar (III) Inmate From: under the Milky Way tonight |
![]() Hi, guys! |
Maniac (V) Inmate From: Den Haag: The Royal Residence |
![]() Well i am not an php-guru but i noticed the php code is outside the body tags with no closing html tag. My best guess is that the browser will not do anything with code outside the body tags. |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
![]() php code can be placed anywhere, rincewind. |
Paranoid (IV) Inmate From: [s]underwater[/s] under-snow in Juneau |
![]() Have you echoed your $_POST variables to make sure that they are making it from your submitting page? Or using- |
Nervous Wreck (II) Inmate From: canada |
![]() How come you have $_POST['name'] then start doing: $_POST[$name]? |
Maniac (V) Mad Scientist From: :morF |
![]() You're actually damn right there falling. The $_POST, $_GET, $_SESSION, etc array are all associative arrays, so the keys that point to each index's contents are words, instead of numbers. As such they have be treated like strings, so only $_POST["name"] and $_POST['name'] are correct. However, if you have auto_register turned on all the keys of the $_POST, etc arrays are automatically turned into global variables, which is a very unsecure way of doing things. So, when you're calling $_POST[$email], what it's actually doing is: |
Bipolar (III) Inmate From: under the Milky Way tonight |
![]() I appreciate all the advice. I had no idea that there was a security issue with the code. I have only recently learned php, and a lot of it was taught on the fly. With that said, I am trying to digest all that has been suggested here. |
Paranoid (IV) Mad Scientist with Finglongers From: Germany |
![]() $_POST[name] will actually cause undefined constant errors. You must quote the 'name' part. |
Nervous Wreck (II) Inmate From: canada |
![]() quote:
|
Paranoid (IV) Inmate From: Sthlm, Sweden |
![]() I think you've got it a bit mixed up here. |