graph generation in csv file - php

I have generated a graph based on the user, stored in database. This graph is generating in a web page. But I am thinking to generate this graph to a csv file. But I don't know whether it is possible or not. If so, please help me out.

You can use this PHP function PHP file-put-contents()

Related

PHP get Google spreadsheet data with authentication (additional: send row data to google doc)

I'm currently developing a php page that will get spreadsheet data and display it in a datatable. I have done so by publishing my spreadsheet and getting the JSON object through spreadsheet url/key.
I have been successful in doing so :
Now, I have been requested an enhancement, I need to change the functionality of the 'print pdf' button to actually get the row data and create and populate a google doc. I'm thinking that I would need authentication for that and the implementation of accessing the google spreadsheet would change. Could anyone give me a nice example cause I am fairly new with google api and php in general.
I tried to read samples from developer.google but I'm having trouble understanding them.
Thanks a lot!

Form Hub Data Exorter

I have the website is hosted by Web Server. I use PHP and Mysql. And I also register and upload my data in formhub.org. Formhub allow us to export data to CSV.
My purpose, I want to automatic import the latest CSV file in Formhub or mean the latest data to my Mysql Database.
So When I upload data from Smart Phone through the customize From in Formhub.org, It will automatically update to my web base online.
How Could I do? Who can help me? Please Please give me the best solution and suggestion for this purpose.
Why not using the REST services formhub provides?
info at https://github.com/SEL-Columbia/formhub/wiki/Posting-To-External-Site
In this way, each form data is stored to your formhub and also by POST to a script anywhere you like and you can process it in your php (e.g your own mysql db).
with php you can collect the data with
$entityBody = file_get_contents('php://input');
like explained here: How to get body of a POST in php?

How to retrieve link to an image from CakePHP to Android?

I'm fairly new with CakePHP and images so bear with me. You can assume I'm using the latest version.
I'm trying to build an Android application which can display images retrieved from the server.
Suppose I have an image in the assets folder called football.jpg. How would I store this in the database and then how would I output this to the Android application? Do I send only the link or do I send the whole image over? If it is just the link, does this mean I would have to reconnect to the server with the link and then get the image? Sorry if this doesn't make sense. Still trying to get my head around it.
Just a word of caution, it's probably better to store the file on the server's file system and store the path to the file in the database. The reason behind this is that BLOBs are stored in a different area on the file system to all your other typical data and in terms of retrieval, its not a great deal faster.
Here's a link to what I mean: Store pictures as files or in the database for a web app?
With regards to returning it to your Android app, you can send files in the response object (http://book.cakephp.org/2.0/en/controllers/request-response.html#cake-response-file):
public function sendFile($id) {
$file = $this->Attachment->getFile($id);
$this->response->file($file['path']);
//Return reponse object to prevent controller from trying to render a view
return $this->response;
}
This should give you finer control over what files are returned to your client.

Log into site and download file via PHP

Not sure if this is even possible but since Verizon does not have an API set for this I thought I would look for an alternative.
As a verizon customer I can login to myverizon.com and from there they have a link to download an .XLS sheet with all of my recent history.
I would like to automate this process somehow but not sure if there is a way to create a session on another site with a valid username/password and then process to pull the file once credentials have been verified?
Right now I have to manually downlaod the XLS sheet and import into an application.
Thanks,
You need to use the CURL Library for this in PHP. It will allow you to post login credentials and save the cookie.
Login CURL Example
The above link demonstrates a login to Ebay using CURL
Well, there should be a way.
I cannot give you an instruction since I am not a Verizon customer. But you could start by trying to automate the XLS retrieval with Selenium.
Then, if you want to do it via PHP/cURL (as is suggested by your tags), you could translate the Selenium file to corresponding cURL requests.
Update: Also, please make sure that this is okay according to the terms and conditions of your contract with Verizon.

Uploading Videos in Graph API

I'm putting together an application in facebook, part of which requires a user to input a bunch of information into a form, including a video and a number of text fields.
For my application, I'm using a combination of HTML, PHP, mySQL and Javascript.
I want to be able to upload the users video file to facebook using the PHP SDK in the same page as I am inserting their info into my database. I want something similiar to the photo solution here: Exception when uploading photo with Facebook Graph API. But I'm not sure what the array key should be for the video itself.
Can any give me any ideas?
My apologies,
I realized that the solution I linked to works. However, you have to give facebook time to process the video, otherwise the graph api replies false.

Categories