Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

updating calendar...need help...

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

updating calendar...need help...

Postby shile » Fri Oct 05, 2012 2:48 am

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...

<?php
$webhook_secret = 'mysecret';

if ($_POST['secret'] !== $webhook_secret)
{
header('HTTP/1.1 403 Forbidden');
echo "Invalid webhook secret";
}
else
{
if ($_POST['event'] == 'incoming_message')
{
$content = $_POST['content'];
$from_number = $_POST['from_number'];
$phone_id = $_POST['phone_id'];
if($_POST['content']== 'October-4-2012-1700'){
=>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<=
}

}
}

This is a picture of the calendar.
Image
shile
New php-forum User
New php-forum User
 
Posts: 2
Joined: Fri Oct 05, 2012 2:46 am

Re: updating calendar...need help...

Postby shile » Sun Oct 07, 2012 3:15 am

any help guys?
shile
New php-forum User
New php-forum User
 
Posts: 2
Joined: Fri Oct 05, 2012 2:46 am

Re: updating calendar...need help...

Postby seandisanti » Mon Oct 08, 2012 2:58 pm

how can we offer help updating a form or object you've not given us any code for? If i assume that you're using a calendar class, and Calendar has a method named "doIt" that takes a date and books it and changes it to occupied, and that the variable $date contains only the date in exactly the right format, then the super simple solution is:
Code: Select all
Calendar::doIt($content);

The only way I can give you better advice is if you give more information so that i don't have to make assumptions.
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 838
Joined: Mon Oct 01, 2012 12:32 pm


Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot], Strider64 and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.