TalkPHP
 
 
Account Login
Latest Articles
» The basic usage of PHPTAL, a XML/XHTML template library for PHP
» Vulnerable methods and the areas they are commonly trusted in.
» Simple way to protect a form from bot
» The Basics On: How Session Stealing Works
» How to keep your forms from double posting data
IRC Channel
IRC Speech Bubble Join the friendly bunch on IRC...
(#TalkPHP on Freenode)

...Also available via a web interface.

See this thread for information on the TalkPHP Free Hugs Initiative™. Subject to availability.
Associates
Associates
CSS Tutorials
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 01-25-2008, 02:35 AM   #1 (permalink)
The Addict
 
sarmenhb's Avatar
 
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
sarmenhb is on a distinguished road
Default New php challenge

this might be a little advanced but the challenge is to create a php script that will take user input kind of like a tasks page and when the submit button is pressed that data will be sent to outlook and be displayed in the tasks pane

if your a linux user use whatever you use for your email client

the winner gets a beer with a hot girl.
__________________
no signature set
sarmenhb is offline  
Reply With Quote
Old 01-25-2008, 02:41 AM   #2 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

SQL is your friend, though I'm just saying that cause I don't feel like writing some code down right now.
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 01-25-2008, 11:16 AM   #3 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

I'm gonna skip this one since I've written more tools to connect to Outlook than I can remember so it wouldn't be fair, but I'll give everyone else one little word to help them along: Com

Alan
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote
Old 01-27-2008, 02:18 PM   #4 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

Ok, since no-one else entered I might as well post my code :) It doesn't take user input purely because I'm too lazy to make a form, but you get the idea

PHP Code:
<?php
/**
 * Generates a new task and adds it to Outlook
 * This PHP script must be run on the same machine as Outlook for it to work
 */

// Connect to Outlook using the Com interface
try
{
    
$comOutlook = new Com('Outlook.Application');
}
catch (
Exception $e)
{
    die(
'Unable to connect to Outlook: ' $e->getMessage());
}

// Create the new task
try
{
    
$newTask $comOutlook->CreateItem(3);

    
// Task details - full list of properties: http://msdn2.microsoft.com/en-us/library/bb177256.aspx
    
$newTask->Subject 'Visit TalkPHP';
    
$newTask->Body 'Do not forget to visit TalkPHP today!';
    
$newTask->DueDate '01/28/08';

    
// Save the new task
    
$newTask->Save();
    echo 
'Task Added';
}
catch (
Exception $e)
{
    die(
'Unable to create new task: ' $e->getMessage());
}
Screenshot of the new task in Outlook: http://i77.photobucket.com/albums/j4...n/outlook1.jpg

Alan

Last edited by Alan @ CIT : 01-27-2008 at 02:55 PM. Reason: Cleaned up the code a little bit
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote
Old 01-30-2008, 03:05 AM   #5 (permalink)
The Addict
 
sarmenhb's Avatar
 
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
sarmenhb is on a distinguished road
Default

thanks for the code but when i try to compile it my browser crashes. am i missing anything?
__________________
no signature set
sarmenhb is offline  
Reply With Quote
Old 01-30-2008, 03:42 AM   #6 (permalink)
Orc
The Prestige
 
Orc's Avatar
 
Join Date: Dec 2007
Posts: 1,044
Thanks: 193
Orc is on a distinguished road
Default

Quote:
Originally Posted by Alan @ CIT View Post
Ok, since no-one else entered I might as well post my code :) It doesn't take user input purely because I'm too lazy to make a form, but you get the idea

PHP Code:
<?php
/**
 * Generates a new task and adds it to Outlook
 * This PHP script must be run on the same machine as Outlook for it to work
 */

// Connect to Outlook using the Com interface
try
{
    
$comOutlook = new Com('Outlook.Application');
}
catch (
Exception $e)
{
    die(
'Unable to connect to Outlook: ' $e->getMessage());
}

// Create the new task
try
{
    
$newTask $comOutlook->CreateItem(3);

    
// Task details - full list of properties: http://msdn2.microsoft.com/en-us/library/bb177256.aspx
    
$newTask->Subject 'Visit TalkPHP';
    
$newTask->Body 'Do not forget to visit TalkPHP today!';
    
$newTask->DueDate '01/28/08';

    
// Save the new task
    
$newTask->Save();
    echo 
'Task Added';
}
catch (
Exception $e)
{
    die(
'Unable to create new task: ' $e->getMessage());
}
Screenshot of the new task in Outlook: http://i77.photobucket.com/albums/j4...n/outlook1.jpg

Alan
That'll only work on Windows, :<
__________________
VillageIdiot can have my babbies ;d
Orc is offline  
Reply With Quote
Old 01-30-2008, 07:10 AM   #7 (permalink)
The Addict
 
sarmenhb's Avatar
 
Join Date: Jan 2008
Location: los angeles
Posts: 309
Thanks: 44
sarmenhb is on a distinguished road
Default

Quote:
Originally Posted by Orc View Post
That'll only work on Windows, :<
i am using windows xp, and i got outlook 2007, is there a setting i gotta set in registry or something like that?
__________________
no signature set
sarmenhb is offline  
Reply With Quote
Old 01-30-2008, 08:03 AM   #8 (permalink)
Alan @ CIT
Member of the Month
The Frequenter
Member of the Month Top Contributor 
 
Alan @ CIT's Avatar
 
Join Date: Apr 2005
Location: South UK
Posts: 483
Thanks: 51
Alan @ CIT is on a distinguished road
Default

Orc: I only use Windows so it's all good

Sarmenhb: What web browser are you using, are you using a full copy of Outlook or Outlook Express, and is Outlook open when you run the script?

Alan
Send a message via MSN to Alan @ CIT
Alan @ CIT is offline  
Reply With Quote
Reply



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

Advanced Search
Display Modes

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

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


All times are GMT. The time now is 09:38 AM.

 
     

Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Inactive Reminders By Icora Web Design