jg1234 Posted March 31, 2012 Share Posted March 31, 2012 Let me know if i am understanding this correctly Below is the form code i put in my HTML editor followed by the php code that i right out as a text doc. then save as .php and upload to the appropriate location? if the above is correct what do i name the php file scripts/send_sms.php? when i do it this way i get this error message Not Found The requested URL /scripts/sms_error.php was not found on this server. Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request. *************************************** <form id="sms" name="sms" method="post" action="scripts/send_sms.php"> <table width="400"> <tr> <td align="right" valign="top">From:</td> <td align="left"><input name="from" type="text" id="from" size="30" /></td> </tr> <tr> <td align="right" valign="top">To:</td> <td align="left"><input name="to" type="text" id="to" size="30" /></td> </tr> <tr> <td align="right" valign="top">Carrier:</td> <td align="left"><select name="carrier" id="carrier"> <option value="verizon">Verizon</option> <option value="tmobile">T-Mobile</option> <option value="sprint">Sprint</option> <option value="att">AT&T</option> <option value="virgin">Virgin Mobile</option> </select></td> </tr> <tr> <td align="right" valign="top">Message:</td> <td align="left"><textarea name="message" cols="40" rows="5" id="message"></textarea></td> </tr> <tr> <td colspan="2" align="right"><input type="submit" name="Submit" value="Submit" /></td> </tr> </table> </form> ******************************************************** <?php $from = $_POST['from']; $to = $_POST['to']; $carrier = $_POST['carrier']; $message = stripslashes($_POST['message']); if ((empty($from)) || (empty($to)) || (empty($message))) { header ("Location: sms_error.php"); } else if ($carrier == "verizon") { $formatted_number = $to."@vtext.com"; mail("$formatted_number", "SMS", "$message"); // Currently, the subject is set to "SMS". Feel free to change this. header ("Location: sms_success.php"); } else if ($carrier == "tmobile") { $formatted_number = $to."@tomomail.net"; mail("$formatted_number", "SMS", "$message"); header ("Location: sms_success.php"); } else if ($carrier == "sprint") { $formatted_number = $to."@messaging.sprintpcs.com"; mail("$formatted_number", "SMS", "$message"); header ("Location: sms_success.php"); } else if ($carrier == "att") { $formatted_number = $to."@txt.att.net"; mail("$formatted_number", "SMS", "$message"); header ("Location: sms_success.php"); } else if ($carrier == "virgin") { $formatted_number = $to."@vmobl.com"; mail("$formatted_number", "SMS", "$message"); header ("Location: sms_success.php"); } ?> Quote Link to comment https://forums.phpfreaks.com/topic/260093-begining-php-need-help-take-a-look/ Share on other sites More sharing options...
Proletarian Posted March 31, 2012 Share Posted March 31, 2012 Is send_sms.php in the /scripts directory? The error you are getting is indicating it's not. Quote Link to comment https://forums.phpfreaks.com/topic/260093-begining-php-need-help-take-a-look/#findComment-1333090 Share on other sites More sharing options...
jg1234 Posted March 31, 2012 Author Share Posted March 31, 2012 its in the scripts directory as well as public_ html Quote Link to comment https://forums.phpfreaks.com/topic/260093-begining-php-need-help-take-a-look/#findComment-1333093 Share on other sites More sharing options...
jg1234 Posted March 31, 2012 Author Share Posted March 31, 2012 got this working but still need to improve can be seen http://tabforcast.com Quote Link to comment https://forums.phpfreaks.com/topic/260093-begining-php-need-help-take-a-look/#findComment-1333129 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.