Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 6 of 6 total
Thread Read url info
Mon, Mar 12 2018 8:12 PMPermanent Link

KimHJ

Comca Systems, Inc

I'm creating a website that can be called from my customers website. In order to have the right information on the screen I need to send an id in the redirect hyperlink.

www.mywebsite.com:8100/custompage?customerid=1000

How will I read the customerid?

Or is there a better way?

Thanks
Kim
Mon, Mar 12 2018 9:05 PMPermanent Link

Frederick Chin

KimHJ wrote:

/*
How will I read the customerid?
*/

window.location.search should give you the parameter value.

--
Frederick
Mon, Mar 12 2018 9:19 PMPermanent Link

Rick

On 13/03/18 11:12, KimHJ wrote:
> I'm creating a website that can be called from my customers website. In order to have the right information on the screen I need to send an id in the redirect hyperlink.
>
> www.mywebsite.com:8100/custompage?customerid=1000
>
> How will I read the customerid?
>
> Or is there a better way?
>

Have a look at the TAddress class. It has properties for accessing
components of the URL (anchor, params, etc.)

Note that there is a global variable called "Address" which is
automatically available. You can use this directly to get the info.

--
Rick
Tue, Mar 13 2018 11:02 AMPermanent Link

KimHJ

Comca Systems, Inc

wrote:

>>Have a look at the TAddress class. It has properties for accessing
components of the URL (anchor, params, etc.)

Note that there is a global variable called "Address" which is
automatically available. You can use this directly to get the info.<<

Thanks, when you say automatic available I would think that I could do this in MainForm.Create:
MyParam: String;
MyParam := Address.Params;

But I get: does not exist;

How will I access it?

Thanks,
Kim
Tue, Mar 13 2018 11:13 AMPermanent Link

Rick

On 14/03/18 02:02, KimHJ wrote:
>
> Thanks, when you say automatic available I would think that I could do this in MainForm.Create:
> MyParam: String;
> MyParam := Address.Params;
>
> But I get: does not exist;
>
> How will I access it?
>

Make sure that WebComps is in your uses list at the top of the unit.
Address is defined in there.

--
Rick
Tue, Mar 13 2018 4:44 PMPermanent Link

KimHJ

Comca Systems, Inc

wrote:

>>Make sure that WebComps is in your uses list at the top of the unit.
Address is defined in there.<<

Thanks again I should have seen that.
Kim
Image