carbide20 Posted December 16, 2007 Share Posted December 16, 2007 Hi, I'm new to php - basically I'm trying to call a php file and pass it a variable. like if this was test.php: $var1; echo $var1; and I was trying to call that in an html file somewhat like this and pass it $var1: <a href="test.php?$var1='hello'>pass hello to test.php</a> how might I go about doing that? Link to comment https://forums.phpfreaks.com/topic/81960-solved-call-file-with-variable/ Share on other sites More sharing options...
teng84 Posted December 16, 2007 Share Posted December 16, 2007 you have to use GET variables eg.. teng.php?x=cool echo $_GET['x']; // give you cool Link to comment https://forums.phpfreaks.com/topic/81960-solved-call-file-with-variable/#findComment-416430 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.