Submit Your Article Webforumz RegistrationAnnouncements Contact Webforumz StaffContact
Home Resources Blogs Meet the Team Contact Register
 

Go Back   WebForumz.com > The Code > PHP

Reply
 
LinkBack Thread Tools
Old July 10th, 2008, 02:22 PM   #1
New Member
 

Join Date: Jul 2008
Location: Mishawaka, IN
Age: 36
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Altering Power: 0 ckling is on a distinguished road
Outlook Calendar event that's submits through php form

Through heavy research, I've been able to create a form similar to a contact form, but it forces a Microsoft Outlook calendar to pop-up and pre-populates the calendar with information filled out. Once it is sent to an email, in outlook it will show up as a calendar event where the person can then choose to accept or decline. Either choice sends an email to the person who submitted, but accept also places it in Outlook's calendar.

My Dilemma
It works but is pretty tacky and instructions are given on once the calendar pops up, you have to hit "Add Attendee" then enter the email address for the person your sending it too. It needs to be one specific email and I can't get it to pre-populate that email. My assumption is because you need to somehow tell VB to automatically add a certain attendee but within the php code.
Anyways, here's the code that does the magic:

Code:
 <?php
    header
("Content-Type: text/x-vCalendar");
    
header("Content-Disposition: inline; filename=MyvCalFile.vcs");
$timestamp strtotime("Ymd");

$month =  $_POST['month'];
$day $_POST['day'];
$year $_POST['year'];
$hour =  $_POST['hour'];
$minute =  $_POST['minute'];

$tomorrow mktime($hour,$minute0$month$day+1$year);

$vCalStart date("Ymd\THi00"$tomorrow);
$vCalEnd date("Ymd\THi00"$tomorrow);

print 
"BEGIN:VCALENDAR\n";
print 
"VERSION:1.0\n";
print 
"PRDID:RBC Web Calendar\n";
print 
"METHD:PUBLISH\n";
print 
"TZ:-08\n";
print 
"BEGIN:VEVENT\n";
print 
"DTSTART:".$vCalStart."\n";
print 
"DTEND:".$vCalEnd."\n";
print 
"LOCATION:". ($_POST['hospital']) ."\n";
print 
"TRANSP:PAQUE\n";
print 
"UUID:".microtime()."\n";
print 
"DTSTAMP:".date('Ymd').'T'.date('His')."\n"// required by Outlook
print "SUMMARY:".($_POST['name']) . "\n"//subject line shows name field
print "DESCRIPTION;ENCODING=QUOTED-PRINTABLE: " //description shows all fields
"--Contact Information:-- "  "=0D=0A" .
"Full Name: " . ($_POST['name']) . "=0D=0A" .
'Contact Phone #:  ' . ($_POST['phone']) . "=0D=0A" .
'Hospital Scheduling Surgery for: ' . ($_POST['hospital']) .  "=0D=0A" .
'--Surgery Information:-- ' "=0D=0A" .
'Physician:  ' . ($_POST['physician']) . "=0D=0A" .
'Type of Surgery: ' . ($_POST['surgery_type']) . "=0D=0A" .
'Side: ' . ($_POST['side']) .  "=0D=0A" .
'Special Instructions: ' . ($_POST['special_instructions']) . "\n";

print 
"BEGIN:VALARM\n";
print 
"TRIGGER:PT15M\n";
print 
"ACTIN:DISPLAY\n";
print 
"END:VALARM\n";
print 
"END:VEVENT\n";
print 
"END:VCALENDAR\n";
exit;
?>
I've tried the print "ATTENDEE; mailto:'email@email.com'\n"
but it doesn't work. This gets crazy because at some point VB takes over so my best guess is that I need to tell VB in php to open a button then populate the ATTNEDEE field but I'm coming up short on how to do that.

Any suggestions would be awesome.
ckling is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Form submits to email via php, but email is blank!!?? DH1234 PHP 2 June 18th, 2007 07:42 AM
Enter key logs out instead of submits mr300 .NET 1 August 7th, 2006 02:42 PM
Access Form Event oldmanmedic Databases 1 June 26th, 2006 09:01 PM
sync outlook with an online calendar marco_van_mayo Other Languages 0 February 7th, 2006 11:54 AM
EVENT: SPARK - Flash Event Flasher Flash and ActionScript 0 November 15th, 2005 07:08 AM


Search Engine Optimization by vBSEO 3.2.0 RC8