everlifefree Posted March 3, 2008 Share Posted March 3, 2008 Ok here's what'd I'd like to do but needs some help on how to do it. The sms_address is coming in from one text input field and what I'd like to do is make it so there is the text field and a drop down field. That combine together to make the sms_address that is submitted. Here's my current code... // HANDLE SUBMITTED MOBILE BEHAVIOR CONFIG // if (isset($_POST["SubmitMobile"])) { if (!isset($mySettings)) $mySettings = unpk(me("settings")); if (!is_array($mySettings)) $mySettings = array(); $mySettings["MOBILE"]["SMSADDRESS"] = (preg_match($CONF["REGEXP_EMAIL"], $_POST["sms_address"])?$_POST["sms_address"]:NULL); $mySettings["MOBILE"]["TRUSTCONTACTS"] = (ckbool($_POST["sms_trustcontacts"])?true:false); $mySettings["MOBILE"]["EXCLUDEONLINE"] = (ckbool($_POST["sms_excludeonline"])?true:false); myQ("UPDATE `[x]users` SET `settings`='".pk($mySettings)."' WHERE `id`='".me("id")."'"); } Quote Link to comment https://forums.phpfreaks.com/topic/94105-php-input-field-to-two-fields/ Share on other sites More sharing options...
everlifefree Posted March 3, 2008 Author Share Posted March 3, 2008 Anyone? Quote Link to comment https://forums.phpfreaks.com/topic/94105-php-input-field-to-two-fields/#findComment-482190 Share on other sites More sharing options...
everlifefree Posted March 3, 2008 Author Share Posted March 3, 2008 help Quote Link to comment https://forums.phpfreaks.com/topic/94105-php-input-field-to-two-fields/#findComment-482393 Share on other sites More sharing options...
kkeim Posted March 3, 2008 Share Posted March 3, 2008 Can you elaborate your application? Quote Link to comment https://forums.phpfreaks.com/topic/94105-php-input-field-to-two-fields/#findComment-482397 Share on other sites More sharing options...
ohdang888 Posted March 4, 2008 Share Posted March 4, 2008 so the info put in on 1 field, would join together with info from anyother field? try: $x = $text_1.$drop_down; of course, change the variables to what the GET is. Quote Link to comment https://forums.phpfreaks.com/topic/94105-php-input-field-to-two-fields/#findComment-482459 Share on other sites More sharing options...
everlifefree Posted March 4, 2008 Author Share Posted March 4, 2008 ok but where exactly in the above code would i put that? Quote Link to comment https://forums.phpfreaks.com/topic/94105-php-input-field-to-two-fields/#findComment-482575 Share on other sites More sharing options...
ohdang888 Posted March 4, 2008 Share Posted March 4, 2008 well before you update anything.... $text1 = $_GET['text_field_name']; $drop_down = $_GET['drop_down_field_name']; $x = $text_1.$drop_down; then update Quote Link to comment https://forums.phpfreaks.com/topic/94105-php-input-field-to-two-fields/#findComment-483289 Share on other sites More sharing options...
everlifefree Posted March 4, 2008 Author Share Posted March 4, 2008 so would the $x be the smsaddress? Quote Link to comment https://forums.phpfreaks.com/topic/94105-php-input-field-to-two-fields/#findComment-483326 Share on other sites More sharing options...
ohdang888 Posted March 5, 2008 Share Posted March 5, 2008 X is the variable of what will store the 2 combined things. Call it "adhsfjadhfsasfd", or hell, call it "i_hate_php" .. whatever you want (I'm a math nerd, i say everything in terms of x) Quote Link to comment https://forums.phpfreaks.com/topic/94105-php-input-field-to-two-fields/#findComment-483398 Share on other sites More sharing options...
everlifefree Posted March 5, 2008 Author Share Posted March 5, 2008 Ok, i get it but where exactly do I insert it in the above code? Quote Link to comment https://forums.phpfreaks.com/topic/94105-php-input-field-to-two-fields/#findComment-483673 Share on other sites More sharing options...
ohdang888 Posted March 5, 2008 Share Posted March 5, 2008 well, obvisouly before the update. and change the variable names to whatever makes sense in your code. Quote Link to comment https://forums.phpfreaks.com/topic/94105-php-input-field-to-two-fields/#findComment-484231 Share on other sites More sharing options...
everlifefree Posted March 18, 2008 Author Share Posted March 18, 2008 Ok explain this one more time in simple detail I'm still a little confused Quote Link to comment https://forums.phpfreaks.com/topic/94105-php-input-field-to-two-fields/#findComment-495123 Share on other sites More sharing options...
ohdang888 Posted March 18, 2008 Share Posted March 18, 2008 you overall code doesn't make sense there are a number of problems <? // HANDLE SUBMITTED MOBILE BEHAVIOR CONFIG // if (isset($_POST["SubmitMobile"])) { if (!isset($mySettings)) $mySettings = unpk(me("settings")); if (!is_array($mySettings)) $mySettings = array(); $mySettings["MOBILE"]["SMSADDRESS"] = (preg_match($CONF["REGEXP_EMAIL"], $_POST["sms_address"])?$_POST["sms_address"]:NULL); $mySettings["MOBILE"]["TRUSTCONTACTS"] = (ckbool($_POST["sms_trustcontacts"])?true:false); $mySettings["MOBILE"]["EXCLUDEONLINE"] = (ckbool($_POST["sms_excludeonline"])?true:false); // what is all this stuff??????? myQ("UPDATE `[x]users` SET `settings`='".pk($mySettings)."' WHERE `id`='".me("id")."'"); myQ ??? // WRONG, its mysql_query `[x]users`// whats the [x]? a variable?... then you have to use the [$x] ".pk($mySettings)."' // i don't uiserstand what uo're veen trying to do ".me("id")."'" // same here } ?> Quote Link to comment https://forums.phpfreaks.com/topic/94105-php-input-field-to-two-fields/#findComment-495329 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.