Pass a value in link type button through the url to be last in another page with javascript or php

Asked

Viewed 1,655 times

2

Good morning to you all! I am new to web development and am developing a web application with Php, javascript and mysql. My question is the following question: I have a table, where I am loading the information I recovered from my database, and are being displayed as it should be. What I need is, in one of the cells, I load the information id and when I click on it I want to open another tab, containing the information of that particular id, what I’m not able to do is pass this id using <a href="minhapagina.php"></a>. And the other question would be, how do I take another cell from that same table and see if the value in it is greater than zero, and if it is, change the background. Thanks for your help!

  • <a href="minhapagina.php?minhavariavel=123"></a> ?

  • Post your PHP code and HTML code where you populate the data.

1 answer

2


very simply in php:

<a href="minhapagina.php?foo=bar"></a>

<?php
    $foo = $_GET['foo']; // 'bar';
?>
  • Pretty much @jbrunoxd, it worked right! : D

Browser other questions tagged

You are not signed in. Login or sign up in order to post.