DuaneCawaling Posted March 5, 2013 Share Posted March 5, 2013 Type SMART[space]WALLET[space]keyword* KEYWORDS:register[space]passwordbalmenudrinkssnacksbuy[space]qty-item_keyword ex: ADZU WALLETbuy 1-M1,1-M2,3-S1pass[space]password ex: ADZU WALLET pass 12345 i want to check all the errors that may occur in the scenario of inputing the different keywords. for example: ADZU WALLET pass in this string, the error would be that there is no password ..a message should be shown to the user that it is an error please help me check every possible error and scenario Quote Link to comment https://forums.phpfreaks.com/topic/275269-error-checking-keywords/ Share on other sites More sharing options...
Christian F. Posted March 5, 2013 Share Posted March 5, 2013 What have you tried? This section is for getting help with code that you're writing yourself, but have gotten stuck on for some reason. It's not for getting us to write the code for you, but for us to help you learn to do it yourself. If you want others to do it for you, you'll need to post in the Freelancer section. Also, be prepared that this will most likely cost you money. Quote Link to comment https://forums.phpfreaks.com/topic/275269-error-checking-keywords/#findComment-1416719 Share on other sites More sharing options...
DuaneCawaling Posted March 5, 2013 Author Share Posted March 5, 2013 <?php echo ('Type <strong>ADZU</strong>[space]<strong>UEW</strong>[space]<em>keyword</em>*')."<br />"; echo "<em>KEYWORDS</em>:"."<br />". "<strong>register</strong>[space]<em>password</em>"."<br>" ."<strong>bal</strong>"."<br />"."<strong>menu</strong>"."<br />"."<strong>drinks</strong>"."<br />" ."<strong>snacks</strong>"."<br />"."<strong>buy</strong>[space]<em>qty-item_keyword</em> ex: ADZU UEW buy 1-M1"."<br />" ."<strong>pass</strong>[space]<em>password</em>"."<br />"; ?> <form action="keyword.php" method="post"> Message: <input type="text" name="message"> Contact no.: <input type="text" name="number"> <input type="submit"> </form> this is the code for asking message and mumber <?php $str_full = "$_POST[message]"; //full message $number = "$_POST[number]"; //contact number $message = explode(" ",$str_full); $str_keyword = strtolower($message[2]); //----->message [2] echo iskeyword($str_full,$str_keyword); function iskeyword($word,$dummy){ if($dummy == "register"){ $msg = substr($word,17); $msg1 = str_replace(' ','',$msg); return $msg1; }else if($dummy == "bal"){ $msg = substr($word,12); $msg1 = str_replace(' ','',$msg); return $msg1; } if($dummy == "buy"){ $msg = substr($word,12); $msg1 = str_replace(' ','',$msg); return $msg1; } } ?> this is the part im checking for errors in some keywords, im still in the process of finishing the codes Quote Link to comment https://forums.phpfreaks.com/topic/275269-error-checking-keywords/#findComment-1416722 Share on other sites More sharing options...
Christian F. Posted March 5, 2013 Share Posted March 5, 2013 I don't see any attempts to check for missing input there, at all. Nor do I see any specific questions as to what you're having a difficulty with. So I'm forced to assume that you haven't tried to solve this on your own, at all, and is just looking for people to work for free. As previously noted: This is not the correct section for that. Quote Link to comment https://forums.phpfreaks.com/topic/275269-error-checking-keywords/#findComment-1416726 Share on other sites More sharing options...
DuaneCawaling Posted March 5, 2013 Author Share Posted March 5, 2013 im sorry for the wrong use of section. i would post the working codes after. thank you and i apologize for the inconvenience Quote Link to comment https://forums.phpfreaks.com/topic/275269-error-checking-keywords/#findComment-1416730 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.