Jump to content

Parse error: syntax error, unexpected end of file


moisesbr

Recommended Posts

Hi

 

I have:
 

Parse error: syntax error, unexpected end of file in C:\wamp\www\busca_prova.php on line 267

 

267 is the last line of file, a blank line.


This ony happens at desktop, not when file is  in server.

 

Code is below

##########################################################




<?php
/*-----------------------------------------------------------------------------*
* This form has 2 parts: 
* 1. the first time (_submit not in $_POST) the form is displayed 
* to the user requesting input data
* 2. when $_POST['submit'] is set, the form has been filled in 
* and the variables in $_POST must be validated.
* Fields filled: continue whatever processing you want to do
* Fields not exist or blank, redisplay form with previous values echoed
*-----------------------------------------------------------------------------*/


$errors = array();


// validate the input




$protocolo = preg_replace("/[^0-9]/", '', $_POST['protocolo']);


$cpf = preg_replace("/[^0-9]/", '', $_POST['cpfmf']


$today = getdate();
$num = (int)$today[hours];
$horaReal = $num +4;








 $datetime = $today[mday].'/'.$today[mon].'/'.$today[year].'    '.$horaReal.':'.$today[minutes].':'.$today[seconds];










$ipAddress = $_SERVER['REMOTE_ADDR'];  




$referer = $_SERVER['HTTP_REFERER'];






#$cpf = str_pad(ereg_replace('[^0-9]', '', $cpf), 11, '0', STR_PAD_LEFT);


$cpf = str_pad(preg_replace('[^0-9]', '', $cpf), 11, '0', STR_PAD_LEFT);
    if (strlen($cpf) != 11 || $cpf == '00000000000' || $cpf == '11111111111'|| $cpf == '22222222222'|| $cpf == '33333333333'|| $cpf == '44444444444' )                                                       {
      
 $errors[] = 'CPF inválido -- O preenchimento do CPF é importante para que você possa ser cadastrado como nosso aluno.';


    } else {
        for ($t = 9; $t < 11; $t++) {
            for ($d = 0, $c = 0; $c < $t; $c++) {
                $d += $cpf{$c} * (($t + 1) - $c);
            }


            $d = ((10 * $d) % 11) % 10;


            if ($cpf{$c} != $d) {
               $errors[] = 'CPF inválido.';
            }
        }


        
    }








if (count($errors) == 0)
{








// Process form




// Make a MySQL Connection
mysql_connect("localhost", "monitor_monitor", 'password') or die(mysql_error());
mysql_select_db("monitorr_acrisoft") or die(mysql_error());




$result = mysql_query("SELECT * FROM reembolso WHERE cpfmf= '$cpf' AND nome_curso= '$nome_curso'") or die (mysql_error());


$mem_row = mysql_fetch_array( $result );




$count = mysql_num_rows($result); 




if($count >= 1)


{




$pedido = $mem_row['ID'];






######################################HTML################################################




?>


<html>


<head>
<meta http-equiv="Content-Language" content="pt-br">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
</head>


<body background="http://www.juntatecnica.com/fundo2.jpg">


<div align="center">
<table id="table6" border="0" width="50%" bgColor="#ffffff">
<tr>
<td>
<div align="center">
<img border="0" src="http://www.juntatecnica.com/header.jpg" width="764" height="120" ></div>


<div align="center">
<table id="table7" border="0" width="92%">
<tr>
<td><font size="5">
<p><font face="Arial"><big>








<strong style="font-weight: 400"><br>
<?php echo $nome_curso1 ?></strong></big></font><strong style="font-weight: 400"><font face="Arial">Prezado(a):</font></strong><font face="Arial"><strong style="font-weight: 400"> 
<?php echo $nome ?><br>
<br>
Seu pedido foi realizado com sucesso !<br>
 </strong></font><table border="0" width="100%" id="table8" bgcolor="#00CC00" height="37">
<tr>
<td><big><font color="#FFFFFF" face="Arial"><strong>
<font size="5">Pedido: </font></strong></font>
                                                        <font size="5" color="#FFFFFF"><strong>
                                                        <font face="Arial">R</font>
<font face="Arial"> <?php echo $pedido ?></font></strong></big></td>
</tr>
</table>
<p>
<font face="Arial">
<strong style="font-weight: 400">Dentro de alguns 
dias você receberá um aviso dos correios ou um 
e-mail nosso informando sobre a chegada do produto.<br>
<br>
Caso não receba nenhum e-mail informando a situação 
do seu pedido, por favor entre em contato através do 
e-mail: <font color="#FF0000">[email protected]</font></strong></font><br>
 </td>
</tr>
</table>
<p> 
<hr color="#FF8040" size="3">
</div>
</form>
 </td>
</tr>
</table>
<p><br>
<br>
<br>
 </div>












<!-- Google Code for Vendas Conversion Page: SALES@ --><script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 00000000000;
var google_conversion_language = "pt_BR";
var google_conversion_format = "1";
var google_conversion_color = "ffffff";
var google_conversion_label = "purchase";
var google_conversion_value = 0;




/* ]]> */
</script>
<script type="text/javascript" src="https://www.googleadservices.com/pagead/conversion.js">
</script>


<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" 
src="https://www.googleadservices.com/pagead/conversion/1038429544/?label=purchase&guid=ON&script=0"/>
</div>
</noscript>




<!-- Google Code for Vendas Conversion Page: CURSOS@  --><script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 000000000001;
var google_conversion_language = "pt_BR";
var google_conversion_format = "1";
var google_conversion_color = "ffffff";
var google_conversion_label = "purchase";
var google_conversion_value = 0;




/* ]]> */
</script>
<script type="text/javascript" src="https://www.googleadservices.com/pagead/conversion.js">
</script>


<noscript>
<div style="display:inline;">
<img height="1" width="1" style="border-style:none;" alt="" 
src="https://www.googleadservices.com/pagead/conversion/1072600120/?label=purchase&guid=ON&script=0"/>
</div>
</noscript>








<SCRIPT language="JavaScript" type="text/javascript">
<!-- Yahoo! do Brasil Internet Ltda.
window.ysm_customData = new Object();
window.ysm_customData.conversion = "transId=,currency=,amount=";
var ysm_accountid  = "1NHEBQGPFIM24HQ7PP1H1F7R0LO";
document.write("<SCR" + "IPT language='JavaScript' type='text/javascript' " 
+ "SRC=//" + "srv2.wa.marketingsolutions.yahoo.com" + "/script/ScriptServlet" + "?aid=" + ysm_accountid 
+ "></SCR" + "IPT>");
// -->
</SCRIPT>
















</body>


</html>






<?php








}




    











Very few people around here are willing to look at code like that when you don't put it in

 tags.

 

Parse error: syntax error, unexpected end of file in C:\wamp\www\busca_prova.php on line 267

You're probably missing a } somewhere.
This ony happens at desktop, not when file is  in server.

 

 

this error is occurring on the server too, but is it not being reported/displayed. your code is not running at all on both your development system and your live server because this is a fatal parse error in the php source code.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.