Okay, I am a serious newbie so I apologize if I use the wrong terminology. I originally created a forum in order to collect people's cell phone numbers. Now, I want to add a drop-down menu so I know which group they are in and if they do not select a group I want them to be prompted to. When I created the form originally I did it with someone else and they were a very savvy web designer, so they knew PHP. I am not as good. I know, a little about PHP, but not a lot. So I am not sure what to add to the post.php page.
I really could use some serious help. If someone would be so kind to help me I would surely appreciated.
So here is the form I created:
<form action="post.php" method="post" >
Phone number: <input name="phone_number" type="text" size="13" />
Group:
<label>
<select name="organization" size="1" id="organization">
<option value="novalue" selected>Please choose one</option>
<option value="stmichael">St. Michael's</option>
<option value="stpeter">St. Peter's</option>
<option value="stpierre">St. Pierre</option>
</select>
</label>
<input type="submit" name="send" value="Send" /><br />
<font size="2">(Do Not Include Dashes)</font>
<br />
<span id="sprycheckbox1">
<label>
<input type="checkbox" name="agre" id="agre" />
<font size="2"> By selecting this box, I agree to <a href="#" onClick="MM_openBrWindow('terms_and_conditions_pop_up.html','','width=400,height=600')">terms and conditions</a></font></label>
<span class="checkboxRequiredMsg">Please select box.</span></span>
</form>
Here is the post.php page:
<?php
if ($_POST['send'])
{
// The HTTP class
include_once('class.HttpClient.php');
// The XML class
include_once('class.xml_tree.php');
// The configuration file
include_once('config.php');
$send['username'] = USERNAME;
$send['password'] = PASSWORD;
$send['trigger_id'] = TRIGGER_ID;
// This is the phone number that you whant to send the campiang to
$send["phone_number"] = $_POST['phone_number'];
$send["phone_number"] = str_replace('-', '', $send["phone_number"]);
$send["phone_number"] = str_replace('_', '', $send["phone_number"]);
$send["phone_number"] = str_replace(' ', '', $send["phone_number"]);
$send["phone_number"] = str_replace('.', '', $send["phone_number"]);
if (strlen($send["phone_number"]) != 12 && strlen($send["phone_number"]) != 10)
{
$error_message = 'Invalid phone number, wrong len';
}
if (!is_numeric($send["phone_number"]))
{
$error_message = 'Invalid phone number, not numeric';
}
if (!$error_message)
{
$pageContents = HttpClient::quickPost("http://platform.3cinteractive.com/web_registration.php", $send);
$xml_tree = new xml_tree($pageContents);
if ($xml_tree->getPath("successNotification/message"))
{
header("Location: template_success.php");
exit;
}
elseif ($error_message = $xml_tree->getPath("errorNotification/message"))
{
header("Location: template_error.php?error=".urlencode($error_message->content));
exit;
}
else
{
header("Location: template_error.php?error=".urlencode("Unknow error"));
exit;
}
}
else
{
header("Location: template_error.php?error=".urlencode($error_message));
exit;
}
}
else
{
header("Location: index.html");
exit;
}