November 19, 200718 yr Hi guys i am looking for a free testimonials script to add to my site i have searched in google but the few i have tried do not seem to be great. I want one that is lightweight and simple just wondered if any of you knew of any.
November 20, 200718 yr Author I would like people to be able to add testimonials to my site they fill in form i then authorize it and would also like it to randomize which ones it shows on sight
November 20, 200718 yr For the random aspect of the testimonials, here's a PHP script I use on a site at the moment. The txt file contains nothing more than the quotes with line breaks. TXT file: It was brilliant, thank you I will be back again Love your work, darling - we must do lunch Your web designer is hot - is he single? PHP file: <?php $quotesfile = "file-includes/testimonials.txt"; //Relative path to and the filename of the file that contains your quotes. //You should not have to edit anything after this line. if ($array = @file("$quotesfile")) { // Build an array with the quotes $quote = rand(0, count($array)-1); $ar.= "<blockquote>\""; //clen the array $array[$quote] = stripslashes(htmlentities($array[$quote])); //choose a random quote from the array. $ar.= $array[$quote]; $ar.= "\"</blockquote>"; echo $ar; } else{ echo ("<blockquote>If the script doesn't work - you will see this message!</blockquote>"); } ?>
November 21, 200718 yr Author Thanks i get this error using your code PHP Notice: in file modules/module_webpages.php(74) : eval()'d code on line 9: Undefined variable: ar
November 21, 200718 yr That's because the $ar variable isn't initialized but the code implies it does. Remove the period in that line. $ar= "<blockquote>\""; so it looks like this.
February 15, 200818 yr Author Ok so not been here for a while and gave up trying to use this but i am back again giving it a go so i have put this code in <?php $quotesfile = "file-includes/testimonials.txt"; //Relative path to and the filename of the file that contains your quotes. //You should not have to edit anything after this line. if ($array = @file("$quotesfile")) { // Build an array with the quotes $quote = rand(0, count($array)-1); $ar.= "<blockquote>\""; //clen the array $array[$quote] = stripslashes(htmlentities($array[$quote])); //choose a random quote from the array. $ar.= $array[$quote]; $ar.= "<blockquote>\""; echo $ar; } else{ echo ("<blockquote>If the script doesn't work - you will see this message!</blockquote>"); } ?> But get the message "If the script doesn't work - you will see this message!" Any ideas?
November 29, 201015 yr 'cutenews' search that, easily intregratable (my spellings not great..) and works perfect. benn - www.bkwebdesignandhosting.co.uk
Create an account or sign in to comment