₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,083 members, 8,420,235 topics. Date: Thursday, 04 June 2026 at 02:13 PM

Toggle theme

Will This Code Work? - Webmasters - Nairaland

Nairaland ForumScience/TechnologyWebmastersWill This Code Work? (742 Views)

1 Reply (Go Down)

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.
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
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 grin
1 Reply

i need help on this codeSomeone Please Help Me With This CodeHelp How Do I Backup Mysql Database With This Code234

Channels Television Website Hacked By Chiang Yo KayBecome A Network AdministratorDo You Have A Website To Sale?