Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Testimonials script

Featured Replies

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.

  • 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

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?

 

:D

 

 

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>");  
}
?>

 

:)

  • 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

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.

  • 2 months later...
  • 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?

  • 2 years later...

'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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.