![]() |
|
|
|||||||
| Register | Forum FAQ | Search | Today's Posts | Mark Forums Read |
|
|
LinkBack | Thread Tools | Display Modes |
|
||||
|
Hey
Just comment-out the line //echo "$key: $val<br />";//debugging info The script can send HTTP headers only before any output. This should help. It worked on your previous host because default PHP error level was not showing all script errors. However on GlowHost servers PHP will show all errors, unless specified other option. This is good, because you can debug your scripts & see all errors they're causing. |
|
||||
|
Looks like $first_name, $last_name, $vis_email etc comes from form via POST request. You should always referrer to these variables as $_POST['key'] - $_POST['last_name'], $_POST['first_name'] etc. Refering to $_POST['last_name'] as $last_name will return PHP error & empty string in this variable. This code works:
if (strlen($first_name) <1) { header("Location: error.php"); exit; } This is another bad security example. On some hosts register_globals PHP option is enabled. Disabling register_globals gives more security to your scripts - this is PHP team recommendation. This is done on GlowHost servers to gain better security level for PHP scripts. |
|
||||
|
John_Marc -
I understand the code that you sent - thank you so much! But, what I don't get is: how come the formprocessor works fine until I start checking for strlen or ereg? This processor was cool because no matter what field you had in the form, it processed it and submitted all fields to the recipient. Doesn't the code specify here: Quote:
|
|
||||
|
Yes it is, but .... it ONLY looks for redirect and recipient and ignores the rest. Something tells me wht he meant to do was this line: $val = trim($val); is a typo and he meant: ${$key} = trim($val); which essentially bypasses the register globals off setting. Not recommended. So what you end up with is a bunch of empty PHP vars, all with a strlen of 0 - hence the error triggering. Best, as Dmitriy points out is to just refer to the var in its POST format and be done with it. PHP 4 is almost dead. PHP 6 will not allow overriding this like your old host did, and when that happens, there will be a lot of companies scrambling.
|