Results 1 to 4 of 4

Thread: file_get_contents and characters in a URL problem

  1. #1

    Thread Starter
    New Member
    Join Date
    Feb 2008
    Posts
    14

    file_get_contents and characters in a URL problem

    I use the file_get_contents function to get the html from a page. I parse through that page and get a specific url I want. It looks similar to this:

    http://www.domain.com/index.cfm?action=blah&ID=5000

    Now I want to file_get_contents the above url. I understand that the & is for html so I tried to convert the string to work as a url. I tryed both using urlencode function on the query of this url and just manually through php replacing with what I thought were the appropriate characters with no luck. Can anyone help, or point me in the right direction?

  2. #2
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: file_get_contents and characters in a URL problem

    Is it returning an empty string? How are you getting that URL which already has the & in it?

  3. #3
    VBA Nutter visualAd's Avatar
    Join Date
    Apr 2002
    Location
    Ickenham, UK
    Posts
    4,906

    Re: file_get_contents and characters in a URL problem

    & is the HTML equivalent of &. So why not convert & to &? Just a thought
    PHP || MySql || Apache || Get Firefox || OpenOffice.org || Click || Slap ILMV || 1337 c0d || GotoMyPc For FREE! Part 1, Part 2

    | PHP Session --> Database Handler * Custom Error Handler * Installing PHP * HTML Form Handler * PHP 5 OOP * Using XML * Ajax * Xslt | VB6 Winsock - HTTP POST / GET * Winsock - HTTP File Upload

    Latest quote: crptcblade - VB6 executables can't be decompiled, only disassembled. And the disassembled code is even less useful than I am.

    Random VisualAd: Blog - Latest Post: When the Internet becomes Electricity!!


    Spread happiness and joy. Rate good posts.

  4. #4
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: file_get_contents and characters in a URL problem


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width