Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Embedding CGI Script into HTML

Posted on 2000-03-10
11
Medium Priority
?
401 Views
Last Modified: 2013-12-25
Hi

Not sure if this is the right place, but here goes.

I want to put a cgi script into my HTML code.  Is it possible to do this?  I know you can put a page in a page, but can you put a script in a page?

Regards

Peter Thomas
0
Comment
Question by:development
[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
  • 4
  • 3
  • 2
  • +2
11 Comments
 
LVL 9

Expert Comment

by:TTom
ID: 2608202
If you are wanting to do this simply to illustrate the code, I don't see any problem.  If the intent is to execute the code, I see many problems.

In the first place, you would be asking to execute the code at the client side.  That would be a major security issue.

If you want code on the client side to initiate server side events/scripts, you may be able to do this with some sort of remote scripting, but that would still be code executing at the server.

What is it that you intend with your inserted code?

Tom
0
 
LVL 1

Author Comment

by:development
ID: 2609920
Basically, I have a script which does a domain check, and returns the results.
0
 
LVL 84

Expert Comment

by:ozo
ID: 2609946
So do you want to put the results in your page?
0
Simplify Your Workload with One Tool

How do you combat today’s intelligent hacker while managing multiple domains and platforms? By simplifying your workload with one tool. With Lunarpages hosting through Plesk Onyx, you can:

Automate SSL generation and installation with two clicks
Experience total server control

 
LVL 1

Author Comment

by:development
ID: 2610042
for the page, so you can see what i am talking about, go to :

www.angelsolutions.net/cgi-bin/whois.cgi
0
 
LVL 1

Author Comment

by:development
ID: 2610957
I have given up trying to embed it.  Its been a long time (3 years) since I actually had to write the code myself, so bare with me.  I want to open a window, with no navigation, and minimise and maximise blanked out, and i want to set the dimensions myself.  How can I do this.  
0
 
LVL 9

Expert Comment

by:TTom
ID: 2612137
Part of what you wish to do is not very difficult.  Using the JavaScript "window.open()" method, you can open a new window with minimal tools and whatever dimensions you wish.

However, you will not be able to remove the minimize and maximize buttons (so far as I know).

The syntax for the method is:

myWin = window.open("filename","windowname",options)

where options is a comma delimited list, enclosed in quotes.  Options include toolbar, location, directories, status, menubar, scrollbars, resizable, width, height, top, and left.

HTH,

Tom
0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2613294
Or, why don'e you just write some HTML code into the CGI?  
0
 
LVL 1

Accepted Solution

by:
damianosky earned 150 total points
ID: 2623127
Basically, you cannot include cgi script in HTML because cgi are server side scripts, in Perl, PHP or C/C++. A client cannot interpret this languages, so it's not possible to achieve this.

If you want a domain checking and get the result, you can get this with a perl script which give you an output according to the situation you program it to. Simply open the windows like TTom has suggested you (for the option see a good book on Javascript because Netscape and Explorer have different features - see O'Reilly books on Amazon.com), and in the filename recall the cgi script.

In This script you will read the system variables for IP address and domain name and will act consequently, sending the appropriate html output to the windows in which you have recalled the script. I suggest you perl as scripting language (more diffuse and more simple than c/c++).

Alternative to cgi are ASP pages (they act similarly to CGI, but they use VBScript or Jscript on server side), but they are available only on Microsoft Web Servers (IIS and PWS); on UNIX you need third part libraries (not free) and you must have an administration account to install them.

On client side you can only use VBScript (but with limitation to Internet Explorer) or Javascript (with compatibility problems between different browsers), but obviously if you need good security level they are bad, because simply viewing source code any user can see you script code.

At last, on HTML pages you can optionally send SSI (Server Side Include) commands which can recall cgi scripts (like access counters). But to use SSI, you must have the server enabled to support them and the extension of the pages must be (in general) *.shtml (but it can be configurated differently)

The best solution is a mix of client and server code. Keep in mind that the best solution is to put security code on server side (remeber to disable directory browsing on the web you do) to hide your code to users, and use client scripts language only for less critical tasks (like validation of input data and managing of forms and windows).

Depending on the technology you use (WinNT or UNIX), use ASP or CGI to achieve your needs.

Good work.


0
 
LVL 18

Expert Comment

by:mgfranz
ID: 2628845
Thats an answer???  While it is all good info and generaly basic knowledge, where does it solve the problem?
0
 
LVL 9

Expert Comment

by:TTom
ID: 2628867
Well, the answer seems to be, "No, you can't do that".  If development is happy with the explanation (and it's a pretty good one), and doesn't want to go any further looking for a solution...

Perhaps we could solve the problem by other means, but I can live with it.

Tom
0
 
LVL 1

Author Comment

by:development
ID: 2629209
You can go on posting if you want.  I basically gave up, and took the explanation, than a solution.
0

Featured Post

Understanding Web Applications

Without even knowing it, most of us are using web applications on a daily basis. Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We often confuse these web applications tools for websites.  So, what is the difference?

Question has a verified solution.

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

Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
Although a lot of people devote their energy toward marketing for specific industries, there are some basic principles that can be applied to any sector imaginable. We’ll look at four steps to take and examine how those steps were put into action fo…
The viewer will get a basic understanding of what section 508 compliance can entail, learn about skip navigation links, alt text, transcripts, and font size controls.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

715 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