Jump to content

[SOLVED] How do I pass a link (webpage) through url?


jordan00

Recommended Posts

Hello,

 

I'm new in coding in php

I want to transfer a webpage (news5.html) to another webpage (in a table), so it will be opened and displayed in a cell.

(Like it is done on the news' websites eg. "www.domain.com/index?ID=4343"

How can I do it?

 

I read about passing variables through url, but if it is how it should be done how do I include a link in the variable?

 

Please help me

Okay,

 

This is my website www.infolek.we.bs

 

Please go there http://www.infolek.we.bs/lek/paracetamol.html

 

I want, instead of making 300 pages, just to make one main webpage, and use the central cell (where it is written paracetamol)

to be displayed the appropriate webpage. (The aim is not to repeat the other cells of the table in all the webpages)

 

so it would be something like http://www.infolek.we.bs/drug.php?ID=323 (indicating that the page paracetamol.php will be opened in the central cell).

 

I know it is (probably) done with passing variables through url, but i don't know how to define the variable to

pass the webpage, or how to just pass the whole webpage in the central cell.

It's Macedonian  ;)

 

No no, they are in separete files.

 

I tried this...but doesnt work..

 

  echo "<a href='1.php?ID=2442'>";

  echo "click";

  ?>

 

 

and in the other file:

 

<?php

  if $_GET['ID'] == 2442 echo file_get_contents("news5.html");

?>

 

 

Oh, it's Macedonian? :o  I'm from Greece, lol.  Anyway...

Firstly: You have no file called news5.html, it was just an example.  Secondly:  Just make a file with ONLY the text you want to be in the cell and name them according to the ID.

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.