Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

help me

<?PHP



//  ------ create table variable ------

// variables for Netscape Navigator 3 & 4 are +4 for compensation of render errors

$Browser_Type  =  strtok($HTTP_ENV_VARS['HTTP_USER_AGENT'],  "/");

if ( preg_match( "/MSIE/", $HTTP_ENV_VARS['HTTP_USER_AGENT']) || preg_match( "Mozilla/5.0", $HTTP_ENV_VARS['HTTP_USER_AGENT']) || preg_match ("/Opera/5.11/", $HTTP_ENV_VARS['HTTP_USER_AGENT']) ) {if ( preg_match( "/MSIE/", $HTTP_ENV_VARS['HTTP_USER_AGENT']) || preg_match( "/Mozilla\/5.0/", $HTTP_ENV_VARS['HTTP_USER_AGENT']) || preg_match ("/Opera/5.11/", $HTTP_ENV_VARS['HTTP_USER_AGENT']) ) {

    $theTable = 'WIDTH="400" HEIGHT="245"';

} else {

    $theTable = 'WIDTH="400" HEIGHT="245"';

}



//echo $HTTP_ENV_VARS["QUERY_STRING"];



// ------ create document-location variable ------

if ( preg_match("/php\.exe/", $HTTP_SERVER_VARS['PHP_SELF']) || preg_match("/php3\.cgi/", $HTTP_SERVER_VARS['PHP_SELF']) || preg_match("/phpts\.exe/", $HTTP_SERVER_VARS['PHP_SELF']) ) {

    $documentLocation = $HTTP_ENV_VARS['PATH_INFO'];

} else {

    $documentLocation = $HTTP_SERVER_VARS['PHP_SELF'];

}

if ( $HTTP_ENV_VARS['QUERY_STRING'] ) {

    $documentLocation .= "?" . $HTTP_ENV_VARS['QUERY_STRING'];

}

include("../config.php");



?>



<SCRIPT LANGUAGE="JavaScript">

<!--

//  ------ check form ------

function checkData() {

    var f1 = document.forms[0];

    var wm = "<?PHP echo $strJSHello; ?>\n\r\n";

    var noerror = 1;



    // --- entered_login ---

    var t1 = f1.entered_login;

    if (t1.value == "" || t1.value == " ") {

        wm += "<?PHP echo $strLogin; ?>\r\n";

        noerror = 0;

    }



    // --- entered_password ---

    var t1 = f1.entered_password;

    if (t1.value == "" || t1.value == " ") {

        wm += "<?PHP echo $strPassword; ?>\r\n";

        noerror = 0;

    }



    // --- check if errors occurred ---

    if (noerror == 0) {

        alert(wm);

        return false;

    }

    else return true;

}

//-->

</SCRIPT>



<table width="300" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr> 

    <td colspan="2" align="center" bgcolor="#666666">

      <span style="font-weight: bold; font-size: 16px; color: #FFFFFF">Painel de Administra&ccedil;&atilde;o</span><br />

      <br />

      <table width="275"  border="0" cellpadding="0" cellspacing="0">

        <tr>

          <td align="center"><a href="http://www.urai.pr.gov.br" target="_blank"><img src="../images/layout/img_logo.png" border="0" /></a><br />

            <br />

 <table width="100%"  border="0" cellpadding="0" cellspacing="0" style="border:1px solid #666666;">

            <tr>

              <td height="195" valign="top" bgcolor="#333333"><form action='<?PHP echo $documentLocation; ?>' METHOD="post" onSubmit="return checkData()">

<br />

<TABLE border="0" align="center" CELLPADDING="0" CELLSPACING="0">

          <TR>

            <TD width="130" ALIGN="left" VALIGN="middle">

              <font class="pequeno branco">USU&Aacute;RIO:</font><br />

              <input name="entered_login" type="text" size="25" class="input" onblur="this.className='input';" onfocus="this.className='inputon';" style="border:1px solid #666666;">

              <br />

<font class="pequeno branco">SENHA:</font><br />

<input name="entered_password" type="password" size="25" class="input" onblur="this.className='input';" onfocus="this.className='inputon';"  style="border:1px solid #666666;">

<br />

<br />

<input name="logar" type="submit" value="ENTRAR" class="input" onblur="this.className='input';" onfocus="this.className='inputon';"  style="border:1px solid #666666; height: 15px; width:70px; font-size:9px; font-family:Tahoma, Verdana, arial;">

<br /></TD>

            <TD width="85" ALIGN="right" VALIGN="middle"><img src="../images/layout/img_login.png"></TD>
          </TR>

          <TR>

            <TD height="28" colspan="2" ALIGN="center" VALIGN="middle"><font color="#FF0000" class="titulos"><? if ($message) { echo $message; } ?>

            </font></TD>
            </TR>

          <TR>

            <TD height="12" colspan="2" VALIGN="middle">&nbsp;</TD>
          </TR>
        </TABLE>

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

      <br />

      <font class="pequeno"><span style="font-size: 14px; font-weight: bold; color: #FFFFFF">TODOS OS DIREITOS RESERVADOS <br />
&reg; COPYRIGHT 2010 - WebMedia</span><span style="color: #FFFFFF"><br />

      </span><br />
    </font></td>

  </tr>

</table>





;
share|improve this question

closed as off-topic by John Conde, Sverri M. Olsen, Soner Gönül, 웃웃웃웃웃, Rakesh Sharma Jul 17 at 6:05

This question appears to be off-topic. The users who voted to close gave these specific reasons:

  • "Questions seeking debugging help ("why isn't this code working?") must include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers. See: How to create a Minimal, Complete, and Verifiable example." – Sverri M. Olsen, Rakesh Sharma
  • "This question was caused by a problem that can no longer be reproduced or a simple typographical error. While similar questions may be on-topic here, this one was resolved in a manner unlikely to help future readers. This can often be avoided by identifying and closely inspecting the shortest program necessary to reproduce the problem before posting." – John Conde, Soner Gönül, 웃웃웃웃웃
If this question can be reworded to fit the rules in the help center, please edit the question.

4  
Please don't just paste your code here and expect help. Otherwise nobody will help you to find your issue as you haven't even attempted to fix it. –  Darren Jul 17 at 5:40
1  
By the way: That error usually means you're missing a closing bracket -> } –  Darren Jul 17 at 5:40
    
Missing a closing bracket near function checkData() –  Azrael Jul 17 at 5:43
1  
@Azrael affirmative, just answering the scope of this super bad question ! :-) –  Darren Jul 17 at 5:50
1  
I gotta agree with you that this is a REALLY bad question @Darren! :P –  Azrael Jul 17 at 5:52

