• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Read in the contents of a file located on a webserver.

 
Greenhorn
Posts: 1
Netbeans IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
At line 6 I am getting a return of null for the very first line of the Linkage.php file. When I tested the code with the file on my harddrive there were no issues and it read the line into my String variable. Now that I have put the file out on the webserver it just returns null. I have confirmed that the URL path is correct. Am I improperly using the IO class to read the file in when the file is located at a URL because I should be getting "<?php" for the first line?

The goal of this code is to obtain the information about the location, port, and type of database (mySQL, etc) and allow the applet to open a connection to the database so it can retrieve some values stored there and initialize properly.

Update: I changed my URL from the below to www.google.com and it worked. So I've narrowed the issue down to the file itself. I created an identical file called Linkage.txt and changed the url to reference that file. It read in everything the way it was supposed to. So nothing wrong with the I/O & Stream code. Now wandering a little off topic: Any ideas as to why the php file is being seen as null?


reply
    Bookmark Topic Watch Topic
  • New Topic