Hey Guys.Good news.Problem solved.Thank you all for the help and special thanks to Designer_101.I got immediate results after instaling wamp server and now I can continue my work.Users inserted successfully and no blank pages.Thanks again and Peace to you all.
tedobg 0 Newbie Poster
Designer_101 -2 Posting Whiz
no problem m8. Btw can i ask how old u r...earlier you said you had 2 go 2 school? im 14
tedobg 0 Newbie Poster
Designer mate sorry I didn't answer immediately but I was having diner.Well I am 16... PM me later we can talk mate. Right now I am marking this as solved :) thanks again.
patel manish 0 Newbie Poster
can any buddy help me!!!
this is my php sms sending script but i cant send it.
for sending sms any setting reqire?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Send SMS from your web page</title>
</head>
<body>
<?php
$footer = 'Your footer text';
$maxSizeSms = 160 - strlen($footer);
DEFINE('API_USER', 'ts_ravie');
DEFINE('API_PWD', 'rav@34');
DEFINE('API_receipt', 'Yes');
DEFINE('API_sender', 'Ravience');
// check if form has been "posted"
if( isset($_GET['mobile']) && isset($_GET['sms']) ){
// phone number and message (message + footer)
preg_match_all('/[\d]{11}/', $_GET['mobile'], $mobile);
$sms = urlencode(substr($_GET['sms'], 0, $maxSizeSms).$footer);
// URL for sending the SMS
$apiCallUrl = 'http://122.169.193.83:8888/?';
$apiCallUrl .= 'User='.API_USER.'&Password='.API_PWD.'&ReceiptRequested='.API_receipt.'&sender='.API_sender;
$apiCallUrl .= '&PhoneNumber='.$_GET['mobile'].'&Text='.$sms;
$curlHandle = curl_init();
curl_setopt($curlHandle, CURLOPT_URL, $apiCallUrl);
curl_setopt($curlHandle, CURLOPT_HEADER, 0);
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curlHandle, CURLOPT_POST, 1);
curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $data);
curl_setopt($curlHandle, CURLOPT_TIMEOUT, 15);
$content = curl_exec($curlHandle); // Make the call for sending the SMS
curl_close($curlHandle); // Close the connection to Clickatell
if( preg_match('/^ID:/', $content) ){
echo '<h2>Message have been sent</h2>';
}else{
echo '<h2>Error sending message</h2>';
}
}
?>
<form method="get" action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>">
Phone number <br />
<input type="text" name="mobile" size="20" maxlength="12" value="" />
<br />
Message <br />
<input type="text" name="sms" size="30" maxlength="<?php echo $maxSizeSms ?>" value="" />
<br />
<input type="submit" value="Send SMS" />
</form>
</body>
</html>
patel manish 0 Newbie Poster
can any buddy help me!!!
this is my php sms sending script but i cant send it.
for sending sms any setting reqire?
start quote:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Send SMS from your web page</title>
</head>
<body>
<?php
$footer = 'Your footer text';
$maxSizeSms = 160 - strlen($footer);
DEFINE('API_USER', 'ts_ravie');
DEFINE('API_PWD', 'rav@34');
DEFINE('API_receipt', 'Yes');
DEFINE('API_sender', 'Ravience');
// check if form has been "posted"
if( isset($_GET['mobile']) && isset($_GET['sms']) ){
// phone number and message (message + footer)
preg_match_all('/[\d]{11}/', $_GET['mobile'], $mobile);
$sms = urlencode(substr($_GET['sms'], 0, $maxSizeSms).$footer);
// URL for sending the SMS
$apiCallUrl = 'http://122.169.193.83:8888/?';
$apiCallUrl .= 'User='.API_USER.'&Password='.API_PWD.'&ReceiptRequested='.API_receipt.'&sender='.API_sender;
$apiCallUrl .= '&PhoneNumber='.$_GET['mobile'].'&Text='.$sms;
$curlHandle = curl_init();
curl_setopt($curlHandle, CURLOPT_URL, $apiCallUrl);
curl_setopt($curlHandle, CURLOPT_HEADER, 0);
curl_setopt($curlHandle, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curlHandle, CURLOPT_POST, 1);
curl_setopt($curlHandle, CURLOPT_POSTFIELDS, $data);
curl_setopt($curlHandle, CURLOPT_TIMEOUT, 15);
$content = curl_exec($curlHandle); // Make the call for sending the SMS
curl_close($curlHandle); // Close the connection to Clickatell
if( preg_match('/^ID:/', $content) ){
echo '<h2>Message have been sent</h2>';
}else{
echo '<h2>Error sending message</h2>';
}
}
?>
<form method="get" action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>">
Phone number <br />
<input type="text" name="mobile" size="20" maxlength="12" value="" />
<br />
Message <br />
<input type="text" name="sms" size="30" maxlength="<?php echo $maxSizeSms ?>" value="" />
<br />
<input type="submit" value="Send SMS" />
</form>
</body>
</html>
end quote.
Edited by mike_2000_17 because: Fixed formatting
ashafaaiz 0 Newbie Poster
Hi guys.I am new to web development and of course I have been experiensing some problems.Most of them are easy to solve and I usually find my way, but there is some thing that is getting on my nerves for some time now.
I have been trying to make a simple script for registering a user via MySQL.No filtering input, no validating only the part that adds the new user into the MySQL table. But it doesn't work.I have checked my code a couple of times and i can't see the problem.Here it is:
<?php if(isset($_POST["name"]) && isset($_POST["pass"]) && isset($_POST["email"])) { $name=$_POST["name"]; $pass=$_POST["pass"]; $email=$_POST["email"]; $con=mysql_connect('localhost','root','password'); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("users", $con); mysql_query("INSERT INTO members (username,password,email) values ('$name','$pass','$email')") or die('Error'); } ?>
Hi,
You have get name,pass,email in a html form using a submit button and then later you have to post the details using $post
See the form given below
<form name="form1" method="post" action="">
Name
<input type="text" name="Name" value="">
Pass
<input type="password" name="Pass" value="">
Email
<input type="text" name="Email" value="">
<input type="submit" name="Submit" value="Submit">
</form>
<?
if(isset($_POST['Submit'']))
{
$name=$_POST['Name'];
$pass=$_POST['Pass'];
$email=$_POST['Email'];
$con=mysql_connect('localhost','root','password');
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("users", $con);
mysql_query("INSERT INTO members (username,password,email) values ('$name','$pass','$email')") or die('Error');
}
I think it should be work!
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.