How to use PageWest's WebPage.cgi



What is WebPage.cgi about?

WebPage.cgi is a web-based (cgi) program you can use to send pages to Kentec/PageWest customer pagers. Using standard html form tags in a web page you can create a form to fill out a message to send to your pager.



Numeric vs. AlphaNumeric Pagers

WebPage.cgi can handle both Numeric and AlphaNumeric pagers, as long as it's given the appropriate type of input. There's no way for it to know what type of pager you have, so it would be wise to make a note on your web page to only use numbers if you have a Numeric pager. Sending text to a numeric pager will not produce an error, it will just result in "garage" (usually numbers) showing up on the pager display.



Basic Example

To use WebPage.cgi, it'd help to have a bit of familiarity with HTML (Hyper Text Markup Language), the formatting language web browsers know how to read. Here is a good place to learn (or if you don't enable javascript, try this Yahoo page on the topic), and here is a good reference html place. But even if you have no clue on using html, if you can figure out how to stuff a few html tags into your web page, it'll be pretty easy to use WebPage.

Here's an example of the most basic setup (though it's probably all that most people will ever need). Stick this somewhere in the body of your web page:

Send a message to my pager!  <br>

<form method="POST" action="http://www.pagewest.net/cgi-bin/WebPage.cgi">
<input type="hidden" name="function" value="send_page">
<input type="hidden" name="pagerid" value="5551234">
<textarea name="message" rows=5 cols=48></textarea>  <br>
<input type="submit" value="Send Page">
</form>

And here's what that would actually look like in your web browser:

Send a message to my pager!




Numeric Pager Example

And what about a numeric pager? Simply change the "textarea" to an "input" of type "text", like so:

Send a message to my pager!  <br>

<form method="POST" action="http://www.pagewest.net/cgi-bin/WebPage.cgi">
<input type="hidden" name="function" value="send_page">
<input type="hidden" name="pagerid" value="5551234">
<input type="text" name="message" size="12" maxlen="20">
<br>
(numbers only, hit Enter to send)
</form>

And here's what that looks like in your web browser:

Send a message to my pager!


(numbers only, hit Enter to send)



More Examples

Ok, so that's fine and dandy, and should be quite useful for most people. But there's more functionality you can use in WebPage.cgi if you want/need to.



Allow a User's Name

Now you definitely don't want to do this with a Numeric pager, but for AlphaNumeric folks it might be nice to have a place for the person paging you to enter their name (yes, sometimes they do forget). Simply add a form element called "name", and you'll get a nice little "From Joe: ..." at the beginning of your message. Example so:


Got an urgent message?  You can page me:

<form method="POST" action="http://www.pagewest.net/cgi-bin/WebPage.cgi">
<input type="hidden" name="function" value="send_page">
<input type="hidden" name="pagerid" value="5551234">

Your Name: 
<input type="text" name="name" size="20">  <br>

My Message:  <br>
<textarea name="message" rows=5 cols=48></textarea>  <br>
<input type="submit" value="Send It!">
</form>

And you'll end up with something that looks about like this:

Got an urgent message? You can page me:

Your Name:
My Message:



Limit Message Length

Many alphanumeric pagers only allow 130 characters per page, but the WebPage.cgi program will allow up to 250. If you want to specify a lower limit according to what your pager supports, you need an input form element named "limit". Eg.:

<input type="hidden" name="limit" value="130">



Multiple Pager Support

Most folks only carry one pager personally, so this feature probably won't make it on very many people's personal web pages. But say you're in an office with 10 people who you page regularly, and don't care to memorize all 10 pager numbers - you can make yourself a private web page (even store it on your local harddrive if you want) with saved "pointers" to everybody's pager numbers with an easy selection list, like so:


<center> <h2> My Pager Page </h2> </center>

<p>
<form method="POST" action="http://www.pagewest.net/cgi-bin/WebPage.cgi">
<input type="hidden" name="function" value="send_page">

To:
<select name="pagerid" size="1">
	<option value="5551230"> John Doe
	<option value="5551231"> Jane Doe
	<option value="5551232"> Jim Doe
	<option value="5551233"> Jerry Doe
	<option value="5551234"> Julie Doe
	<option value="5551235"> Jen Doe
	<option value="5551236"> Jesse Doe
	<option value="5551237"> Joel Doe
	<option value="5551238"> Josh Doe
	<option value="5551239"> Janet Doe
</select>

<br>

Name: 
<input type="text" name="name" size="20">  <br>

Message:  <br>
<textarea name="message" rows=5 cols=48></textarea>  <br>
<input type="submit" value="Send Message">
<input type="reset" value="Reset/Clear">
</form>

Now in your web browser, that's going to look just about like so:

My Pager Page

To:
Name:
Message:



Debug Info

I'm sure this feature has come in more handy for me as I've written/modified various cgi scripts, but perhaps you might at some time have a need for it too, so I'll document it. Basically this tag simply tells WebPage.cgi to dump all the names/values of the html form elements it ended up with. It is a simple:

