S
Simulacrom1
Hi!
I am having a very strange problem. The code listed below works fine
with one exception - it returns a blank. The JavaScript code tells it
to set the value to "loginContractor" and when I step through the
JavaScript it does just that. But when the PHP program sees the
incoming information - it sees it as a blank. So I'm asking here first
to see if anyone has any ideas on the JavaScript side. If not, I'll try
the PHP side of things.
Thanks in advance for any ideas/help you may be able to give.
Mark
Webpage source code to follow:
<!-- The Command = -->
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html lang='en'>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Mark's PHP Classes v1.0">
<meta name="Copyright" Content="Copyright (c) 2008. All rights reserved.">
<meta name="Author" content="Mark Manning">
<script language="JavaScript">
////////////////////////////////////////////////////////////////////////////////
// Set global browser boolean flags
// Originally taken from Danny Goodman's JavaScript Bible.
////////////////////////////////////////////////////////////////////////////////
var isIE = document.all;
var isIE7 = isIE && window.XMLHttpRequest &&
window.ActiveXObject;
var isIE6 = isIE && document.implementation;
var isgteIE6 = isIE7 || isIE6;
var isIE5 = isIE && window.print && !isgteIE6;
var isIEDOM2 = isIE5 || isgteIE6;
var isIE4 = isIE && !isIEDOM2 &&
navigator.cookieEnabled;
var isIE3 = isIE && !isIE4 && !isIEDOM2;
var isNS = navigator.mimeTypes && !isIE;
var isNS3 = isNS && !navigator.language;
var isNS4 = document.layers;
var isNS6 = document.getElementById && !isIE;
var isNS7 = isNS6;
var isNS71 = document.designMode;
var isNSDOM2 = isNS6;
var isDOM2 = isIEDOM2 || isNSDOM2;
////////////////////////////////////////////////////////////////////////////////
// doesExist. A function to detect whether something exists or not.
// Copyright (c) 2009. All rights reserved.
////////////////////////////////////////////////////////////////////////////////
function doesExist(e)
{
if( (typeof(e) == "undefined") || (e == "") || (e == null) ){
return false;
}
return true;
}
////////////////////////////////////////////////////////////////////////////////
// Simple cross-browser function to get an element.
// by Jason D. Agostoni @ jason ATNOSPAM agostoni DOTNOSPAM net
// Modified by Mark Manning @ www.sim1.us
////////////////////////////////////////////////////////////////////////////////
function getElement(psID)
{
if( isNS && isNS3 ){
alert( "This program does not support Netscape versions earlier than
v4.7" );
return null;
} // We do not deal with NS3 or older
if( isIE3 || isIE4 ){
alert( "This program does not support Internet Explorer versions
earlier than v6.0" );
return null;
} // We do not deal with IE4 or older
if( document.all ){
return document.all[psID];
}
else if( document.getElementById ){
var myID = document.getElementById( psID );
if( !doesExist(myID) ){ myID = document.getElementsByName( psID ); }
return myID;
}
else {
for( iLayer = 1; iLayer < document.layers.length; iLayer++ ){
if( document.layers[iLayer].id == psID ){
return document.layers[iLayer];
}
}
}
return Null;
}
////////////////////////////////////////////////////////////////////////////////
// Function: setValue( eid, v ).
// Copyright (c) 2008. All rights reserved.
////////////////////////////////////////////////////////////////////////////////
function setValue( eid, v )
{
var e = getElement( eid );
if( e == null ){ return false; }
e.value = v;
return true;
}
</script>
<noscript>
If you are seeing this, then your browser either has
JavaScript turned off or it doesn't support JavaScript.
In either case you need to either enable JavaScript
or upgrade your browser so it can handle JavaScript.
Otherwise you will not be able to use this program.
Thank you.
</noscript>
<style>
.notYet {
background-color:white;
color:#ee0000;
font:bold 24pt 'Courier New';
border:1px solid black;
position:absolute;
top:100px;
left:5;
width:800px;
height:100px;
}
.TitleDiv {
background-color:#ccccff;
color:#000000;
border:1px solid black;
position:absolute;
left:5px;
top:5px;
width:800px;
height:75px;
}
.font_1 {
font:18pt "Courier New";;
font-weight:bold;
color:black;
z-index:1;
position:absolute;
left:5px;
top:5px;
}
.font_2 {
font:52pt "Courier New";;
color:white;
position:absolute;
left:5px;
top:0px;
}
.font_3 {
font:24pt "Courier New";;
font-weight:bold;
color:black;
position:absolute;
left:475px;
top:40px;
}
.font_4 {
font:8pt "Courier New";;
color:black;
position:absolute;
left:675px;
top:60px;
}
.ContractorLogon {
background-color:#88ff88;
color:#000000;
border:1px solid black;
position:absolute;
top:100px;
left:200px;
width:400px;
height:200px;
}
.CustomerLogon {
background-color:#eeee00;
color:#000000;
border:1px solid black;
position:absolute;
top:310px;
left:200px;
width:400px;
height:100px;
}
.href_1 {
font:8pt Arial;
}
.title_2 {
font:bold 12pt 'Courier New';
}
.title_3 {
font:bold 8pt 'Courier New';
}
.NewsBox {
background-color:#f4f4ff;
color:#000000;
border:1px solid black;
position:absolute;
top:100px;
left:610px;
width:195px;
height:400px;
}
.newsTitle_1 {
font:bold 18pt 'Courier New';
text-align:center;
}
.newsTitle_2 {
font:8pt 'Courier New';
}
.newsTitle_3 {
font:bold 8pt 'Courier New';
}
.updatesBox {
background-color:#ddffff;
color:#000000;
border:1px solid black;
position:absolute;
top:100px;
left:5px;
width:185px;
height:400px;
}
.updatesTitle_1 {
font:bold 18pt 'Courier New';
text-align:center;
}
.updatesTitle_2 {
font:8pt 'Courier New';
}
.updatesTitle_3 {
font:bold 8pt 'Courier New';
}
</style>
</head>
<body>
<div class="TitleDiv" name='Title0' id='Title0'>
<form action='index.php' method='post'>
<input name="theCmd" id="theCmd" type="hidden" value="">
<font class="font_1">The</font>
<font class="font_2">Contractor's</font>
<font class="font_3">Friend</font>
<font class="font_4">by Simulacron I</font>
</form>
</div><div class="ContractorLogon" name='Login0' id='Login0'>
<form action='index.php' method='post'>
<input name="theCmd" id="theCmd" type="hidden" value="">
<table border='0' width='100%'>
<tr>
<td colspan='3' align='center'><font style='font:bold 18pt "Courier
New'>Contractor's Login</font></td>
</tr>
<tr>
<td colspan='3' align='center'>
<table style="border:0px solid black"><tr>
<td align='right' class='title_2'>Username:</td>
<td align='left'><input name='uid' type='text' size='40'
maxlength='35' value=' '></td>
</tr></td></table>
</td>
</tr>
<tr>
<td colspan='3' align='center'>
<table style="border:0px solid black">
<tr>
<td align='right' class='title_2'>Password:</td>
<td align='left'><input name='pwd' type='password' size='40'
maxlength='35'></td>
</tr>
</table>
</td>
</tr>
<tr><td height='20px'> </td></tr>
<tr>
<td colspan='3' align='center'><input type='submit' value='Log Me In!'
style="height:30px;width:150px;" onClick="Javascript:return
setValue('theCmd', 'loginContractor');"></td>
</tr>
<tr>
<td colspan='3' align='center' nowrap height='20px'><a
href="index.php?theCmd=newUser_1" class="href_1">New users click
here</a>
</td>
</tr>
<tr>
<td align='left'><a href='index.php?theCmd=forgotUID'>
<font style='font:8pt Arial'>Forgot your <b>USERNAME?</b></font></a>
</td>
<td align='center'><a href='index.php?nu=1'> </td>
<td align='right'><a href='index.php?theCmd=forgotPWD'>
<font style='font:8pt Arial'>Forgot your <b>PASSWORD?</b></font></a>
</td>
</tr>
</table>
</form>
</div><div class="CustomerLogon" name='Login1' id='Login1'>
<form action='index.php' method='post'>
<input name="theCmd" id="theCmd" type="hidden" value="customer">
<table border='0' width='100%'>
<tr>
<td colspan='3' align='center'><font style='font:bold 18pt "Courier
New'>Customer's Login</font></td>
</tr>
<tr>
<td colspan='3' align='center'>
<table style="border:0px solid black"><tr>
<td align='right' class='title_2'>Invoice #:</td>
<td align='left'><input name='invoice' type='text' size='40'
maxlength='35' value=''></input></td>
</tr></td></table>
</td>
</tr>
<tr>
<td colspan='3' align='center'><input type='submit' value='Continue'
style="height:30px;width:150px;"></td>
</tr>
</table>
</form>
</div><div class="NewsBox" name='Login0' id='Login0'>
<form action='index.php' method='post'>
<input name="theCmd" id="theCmd" type="hidden" value="">
<table border='0' width='100%'>
<tr>
<td class="newsTitle_1">News</td>
</tr>
<tr>
<td class="newsTitle_2">This is the news box</td>
</tr>
</table>
</form>
</div><div class="updatesBox" name='Login0' id='Login0'>
<form action='index.php' method='post'>
<input name="theCmd" id="theCmd" type="hidden" value="">
<table border='0' width='100%'>
<tr>
<td class="updatesTitle_1">Updates</td>
</tr>
<tr>
<td class="updatesTitle_2">This is the updates box</td>
</tr>
</table>
</form>
</div></body>
</html>
End of webpage source code.
(If this is too warped for you due to how newsgroups format things - let
me know and I will e-mail you a zip file with the source code in it.)
I am having a very strange problem. The code listed below works fine
with one exception - it returns a blank. The JavaScript code tells it
to set the value to "loginContractor" and when I step through the
JavaScript it does just that. But when the PHP program sees the
incoming information - it sees it as a blank. So I'm asking here first
to see if anyone has any ideas on the JavaScript side. If not, I'll try
the PHP side of things.
Thanks in advance for any ideas/help you may be able to give.
Mark
Webpage source code to follow:
<!-- The Command = -->
<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.01 Transitional//EN'>
<html lang='en'>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="Generator" content="Mark's PHP Classes v1.0">
<meta name="Copyright" Content="Copyright (c) 2008. All rights reserved.">
<meta name="Author" content="Mark Manning">
<script language="JavaScript">
////////////////////////////////////////////////////////////////////////////////
// Set global browser boolean flags
// Originally taken from Danny Goodman's JavaScript Bible.
////////////////////////////////////////////////////////////////////////////////
var isIE = document.all;
var isIE7 = isIE && window.XMLHttpRequest &&
window.ActiveXObject;
var isIE6 = isIE && document.implementation;
var isgteIE6 = isIE7 || isIE6;
var isIE5 = isIE && window.print && !isgteIE6;
var isIEDOM2 = isIE5 || isgteIE6;
var isIE4 = isIE && !isIEDOM2 &&
navigator.cookieEnabled;
var isIE3 = isIE && !isIE4 && !isIEDOM2;
var isNS = navigator.mimeTypes && !isIE;
var isNS3 = isNS && !navigator.language;
var isNS4 = document.layers;
var isNS6 = document.getElementById && !isIE;
var isNS7 = isNS6;
var isNS71 = document.designMode;
var isNSDOM2 = isNS6;
var isDOM2 = isIEDOM2 || isNSDOM2;
////////////////////////////////////////////////////////////////////////////////
// doesExist. A function to detect whether something exists or not.
// Copyright (c) 2009. All rights reserved.
////////////////////////////////////////////////////////////////////////////////
function doesExist(e)
{
if( (typeof(e) == "undefined") || (e == "") || (e == null) ){
return false;
}
return true;
}
////////////////////////////////////////////////////////////////////////////////
// Simple cross-browser function to get an element.
// by Jason D. Agostoni @ jason ATNOSPAM agostoni DOTNOSPAM net
// Modified by Mark Manning @ www.sim1.us
////////////////////////////////////////////////////////////////////////////////
function getElement(psID)
{
if( isNS && isNS3 ){
alert( "This program does not support Netscape versions earlier than
v4.7" );
return null;
} // We do not deal with NS3 or older
if( isIE3 || isIE4 ){
alert( "This program does not support Internet Explorer versions
earlier than v6.0" );
return null;
} // We do not deal with IE4 or older
if( document.all ){
return document.all[psID];
}
else if( document.getElementById ){
var myID = document.getElementById( psID );
if( !doesExist(myID) ){ myID = document.getElementsByName( psID ); }
return myID;
}
else {
for( iLayer = 1; iLayer < document.layers.length; iLayer++ ){
if( document.layers[iLayer].id == psID ){
return document.layers[iLayer];
}
}
}
return Null;
}
////////////////////////////////////////////////////////////////////////////////
// Function: setValue( eid, v ).
// Copyright (c) 2008. All rights reserved.
////////////////////////////////////////////////////////////////////////////////
function setValue( eid, v )
{
var e = getElement( eid );
if( e == null ){ return false; }
e.value = v;
return true;
}
</script>
<noscript>
If you are seeing this, then your browser either has
JavaScript turned off or it doesn't support JavaScript.
In either case you need to either enable JavaScript
or upgrade your browser so it can handle JavaScript.
Otherwise you will not be able to use this program.
Thank you.
</noscript>
<style>
.notYet {
background-color:white;
color:#ee0000;
font:bold 24pt 'Courier New';
border:1px solid black;
position:absolute;
top:100px;
left:5;
width:800px;
height:100px;
}
.TitleDiv {
background-color:#ccccff;
color:#000000;
border:1px solid black;
position:absolute;
left:5px;
top:5px;
width:800px;
height:75px;
}
.font_1 {
font:18pt "Courier New";;
font-weight:bold;
color:black;
z-index:1;
position:absolute;
left:5px;
top:5px;
}
.font_2 {
font:52pt "Courier New";;
color:white;
position:absolute;
left:5px;
top:0px;
}
.font_3 {
font:24pt "Courier New";;
font-weight:bold;
color:black;
position:absolute;
left:475px;
top:40px;
}
.font_4 {
font:8pt "Courier New";;
color:black;
position:absolute;
left:675px;
top:60px;
}
.ContractorLogon {
background-color:#88ff88;
color:#000000;
border:1px solid black;
position:absolute;
top:100px;
left:200px;
width:400px;
height:200px;
}
.CustomerLogon {
background-color:#eeee00;
color:#000000;
border:1px solid black;
position:absolute;
top:310px;
left:200px;
width:400px;
height:100px;
}
.href_1 {
font:8pt Arial;
}
.title_2 {
font:bold 12pt 'Courier New';
}
.title_3 {
font:bold 8pt 'Courier New';
}
.NewsBox {
background-color:#f4f4ff;
color:#000000;
border:1px solid black;
position:absolute;
top:100px;
left:610px;
width:195px;
height:400px;
}
.newsTitle_1 {
font:bold 18pt 'Courier New';
text-align:center;
}
.newsTitle_2 {
font:8pt 'Courier New';
}
.newsTitle_3 {
font:bold 8pt 'Courier New';
}
.updatesBox {
background-color:#ddffff;
color:#000000;
border:1px solid black;
position:absolute;
top:100px;
left:5px;
width:185px;
height:400px;
}
.updatesTitle_1 {
font:bold 18pt 'Courier New';
text-align:center;
}
.updatesTitle_2 {
font:8pt 'Courier New';
}
.updatesTitle_3 {
font:bold 8pt 'Courier New';
}
</style>
</head>
<body>
<div class="TitleDiv" name='Title0' id='Title0'>
<form action='index.php' method='post'>
<input name="theCmd" id="theCmd" type="hidden" value="">
<font class="font_1">The</font>
<font class="font_2">Contractor's</font>
<font class="font_3">Friend</font>
<font class="font_4">by Simulacron I</font>
</form>
</div><div class="ContractorLogon" name='Login0' id='Login0'>
<form action='index.php' method='post'>
<input name="theCmd" id="theCmd" type="hidden" value="">
<table border='0' width='100%'>
<tr>
<td colspan='3' align='center'><font style='font:bold 18pt "Courier
New'>Contractor's Login</font></td>
</tr>
<tr>
<td colspan='3' align='center'>
<table style="border:0px solid black"><tr>
<td align='right' class='title_2'>Username:</td>
<td align='left'><input name='uid' type='text' size='40'
maxlength='35' value=' '></td>
</tr></td></table>
</td>
</tr>
<tr>
<td colspan='3' align='center'>
<table style="border:0px solid black">
<tr>
<td align='right' class='title_2'>Password:</td>
<td align='left'><input name='pwd' type='password' size='40'
maxlength='35'></td>
</tr>
</table>
</td>
</tr>
<tr><td height='20px'> </td></tr>
<tr>
<td colspan='3' align='center'><input type='submit' value='Log Me In!'
style="height:30px;width:150px;" onClick="Javascript:return
setValue('theCmd', 'loginContractor');"></td>
</tr>
<tr>
<td colspan='3' align='center' nowrap height='20px'><a
href="index.php?theCmd=newUser_1" class="href_1">New users click
here</a>
</td>
</tr>
<tr>
<td align='left'><a href='index.php?theCmd=forgotUID'>
<font style='font:8pt Arial'>Forgot your <b>USERNAME?</b></font></a>
</td>
<td align='center'><a href='index.php?nu=1'> </td>
<td align='right'><a href='index.php?theCmd=forgotPWD'>
<font style='font:8pt Arial'>Forgot your <b>PASSWORD?</b></font></a>
</td>
</tr>
</table>
</form>
</div><div class="CustomerLogon" name='Login1' id='Login1'>
<form action='index.php' method='post'>
<input name="theCmd" id="theCmd" type="hidden" value="customer">
<table border='0' width='100%'>
<tr>
<td colspan='3' align='center'><font style='font:bold 18pt "Courier
New'>Customer's Login</font></td>
</tr>
<tr>
<td colspan='3' align='center'>
<table style="border:0px solid black"><tr>
<td align='right' class='title_2'>Invoice #:</td>
<td align='left'><input name='invoice' type='text' size='40'
maxlength='35' value=''></input></td>
</tr></td></table>
</td>
</tr>
<tr>
<td colspan='3' align='center'><input type='submit' value='Continue'
style="height:30px;width:150px;"></td>
</tr>
</table>
</form>
</div><div class="NewsBox" name='Login0' id='Login0'>
<form action='index.php' method='post'>
<input name="theCmd" id="theCmd" type="hidden" value="">
<table border='0' width='100%'>
<tr>
<td class="newsTitle_1">News</td>
</tr>
<tr>
<td class="newsTitle_2">This is the news box</td>
</tr>
</table>
</form>
</div><div class="updatesBox" name='Login0' id='Login0'>
<form action='index.php' method='post'>
<input name="theCmd" id="theCmd" type="hidden" value="">
<table border='0' width='100%'>
<tr>
<td class="updatesTitle_1">Updates</td>
</tr>
<tr>
<td class="updatesTitle_2">This is the updates box</td>
</tr>
</table>
</form>
</div></body>
</html>
End of webpage source code.
(If this is too warped for you due to how newsgroups format things - let
me know and I will e-mail you a zip file with the source code in it.)