Jump to content

Dynamic Drop Down


crazy8

Recommended Posts

Holy smoke, it has been a looooooong time since I have been here. Love the new look of the site btw. Well I am working on a new project for my church. The idea is an email to SMS program. So one use of this would be that if there is a youth activity I could send a message to the entire youth group with one message. I am trying to figure out something specific with it. I need to create a form that grabs info from the database. So more specifically what I need is one drop down that will have "Youth Group", "Parents", "Deacons", etc. now based on what I select I need the second drop down to populate with the corresponding people in that group. Now I want an "All" to be in the drop down to which would let me send the message I type to ALL people in the desired group but to also have the individual names come up just in case I need to do a specific person.

 

How would I go about doing something like this? I have done much research and cant quite find what I would need to do. Any help would be GREATLY appreciated.

Link to comment
Share on other sites

  I got the 'jist' of what you are trying to do...and yes, a long time since I have been also...but had some time to kill...and looking for help on what i need...lol

 

a: Youth Group", "Parents", "Deacons", etc.

 

Well, first off?  (and these are my personal thoughts of flow)

 

a)  I would think the 'church' has a website

b)  What you "plan on doing" is actually a 'spam list'  ;D  BUT? So, with that said... and again...if it was me? Well, i'd want to be able to control the access etc...of what I get in my email etc.

 

c)  This would take?  We'll a user registration form...with "opt in/opt out" etc...and tracking..

d) Then the "user type" would be defined there, and thats tossed into the Db

 

e)  HAve you built the database yet?

 

Jim

Link to comment
Share on other sites

Well maybe I should go into more detail of the project. Probably should have done that from the start...lol This is an idea I had which initially started at a meeting we had and one of the issues to address was "We give kids information for upcoming events and youth activity days, but rarely that info gets to the parents." Well of course all the kids have cell phones and most adults do to so it hit me that with all the texting everyone does maybe we can harness the technology. So the original idea was that I could create something that would send a txt message out to the youth group and their parents so they BOTH would have the info. But then we started thinking of other things like daily Bible verses and stuff.

 

Being a church, despite their good finances, would like to do it cheap/free. Well I recalled that I can go to my email account and send a message to (for example) 6125551234@tmob.net and the person who belongs to that phone number would get the message as an SMS txt message on their phone. Well it really costs nothing to do this so the BIG picture here is this. People from the church will fill a small form online with their name, email, phone number, provider, and what "group" the belong to. If they dont have a cell phone then thats where the email comes in. All the data gets saved into the database including a column which will combine the phone number and the service provider gateway address such as verison which uses "@vtext.com".

 

Then there is a form that I use to send the messages. It will consist of a "subject" text area, "message" text area only 160 characters, a drop down that has the "groups" in it and then the dynamic drop down which populates based on the other drop down selection but will also have an "ALL" choice since I will mostly be sending to "ALL" people in the selected group from the first drop down.

 

I think I would do an op/out option on a third form which would just require first name, last name, and phone number or email address depending which one was used to sign up.

 

Does this help clear it up at all? lol

Link to comment
Share on other sites

re: Well of course all the kids have cell phones and most adults do to so it hit me that with all the texting everyone does maybe we can harness the technology.

 

  OK, I am starting to read the whole thing, but need to interject this...from the 'get go'  :-)

 

a) Yeah, amazing...and the parents pay for them...and kids love to text for sure.. ME Can't stand it

 

b) Many, could have "family plans" etc...BUT? Depending on "the plan"...the NUMBER text messages, per plan or account any times have "caps" on nuers of messages.

 

c)  Hence, my reasoning of first? Having the opt-in/opt-out CONTROL, as face it...Once BILLABLE TIME is attacked to your Cell phone bill, You are HOSTAGE to that 'financial contract'...and MUST pay up...

 

d) Think along the lines off 900 numbers etc....as for what i mean in C)  ::)

 

