Will This Code Work? - Webmasters - Nairaland
Nairaland Forum › Science/Technology › Webmasters › Will This Code Work? (742 Views)
| Will This Code Work? by cbrass(op): 4:16pm On Sep 19, 2014 |
<?php if(isset($_POST['submitted'])) { $country_code = $_POST['country_code']; $phone = mysql_real_escape_string($_POST['phone']); $text = mysql_real_escape_string($_POST['msg']); $message = urlencode($text); if(!empty($phone) && preg_match("/^(\d[\s-]?)?[\(\[\s-]{0,2}?\d{3}[\)\]\s-]{0,2}?\d{3}[\s-]?\d{4}$/i", $phone)) { $recipient = $phone; $url = "http://smsclone.com/components/com_spc/smsapi.php?username=cbrass&password=Bleep&sender=admin&recipient=$recipient&message=$message"; } } ?> <form method="POST" action="" width="100%"> Phone :<input type="text" name="phone" > Message:<input type="text" name="msg" > <input type="submit" name="submit" value="Submit Number"> </form> have tried it but nothing happened |
| Re: Will This Code Work? by DualCore1: 4:30pm On Sep 19, 2014 |
It will not work because you are testing for a condition that will return false. if(isset($_POST['submitted'])) will always return false as their is no form element with the name "submitted". Change this line <input type="submit" name="submit" value="Submit Number"> to <input type="submit" name="submitted" value="Submit Number"> Even at that your code will not give you the desired result, as I see you are trying to send SMS via API. After this line $url = "http://smsclone.com/components/com_spc/smsapi.php?username=cbrass&password=Bleep&sender=admin&recipient=$recipient&message=$message"; You must have something like $response = file_get_contents($url); To see the response from the server you can echo $response |
| Re: Will This Code Work? by cbrass(op): 4:45pm On Sep 19, 2014 |
lol i didnt see that submit error sha |
| Re: Will This Code Work? by cbrass(op): 4:46pm On Sep 19, 2014 |
DualCore1: It will not work because you are testing for a condition that will return false.ok, will try that soon |
| Re: Will This Code Work? by dhtml(m): 5:54pm On Sep 19, 2014 |
Trollin' |
| Re: Will This Code Work? by cbrass(op): 10:10pm On Sep 19, 2014 |
dhtml: Trollin'ogami sir, i site u o ![]() |
i need help on this code • Someone Please Help Me With This Code • Help How Do I Backup Mysql Database With This Code • 2 • 3 • 4
Channels Television Website Hacked By Chiang Yo Kay • Become A Network Administrator • Do You Have A Website To Sale?