2 Answers 2

Managed to get it working: faults were: line 11: if(something){{} double open bracket for some reason? and you forgot a closing bracket on line 67, your code seems working now but your preg_match syntax is wrong, you will need to do some fixing on this.

<?PHP



//  ------ create table variable ------

// variables for Netscape Navigator 3 & 4 are +4 for compensation of render errors

$Browser_Type  =  strtok($HTTP_ENV_VARS['HTTP_USER_AGENT'],  "/");

if ( preg_match( "/MSIE/", $HTTP_ENV_VARS['HTTP_USER_AGENT']) || preg_match( "Mozilla/5.0", $HTTP_ENV_VARS['HTTP_USER_AGENT']) || preg_match ("/Opera/5.11/", $HTTP_ENV_VARS['HTTP_USER_AGENT']) ) {if ( preg_match( "/MSIE/", $HTTP_ENV_VARS['HTTP_USER_AGENT']) || preg_match( "/Mozilla\/5.0/", $HTTP_ENV_VARS['HTTP_USER_AGENT']) || preg_match ("/Opera/5.11/", $HTTP_ENV_VARS['HTTP_USER_AGENT']) )

    $theTable = 'WIDTH="400" HEIGHT="245"';

} else {

    $theTable = 'WIDTH="400" HEIGHT="245"';

}



//echo $HTTP_ENV_VARS["QUERY_STRING"];



// ------ create document-location variable ------

if ( preg_match("/php\.exe/", $HTTP_SERVER_VARS['PHP_SELF']) || preg_match("/php3\.cgi/", $HTTP_SERVER_VARS['PHP_SELF']) || preg_match("/phpts\.exe/", $HTTP_SERVER_VARS['PHP_SELF']) ) {

    $documentLocation = $HTTP_ENV_VARS['PATH_INFO'];

} else {

    $documentLocation = $HTTP_SERVER_VARS['PHP_SELF'];

}

if ( $HTTP_ENV_VARS['QUERY_STRING'] ) {

    $documentLocation .= "?" . $HTTP_ENV_VARS['QUERY_STRING'];

}

include("../config.php");



?>



<SCRIPT LANGUAGE="JavaScript">

<!--

//  ------ check form ------

function checkData() {

    var f1 = document.forms[0];

    var wm = "<?PHP echo $strJSHello; ?>\n\r\n";

    var noerror = 1;

    }



    // --- entered_login ---

    var t1 = f1.entered_login;

    if (t1.value == "" || t1.value == " ") {

        wm += "<?PHP echo $strLogin; ?>\r\n";

        noerror = 0;

    }



    // --- entered_password ---

    var t1 = f1.entered_password;

    if (t1.value == "" || t1.value == " ") {

        wm += "<?PHP echo $strPassword; ?>\r\n";

        noerror = 0;

    }



    // --- check if errors occurred ---

    if (noerror == 0) {

        alert(wm);

        return false;

    }

    else return true;

}

