Php Help Please - ^.^

free web hosting
Free Web Hosting, No Ads > CONTRIBUTE > The Internet > Web Design

Php Help Please - ^.^

loc
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?

Reply

Gamesquare
Unless you are using POST requests in forms, you can access it with the $_GET array. With the ranks example:

CODE
<?php
if ($_GET['view'] == 'Ranks')
{
// display the ranks page
}
else
{
// other code goes here
}
?>


You may have to use $_POST instead of $_GET if you're using the POST method to submit data.

Reply

rigueira
the only way to use method POST is using FORM?

The method GET can be used like a simple link, didn't it?

Reply

gogoily
I'm not sure what's your mean
But if you wanna get parameters that after ".php?", you should use $_GET

Reply

acantocephala
You don't need a $_GET to pass parameters, or a form, you can use a simple link like this:


CODE
<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:

CODE
<?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!

 

 

 


Reply



Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

(Maximum characters: 10,000)
You have characters left.
Confirm Code:

Similar Topics
Looking for php

Searching Video's for php
advertisement



Php Help Please - ^.^



 

 

 

 

ADD REPLY / Got an Opinion! a humble request :-) RAPID SEARCH! Free Hosting [X]
Express your Opinions, Thoughts or Contribute more info. to help others.
Ask your Doubts & Queries to get answers, So that "Together We can help others!"
Register FREE for AD-FREE forum, Create your own topics, Ask Questions, track topics, setup subscriptions & notifications and Get a Free Website w/ Email and FTP.
500MB Space *No Ads*, CPanel, FTP, PHP, MySQL, EMails - 100% FREE