S Saulius New member Apr 13, 2009 #1 So lets say i have url mywebsite.com/page.php?Special+text What code do I need to print out that text on my page? I guess it should be function that reads url and creates the variable which then I can echo, anyone can help?
So lets say i have url mywebsite.com/page.php?Special+text What code do I need to print out that text on my page? I guess it should be function that reads url and creates the variable which then I can echo, anyone can help?
C cjconnor24 Guest Apr 13, 2009 #2 Hey, If you want to pass a variable to a page using php you would make use of the get function. Usually you would start with a form with method GET. For example if you wanted a page to display a name. page1.php would consist of: <form action="page2.php" method="get"> <input type="text" name="name" value="" /> <input type="submit" name="submit" value="submit" /> </form> page2.php would then have: <?php $name = $_GET['name']; echo "Welcome " . $name; ?> Hope this helps. Any quesitons just ask
Hey, If you want to pass a variable to a page using php you would make use of the get function. Usually you would start with a form with method GET. For example if you wanted a page to display a name. page1.php would consist of: <form action="page2.php" method="get"> <input type="text" name="name" value="" /> <input type="submit" name="submit" value="submit" /> </form> page2.php would then have: <?php $name = $_GET['name']; echo "Welcome " . $name; ?> Hope this helps. Any quesitons just ask
J Jack C Guest Apr 13, 2009 #3 mywebsite.com/page.php?username=jack echo $_GET["username"]; prints jack