//-->

</SCRIPT>



<table width="300" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">

  <tr> 

    <td colspan="2" align="center" bgcolor="#666666">

      <span style="font-weight: bold; font-size: 16px; color: #FFFFFF">Painel de Administra&ccedil;&atilde;o</span><br />

      <br />

      <table width="275"  border="0" cellpadding="0" cellspacing="0">

        <tr>

          <td align="center"><a href="http://www.urai.pr.gov.br" target="_blank"><img src="../images/layout/img_logo.png" border="0" /></a><br />

            <br />

 <table width="100%"  border="0" cellpadding="0" cellspacing="0" style="border:1px solid #666666;">

            <tr>

              <td height="195" valign="top" bgcolor="#333333"><form action='<?PHP echo $documentLocation; ?>' METHOD="post" onSubmit="return checkData()">

<br />

<TABLE border="0" align="center" CELLPADDING="0" CELLSPACING="0">

          <TR>

            <TD width="130" ALIGN="left" VALIGN="middle">

              <font class="pequeno branco">USU&Aacute;RIO:</font><br />

              <input name="entered_login" type="text" size="25" class="input" onblur="this.className='input';" onfocus="this.className='inputon';" style="border:1px solid #666666;">

              <br />

<font class="pequeno branco">SENHA:</font><br />

<input name="entered_password" type="password" size="25" class="input" onblur="this.className='input';" onfocus="this.className='inputon';"  style="border:1px solid #666666;">

<br />

<br />

<input name="logar" type="submit" value="ENTRAR" class="input" onblur="this.className='input';" onfocus="this.className='inputon';"  style="border:1px solid #666666; height: 15px; width:70px; font-size:9px; font-family:Tahoma, Verdana, arial;">

<br /></TD>

            <TD width="85" ALIGN="right" VALIGN="middle"><img src="../images/layout/img_login.png"></TD>
          </TR>

          <TR>

            <TD height="28" colspan="2" ALIGN="center" VALIGN="middle"><font color="#FF0000" class="titulos"><? if ($message) { echo $message; } ?>

            </font></TD>
            </TR>

          <TR>

            <TD height="12" colspan="2" VALIGN="middle">&nbsp;</TD>
          </TR>
        </TABLE>

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

      <br />

      <font class="pequeno"><span style="font-size: 14px; font-weight: bold; color: #FFFFFF">TODOS OS DIREITOS RESERVADOS <br />
&reg; COPYRIGHT 2010 - WebMedia</span><span style="color: #FFFFFF"><br />

      </span><br />
    </font></td>

  </tr>

</table>





;
share|improve this answer
1  
+1 You're the winner :-) –  Darren Jul 17 at 5:56
    
Could you mark it as an Awnser aswell? that way this question get's closed and other people with the same problem can see it quickly ;) –  Azrael Jul 17 at 5:58
1  
Can't do that mate, the OP will have to mark it as an answer if they see it! –  Darren Jul 17 at 6:00
1  
Oh lol, I'm blind, saw you as OP XD –  Azrael Jul 17 at 6:02

Try this code. You forgot closing bracket } of if case

<?PHP
//  ------ create table variable ------
// variables for Netscape Navigator 3 & 4 are +4 for compensation of render errors
$Browser_Type  =  strtok($HTTP_ENV_VARS['HTTP_USER_AGENT'],  "/");
if ( preg_match( "/MSIE/", $HTTP_ENV_VARS['HTTP_USER_AGENT']) || preg_match( "Mozilla/5.0", $HTTP_ENV_VARS['HTTP_USER_AGENT']) || preg_match ("/Opera/5.11/", $HTTP_ENV_VARS['HTTP_USER_AGENT']) )
 {
     if ( preg_match( "/MSIE/", $HTTP_ENV_VARS['HTTP_USER_AGENT']) || preg_match( "/Mozilla\/5.0/", $HTTP_ENV_VARS['HTTP_USER_AGENT']) || preg_match ("/Opera/5.11/", $HTTP_ENV_VARS['HTTP_USER_AGENT'])) 
     {
        $theTable = 'WIDTH="400" HEIGHT="245"';
    }
    else
     {
        $theTable = 'WIDTH="400" HEIGHT="245"';
    }
 }
