loc 0 Report post Posted August 13, 2004 I have noticed that when some people use links, they type in something like this *index.php?view=Ranks* or something like that. Can you tell me how to use the little addons that go after the .php?Or point me toward a good tutorial on the subject? Share this post Link to post Share on other sites
Gamesquare 0 Report post Posted August 13, 2004 Unless you are using POST requests in forms, you can access it with the $_GET array. With the ranks example: <?php[br]if ($_GET['view'] == 'Ranks')[/br]{[br]// display the ranks page[/br]}[br]else[/br]{[br]// other code goes here[/br]}?> You may have to use $_POST instead of $_GET if you're using the POST method to submit data. Share this post Link to post Share on other sites
rigueira 0 Report post Posted November 27, 2007 the only way to use method POST is using FORM?The method GET can be used like a simple link, didn't it? Share this post Link to post Share on other sites
gogoily 0 Report post Posted December 6, 2007 I'm not sure what's your meanBut if you wanna get parameters that after ".php?", you should use $_GET Share this post Link to post Share on other sites
acantocephala 0 Report post Posted December 10, 2007 (edited) You don't need a $_GET to pass parameters, or a form, you can use a simple link like this: <a href="results.php?criteria=searchField=A">Title with A</a><a href="results.php?criteria=searchField=B">Title with B</a><a href="results.php?criteria=searchField=C">Title with C</a> And then, the results.php page: <?php ... $_connection ...?><head><title>Books!</title></head><body><?php$sql = "SELECT * FROM books WHERE $_REQUEST[criteria] like '$_REQUEST[searchField]%' ORDER BY title";$result=mysql_query($sql); if (mysql_num_rows($result)){while ($row=mysql_fetch_array($result)){ echo '<strong>'.$row["title"].'</strong>;}}else echo 'No records were found!';?></body></html> It works for me! Edited December 10, 2007 by acantocephala (see edit history) Share this post Link to post Share on other sites