View Single Post
Old 09-02-2005   #1
sarettah
Stay Out Of The Box
Want to see your own Advertising Here!
 
sarettah's Avatar
 
Join Date: Oct 2002
Location: Lost in the ozone
Posts: 10,318
Default Group project Step 3 - putting it into a web page

Ok, so by now, we should be all set up on remotethumbs. We should have generated a template file, so we should have a file available for testing up on our server (remotethumbs put it there when we generated). So, now we can start to build a page or two.

We can pull in the remote thumbs generated table several ways:

1. we can use a server side include (ssi) call to pull in the file.
2. we can use a php include call to pull in the file.
3. we can write a custom routine to pull in the file.

(not to insinuate that there are not other methods)

I will go through all 3 of these different ways to do this.

No matter how we are going to do it, we need a page to pull the file in to.

For right now, so that we can get an idea of what is going on, we will do this inside a very simple html page. The bare minimum.

To write html, we need an editor of some sort and that editor needs to be capable of producing a pure ascii text file. You could also use a generator (frontpage, dreamweaver, coffee cup visual site, etc) or similar program that can export html (word, etc) but for right now, it is best to stick with just a simple editor.

Notepad works fine for this, but there are also plenty of good editors around that won't jumble up your code on you. My current favorite is pspad http://www.pspad.com/ . I like it because, first of all, it has editing capabilities for all sorts of files built in. 2. It does a certain amount of syntax checking, 3. It has a lot of great built in functions (search and replace across entire fioles) and 4. Becauswe it has a great little tool to expand or compress html code, this feature alone is worth the price !!! (free btw..lol)

Open an editor and get to a new blank file.

Code the structure for a BASIC html page (just the minimum required).









and save the file as "ssi_include.shtml'

Now, hit "save as" from the file menu and save the file a second time as "php_include.php"

Now, hit "save as" from the file menu and save the file a third time as "php_parse.php"

We now have 3 test files created to work with so we can see how all this stuff works.

Open the ss1_include.shtml file

in between the body tags:



where tour_template_folder is the template folder you created on your server and your_template_filename is the name of the file you told your template in RT to create.

save this file.


Open the php_include.php file

in between the body tags:



where tour_template_folder is the template folder you created on your server and your_template_filename is the name of the file you told your template in RT to create.

save this file.


Open the php_parse.php file

in between the body tags:


$filename = "your_template_folder/your_template_filename";

if (file_exists($filename)) {
$fd = fopen ($filename, "r");
while (!feof ($fd)) {
$buffer = fgets($fd);
echo $buffer;
}
fclose ($fd);
}
else
{
echo "Could not find " . $filename;
}


?>

where tour_template_folder is the template folder you created on your server and your_template_filename is the name of the file you told your template in RT to create.

save this file.


Now we need to put these files on the server and check some things out.

We need to know whether SSI is enabled on our server and whether php is running on our server. We will test these files and possibly get our information from the test. If we can't determine it by the test, then we need to go back to our hosts and find out what we need to do.

Put the files on the server, oppen a browser and type in the address for the ssi_include file. ie: http://www.yourdomain.com/ssi_include.shtml

If ssi is enabled on your server and if your host designates that .shtml files are ssi enabled files then we should see the table that remotethumbs produced for us. If we do not see the table, then either ssi is not enabled or .shtml is not the extension that your host designated for ssi enabled files.

Now try the php include the same way. ie: http://www.yourdomain.com/php_include.php

If you do not see your table and do not see an error message then either php is not turned on on your server or your host expects some other extension other than .php for php files.

Now try the php parse the same way. ie: http://www.yourdomain.com/php_parse.php

And again, you should see your table or a message indicating that the file could not be found.

If either the ssi or php versions produced nothing (no output, no errors) then you need to go visit with your host (or your host's faq/tech support section) and determine what you have to do to run an ssi file or a php file on your server.

Working examples:

http://www.sexeducatoon.com/ssi_include.shtml
http://www.sexeducatoon.com/php_include.php
http://www.sexeducatoon.com/php_parse.php


To be continued
__________________


Free Adult Webcams
sarettah is offline   Reply With Quote