//echo $HTTP_ENV_VARS["QUERY_STRING"];
// ------ create document-location variable ------
if ( preg_match("/php\.exe/", $HTTP_SERVER_VARS['PHP_SELF']) || preg_match("/php3\.cgi/", $HTTP_SERVER_VARS['PHP_SELF']) || preg_match("/phpts\.exe/", $HTTP_SERVER_VARS['PHP_SELF'])) {
    $documentLocation = $HTTP_ENV_VARS['PATH_INFO'];
} else {
    $documentLocation = $HTTP_SERVER_VARS['PHP_SELF'];
}
if ( $HTTP_ENV_VARS['QUERY_STRING'] ) {
    $documentLocation .= "?" . $HTTP_ENV_VARS['QUERY_STRING'];
}
include("../config.php");
?>
<SCRIPT LANGUAGE="JavaScript">
<!--
//  ------ check form ------
function checkData() {
    var f1 = document.forms[0];
    var wm = "<?PHP echo $strJSHello; ?>\n\r\n";
    var noerror = 1;
    // --- entered_login ---
    var t1 = f1.entered_login;
    if (t1.value == "" || t1.value == " ") {
        wm += "<?PHP echo $strLogin; ?>\r\n";
        noerror = 0;
    }
    // --- entered_password ---
    var t1 = f1.entered_password;
    if (t1.value == "" || t1.value == " ") {
        wm += "<?PHP echo $strPassword; ?>\r\n";
        noerror = 0;
    }
    // --- check if errors occurred ---
    if (noerror == 0) {
        alert(wm);
        return false;
    }
    else return true;
}
//-->
</SCRIPT>
<table width="300" height="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr> 
    <td colspan="2" align="center" bgcolor="#666666">
      <span style="font-weight: bold; font-size: 16px; color: #FFFFFF">Painel de Administra&ccedil;&atilde;o</span><br />
      <br />
      <table width="275"  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td align="center"><a href="http://www.urai.pr.gov.br" target="_blank"><img src="../images/layout/img_logo.png" border="0" /></a><br />
            <br />
 <table width="100%"  border="0" cellpadding="0" cellspacing="0" style="border:1px solid #666666;">
            <tr>
              <td height="195" valign="top" bgcolor="#333333"><form action='<?PHP echo $documentLocation; ?>' METHOD="post" onSubmit="return checkData()">
<br />
<TABLE border="0" align="center" CELLPADDING="0" CELLSPACING="0">
          <TR>
            <TD width="130" ALIGN="left" VALIGN="middle">
              <font class="pequeno branco">USU&Aacute;RIO:</font><br />
              <input name="entered_login" type="text" size="25" class="input" onblur="this.className='input';" onfocus="this.className='inputon';" style="border:1px solid #666666;">
              <br />
<font class="pequeno branco">SENHA:</font><br />
<input name="entered_password" type="password" size="25" class="input" onblur="this.className='input';" onfocus="this.className='inputon';"  style="border:1px solid #666666;">
<br />
<br />
<input name="logar" type="submit" value="ENTRAR" class="input" onblur="this.className='input';" onfocus="this.className='inputon';"  style="border:1px solid #666666; height: 15px; width:70px; font-size:9px; font-family:Tahoma, Verdana, arial;">
<br /></TD>
            <TD width="85" ALIGN="right" VALIGN="middle"><img src="../images/layout/img_login.png"></TD>
          </TR>
          <TR>
            <TD height="28" colspan="2" ALIGN="center" VALIGN="middle"><font color="#FF0000" class="titulos"><? if ($message) { echo $message; } ?>
            </font></TD>
            </TR>
          <TR>
            <TD height="12" colspan="2" VALIGN="middle">&nbsp;</TD>
          </TR>
        </TABLE>
                </form></td>
            </tr>
          </table></td>
        </tr>
      </table>
      <br />
      <font class="pequeno"><span style="font-size: 14px; font-weight: bold; color: #FFFFFF">TODOS OS DIREITOS RESERVADOS <br />
&reg; COPYRIGHT 2010 - WebMedia</span><span style="color: #FFFFFF"><br />
      </span><br />
    </font></td>
  </tr>
</table>
share|improve this answer
    
Duplicate awnser –  Azrael Jul 17 at 5:56
    
@Azrael code is different, have a proper look at code :) –  GTS Soft. Jul 17 at 6:00
    
It's the same? you ony removed som breaklines? –  Azrael Jul 17 at 6:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.