Quote:
Originally Posted by _Aerospace_Eng_
You have a problem here
PHP Code:
$query = "SELECT id, email, key FROM friendko_text WHERE key = '{$_POST['key']}'"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo '11 Digit Key: ' . $row['key'] . '<br>'; echo 'Email: ' . $row['email'] . '<br>'; echo 'Carrier: ' . $carrier'] . '<br>'; }
$to = $_POST['to']; $carrier = $_POST['carrier']; $message = stripslashes($_POST['message]);
It should be
PHP Code:
$to = $_POST['to']; $carrier = $_POST['carrier']; $message = stripslashes($_POST['message']); $query = "SELECT id, email, key FROM friendko_text WHERE key = '{$_POST['key']}'"; $result = mysql_query($query); while($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo '11 Digit Key: ' . $row['key'] . '<br>'; echo 'Email: ' . $row['email'] . '<br>'; echo 'Carrier: ' . $carrier . '<br>'; }
Your code is very insecure by the way. I suggest you look into preventing SQL injection: http://www.tizag.com/mysqlTutorial/m...-injection.php
|
Yes, very insecure. I am just focusing on getting this to work
I removed $from, since it had no value. Also the its still stuck on send.php
now its
PHP Code:
$con = mysql_connect("localhost","friendko_admin","Macbookpro17#");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
mysql_select_db("friendko_text", $con);
$key = $_POST['key'];
$carrier = $_POST['carrier'];
$message = stripslashes($_POST['message']);
$query = "SELECT id, email, key FROM friendko_text WHERE key = '{$_POST['key']}'";
$result = mysql_query($query);
while($row = mysql_fetch_array($result, MYSQL_ASSOC))
{
echo '11 Digit Key: ' . $row['key'] . '<br>';
echo 'Email: ' . $row['email'] . '<br>';
echo 'Carrier: ' . $carrier . '<br>';
}
if ((empty($key)) || (empty($message)) {
header ("Location: sms_error.php");
}