Need to regenerate a randomised list in same order


#1

I think this should be something straightforward. I hope so anyway.

After using a search facility on my property rental site a list is generated in a randomised order. A visitor then selects a property to view in the site. If they then click the back button on the browser to return to the list I need it to display the list in the same order as it was after the first search. Is there a piece of code that I can insert that would enable this to happen? I am a bit of a novice, so plain language would be appreciated. And where would I insert it? Many thanks in advance.


#2

I suspect that somewhere there is a setting on the page that provides for no caching. If this is the case the only thing you could do is to disable that so the page is cached.

You could also consider opening up the link in a new window instead, thereby leaving the original (randomized) page alone. I think that would be an easier solution.

In the “Anchor” you could add a target…

 <a href="http://somesite.com/SomePage.php?SomeID=191" target=_BLANK>Click here </a>

#3

Thanks for the suggestion, it makes sense. But… could tell me where abouts it would go in this script please?

[php]
while($row = $conn->results()) {
?>

<?=$row[shortdesc]?> Ref: RIS<?=$row[id]?> More ->>

[/php]

I think it would be here, am I right?

[php]while($row = $conn->results()) {
?>

<a href="http://www.rentinspain.co.uk<?=$row[shortname]?>.php"target=_BLANK>
<?=$row[shortdesc]?> Ref: RIS<?=$row[id]?> More ->>
[/php]

Admin Edit: Added PHP code tags for readability. Please see http://phphelp.com/guidelines.php for Posting Guidelines.


#4

Where you have put it in the second set of code looks like the right spot however you need a space before it so it doesn’t run right into the url.

Also, after looking at the code after the PHP tags (for syntax highlighting) have been added, It doesn’t look like your code will work anyway. I know I am not an expert but I think the injected PHP is all wrong. Did you take this code from a working program?