e) re: I think I would do an op/out option on a third form which would just require first name, last name, and phone number or email address depending which one was used to sign up.

 

  How fluent in php are you?

 

1) As you'd have to build all this, using cookies and sessions to track who's-who during the "form experience"

2) You for sure, would want to run it "secure" https;//

3) Why?  Heck, I'll log in and spam the heck out it...just kidding>

  All, food for thought...lol

 

And, it can be done...but? Not on a simple/cheap shared hosting account...as you'd have to install modules for the SMS onto the core OS

 

you other option...and I am sure you know you can...is subscribe to a service etc...

 

Jim

Link to comment
Share on other sites

Well im no pro at PHP but I can stumble a long a bit. Based on my research I was under the impression that I could just set up an email account on the server that will host the php files and then use that email address to send out sms messages to who I desire without much or any more than that. As for spamming the form and using HTTPS couldn't I use captcha to cut on potential spam? So is this idea/project pretty much just going to be an idea unless a good amount of money is invested in it?

Link to comment
Share on other sites

Well I thought maybe this would work but its not quite yet. So what I need to do is in drop down 1, if I select "youth" I need all of the names to populate into the second drop down. I know Im missing something and not quite sure where to go from here. Any help would be greatly appreciated. Here is what I have as of now...

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>FBCSF SMS Message Form</title>
<link href="../files/css/register.css" rel="stylesheet" type="text/css" />
</head>
<? include('../files/class/ajaxRegistrationModule.class.php'); ?>
<body>

<div id="container">
      <form action="" method="post" class="ajax_form">
      <h2>SMS Form</h2>
      <h3>Send An SMS Message</h3>
        <ul>
          <li class="label"> Group:  </li>
          <li class="field">
            <select id="group" name="group" class="validate_blank combo">
              <option value="0">Select:</option>
              <option value="Youth">Youth</option>
              <option value="Youth Parent">Youth Parent</option>
              <option value="Deacon">Deacon</option>
            </select>
          </li>
          <li class="label"> Who:  </li>
          <li class="field">
            <select id="name" name="who" class="validate_blank combo">
              <option value="All">All:</option>

      <?PHP

	if ( $group == "youth" ) {
echo $query = "SELECT * from ajax_form WHERE group= 'youth' ";  
echo $result = mysql_query($query) OR DIE ("There was an error" .mysql_error());
    while ($line = mysql_fetch_array($lw1_query,MYSQL_ASSOC)){
    echo $id = $line['id'];
    echo $fname = $line['fname'];    
    echo '<option value="$id">$fname</option>\n';
      }
  }
	if ( $group == "youth parent" ) {
echo $query = "SELECT * from ajax_form WHERE group= 'youth parent' ";  
echo $result = mysql_query($query) OR DIE ("There was an error" .mysql_error());
    while ($line = mysql_fetch_array($lw1_query,MYSQL_ASSOC)){
    echo $id = $line['id'];
    echo $fname = $line['fname'];    
    echo '<option value="$id">$fname</option>\n';
      }
  }
  	if ( $group == "deacon" ) {
echo $query = "SELECT * from ajax_form WHERE group= 'deacon' ";  
echo $result = mysql_query($query) OR DIE ("There was an error" .mysql_error());
    while ($line = mysql_fetch_array($lw1_query,MYSQL_ASSOC)){
    echo $id = $line['id'];
    echo $fname = $line['fname'];    
    echo '<option value="$id">$fname</option>\n';
      }
  }
      ?>
            </select>
          </li>
          <li class="label"> Message:</li>
          <li class="field">
            <textarea name="mesg" maxlength="160" height="40" size="40" type="text" class="validate_blank text"/></textarea>
          </li>
</ul>
</form>
</div>
          
          

    <!-- container end -->
    <div class="footer">
        <p>Powered by: First Baptist Church of St. Francis</p>   
    </div>
</body>
</html>

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.