HTML Tutorial


 Forum HomeForum Home   FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
RegisterRegister - Not registered yet? Got something to say? Join HTML Code Tutorial!
Integrating PHP quote generator into HTML?
Post new topic   Reply to topic    HTML Help Forum Index -> PHP
View previous topic :: View next topic  
Author Message
moviepie



Joined: 04 Apr 2006
Posts: 5

PostPosted: Tue Apr 04, 2006 3:41 pm     Integrating PHP quote generator into HTML? Reply with quote

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

PostPosted: Tue Apr 04, 2006 3:47 pm     Reply with quote



did you check out included content?

_________________
Corey
Loud Commerce | Loud Worx | Merchant Account Blog
moviepie



Joined: 04 Apr 2006
Posts: 5

PostPosted: Tue Apr 04, 2006 3:58 pm     Reply with quote

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

PostPosted: Wed Apr 05, 2006 2:47 am     Reply with quote

Well you would write the include statement where you have
Code:
I WANT THE RANDOM QUOTE TO GO RIGHT HERE!


_________________
Corey
Loud Commerce | Loud Worx | Merchant Account Blog
moviepie



Joined: 04 Apr 2006
Posts: 5

PostPosted: Wed Apr 05, 2006 8:36 am     Reply with quote

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

PostPosted: Wed Apr 05, 2006 11:58 am     Reply with quote

I went to http://www.moviepie.com/ but I did not see
Code:
<?php include("quotes/quotes.php"); ?>
in the code. Also make sure that the page is named with the proper extension (php, phtml, etc) so that it will be parsed as php.

_________________
Corey
Loud Commerce | Loud Worx | Merchant Account Blog
legohead6



Joined: 23 Feb 2006
Posts: 39

PostPosted: Sat Apr 08, 2006 10:30 am     Reply with quote

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

PostPosted: Sat Jun 03, 2006 12:19 pm     Reply with quote

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

PostPosted: Sat Jun 03, 2006 1:30 pm     Reply with quote

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

PostPosted: Sat Jun 03, 2006 2:50 pm     Reply with quote

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!
Display posts from previous:   
Post new topic   Reply to topic    HTML Help Forum Index -> PHP All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
HTML Help Archive
Powered by phpBB © 2001, 2005 phpBB Group
HTML Help topic RSS feed 

 
HOSTING / DESIGN
MAKE MONEY

Home
  |   Tutorials   |   Forum   |   Quick List   |   Link Directory   |   About
Copyright ©1997-2002 Idocs and ©2002-2007 HTML Code Tutorial