I have a question. I need to get data from this url /wd/biling.php?get&id=1.I now that this url return the liste serialize. I tried to retrieve by using $data= file_get_contents('/wd/biling.php?get&id=1'); but I have the error : Failed to open stream. Can you help me please ?
            Asked
            
        
        
            Active
            
        
            Viewed 37 times
        
    0
            
            
         
    
    
        Harea Costicla
        
- 797
- 3
- 9
- 20
- 
                    Not without seeing your code. – Jay Blanchard May 16 '16 at 15:03
- 
                    You have just supplied the path. So It's looking in the file system for that file name. – Jason K May 16 '16 at 15:03
- 
                    Possible duplicate of [Failed to open stream : No such file or directory](http://stackoverflow.com/questions/36577020/failed-to-open-stream-no-such-file-or-directory) – Vic Seedoubleyew May 16 '16 at 18:24
1 Answers
1
            
            
        URLs can only be passed as absolute(with Protocol+Host+Path). try:
 file_get_contents('http[s]://domain/path');
Also if your loading any local content this way, you might be doing something wrong. We use include or require to run local php files. You can use this way.
 $id = 1;
 include('/wd/biling.php');
now in biling.php you can use $id just like that.
 
    
    
        anwerj
        
- 2,386
- 2
- 17
- 36