Bruce Gust
asked on
Why doesn't this file_get_contents work?
Here's my dilemma:
I'm grabbing info from an excel spreadsheet that is a legitimate file, in that I can download and verify that there is data. But when I go to excute "file_get_contents" and then follow it with a "file_put_contents," I get nothing and I'm not even sure how to diagnose things to see where the problem might be.
Here's what I've got:
I've got no idea on how to even start popping the hood on this and figuring out why this doesn't fire.
Any ideas?
I'm grabbing info from an excel spreadsheet that is a legitimate file, in that I can download and verify that there is data. But when I go to excute "file_get_contents" and then follow it with a "file_put_contents," I get nothing and I'm not even sure how to diagnose things to see where the problem might be.
Here's what I've got:
$file_1="url from where the file is coming from";
$file_1 .=$datestring;
$file_1.="_08_00.xls";
echo $file_1; //I can download the file, so I know I've got data
$datafile1 = file_get_contents($file_1);
$stage_one=file_put_contents('upload/alpt.html', $datafile1);
if(!$stage_one)
{
echo "your alpt.html didn't happen!";
}
else
{
echo "something's cookin!";
}
I've got no idea on how to even start popping the hood on this and figuring out why this doesn't fire.
Any ideas?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
First off, let me share with you the actual html file that's being uploaded. That way, perhaps, it will be easier for you to diagnose.
It's attached. It's called "totals.html."
Here's what I get with "var_dump:"
string '<div id='comment' style='display:none;'>QUER
<div id='tooltip' style='font-size: 8pt;font-family: Tahoma;'>Query Time: 0 sec.</div>'... (length=6400)
BTW: This isn't my code, I'm just trying to take some working code (for the most part), and install it on a different server.
Having said that, I'm getting several warnings. It seems like every value in my html page is not getting recognized.
I get this warning: Trying to get property of non-object in C:\wamp\www\SouthArea\week
I'm getting that for lines 33-77, which is every value, from I can determine. Here's the actual code:
Open in new window
Finally, the insert statement:
Open in new window
...and I'm getting this error:
Undefined variable: latest_date in C:\wamp\www\SouthArea\week
So, now that I'm seeing the errors, it looks like this thing is broke on several levels. How do I fix it?
totals.htm