Forum Moderators: coopster
The script looks like this:
<?
$meta = array (
1=>"meta1",
2=>"meta2,
3=>"meta3",
4=>"meta4",
5=>"meta5",
6=>"meta6",
7=>"meta7",
8=>"meta8",
9=>"meta9",
10=>"meta10",etc They go up to 50
?>
Here is where it calls the tags:
<?php
$random_number=rand(1, count($meta));
$random_meta=$meta[$random_number];
echo("$random_meta, $random_meta, $random_meta, $random_meta, $random_meta, $random_meta, $random_meta, $random_meta");
?>
Here is what is currently displays : meta1, meta1, meta1, meta1, meta1, meta1, meta1, meta1,
then I refresh the page it displays: meta3, meta3, meta3, meta3, meta3, meta3, meta3, meta3,
My question is how can I make them random by page instead of everytime the page loads it pulls random results... I want it to pull random meta tage from this list but I want them to be the same everytime the page reloads... with each page having a adifferent set of 8 random meta keyowrd from this list.
Ex....
Page 1 everytime you refresh the page:
meta3, meta1, meta32, meta11, meta47, meta24, meta9, meta50
Page 2 everytime you refresh the page:
meta22, meta15, meta12, meta41, meta1, meta8, meta17, meta44
and so on...
Do i need a database to do this? Or can I just call them similar as above.
Thx.
sauce
$random_meta_string = '';
for($x = 0; $x < 50; $x++){
$random_number=rand(1, count($meta));
$random_meta_string .= ' ' . $meta[$random_number];
}
echo $random_meta_string;
This will get you a string of 50 random meta keywords.
-sned