PDA

View Full Version : How Do I Limit The Number Of Characters?


Sharon Montero
04-12-2003, 09:38 AM
Hello Forum-Mates,

I want to limit the number of characters in the TITLE (which is a hyperlink) of the listings returned in a Metaseach (search engine) CGI script.

I have no idea what code to use to accomplish this.

I would appreciate it if you could explain how I could do this.


The original script is found here ...

http://www.mycgiscripts.com/metasearcher.html


This is an example of the listings of which I would like to limit the TITLE output to just 50 characters.

http://www.mycgiscripts.com/cgi-bin/search.cgi?query=marketing+Ibsites&where=1

TIA

toolkit
04-14-2003, 03:05 PM
Just had a quick look and think this should work (haven't had a change to check though):

websearch-alltheweb.pl

at line #64 insert this line:

$title = substr($title,0,50);

websearch-google.pl

at line #84 insert this line:

$title = substr($title,0,50);

Hopefully that should work ;)