Jump to content

outdoorxtreme

New Members
  • Posts

    6
  • Joined

  • Last visited

outdoorxtreme's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. When I open my index page, I would like to redirect to another page after a set amount of time. Before the time expires I would like to display an animated loading icon centered in the screen. How do I go about doing this in jquery?
  2. Ah, I figured it out. The one I was trying to use didn't have and echo. It is working now. Thank you for your help
  3. Ok, I have almost everything working but it doesnt echo "Success" if it was successfully submitted. <?php function html_escape($raw_input) { return htmlspecialchars($raw_input, ENT_QUOTES, 'UTF-8'); } echo"<form id=\"sms\" name=\"sms\" method=\"post\" action=\"\"> <table width=\"300\"> <tr> <td align=\"right\" valign=\"top\">Cell number:</td> <td align=\"left\"><input name=\"number\" type=\"text\" id=\"number\" size=\"10\"> No dashes</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 colspan=\"2\" align=\"center\" ><input type=\"submit\" name=\"Submit\" value=\"Submit\"></td> </tr> </table> </form>"; if(isset($_POST['Submit'])) { $number = $_POST['number']; $carrier = $_POST['carrier']; $message = "test"; if( empty($_POST['number'])) echo "You must enter a number to send to"; else if ($carrier == "verizon") { $formatted_number = $number."@vtext.com"; mail("$formatted_number", "", "$message", "From: john@gmail.com"); echo "Success"; } else if ($carrier == "tmobile") { $formatted_number = $number."@tomomail.net"; mail("$formatted_number", "", "$message", "From: john@gmail.com"); echo "Success"; } else if ($carrier == "sprint") { $formatted_number = $number."@messaging.sprintpcs.com"; mail("$formatted_number", "", "$message", "From: john@gmail.com"); } else if ($carrier == "att") { $formatted_number = $number."@txt.att.net"; mail("$formatted_number", "", "$message", "From: john@gmail.com"); echo "Success"; } else if ($carrier == "virgin") { $formatted_number = $number."@vmobl.com"; mail("$formatted_number", "", "$message", "From: john@gmail.com"); echo "Success"; }} ?>
  4. I fixed the security risk with changing these lines $phpSelf = filter_input(INPUT_SERVER, 'PHP_SELF', FILTER_SANITIZE_URL); echo"<form id=\"sms\" name=\"sms\" method=\"post\" action=\"".$phpSelf."\">
  5. Currently, when a number is not entered and submit is pressed, it displays "Success" it should display "You must enter a number to send to". I only want the message displayed after the submit button is pressed.
  6. Hi, I'm a beginner to PHP scripting. I'm trying to get the error message to work correctly when the number field is left blank in this code. If you see anything else I may be doing wrong or a better way I would appreciate any input. basically what this script will do is that a person can enter their cell number and select their carrier then press submit. It will then send them a message to their moble. Thanks for your help. <?php echo"<form id=\"sms\" name=\"sms\" method=\"post\" action=\"".$_SERVER['PHP_SELF']."\"> <table width=\"400\"> <tr> <td align=\"right\" valign=\"top\">Cell number:</td> <td align=\"left\"><input name=\"number\" type=\"text\" id=\"number\" size=\"10\"> No dashes</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 colspan=\"2\" align=\"right\"><input type=\"submit\" name=\"Submit\" value=\"Submit\"></td> </tr> </table> </form>"; $number = $_POST['number']; $carrier = $_POST['carrier']; $message = "test"; if( !empty($_POST['number'])) echo "You must enter a number to send to"; else if ($carrier == "verizon") { $formatted_number = $number."@vtext.com"; mail("$formatted_number", "", "$message", "From: john@gmail.com"); echo "Success"; } else if ($carrier == "tmobile") { $formatted_number = $number."@tomomail.net"; mail("$formatted_number", "", "$message", "From: john@gmail.com"); echo "Success"; } else if ($carrier == "sprint") { $formatted_number = $number."@messaging.sprintpcs.com"; mail("$formatted_number", "", "$message", "From: john@gmail.com"); } else if ($carrier == "att") { $formatted_number = $number."@txt.att.net"; mail("$formatted_number", "", "$message", "From: john@gmail.com"); echo "Success"; } else if ($carrier == "virgin") { $formatted_number = $number."@vmobl.com"; mail("$formatted_number", "", "$message", "From: john@gmail.com"); echo "Success"; } ?>
×
×
  • 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.