Click to See Complete Forum and Search --> : How to make this php file work??


SA Heat
11-17-2003, 01:54 PM
I must be a total moron when it comes to php because I am sure this is very simple but I am making it quite difficult. I downloaded a simple date and time php file to try to understand how its working, the problem is I can't figure out what goes where. Here is what the program tells ya to do...
1: Usage
a: Use the code below to show the date on your page. (For files with .php extensions)
<?php include "onlydate.php" ?>
b: To use it in a HTML Page use iframes
<iframe src=onlydate.php width=200 height=60 frameborder=0 scrolling=no></iframe>

2: Credits
Coded by Orkun Kaya.

3: Downloaded
This file was downloaded from www.onlyphp.com .
www.onlyphp.com/main/onlydate.php

Now I did two things, I opened up a blank html file and inserted the following into the "head" part iof the html... <iframe src=onlydate.php width=200 height=60 frameborder=0 scrolling=no></iframe>
I then saved the file as test.html
The file came with a php file and I uploaded that to my web shell in the CGI bin because my web site says I have to do that with active pages. So now I have a php file and the test.html file in the same cgi bin folder. When I open the html file it keeps asking me if I want to download the file.... I moved the Html file to another folder in my web shell outside of the cgi-bin but kept the php file there. Now when I open the html file it says file not found... Am I missing something really simple here?

Jona
11-17-2003, 07:36 PM
Put the IFrame code in the BODY of the HTML document, not the head.

[J]ona

Code One
11-18-2003, 12:25 AM
and it asked me to download the file too...I did pretty much what he did...put the php file in my cgi-bin and put a html file with the iframe code in the body of the doc, in my root dir. And nothing. What's going on here, anyone?

CO

Jona
11-18-2003, 12:28 AM
If your document ends in a .php extension, you don't need the IFrame:


<?php
include("onlydate.php");
?>


[J]ona