Converting google spreadsheet for use in xcelsius dashboard

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
tjjansma
Forum Newbie
Posts: 4
Joined: Mon Nov 15, 2010 4:15 pm

Converting google spreadsheet for use in xcelsius dashboard

Post by tjjansma »

Hi,
I've been pulling my hair out trying to make this happen and I was hoping someone can help me out. I want to make a google spreadsheet accessible through a swf created in xcelsius and I'm running into Flash security issues. So I thought I would write a php script that would open the spreadsheet and save it as an html document, which would be read by the xcelsius swf. I'm probably missing something here, but here's the code I came up with.

<?php
$src = fopen('http://spreadsheets.google.com/pub?key= ... FYyRTVyT2c', 'r');
$dest1 = fopen('goals.html', 'w');
stream_copy_to_stream($src, $dest1);
?>

Here's the error I get:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home/focusdco/public_html/TwoRiversPCS/goals3.php on line 10
s992
Forum Contributor
Posts: 124
Joined: Wed Oct 27, 2010 3:06 pm

Re: Converting google spreadsheet for use in xcelsius dashbo

Post by s992 »

I'm not sure the problem is in the code you posted. I copy pasted and ran it exactly as presented with no problems.
tjjansma
Forum Newbie
Posts: 4
Joined: Mon Nov 15, 2010 4:15 pm

Re: Converting google spreadsheet for use in xcelsius dashbo

Post by tjjansma »

Thanks for the response.
I'll look into what's happening when I run it.
s992
Forum Contributor
Posts: 124
Joined: Wed Oct 27, 2010 3:06 pm

Re: Converting google spreadsheet for use in xcelsius dashbo

Post by s992 »

Can you post line 10 and some of the surrounding lines?
tjjansma
Forum Newbie
Posts: 4
Joined: Mon Nov 15, 2010 4:15 pm

Re: Converting google spreadsheet for use in xcelsius dashbo

Post by tjjansma »

9 <?php
10 $src = fopen('http://spreadsheets.google.com/pub?key= ... FYyRTVyT2c', 'r');
11 $dest1 = fopen('/home/focusdco/public_html/TwoRiversPCS/goals.html', 'w');

Could this be a shared hosting permissions issue?
s992
Forum Contributor
Posts: 124
Joined: Wed Oct 27, 2010 3:06 pm

Re: Converting google spreadsheet for use in xcelsius dashbo

Post by s992 »

I'm really not sure, T_CONSTANT_ENCAPSED_STRING references double and single quotes(http://us2.php.net/tokens). Maybe try replacing the single quotes with double quotes? I'm just taking a shot in the dark here..someone with a better idea, please feel free to step in!
tjjansma
Forum Newbie
Posts: 4
Joined: Mon Nov 15, 2010 4:15 pm

Re: Converting google spreadsheet for use in xcelsius dashbo

Post by tjjansma »

Thanks for the idea, but I tried that already.
Post Reply