Jump to content

[SOLVED] Passing PHP arguments through HTML link


tmh766

Recommended Posts

Hi can I have a quick example on how to pass a php argument through and html link and how the php document that accepted the passed variable would be setup?

 

phpdoc1.php

a href="phpdoc2.php?passedVar=3455"

 

phpdoc2.php

<?php
echo($passedVar);
?>

 

is not working..

 

 

 

 

 

 

a.php

 

we set a condition to the url in this example we set got=it

if the got=it is in the url you get a nice message ok.

<?php

//get this file

echo"<a href='b.php?got=it'>get the file</a>";

?>

b.php

 

<?php

if($_GET['got']=="it"){

echo "Hi there mate hows you";

}else{

echo "sorry you have not come from the correct url";

}

?>

 

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.