Jump to content

[SOLVED] passing a parameter from an HTML page to a PHP page


Johnain

Recommended Posts

can I do this?  I want to pass a language value (EN/FR/DE etc.) from an Index HTML page to a PHP page with a language code in the call, so that the PHP page can select texts in that language. I would like to to it from an unordered list item if possible by extending the link ...

 

<li><a href="scripts/pricelist.php??????????????????>Pricelist</a></li>

can I do this?  I want to pass a language value (EN/FR/DE etc.) from an Index HTML page to a PHP page with a language code in the call, so that the PHP page can select texts in that language. I would like to to it from an unordered list item if possible by extending the link ...

 

<li><a href="scripts/pricelist.php>Pricelist</a></li>

 

Sorry about the dodgy faces. I thought I was just putting question marks in.

Of course...

 

<li><a href="scripts/pricelist.php?lan=en>English Pricelist</a></li>
<li><a href="scripts/pricelist.php?lan=fr>French Pricelist</a></li>

 

pricelist.php

<?php

  if (isset($_GET['lan'])) {
    switch ($_GET['lan']) {
      case 'en':
        // english list
        break;
      case 'fr':
        // french list
        break;
    }
  }

?>

Of course...

 

<li><a href="scripts/pricelist.php?lan=en>English Pricelist</a></li>
<li><a href="scripts/pricelist.php?lan=fr>French Pricelist</a></li>

 

pricelist.php

<?php

  if (isset($_GET['lan'])) {
    switch ($_GET['lan']) {
      case 'en':
        // english list
        break;
      case 'fr':
        // french list
        break;
    }
  }

?>

 

Thank you very much.

 

It's a steep learning curve for me, but I am enjoying it.

 

Regards

 

John

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.