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

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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");

?>

 

 

Link to comment
Share on other sites

Thanks to all especially to my beloved neighbour  ;)

 

I've done it!

 

<?php

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

  echo "click";

  ?>

------------------------------------------

<?php

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

?>

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.