i was trying to make a script that will process sms message and if its content is with a specific month,day and time to update it to my calendar appointment and set it to occupied...this is how i started,i need help for the rest...i would appreciate any help guys...
$webhook_secret = 'mysecret';
if ($_POST['secret'] !== $webhook_secret)
header('HTTP/1.1 403 Forbidden');
echo "Invalid webhook secret";
if ($_POST['event'] == 'incoming_message')
$content = $_POST['content'];
$from_number = $_POST['from_number'];
$phone_id = $_POST['phone_id'];
=>i need here the code to now update the calendar appointment at october 4,2012,17:00 and set it to occupied<=
=>the code for incoming sms message is working i just need the rest for updating<=
There could be but you need to help us to help you. Take a few seconds to read the sticky topic about using [php] and [/php] tags to present your php code to us. There is a link to it in my sig.
Secondly, you've provided no information about how this sms text is going to get to your script. Are you sending it to a mobile that then initiates a http request? sms and http are two completely different protocols. If you don't give us anything to go on then we can't do much to help.
i'm sorry for not setting it to php tags,i forgot...i dont think that is relevant how the sms message comes to my site,because i only need to use the content of that and from it to update my calendar.But maybe i'm wrong so i will tell you how i managed to set it,i have set sms gateway that redirects sms messages from my phone to my website...
i'm sorry for not setting it to php tags,i forgot...
Originally Posted by shile
i dont think that is relevant how the sms message comes to my site
On the contrary, it is.
I saw your post days ago and ignored it. Want to know why? Because the first thing I thought was "here is another I wanna do sms" post from someone who doesn't even realise how much is invoved. There is no way I'm going into a long explantion of how sms needs to be converted to a http post somewhere along the line every time I see a 'wannabe' post and so i skipped it. Why? Because I'd either end up being forced to try and help you write php to interface with a gsm modem OR write php to interface with an SMS gateway. That makes the problem look bigger and more time consuming than it really is.
If I'm thinking that way, how many others here were? - You see, that is why what you think about it not being important to tell us is wrong. We need to at least know that you're aware of what you're doing so that we know what we're up against. Now you've told us that you're using an SMS gateway it means that your problem is much smaller than it first looked. Therefore that makes it easier for us to help you. SMS gateways are no secret, all you had to do was mention that you were using one and one of us would of been able to help you days ago.
You have to think of this from the other peoples perspective. They have other things to do rather than sit around for hours writing an SMS interface for you for free. If you mention that you're using a SMS gateway then it eliminates that. Thats the way you need to think about it, making it as easy as possible for people to understand your problem and help you with it
i understand what you are saying but i didnt ask for help about sms interface,i already got that working...now i just need to process the content of sms message and then if it is the right format to update it in my calendar...now can you help me with that?
Unfortunately I've never done anything calender related (never needed to) so I'm not the best person to help out with it.
As for the sms thing, I appreciate you didn't ask about it but the very fact you mentioned SMS gives an impression that you may need help with that. If you had simply asked for help with a calender and not mentioned SMS then I'm sure you would have got help with it almost instantly (in fact you may be better off starting another topic about it and just skipping the sms bit completely).
Is this of any particular meaning? The actual input value you have there in a string is a GNU compatible datetime format. Because it is, we can now convert that easily using DateTime or strtotime handling. This will be beneficial assuming that you don't want to write a conditional branch for each day and time block.
So what is it you're actually updating? Like a database? If so we need a structure for this.
yes i figured out that i have to use strtotime to format this string to a date,but i dont know what to do next...my idea was when a message comes with the specific date to update the calendar and set occupied at the given date like it was shown in the picture,i guess i need a database update,the calendar that i used was a joomla module jxtc appointment book,if you want to help me i will pm you the code of the module so you give me the pointers what to do...