Solved

Requesting HTTP_HOST and putting result in a text box

Posted on 2004-10-05
4
163 Views
Last Modified: 2006-11-17

  Hi all,

  I am starting in Perl. Actually I programming only ASP.

  I have been problems trying to get the URL typed in browser and pass the results to an Text Box.

  Example:

  1. A user request the URL  webmail.mycompany.com
  2. He is redirect to the entrance of webmail
  3. The webmail has 2 text box, one for user (user input) and other to Domain.
  --> Then, I'd like to get URL and pass to the Domain Text Box (mycompany.com).... then, the user need only to type your name and password.

  Sorry for this dumb question, it is very easy in Asp, but in Perl I am only starting.
0
Comment
Question by:ipsystems
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 48

Expert Comment

by:Tintin
ID: 12233690
I'm finding it hard to understand your question.

Are you saying that you want to take the two inputs from an HTML form (username and domain) and "pass" then to a domain controller?  If so, what protocol are you talking to the DC on?
0
 

Author Comment

by:ipsystems
ID: 12233728

Sorry, I will explaing better.

The webmail page has a form with 3 text box (Username, password and domain)

The user needs to fill like this:

User:  mymail
Domain:  experts.com
Password:  *****
and click OK

All users has different domains  ex1.com ex2.com tttt.com etc... then...to acess webmail it acessa throught url  http://webmail.ex2.com for exemple.

I'd like to get the digited URL, in this case EX2.COM.BR and pass this parameter to the text box DOMAIN, then, the users will fill only username and password.

In ASP we use request.servervariables("HTTP_HOST")...but in Perl I don't know how...
0
 
LVL 48

Accepted Solution

by:
Tintin earned 500 total points
ID: 12235080
The Perl equivalent of your ASP code is

$host = $ENV{'HTTP_HOST'};

You will need to ensure that the webmail page is generated via a Perl CGI script, so it can fill in the domain, eg:

print "Content-Type: text/html\n\n";
$host = ENV{'HTTP_HOST'};

print <<EOF;
<html>
...
<form action=/cgi-bin/script.cgi method=post>
User: <input type=text name=user><br>
Domain: <input type=text name=domain value=$host><br>
Password: <input name= passwd type=password><br>
</form>
..
EOF
0
 

Author Comment

by:ipsystems
ID: 12237479

   Thanks!!!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

738 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question