SMS API HELP
Moderator: General Moderators
-
php_new_guy_09
- Forum Newbie
- Posts: 12
- Joined: Fri Sep 04, 2009 3:21 pm
Re: SMS API HELP
So what's the problem? What's your question?
-
php_new_guy_09
- Forum Newbie
- Posts: 12
- Joined: Fri Sep 04, 2009 3:21 pm
Re: SMS API HELP PLEASE............................
b
Last edited by php_new_guy_09 on Wed Sep 16, 2009 7:33 pm, edited 3 times in total.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: SMS API HELP
We're not here to do the work for you. Again, what specifically are you having trouble with?
-
php_new_guy_09
- Forum Newbie
- Posts: 12
- Joined: Fri Sep 04, 2009 3:21 pm
Re: SMS API HELP
I do not have any knowledge of php or mysql, I have a little knowledge of sql in ms access, and a little experience of programming in vb, so im pretty useless, I downloaded xampp on a laptop yesterday however incurred problems, i would just like to know if the code i posted will work and if not, where have i made mistakes.
Re: SMS API HELP
Well, no, it won't work.php_new_guy_09 wrote:i would just like to know if the code i posted will work and if not, where have i made mistakes.
Code: Select all
<?php
$uname = "youremailaddress";
$pword = "yourpassword";
$database="my database";
$sender = $_REQUEST['sender'];
$content = $_REQUEST['content'];
$from = " php_new_guy_09";
$selectednums = $sender;
$message = AUTOREPLY CONTENT;
$message = urlencode($message);
mysql_connect(localhost,$username,$password); // localhost is not a constant. where's $username? $password?
mysql_select_db($database);
INSERT INTO log (sender,content) VALUES ('$sender','$content'); // not php code
$query="SELECT $sender, $content FROM log "; // horrible, horrible idea - see below
$result=mysql_query($query);
$content ^ sunrise // not a php statement. what is this supposed to be?
SELECT '$content', FROM autoreplymsg WHERE content ='sunrise'
ORDER BY RAND()
LIMIT 1 // not php code, invalid sql
$data = "uname=".$uname."&pword=".$pword."&message=".$message."&from=". $from."&selectednums=".$selectednums."&info=".$info."&test=".$test;
$ch = curl_init('http://www.txtlocal.com/sendsmspost.php');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$result = curl_exec($ch);
curl_close($ch);
mysql_close();
?>Code: Select all
$query="SELECT $sender, $content FROM log ";-
php_new_guy_09
- Forum Newbie
- Posts: 12
- Joined: Fri Sep 04, 2009 3:21 pm
Re: SMS API HELP
Line 13: Wouldn’t my hostname need to replace ‘localhost’
Line 13: is suppose to read ‘$uname’ and ‘$pword’
Line 19: is suppose to mean where the string $content matches the keyword sunrise
Line 22: is suppose to mean select only one result
Line 19/22: I’m not sure where I got that from, I will find out the correct code for that.
Thanks a lot, you have put me on the right tracks, I am now going to make some corrections and look into Line 16.
THANKS A LOT AGAIN
Line 13: is suppose to read ‘$uname’ and ‘$pword’
Line 19: is suppose to mean where the string $content matches the keyword sunrise
Line 22: is suppose to mean select only one result
Line 19/22: I’m not sure where I got that from, I will find out the correct code for that.
Thanks a lot, you have put me on the right tracks, I am now going to make some corrections and look into Line 16.
THANKS A LOT AGAIN