jordan00 Posted April 30, 2008 Share Posted April 30, 2008 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 https://forums.phpfreaks.com/topic/103624-solved-how-do-i-pass-a-link-webpage-through-url/ Share on other sites More sharing options...
revraz Posted April 30, 2008 Share Posted April 30, 2008 When you use ? in the URL like ?ID=4343 then you can use $_GET to retrieve that information. Link to comment https://forums.phpfreaks.com/topic/103624-solved-how-do-i-pass-a-link-webpage-through-url/#findComment-530633 Share on other sites More sharing options...
jordan00 Posted April 30, 2008 Author Share Posted April 30, 2008 Yes I know it, but how can I send the webpage with that ID=2442 ? I know how to retrive the information. But how to send the whole webpage to a specific cell from a table on another website? Link to comment https://forums.phpfreaks.com/topic/103624-solved-how-do-i-pass-a-link-webpage-through-url/#findComment-530642 Share on other sites More sharing options...
DarkWater Posted April 30, 2008 Share Posted April 30, 2008 Please provide some sort of example. >_> "Send the whole webpage to a specific cell" isn't too detailed. Give us some code or screenshots of what you want to do. Link to comment https://forums.phpfreaks.com/topic/103624-solved-how-do-i-pass-a-link-webpage-through-url/#findComment-530652 Share on other sites More sharing options...
moselkady Posted April 30, 2008 Share Posted April 30, 2008 try something like if ($_GET['ID'] == 2442) echo file_get_contents("news5.html"); Link to comment https://forums.phpfreaks.com/topic/103624-solved-how-do-i-pass-a-link-webpage-through-url/#findComment-530662 Share on other sites More sharing options...
jordan00 Posted April 30, 2008 Author Share Posted April 30, 2008 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 https://forums.phpfreaks.com/topic/103624-solved-how-do-i-pass-a-link-webpage-through-url/#findComment-530676 Share on other sites More sharing options...
DarkWater Posted April 30, 2008 Share Posted April 30, 2008 Oh, Russian. Had a feeling English wasn't your first language. And do you have all the drugs stored in a database, or do you have individual pages for them. Link to comment https://forums.phpfreaks.com/topic/103624-solved-how-do-i-pass-a-link-webpage-through-url/#findComment-530679 Share on other sites More sharing options...
jordan00 Posted April 30, 2008 Author Share Posted April 30, 2008 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 https://forums.phpfreaks.com/topic/103624-solved-how-do-i-pass-a-link-webpage-through-url/#findComment-530710 Share on other sites More sharing options...
DarkWater Posted April 30, 2008 Share Posted April 30, 2008 Oh, it's Macedonian? 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. Link to comment https://forums.phpfreaks.com/topic/103624-solved-how-do-i-pass-a-link-webpage-through-url/#findComment-530713 Share on other sites More sharing options...
jordan00 Posted April 30, 2008 Author Share Posted April 30, 2008 Oh from Greece the world is a small place yes I created the file news5.html just for this purpose... but it still doesnt work.... i think there is something in the code.. Link to comment https://forums.phpfreaks.com/topic/103624-solved-how-do-i-pass-a-link-webpage-through-url/#findComment-530719 Share on other sites More sharing options...
pwes24 Posted May 1, 2008 Share Posted May 1, 2008 If its a cell table and you'd like to like show details of a product echo '<a href="products.php?cat_name='.$row['cat_name'].'">'. $row['cat_name']. '</a>'; . Link to comment https://forums.phpfreaks.com/topic/103624-solved-how-do-i-pass-a-link-webpage-through-url/#findComment-530845 Share on other sites More sharing options...
jordan00 Posted May 1, 2008 Author Share Posted May 1, 2008 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 https://forums.phpfreaks.com/topic/103624-solved-how-do-i-pass-a-link-webpage-through-url/#findComment-530914 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.