PDA

View Full Version : Perl & SSI together?


BusterLee
10-25-2002, 01:45 AM
I want to put a form on a member only page.

At present there is an SSI comand that shows the username on screen in strategic places within the section.

Can the SSI be used to complete part of a form.

In English, what I want to do is include the members name automatically in the form. All the visitor has to do then is add comments only and does not need to identify themselves as the member name will automatically be included in the form>email

It sounds easy so must be possible somehow... must it?

res
10-25-2002, 01:37 PM
Hi,

Inside your form where you have got the inputbox for the username, you could try something like this :

<!--#if expr="!${REMOTE_USER}"-->
<input name="name" />
<!--#else -->
<input name="name" value="<!--#echo var="REMOTE_USER" -->" />
<!--#endif -->

This will display the REMOTE_USER name in the input box, or an empty box if there is no current user. If a valid username is always required to access the page, simply get rid of the 'if expr' statement.

If this does not work, or is not compatible with your system, you could investigate using cookies/javascript to autofill your form.

Cheers,

Richard Sherwood :)

BusterLee
10-25-2002, 06:06 PM
bingo.....

Just what I wanted thank you everso res!!!!