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")."'"); } 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? 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 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? 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. 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? 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 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? 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) 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? 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. 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 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 } ?> 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
Archived
This topic is now archived and is closed to further replies.