Variables from link to php | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

Variables from link to php

Hey, Let's say I have 2 files, first is some kind of html website where i put a link (a href) to php(second) file. This second file contains a function which uses variables. Now is the question: Is it possible to open php file by clicking link with variables? Like <a href="something.php?a=5"></a> Or maybe there is another way to do this?

10th Dec 2017, 5:20 PM
ThreeG
ThreeG - avatar
1 Answer
+ 1
Shouldn't be a problem. Sending query strings is normal behavior, I'd just include the protocol ("http:" or "https:") so the browser doesn't guess. This works on CodePlayground, e.g.: <a href="https://www.google.com/search?q=SoloLearn+Codes">Click to query Google</a>
10th Dec 2017, 8:41 PM
Kirk Schafer
Kirk Schafer - avatar