chuchu1 Posted May 18, 2009 Share Posted May 18, 2009 Hi guys. I need some help here (am an amateur.., but can do copy n paste ).. what should be the correct code here: while(list($key,$value) = each($_POST)){if(!(empty($value))){$set=1;}$message = $message . "$key: $value\n\n";} if($set!==1){header("location: $_SERVER[HTTP_REFERER]");exit;} Thanks for help in advance. Quote Link to comment https://forums.phpfreaks.com/topic/158556-php-form-help/ Share on other sites More sharing options...
Daniel0 Posted May 18, 2009 Share Posted May 18, 2009 Dude, you need to format your code. It's really difficult reading your code. while (list($key, $value) = each($_POST)) { if(!empty($value)) { $set = 1; } $message = $message . "$key: $value\n\n"; } if ($set !== 1) { header("location: $_SERVER[HTTP_REFERER]"); exit; } What do you mean with "the correct code" though? Quote Link to comment https://forums.phpfreaks.com/topic/158556-php-form-help/#findComment-836251 Share on other sites More sharing options...
chuchu1 Posted May 18, 2009 Author Share Posted May 18, 2009 Thanks Daniel0 What I mean by 'correct code' is that I get an error on the page, "undefined variable' , line 59. The code I put is the line 59. What should I enter? Thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/158556-php-form-help/#findComment-836255 Share on other sites More sharing options...
Daniel0 Posted May 18, 2009 Share Posted May 18, 2009 There probably is no referrer then. Quote Link to comment https://forums.phpfreaks.com/topic/158556-php-form-help/#findComment-836261 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.