everah
07-14-2005, 06:59 PM
I have an application coded in PHP that accepts a user selection and passes that selection by URL back to itself to show something in the page. As an example, I have a list of calculators that a user can select. Each one is displayed as a URL. When the user clicks the URL the page is refreshed and shows the user the calculator they chose based on a value passed by the query string.
<?php
if (isset($_GET['calc_id']))
{
include($path_to_calcs . "calc_" . $_GET['calc_id'] . ".php");
}
else
{
//load a fresh page with a list of available selections as a post back
//use an array to store calc id's and link references
foreach ($calc_array as $calc_id => $calc_ref)
{
echo '<a href="' . $_SERVER['PHP_SELF'] . '?calc_id=' . $calc_id . '">' . $calc_ref . '</a>';
}
}
?>
How can this be done in C#? All help is appreciated.
<?php
if (isset($_GET['calc_id']))
{
include($path_to_calcs . "calc_" . $_GET['calc_id'] . ".php");
}
else
{
//load a fresh page with a list of available selections as a post back
//use an array to store calc id's and link references
foreach ($calc_array as $calc_id => $calc_ref)
{
echo '<a href="' . $_SERVER['PHP_SELF'] . '?calc_id=' . $calc_id . '">' . $calc_ref . '</a>';
}
}
?>
How can this be done in C#? All help is appreciated.