Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Dynamic Content 1

Status
Not open for further replies.

kylebellamy

Programmer
Jan 24, 2002
398
US
I'm making a website for my old grade school as a favor and a tax write off. lol One of the things they wanted was an alert box on the side that would have delay information and such in case of snow, floods, that sort of thing.

So what I was wondering was how do I go about setting up a page that has a number of selections such as a snowflak image and a little text box they can type in that will then re-write the alert page. The page will display in a little iframe, by the way.

Thanks all.

 
Are you using any kind of server side language, like Coldfusion, ASP, PHP, etc.? If you are then what you can do is have an admin section that gives permission to ceratin staff members to enter in the "Delay Info" and once they hit update it loads onto the main page, in that iFrame.

If not, I think you can use JS to acheive the same effect, but might have some uncertain resolutions depecing on browser and whatnot.

If you can i'd stick to the server-side technique because this way you can log all the "delay Info" in a table along with who made that request, when and why.

[sub]
____________________________________
Just Imagine.
[sub]
 
My reasoning is this: The users of this have no tech savy so the more automated I can make it the better. I've set up a small for that I'll pasword access to.

I've seen some CGI stuff listed but I don't know where to begin.

 
Well, let's begin from the top then, ok??

First off, can you post the link to the site so we can take a look and see what the setup is so far??

Next, how did you design the site so far?? In only HTML?? Or some type of server side langauage also?? If you used some SS language then which one??

Your users do not have to be tech-savy to make updates (that is why they have you, :)) All your users need is access to the right pages (well, that and a PC with net connection)...

If you're using only HTML, then you'll have use JavaScript to accomplish the same effect.

Let me see if I can write a quick code so you can look at.

[sub]
____________________________________
Just Imagine.
[sub]
 
Hey, I wrote a small code that might do what you want, but let me test it some more. Will post in a day or so, ok?

[sub]
____________________________________
Just Imagine.
[sub]
 
GUJU,
find out what the server supports first, no point in wasting time using CGI if it supports an easier language like PHP, ASP or the like. Or write it in CF and not have it supported, which is a good posibility. Not to offend kylebellamy but since he's asking for help it'll probably be greek to him anyway, pearl isn't exactly for scripting beginners.

kylebellamy,
What you're looking at here is a content management system, one of the most common uses for server side scripting. In order to make this you're going to need a few server side scripts, a database or text file to save the content (preferably a Database). You'll also need to know a little SQL to write the info to the DB.


Step 1) find out what languages your server supports. If PHP and ASP i'd pick one of those (unless it supports coldFusion that is a very simple lanugage that is easy to learn and very powerfull even for beginners). If php is available and CF is not i'd go with that. ASP is pretty easy but with .net out there, there is a good chance good'ol asp will be a dinasour like CGI soon (my theory only no microsoft documentation to support that).

step 2) find out what databases you can use on the server. If php is installed chances are so is mySql.

step 3) buy a book about the language you're going to use. begin teaching yourself.

step 4) once you're in the thick of it post any questions in the forum for that language.

once you learn some server programming you'll never turn back. your webpages will be 100 times more powerful. I build a content management system in all the sites i sell so the customer has some control over the site. (and they call me less for changes) :)


A common mistake that people make when trying to design something completely foolproof is to underestimate the ingenuity of complete fools.
-Douglas Adams (1952-2001)
 
bombboy, that was my original post to kylebellamy...I wanted to know if his/her hosting supported any kind of server side langauge, and if so what kind. Doing this in CF is a piece of cake, but since kylebellamy said that its mostly HTML I just assumed his/her site doesn't have any server-side language...

As far as the code I was mentioning, its going to be in JS. The basic logi i'm going for is this:
1) The admin makes comments on page1, then hits submit
2) The comments from page1 gets sent to page2
3) Page2 is what gets loaded into the iFrame

Theoritcally this will work, but since I originally responded to this thread from work I started the code there and left it on work PC, so have to wait to till Monday when I get back in the office...

Again, if kylebellamy says his/her host has some kinda server side language support then it'd be easier...

I also mentioned that its a good idea to have a backlog of these comments being made for archive purposes, this way if a comment is made in liue or in mistake then they have a record of when it was made, and by whom...I have always believed in the CYA theory (Cover Your A$$), LOL

[sub]
____________________________________
Just Imagine.
[sub]
 
That's the difficult part of it. My server has PHP capability but the server this is going on may not. I sent an email to the "admin" but he has not responded as of yet. I get the feeling that he's miffed that I'm doing this project but his design was awful so...

I like the idea of the JS if it is possible.

What I do know about the server is that it is running on BASH flavor and does have CGI but since the "admin" set up the whole thing I don't trust it to work properly.

Anyway, thanks so much for the larger response. I do appreciate you two helping me out here.

 
Hi, I used the code from here as a guideline:
But see if this works from you:
Code:
[COLOR=red]PAGE1[/color]

<html>
<head>
</head>

<BODY>
<center>
<form method="get" action="to.html">
<table>
<tr>
  <td>First Name:</td>
  <td><input type="text" name="firstname" size="10"></td>
</tr>
<tr>
  <td>Last Name:</td>
  <td><input type="text" name="lastname" size="10"></td>
</tr>
<tr>
  <td>Age:</td>
  <td><input type="text" name="age" size="2"></td>
</tr>
<tr>
  <td colspan=2><input type="submit" value="Submit!"></td>
</tr>
</table>
</form>
</center>
</body>
</html>

===========================================
[COLOR=red]PAGE2[/color]

<html>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
  
  function getParams() {
    var idx = document.URL.indexOf('?');
	var params = new Array();
	  if (idx != -1) {
	    var pairs = document.URL.substring(idx+1,document.URL.length).split('&');
		  for (var i=0; i<pairs.length; i++) {
			nameVal = pairs[i].split('=');
			params[nameVal[0]] = nameVal[1];
          }
      }
	return params;
  }
  params = getParams();
</script>
</HEAD>

<BODY>
<SCRIPT LANGUAGE="JavaScript">
  firstname = unescape(params["firstname"]);
  lastname = unescape(params["lastname"]);
  age = unescape(params["age"]);
			
  document.write("firstname = " + firstname + "<br>");
  document.write("lastname = " + lastname + "<br>");
  document.write("age = " + age + "<br>");
</script>
</body>
</html>

[sub]
____________________________________
Just Imagine.
[sub]
 
I have found a pretty useful tool for allowing non-technical web owners to update site info. It's called Page Publisher and can be found at
It's $99 and is pretty easy to install and use. I just got it and have so far installed it with no problem and tested it to make sure it works- and it does.

FYI, I came across this product randomly and have no connection to the company in case anyone is wondering if I'm pushing my own product. I have one criticism, in fact, and that is that you have to technically buy a $99 license for each website you use Page Publisher for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top