Transfering a varialble with a hyperlink for Netburner

Discussion to talk about software related topics only.
Post Reply
Lachlanp
Posts: 91
Joined: Tue Jan 29, 2013 4:44 am

Transfering a varialble with a hyperlink for Netburner

Post by Lachlanp »

i want to transfer a variable to a new web page when I press a hyperlink. I can find ways to do this using PHP but nothing otherwise. I have tried two methods that dont work and am looking for help.

1. This should pass the loc varialble with the link
<a href="location_display.htm?loc=1" >View Location 1 Details --></a><br>
<a href="location_display.htm?loc=2" >View Location 2 Details --></a><br>
Using this method I cannot find a way to retrieve the varialble 'loc' on the new page. Any suggestions?

2. This should save the loc variable and allow it to be retrieved from the new page
<a href="location_display.htm" onClick=<!--VARIABLE SetLocation(fd,1)>View Location 1 Details --></a><br>
<a href="location_display.htm" onClick=<!--VARIABLE SetLocation(fd,2)>View Location 2 Details --></a><br>
This stops the hyperlink from being displayed. Any suggestions why this does not work (clearly the onClick is not valid in this context)?

Any other suggestions?
Thanks
Lachlan
User avatar
dciliske
Posts: 624
Joined: Mon Feb 06, 2012 9:37 am
Location: San Diego, CA
Contact:

Re: Transfering a varialble with a hyperlink for Netburner

Post by dciliske »

To do this, you will need to define a custom GET handler on the netburner. You will want to take the url string and locate the '?' character and parse the trailer for your variables. Take a look at the TicTacToe example in the Web directory for the gist of this.

-Dan
Dan Ciliske
Project Engineer
Netburner, Inc
Lachlanp
Posts: 91
Joined: Tue Jan 29, 2013 4:44 am

Re: Transfering a varialble with a hyperlink for Netburner

Post by Lachlanp »

Thanks, This works fine.
Lachlan
Post Reply