• Howdy! Welcome to our community of more than 130.000 members devoted to web hosting. This is a great place to get special offers from web hosts and post your own requests or ads. To start posting sign up here. Cheers! /Peo, FreeWebSpace.net
managed wordpress hosting

How to produce url like this in PHP?

nag

New Member
While on web i saw several websites with url's like:
--www.site.com/files.php?cat=23....
I want to know how to produce this type of URL's through PHP.I asked a person ,he just told that to produce these links,we have to Query them but How To Produce these queries???
 
you query using a form

file name: test.htm
<form method="GET" action="test.htm">
<input type="text" name="cat" size="20"><input type="submit" value="Submit" name="submit">
</form>

the result would be: test.htm?cat=whatever you type in

but i perfer using method="POST" cause it wouldn't show the query in the url
 
I have done this now 3 times:

please look at my posts in this thread
http://www.freewebspace.net/forums/showthread.php?s=&threadid=25665

this is all the html is:
<a href="page.php?cat=1">Link</a>

and this is the PHP for creating the links:
PHP:
$query = "select * from jokes";
$result = mysql_query($query); 

while($row = mysql_fetch_array($result)){
extract($row)
$jokename = htmlspecialchars($jokename);
echo" <a href=\"joke.php?jokeid=" . $jokeid . "\">" . $jokename . "</a><BR>";
}
 
Back
Top