tecmeister Posted April 27, 2009 Share Posted April 27, 2009 Hi again, I would like to know how to add to the line that I typed previously. feedback.php?error= What I mean by that is. if($name == "") { echo 'name'; } if($product == "") { echo 'product'; } then it will just add name to that line. Thanks again, tecmeister. Link to comment https://forums.phpfreaks.com/topic/155896-help-again/ Share on other sites More sharing options...
premiso Posted April 27, 2009 Share Posted April 27, 2009 $error = ""; if (empty($name)) { $error .= "name is missing<br />"; } if (empty($product)) { $error .= "product is missing<br />"; } if (!empty($error)) { header("Location: feedback.php?error={$error}"); }else { // do other processing } Is that what you were looking for? Link to comment https://forums.phpfreaks.com/topic/155896-help-again/#findComment-820608 Share on other sites More sharing options...
tecmeister Posted April 27, 2009 Author Share Posted April 27, 2009 Might be. If they were all missing I would want it to look like this: feedback.php?error=fullname+product+feedback It would add each one on to it they it is missing. does that explaing it more? Thanks for your help, tecmeister. Link to comment https://forums.phpfreaks.com/topic/155896-help-again/#findComment-820617 Share on other sites More sharing options...
premiso Posted April 27, 2009 Share Posted April 27, 2009 $error = array(); if (empty($name)) { $error[] = "name"; } if (empty($product)) { $error[] = "product"; } if (count($error) > 0) { header("Location: feedback.php?error=" . implode("+", $error)); }else { // do other processing } Hopefully you can configure it from what to be what you want. Link to comment https://forums.phpfreaks.com/topic/155896-help-again/#findComment-820623 Share on other sites More sharing options...
tecmeister Posted April 27, 2009 Author Share Posted April 27, 2009 Hi there, When I run it, it only adds the first one to it. Is there something that I'm missing out? Thanks, tecmeister. Link to comment https://forums.phpfreaks.com/topic/155896-help-again/#findComment-820633 Share on other sites More sharing options...
tecmeister Posted April 27, 2009 Author Share Posted April 27, 2009 I have fixed that part. How do I retrieve off that line? Beacuse there is more than one thing on it how do I get each thing off it one by one? Will I have to do a few if's or can you retrieve each one? thanks, tecmeister. Link to comment https://forums.phpfreaks.com/topic/155896-help-again/#findComment-820645 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.