Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
using an iFrame with php
Old 06-11-2007, 02:24 AM using an iFrame with php
highanddry's Avatar
Close Talker

Posts: 880
Name: Jacob
Trades: 0
i have installed a php script and now I want it to display in an
Iframe, or any other method of showing php on an html platform. The
problem is it either says it cannot find the file, or shows a blank page in the
iframe (plain white box).. How would I go about doing this!?

i've tried this

<iframe

<?php virtual("/home/mysite/public_html/comments/comments.php "); ?>

width="800px">
</iframe>


Thanks
highanddry is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-11-2007, 02:36 AM Re: using an iFrame with php
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Did you try

HTML Code:
<iframe src="comments/comments.php" width="800px"></iframe>
Perhaps putting the URL, if needed?
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 06-11-2007, 04:00 PM Re: using an iFrame with php
highanddry's Avatar
Close Talker

Posts: 880
Name: Jacob
Trades: 0
I can't put it the url because it would cause all the comments to be the same apparently. That didn't work unfortunately. This is frustration because i can hit www.mysite.com/comments/comments.php in the browser and see the script working but i cannot
get it to show on the pages I need it in...
highanddry is offline
Reply With Quote
View Public Profile
 
Old 06-11-2007, 04:04 PM Re: using an iFrame with php
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Quote:
Originally Posted by highanddry View Post
I can't put it the url because it would cause all the comments to be the same apparently.
What? Can you point to a "comment"? What exactly do you think is "the same"? We were talking about a frame and a file.

Totally lost me, dude.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 06-11-2007, 04:18 PM Re: using an iFrame with php
highanddry's Avatar
Close Talker

Posts: 880
Name: Jacob
Trades: 0
the installation guide that came with the script warns not to direct the
script using www.mysite.com/comments/coments.php as all of those comments
would be the "same" as every other page i place them on.

The file is a comments script (comments.php) to allow people to leave comments on a given page. Im simply trying to make this open in an iframe but i've tried several times and the best I can get is a blank iframe. I am thinking it is because I'm not writting the iframe correctly to read the php script within...
highanddry is offline
Reply With Quote
View Public Profile
 
Old 06-11-2007, 04:24 PM Re: using an iFrame with php
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Well, it sounds like the script wasn't intended to be used via an iframe. I'm thinking (and this is w/o having the script), that the script is designed to save comments in a file by accessing the URL that the user is visiting through. When you put the script in an iframe you then have it on it's own URL causing all the comments to appear shared (as opposed to the same). If you want to include it on the page, then you'd need to just include it directly.

Why an iframe? Frames aren't all they're made out to be. You could surround the comments in a DIV and then put them wherever on the page you want them to be.

For example, what's so wrong with:

Code:
<div id="comments">
<?php include("comments/comments.php");?>
</div>
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 06-11-2007, 04:29 PM Re: using an iFrame with php
highanddry's Avatar
Close Talker

Posts: 880
Name: Jacob
Trades: 0
to tell you the truth I thought an IFRAME was the ONLY way to put php into a non php based site. Since I wrote in (x)html and know little about php as of yet, I worked through that assumption. So you are saying I can simply put it in my html page like that?
Thanks for your help that comes so quick. I will shoot you some talkupation if you want when I get out of this **** cubicle.
highanddry is offline
Reply With Quote
View Public Profile
 
Old 06-11-2007, 04:33 PM Re: using an iFrame with php
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
Yep, you can put it directly in your page, just like that. I'm glad that I asked!

And, TK is always appreciated.

Have an awesome day!
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 06-12-2007, 10:39 AM Re: using an iFrame with php
highanddry's Avatar
Close Talker

Posts: 880
Name: Jacob
Trades: 0
Well even that didn't work. I ended up abandoning that script and installing a better one. The only way I could get the new script (which is called "comment script" by gentlesource) to work was through SSI. Which, eventually, worked brilliantly

Last edited by highanddry; 06-12-2007 at 10:40 AM..
highanddry is offline
Reply With Quote
View Public Profile
 
Old 06-12-2007, 12:19 PM Re: using an iFrame with php
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
It sounds like the extension of your file was .html and not .php . PHP will only work if the extension has been setup to use the PHP parser which is usually the extensions .php, .php3, .php4, .php5 (and I think a few others, but I always just use .php).

Anyway, glad you got one working!
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Old 06-12-2007, 02:54 PM Re: using an iFrame with php
highanddry's Avatar
Close Talker

Posts: 880
Name: Jacob
Trades: 0
ya I mentioned something about that initially

"in an
Iframe, or any other method of showing php on an html platform."

Oh well. Next time I'll know.
highanddry is offline
Reply With Quote
View Public Profile
 
Old 06-12-2007, 02:57 PM Re: using an iFrame with php
JeremyMiller's Avatar
WT Moderator

Posts: 1,712
Name: Jeremy Miller
Location: Las Vegas, NV
Trades: 0
oic. You can add a handler to your htaccess file to have html pages parsed by the PHP engine, but it's generally not worth the effort (not that it's hard, but how hard is saving your files as php either?).

Take care.
__________________
Jeremy Miller

Please login or register to view this content. Registration is FREE
JeremyMiller is offline
Reply With Quote
View Public Profile Visit JeremyMiller's homepage!
 
Reply     « Reply to using an iFrame with php
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.64964 seconds with 12 queries