Topic awaiting preservation: PHP code not working, pulling hair out |
|
---|---|
Author | Thread |
Bipolar (III) Inmate From: under the Milky Way tonight |
posted 04-10-2004 09:48
Hi, guys! |
Maniac (V) Inmate From: Den Haag: The Royal Residence |
posted 04-10-2004 10:35
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 |
posted 04-10-2004 13:12
php code can be placed anywhere, rincewind. |
Paranoid (IV) Inmate From: [s]underwater[/s] under-snow in Juneau |
posted 04-10-2004 19:41
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 |
posted 04-11-2004 00:10
How come you have $_POST['name'] then start doing: $_POST[$name]? |
Maniac (V) Mad Scientist From: :morF |
posted 04-11-2004 01:13
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 |
posted 04-11-2004 09:05
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 |
posted 04-11-2004 21:26
$_POST[name] will actually cause undefined constant errors. You must quote the 'name' part. |
Nervous Wreck (II) Inmate From: canada |
posted 04-14-2004 07:37
quote:
|
Paranoid (IV) Inmate From: Sthlm, Sweden |
posted 04-14-2004 09:01
I think you've got it a bit mixed up here. |