Jump to content

The POST array


CocoPop

Recommended Posts

Hello, I was wondering if it is at all possible to have a simple link (href) and for that link to POST variables, say for example a blog page with 3 clickabvle links to see the last 3, 5 or 10 blog entrys.

 

So if i was going to use the get command i would simple add ?$Entrys=3 to the URL.

 

If there is any way to do this with the POST command you help would be appreciated.

Thanks

Link to comment
https://forums.phpfreaks.com/topic/57397-the-post-array/
Share on other sites

OK so the link url html bit loks like this (using GET)

 

<a class="SideLinks" href="http://www.deadandcolourblind.co.uk?$Limit=10"> Last 10</a> </br>

 

And to output the blog i use

 

while($Limit > 0)
	{
		$Entry = mysql_result($Result, $RecordCount, "Blog");
		$Title = mysql_result($Result, $RecordCount, "Title");
		$Category = mysql_result($Result, $RecordCount, "BlogCatagory");
		$Date = mysql_result($Result, $RecordCount, "Date");

		//Output The Blog Contents, Default = 3 Entrys
  			echo "<div class='Border'>";
		echo "<div class='Blog'> <div class='Date'> $Date                Category: $Category </div> <div class='BlogTitle'> <B> $Title </B> <IMG class='Icon' src='Images/Star.png'> </div> <br> <div class='Blog'> $Entry </div> </div> </div>";

		$RecordCount --;
		$Limit --;
	}

Link to comment
https://forums.phpfreaks.com/topic/57397-the-post-array/#findComment-283939
Share on other sites

Couple of points. ?$Limit=10 in your links should actually be Limit=10 (no dollar sign). Also, somewhere in the code to display the output you need to abstract the value of Limit as passed from the previous page via get or post. $Limit does not automatically exist.

 

If you really want to POST values, then you'll need a simple form (method='post') with a dropdown so visitors can select the value of Limit.

Link to comment
https://forums.phpfreaks.com/topic/57397-the-post-array/#findComment-283967
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.