...

View Full Version : Update section of page



ismilelots
01-10-2006, 11:24 PM
Is there a way i can have a section of a web page updated by someone else without giveing them access to the whole page?

I want the pastor to be able to put up a daily message in a box on the index page of the church's website but without giving him access to the site to update.

Is there an easy way for him to do this?

Thanks for the help.

mlseim
01-10-2006, 11:40 PM
If your webhost allows SSI (Server Side Includes), that would be
the easiest way. A special command line in your HTML gets replaced
with whatever is in a text file (which would be your message).
The extension on your web page would need to be changed to ".shtml"

An alternative would be to use PHP scripting. Same idea as SSI, but
the message is inserted with a PHP script.
The extension on your web page would need to be changed to ".php"

Find out if your webhost allows SSI, and let us know.

zro@rtv
01-11-2006, 04:07 AM
if your host has php you could use some tiny cms blog thing
http://cutephp.com/
or
http://www.mylittlehomepage.net/my_little_weblog

helps if people arent too comp savvy

ismilelots
01-11-2006, 11:29 AM
mlseim: My provider has not responded to me about the SSI so I still don't know.

zro@rtv: I know they do not support PHP (it's on a MS server). Can this PHP be hosted somewhere else and the info be displayed on my page?

zro@rtv
01-12-2006, 08:03 AM
well figure out if they support any serverside action, as thatd be the best deal.

At the VERY worst you could host something somewhere else, and use an iframe to display thre content.... but thats pretty sloppy.

ismilelots
01-12-2006, 11:52 AM
My hosting company just got back to me. Sorry for the delay.
They do allow SSI.
So what's next?

And thanks again for the assist

mlseim
01-12-2006, 07:16 PM
OK,

The first thing to do is test it out ...

Create a text file using Notepad ...
Type your message, then save it as a file called: text1.txt

Upload that file into the directory where your web page is located.

Now, open up your web page and insert this line where you want
your message to appear: <!--#include virtual="text1.txt"-->

Now ... and this is important ... change the extension of your web page
to .shtml

Example: it's now called "index.html" change it to "index.shtml"

(Any other pages that reference your .shtml web page should be edited
to point to the new filename.)

Display your web page and see if the message in "text1.txt" now shows
up in the same place as your #include virtual line.

That's what SSI does, it swaps the #include line with whatever is in
the file you specify. You can see how powerful this can be. Your
#include file can be anything, text, images, HTML.

If this all works, let us know.

ismilelots
01-13-2006, 01:42 AM
The SSI worked as promised. Thanks alot.

Now is there a way I can get it so that text file can be uploaded or edited by someone without giving them access to the whole site or the shtml page it's in?

What i'm hoping for here is for him to be able to write the text1.txt and put it on the site from his home.

Any suggestions/ideas?

mlseim
01-13-2006, 01:54 PM
Uploading the file from a web page using a password is where server-side
languages come in. You mentioned that you can't use PHP ... but I am
questioning that.

Copy the code below into a text file (using Notepad).
Save it as a file called "test.php".
Upload the file into your main directory.
Try viewing it and see what happens.


<?
#test.php
echo "This is a test <br>";
echo "If you can see this, it's working. <br>";
?>

Let us know the results.

ismilelots
01-13-2006, 10:00 PM
I put the test.php file on the server just like the .txt file.
I entered the address to it in the address bar (I assume you meant that when you said to view it) and it came back "page not found"

mlseim
01-14-2006, 02:25 AM
darn ...

Server side scripting is the only way to upload from
a regular web page ...

There is one other thought ... and that's using FTP.

Someone else can't use PHP or Perl to upload to your
webhost ... but they can use FTP.

So, someone that uses PHP can load a script like this:
http://www.zend.com/codex.php?id=527&single=1

You would have to give them your Host/User/Password
to put in their script. So, it should be someone you know.

Your Pastor would go to the other guy's site and access
a webpage he/she set-up. Pick the text file from his
PC and enter a password. The PHP script uses FTP to
access your webhost and upload the text file.

That's the only solution I can come up with.

I am curious myself ... so I might experiment with the link
I gave you and see how well it works.

Good Luck.

ismilelots
01-16-2006, 06:56 PM
Is it possible to use the SSI "<!--#include virtual="text1.txt"-->" to display another webpage in my page?

I was thinking of setting up a site for him to have access to and using FrontPage to edit his part (since you can set FP to open a specific file every time) then publish it and it would be displayed in my page.

This would allow him to update without giveing access to the entire site.

Thoughts?

mlseim
01-16-2006, 07:44 PM
Sure,

You just add the path to the #include ...
<!--#include virtual="./messages/text1.txt"-->

Now the #include is a direct swap of whatever text is in the
file with the <#include> line ... so if the other file happens
to be a webpage with HTML, you can see what problems
you might have.

So, you could use an inline frame to display the other webpage
inside your current page.


<html>
<head><title>my main page</title></head>
<body>
This is my main page .... blah blah

<iframe name='FRAME1' src='./messages/pastor_page.html' frameborder='0' scrolling='yes' width='500' height='600'></iframe>

Back to my main page ... blah blah
</body>
</html>

Your Pastor does whatever he wants with FrontPage and his HTML page
goes into a sub-directory called "messages". You just pull the whole
HTML webpage out and display it in an inline frame on your main page.

I know, it gets confusing when you have to work around things ...:confused:

ismilelots
01-16-2006, 10:19 PM
I think I kinda understand that. I'm going to give it a try. I'm also going to beg the host to support PHP there so I can do some of the other fancy stuff mentioned. It sounds cleaner.

mlseim
01-18-2006, 03:10 AM
I can't believe your webhost doesn't support PHP!

Especially if they support SSI.

That seems really strange.

You could switch to another webhost.
Here's one that's only $24.95/year and supports everything,
including a MySQL database.
http://www.cleverdot.com

ismilelots
01-24-2006, 12:52 AM
I know. But the PHP sample thing didn't work. So it must not. I know it's hosted on MS servers, so that might have something to do with it

mark87
01-24-2006, 01:24 AM
PHP runs under Windows fine.

ismilelots
01-25-2006, 02:05 AM
How can i test my site for PHP compliance? I tried putting the php listed here before on the site and tried to open it by entering the address to it in IE's address bar. Nothing happened.
:confused:

mark87
01-25-2006, 02:10 AM
I was merely pointing out the fact PHP can run under Windows so it's not that you're hosted under Windows that's the problem.

Try placing the following in a .php file and then viewing.

<?php
phpinfo();
?>

If you get a list of info, they have PHP installed. If it spits it back out or you see nothing, they don't.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum