Random Quotes for Your Website!
We have been collecting these quotes since 1991.
They represent the funny, thoughtful, or even disturbing words found in books, comics, movies, songs, or everyday conversations.
We welcome your contributions to our ever-growing database of quotes!
Would you like to have our random quotes appear on your website?
The easiest way to show these quotes on your webpage is to insert the following code in your page's HTML:
<iframe src="http://www.moorecompdev.com/quotes/RandomQuote.asp" border=0 width="100%" ></iframe>
This will give you the quotes, but will not let you set the colors or other formatting.
Use the following ASP block to get quotes data from our database for use on your website. Contact us if you need examples in other web programming languages or help formatting the output for your website.
If you have any questions or comments about the code below, please let us know and we'll try to help you.
Also, if you intend to link to our quotes, please drop us a line so we will know what site you are linking from.
<!-- Begin Random Quote Code -->
<%
Dim objRanQuoteXmlHttp
Dim strRanQuoteResponse
dim strRanQuoteLine
dim strRanQuoteUrl
strRanQuoteUrl = "http://www.moorecompdev.com/quotes/RandomQuote.asp"
Set objRanQuoteXmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP")
objRanQuoteXmlHttp.open "POST", strRanQuoteUrl, False
objRanQuoteXmlHttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objRanQuoteXmlHttp.send 'Send quote request.
strRanQuoteResponse = split(objRanQuoteXmlHttp.responseText, vblf)
Set objRanQuoteXmlHttp = Nothing
for each strRantQuoteLine in strRanQuoteResponse
'Output each line of the quote to the screen.
response.write strRantQuoteLine
next
%>
<!-- End Random Quote Code -->
For PHP code, try this. I haven't had an opportunity to test this code yet.
$http_request = "POST /quotes/randomquote.asp HTTP/1.0\r\n";
$http_request .= "Host: www.moorecompdev.com\r\n";
$http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n";
$http_request .= "Content-Length: " . strlen($req) . "\r\n";
$http_request .= "User-Agent: /PHP\r\n";
$http_request .= "\r\n";
$http_request .= $req;
$response = '';
if( false == ( $fs = @fsockopen("www.moorecompdev.com", "80", $errno, $errstr, 10) ) ) {
die ('Could not open socket');
}
fwrite($fs, $http_request);
while ( !feof($fs) )
$response .= fgets($fs, 1160); // One TCP-IP packet
fclose($fs);
$response = explode("\r\n\r\n", $response, 2);
$answers = explode ("\n", $response [1]);
echo $answers;