<input type="hidden" name="debug" value="1">

and won't do very much until you actually submit the form to the web server. If you're just dying to see what it looks like, type something:




HTML Form Element Names/Meanings

WebPage.cgi is of course a cgi program, and like all cgi programs, it's input comes primarily from form elements on a web page. There are different types of form elements, which basically give you different interaction with the user of your web page on how to get the input you want, but all that's really important is that certain elements are assigned the right "name" attribute, and I suppose that the corresponding "value" is correct/usable/etc. If none of this makes sense, you should go read up on HTML, or use the examples above to get you by.

Of course you need to start the form off with a <form> tag pointing to the URL of WebPage.cgi, and probably a method attribute, like so:

<form method="POST" action="http://www.pagewest.net/cgi-bin/WebPage.cgi">

Required Elements

There are 3 required elements:

function
Set this to "send_page".
pagerid
This is the pager number you want the message sent to.
message
This is the text of the message. For numeric pagers, this should be be all digits (though you'd have to use javascript (or maybe java) to actually check that no letters, etc. have been entered).

Ok, so why even have the "function" element if it can only have one value? Simple - it's used by "reentrant" calls to the cgi program to tell it what function it's performing. (ie. the program uses it) Probably setting this in a type "hidden" input tag is easiest.

The "pagerid" will normally be set to your pager number, because it's your web page people are visiting, and your pager you want their message to go to. Another hidden input tag works well here, too, unless you're doing something like the Multiple Pagers example above.

Additional Input

There are 2 more tags that provide info to control the behavior of WebPage.cgi:

name
The name of the sender
limit
The number of characters allowed per message

The name field will be added to the beginning of the page as "From Joe Blow: " if "Joe Blow" is entered. Generally a text input field is appropriate, though you can be creative with it (eg. use javascript to stuff in the user's email address automatically). Don't use this element for numeric pagers.

"limit" is the number of characters allowed to be sent to your pager. There is an upper limit of 250, but many alphanumeric pagers only hold 130, so you may want to use this. (Another way to limit the size is with a text input element, setting the "maxlength" attribute to the size of message allowed.) Note: if you use the "name" element (immediately above), the value entered there + 7 is included as part of the message and it's allowed length. Eg. "From John: " would take up 11 characters out of the limit you specify.

Homepage Theme Intigration

If you've tried any of the examples above, you'll see that the WebPage.cgi program spits out a pretty generic looking result screen, telling you that either the page was sent, or it gives you an error explaining why it was not. That's certainly functional, and probably enough for most people/cases, however if you want a "prettier" display screen that looks somewhat like your web page, there are a few form elements you can use to do so.

bgcolor
Sets "bgcolor" attribute in the <body> tag.
background
Sets "background" attribute in the <body> tag.
text
Sets "text" attribute in the <body> tag.
link
Sets "link" attribute in the <body> tag.
vlink
Sets "vlink" attribute in the <body> tag.
alink
Sets "alink" attribute in the <body> tag.

Example: Here's a form that will submit an incomplete request to WebPage.cgi, and hence produce an error message.

And Here's a form that will generate the same error, but follows the "theme" of this web page:

And here's the html used for that form:


<form method="POST" action="http://www.pagewest.net/cgi-bin/WebPage.cgi">
  <input type="hidden" name="function" value="send_page">

  <input type="hidden" name="bgcolor" value="#ffffff">
  <input type="hidden" name="background" value="http://www.kci.net/~jesse/bg.jpg">
  <input type="hidden" name="text" value="#034059">
  <input type="hidden" name="link" value="#040769">
  <input type="hidden" name="vlink" value="#ee8e05">
  <input type="hidden" name="alink" value="#9a5c03">

  <input type="submit" value="Click Here for Error Message">
</form>

Redirection

redir
URL to redirect user to once form is submitted.

This probably won't be used much, but if you wish to redirect a user to another URL once they submitt the form (ie. send you a page), you can use this element. Make sure the value is a full URL, and not a relative pathname, as browsers tend to choke when they see a Location: header and what follows isn't a URL. Eg:

<input type="hidden" name="redir" value="http://www.somewhere.com/foo/">

Debug

debug
Prints the value of form variables as WebPage.cgi receives them.

You probably won't need this unless you're using funky characters in your form attributes and they're not turning out right and you choose to be lazy in figuring out what they're turning into.



Help

Things should be fairly straight-forward for using this. Pretty much you just need to figure out how to stuff a little html code into your web page (which probably depends on what program you use to create your page), then just copy and paste some of the examples above and make the changes you need/want (hint: changing the "pagerid" field to your pager number helps quite a lot). Most of the forms on this page are fully functional, and you can see another working example at PageWest's WebSite.

If you're really stuck and need a hand, try emailing our webmaster(s) (webmaster@kci.net), they're pretty good with this stuff.