Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading configuration from browser?

Status
Not open for further replies.

ug505

Programmer
Jan 2, 2010
52
US
I'm trying to get seconds and a URL off my friend's website that is stored in a file. He has it in a PHP file that displays it on the screen as text. I'm not sure if I can rip that off the page and then use it. He said he can change it to an XML file for me to get it off of.

Here's my question: How would I get the information from the file and then use that information? His PHP displays like this:

30#
The 30 represents seconds. The # symbols are separators between the seconds and the URL. How would I get the seconds out and set them to a Integer variable and the URL to a String variable?
 
something like:

Code:
procedure SplitSecondsAndUrl(Input: String; var Seconds : Integer; var URL : String);
begin
 Seconds := StrToInt(Copy(Input, 1, Pos('#')-1);
 Url := Copy(Input, Pos('#')+1, MaxInt);
end;

procedure TestIt;

var URL : String;
    Seconds : Integer;
const TestString = '10#testing123';

begin
 SplitSecondsAndUrl(TestString, Seconds, URL);
 Showmessage(Format('URL:%s seconds:%d',[URL, Seconds]));
end;

/Daddy

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top