The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Accessing very long URLs from PHP
Brian Chandler
post Feb 12 2009, 02:45 PM
Post #1


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



The other day I discovered the wonders of the Google chart API, and here's my sample:

http://chart.apis.google.com/chart?chs=300...2|100,100|50,50

I'm trying to make a local copy (since I only need to generate the chart every so often), but both the PHP copy() function and the CURL library seem to choke on a URL of this length -- Google returns 400 Bad Request. I guess it is being chopped off at 512 characters [?], since it seems to be able to access the following shorter chart OK:

http://chart.apis.google.com/chart?chs=300...2|100,100|50,50

Any suggestions for a quick way around this?


Separate question....

Can't find anything at Google about character encoding for text captions etc. Does anyone know if it accepts UTF-8 or whatever?

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Brian Chandler
post Feb 15 2009, 01:39 PM
Post #2


Jocular coder
********

Group: Members
Posts: 2,460
Joined: 31-August 06
Member No.: 43



Just to answer my own question: I tried fopen(), I tried CURL, I tried using POST to send the parameters (doesn't work), and I tried calling wget....

Then I realised that I had html-ified the URL, with & in place of & ... so no wonder it wouldn't work.

Grr!
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 26th April 2024 - 12:53 AM