| View previous topic :: View next topic |
| Author |
Message |
moviepie
Joined: 04 Apr 2006 Posts: 5
|
Posted: Tue Apr 04, 2006 3:41 pm Integrating PHP quote generator into HTML? |
|
|
|
Hi there,
So I borrowed a random-quote generator PHP script, and would like to integrate it into the main page of my site. I got the quote part working as a stand-alone screen, but would like it to be in the corner of my main page whenever it reloads.
Here's the quote generator working:
http://www.moviepie.com/quotes/quotes.php
And I'd like to have the quotes appear in a spot on my main page, in a sidebar the equivalent of my Contest highlight (currently where the Brokeback Mountain blurb is):
http://www.moviepie.com/
Basically, I can't figure out how to put the code in the middle of HTML like this (which is what the contest sidebar looks like):
<table width="198" cellpadding="1" cellspacing="0" border="0" align="right">
<tr>
<td align="center" bgcolor="#996600">
<font size="4" face="Verdana, Arial, Helvetica, Sans Serif" color="white"><b>RANDOM QUOTE</b></font>
</td>
</tr><tr><td bgcolor="#0066cc" align="center">
<table cellpadding="10" cellspacing="0" border="0" width="197"><tr>
<td bgcolor="#ffffff"><table width="100%" cellspacing="5" cellpadding="5" border="0"><font size="1" face="Verdana, Arial, Helvetica, Sans Serif">
I WANT THE RANDOM QUOTE TO GO RIGHT HERE!
</table>
</tr>
</td>
</table>
</td>
</tr>
</table>
Help???? - Linda |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8259 Location: Castle Rock CO USA
|
|
moviepie
Joined: 04 Apr 2006 Posts: 5
|
Posted: Tue Apr 04, 2006 3:58 pm |
|
|
|
| Haven't tried that... and to be honest I don't even know how to go about doing it. I've never used PHP before, and just got the script as a free download, made a couple changes, and put it on my server. :-\ |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8259 Location: Castle Rock CO USA
|
|
moviepie
Joined: 04 Apr 2006 Posts: 5
|
Posted: Wed Apr 05, 2006 8:36 am |
|
|
|
Well, yes, I figured that much, but I can't get it to work, as I'm probably writing it incorrectly.
Looking at the page you linked to, I figure I'm supposed to use that PHP code and mention the location of the quote generator code, yes?
So I came up with this:
<?php include("quotes/quotes.php"); ?>
Because my quote generatore lives here:
http://www.moviepie.com/quotes/quotes.php
But that doesn't do anything (like I said, because I'm sure it is wrong).
This is where I'm simply stuck. |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8259 Location: Castle Rock CO USA
|
|
legohead6
Joined: 23 Feb 2006 Posts: 39
|
Posted: Sat Apr 08, 2006 10:30 am |
|
|
|
| You have to have the page .php ...like YOUR_PAGE.php ....if its .htm or .html it wont work....also you need to have php installed on your machine! (www.php.net)...try both of those |
|
moviepie
Joined: 04 Apr 2006 Posts: 5
|
Posted: Sat Jun 03, 2006 12:19 pm |
|
|
|
Aha... the proper extension thing helped! Seems obvious, but I did not know that.
Now I've got a quote appearing, but there is an error before it:
http://www.moviepie.com/index_test.php
Error:
Warning: main(): stream does not support seeking in /usr/local/www/vhosts/moviepie.com/htdocs/index_test.php on line 77
Line 77 of index_test.php is where I put:
<?php include("http://www.moviepie.com/quotes/quotes.php"); ?> |
|
Corey Bryant Site Admin

Joined: 15 May 2004 Posts: 8259 Location: Castle Rock CO USA
|
Posted: Sat Jun 03, 2006 1:30 pm |
|
|
|
Yes, that is also in the thread abut the extension.
As far as the second part, try putting your test.php in the same folder as the quotes and see if that helps.
_________________
Corey
Loud Commerce |
Loud Worx | Loud Ads |
|
moviepie
Joined: 04 Apr 2006 Posts: 5
|
Posted: Sat Jun 03, 2006 2:50 pm |
|
|
|
A-HA!
http://www.moviepie.com/quotes/index_test.php
I had to tweak the link a little to read:
<?php include("quotes.php"); ?>
... and that seems to work! So in my case, I'll have to put the files and such in the same level as my index. (rubbing my hands together with glee)
This is awesome... a breakthrough for me!
Thanks so much! |
|
|