# Directly accessing cgi link



## Damonc (May 9, 2001)

Hi,
This isn't exactly a web-development question - its more about creating a direct link to a cgi script..

At work we've got an Epson projector with a web interface, which includes the ability to power the unit on. The 'Web remote' page address is: http://192.168.0.14/cgi-bin/webconf.exe?page=13 from what I can see i'd need to access /cgi-bin/directsent?KEY=3B to trigger the unit to power on.. but I'm not sure how as I've never done anything with cgi scripts.

The goal is to be able to start the projector up using a wget script in a PHP page hosted on an internal server so that someone could power up the projector from their browser, without needing the username/password for the web interface or the physical remote control. I've included the source code of the "web remote" page below. 

```
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv="pragma" content="no-cache" />
<META http-equiv="Cache-Control" content="no-cache,no-store" />
<META HTTP-EQUIV="Expires" CONTENT="0" />
<META HTTP-EQUIV="MSThemeCompatible" Content="Yes" />
<META http-equiv="content-type" content="text/html; charset=UTF-8" />
<META http-equiv="Content-Script-Type" content="text/javascript" />
<META http-equiv="Content-Style-Type" content="text/css" />
<title>&#65;&#82;&#77;&#80;&#82;&#79;&#48;&#49; Web Remote</title>
<link rel=stylesheet type="text/css" href="/rsrc/templ.css" />
<link rel=stylesheet type="text/css" href="/rsrc/remote.css" />
<style type="text/css">
<!--
.button {
cursor: pointer;
position: relative;
margin: 0px;
padding: 0px;
overflow: hidden;
background-repeat: no-repeat;
background-position: 0px 0px;
width: 48px;
height: 48px;
}
-->
</style>
<script type="text/javascript" src="/rsrc/common.js"></script>
<meta name="viewport" content="width=255" />
</HEAD>

<body  bgcolor="black" leftmargin=0 rightmargin=0 bottommargin=0 marginwidth=0 topmargin=0 marginheight=0 text="white" link="white" vlink="white" oncontextmenu="return false"
 onLoad="hidescroll();refreshTitle();">
<table border="0" cellpadding="0" cellspacing="0" width="255" height="390" valign="top" align="left">

<tr>
<td><img src="/img/blank.gif" height="15" width="1" border="0" /></td>
</tr>

<tr>
<td valign="top" align="center">
<table border="0" cellpadding="0" cellspacing="0" width="230">
<td width="55" valign="top" align="center">
<font size="2">Power</font>
</td>

<td width="55"></td>
<td width="55"></td>

<td width="55" valign="top" align="center">
<font size="2">Search</font>
</td>
</table>
</td>
</tr>

<tr>
<td valign="top" align="center">
<table border="0" cellpadding="0" cellspacing="0" width="230" align="center">
<td width="57" height="50" valign="top" align="center">
<input type="image" src="/img/blank.gif" tabindex="1"
 class="button" title="Power" id="power"
 onclick="SelectedImage2('/cgi-bin/directsend?KEY=3B',id,-50);return false;" />
</td>

<td width="57" valign="top" align="center">
<img src="/img/blank.gif" height="1" width="57" border="0" />
</td>

<td width="57" valign="top" align="center">
<img src="/img/blank.gif" height="1" width="57" border="0" />
</td>

<td width="57" valign="top" align="center">
<input type="image" src="/img/blank.gif" tabindex="4"
 class="button" title="Source Search" id="search"
 onclick="SelectedImage2('/cgi-bin/directsend?KEY=67',id,-50);return false;" />
</td>
</table>
</td>
</tr>

<tr>
<td valign="top" align="center" height="1">
<hr width="90%" color="#a9a9a9" size="1">
</td>
</tr>

<tr>
<td valign="top" align="center">
<table border="0" cellpadding="0" cellspacing="0" width="230">
<td width="5">&nbsp;</td>
<td valign="buttom" align="left">
<font size="2">Source</font>
</td>
</table>
</td>
</tr>

<tr>
<td valign="top" align="center">
<table border="0" cellpadding="0" cellspacing="0" width="230" align="center">
<td width="55" valign="top" align="center">
<input type="image" src="/img/blank.gif" tabindex="5"
 class="button" title="Computer" id="pc"
 onclick="SelectedImage2('/cgi-bin/directsend?KEY=43',id,-50);return false;" />
</td>

<td width="55" height="48" valign="top" align="center">
<input type="image" src="/img/blank.gif" tabindex="6"
 class="button" title="Video" id="video"
 onclick="SelectedImage2('/cgi-bin/directsend?KEY=46',id,-50);return false;" />
</td>

<td width="55" valign="top" align="center">
<input type="image" src="/img/blank.gif" tabindex="7"
 class="button" title="USB" id="usb"
 onclick="SelectedImage2('/cgi-bin/directsend?KEY=85',id,-50);return false;" />
</td>

<td width="55" valign="top" align="center">

<input type="image" src="/img/blank.gif" tabindex="8"
 class="button" title="LAN" id="lan"
 onclick="SelectedImage2('/cgi-bin/directsend?KEY=8A',id,-50);return false;" />

</td>
</table>
</td>
</tr>

<tr>
<td valign="top" align="center" height="1">
<hr width="90%" color="#a9a9a9" size="1">
</td>
</tr>

<tr>
<td valign="top" align="center">
<table border="0" cellpadding="0" cellspacing="0" width="230">
<td width="5">&nbsp;</td>
<td valign="buttom" align="left">
<font size="2">Operation</font>
</td>
</table>
</td>
</tr>

<tr>
<td valign="top" align="center">
<table border="0" cellpadding="0" cellspacing="0" width="230" height="110">
<tr>
<td valign="top" align="center">
<table border="0" cellpadding="0" cellspacing="0" width="230" height="50">
<td width="55" valign="top" align="center">
<input type="image" src="/img/blank.gif" tabindex="21"
 class="button" title="A/V Mute" id="mute"
 onclick="SelectedImage2('/cgi-bin/directsend?KEY=3E',id,-50);return false;" />
</td>

<td width="55" valign="top" align="center">
<input type="image" src="/img/blank.gif" tabindex="22"
 class="button" title="Freeze" id="freeze"
 onclick="SelectedImage2('/cgi-bin/directsend?KEY=47',id,-50);return false;" />
</td>

<td width="55" valign="top" align="center">
<input type="image" src="/img/blank.gif" tabindex="23"
 class="button" title="Volume-" id="vol-down"
 onclick="SelectedImage2('/cgi-bin/directsend?KEY=57',id,-50);return false;" />
</td>

<td width="55" valign="top" align="center">
<input type="image" src="/img/blank.gif" tabindex="24"
 class="button" title="Volume+" id="vol-up"
 onclick="SelectedImage2('/cgi-bin/directsend?KEY=56',id,-50);return false;" />
</td>
</table>
</td>
</tr>

<tr>
<td valign="top" align="center">
<table border="0" cellpadding="0" cellspacing="0" width="230" height="50">
<td width="55" valign="top" align="center">
<input type="image" src="/img/blank.gif" tabindex="25"
 class="button" title="Page Up" id="page-up"
 onclick="SelectedImage2('/cgi-bin/directsend?KEY=68',id,-50);return false;" />
</td>

<td width="55" valign="top" align="center">
<input type="image" src="/img/blank.gif" tabindex="26"
 class="button" title="Page Down" id="page-down"
 onclick="SelectedImage2('/cgi-bin/directsend?KEY=69',id,-50);return false;" />
</td>

<td width="55" valign="top" align="center">

<img src="/img/blank.gif" height="1" width="48" border="0" />

</td>

<td width="55" valign="top" align="center">
<img src="/img/blank.gif" height="1" width="48" border="0" />
</td>
</table>
</td>
</tr>
</table>
</td>
</tr>


</table>
</body>
<head>
<script type="text/javascript" src="/rsrc/jquery-1.7.2.min.js"></script>
</head>
</HTML>

<script>
reconfigViewport();

function hidescroll(){
	document.body.style.overflow="hidden";
  try{
	if(navigator.userAgent){
	  if(navigator.userAgent.match(/iPod/)){
	    window.scrollTo(0,0);
	  }else if(navigator.userAgent.match(/iPhone/)){
	    setTimeout(function(){window.scrollTo(0,1)},100);
	  }
	}
  }catch(e){
  }
}

function refreshTitle(){
	var name="ARMPRO01 Web Remote";
	window.top.document.title=name;
}
</script>
```


----------



## JiminSA (Dec 15, 2011)

Historically the CGI bin was introduced to enable executable or script code (binaries, shell scripts, etc.) to be executed. Nowadays these scripts can be held and executed anywhere, just like a normal link. There is no special procedure to follow.


----------

