Jump to content

PHP input field to two fields


everlifefree

Recommended Posts

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
Share on other sites

  • 2 weeks later...

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.