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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Capture field entry build URL

Status
Not open for further replies.

Webflex

Technical User
Apr 20, 2001
101
GB
Hi

I want to capture an entry in a form field and use it to build a URL as in

"formentry"

becomes
ideally I'd also like to capture and pass the password from another form field.

(this is for notes but the IBM help system is awful for finding anything)

Any help much appreciated.

TIA
 
<%
dim formentry
formentry = request.form(&quot;input from form&quot;)
%>
<a href=&quot; =formentry %>&quot;>click here</A>

the above will work. on the condition that....

a. you change &quot;input from form&quot; into the name of the form box that will contain the item you are opening..
b. the entered peramiters also include the extension of the file.. if not you can add the extension to the end of the url before the &quot; ie ( <% =formentry %>.txt&quot;)

hope that helps
 
Thanks, that's got me part of the way, code as below but does not pick up the username, I'm sure I've made an elementary error.

Code:
<%@LANGUAGE=&quot;VBSCRIPT&quot; CODEPAGE=&quot;1252&quot;%>
<%
dim username
username = request.form(&quot;username&quot;)
%>
<html>
<head>
<title>NotesMail Login</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>

<body>
<form name=&quot;username&quot;>
  <input  type=&quot;text&quot; name=&quot;username&quot;>
</form>

<a href=&quot;[URL unfurl="true"]http://uk01-s005/<%[/URL] =username %>.nsf&quot;>Click Here to Continue</a>

</body>
</html>
 
ok it wont.. due to the fact that it needs to be refreshed to send the data try the folowing

<%@LANGUAGE=&quot;VBSCRIPT&quot; CODEPAGE=&quot;1252&quot;%>
<%
dim username
username = request.form(&quot;username&quot;)
%>
<html>
<head>
<title>NotesMail Login</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>

<body>
<%
if username=&quot;&quot; then %>
<form name=&quot;username&quot; action=&quot;self.asp&quot;>
<input type=&quot;text&quot; name=&quot;username&quot;>
<input type=&quot;submit&quot; name=&quot;continue&quot; value=&quot;submit&quot;>
</form>
<%
else
response.redirect(&quot; & username & &quot;.nsf&quot;)
end if %>
</body>
</html>


i am only a learner myself. so if the above dont work try these alters

responce.redirect(&quot; & username & &quot;.nsf&quot;)
response.redirect &quot; & username & &quot;.nsf&quot;
responce.redirect &quot; & username & &quot;.nsf&quot;

one of them should work

hope that helps
 
shoot done it again... change the page self.asp to the page that the above script is on
 
Thanks but not getting anywhere, unless I take the ; out after &quot; the page will not compile with any option.

Code as currently running below

Code:
<%@LANGUAGE=&quot;VBSCRIPT&quot; CODEPAGE=&quot;1252&quot;%>
<%
dim username
username = request.form(&quot;username&quot;)
%>
<html>
<head>
<title>NotesMail Login</title>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=iso-8859-1&quot;>
</head>

<body>
<% 
if username=&quot;&quot; then 
%>
<form name=&quot;username&quot; action=&quot;noteslogin.asp&quot;>
  <input  type=&quot;text&quot; name=&quot;username&quot;>
 <input  type=&quot;submit&quot; name=&quot;continue&quot; value=&quot;submit&quot;>
</form>
<% 
else
response.redirect (&quot;[URL unfurl="true"]http://uk01-s005/&quot;[/URL] & username & &quot;.nsf&quot;)
end if 
%>
</body>
</html>

with input of joeuser in the form field outputs this in the browser address bar



Thanks for all the help so far, it may be tomorrow GMT before I get back here.
 
As you have not specified the post method of the form it looks like it is defualting to a 'Get', in which case in your asp you will have to write:

username = request.querystring(&quot;username&quot;)

I would also suggest not having the same name for the input field and the form and I would specify the method for the form.
 
Again many thanks for the above - I only know enough about this to be dangerous!!

Trying to use your method has ended up with me getting the errors below

Response object error 'ASP 0156 : 80004005'

Header Error

If you could be so kind as to copy and paste and annotate the code above this may (I say may) prevent me from breaking it yet again :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top