“注意:在PHP中使用未定义的常量 - 假定' '”错误

时间:2013-05-11 21:49:06

标签: constants undefined

我得到错误“注意:使用未定义的常量Â - 在第94行的C:\ wamp \ www \ Marketi \ php \ konfirmimi.php中假定'Â'”当我运行下面构建的脚本时。我在Google上查了一遍,无法找到任何解决方案。我通过Wammp服务器,最新的PHP和MySQL版本运行。我也检查了报价,没有任何遗漏或不正确的地方。我还确保在提交表单时填写了表单的所有字段。错误是在脚本的第94行给出的,所以在它结束时。

我想知道导致此错误的原因是什么?

谢谢

<?php 
//let's start the session
session_start();
$emri = $_POST['emri'];
$_SESSION['emri'] = $emri;

$mbiemri = $_POST['mbiemri'];
$_SESSION['mbiemri'] = $mbiemri;

$kompania = $_POST['kompania'];
$_SESSION['kompania'] = $kompania;

$emaili = $_POST['emaili'];
$_SESSION['emaili'] = $emaili;

$telefoni = $_POST['telefoni'];
$_SESSION['telefoni'] = $telefoni;

$titulli = $_POST['titulli'];
$_SESSION['titulli'] = $titulli;

$pershkrimi = $_POST['pershkrimi'];
$_SESSION['pershkrimi'] = $pershkrimi;


$foto = $_FILES['foto'];
$_SESSION['foto'] = $foto;
if (isset($_FILES['foto']) && $_FILES['foto']['size'] > 0) { 
    // Temporary file name stored on the server
    $tmpName  = $_FILES['foto']['tmp_name'];  
    // Read the file 
    $fp      = fopen($tmpName, 'r');
    $data = fread($fp, filesize($tmpName));
    $data = addslashes($data);
    fclose($fp);
}



?>

<?php
class InsertPune {

protected $conn;

   public function _construct()
            {
                $this->DbConnect();
            }

   protected function _DbConnect()
            {
include "../Connections/postal.php";
$this->conn = mysql_connect($host,$user,$password) OR die("Unable to connect to                                         the database");
mysql_select_db($db,$this->conn) OR die("can not select the database $db");
return TRUE;
}

    public function _pune_query()
    {
        //let's create the query
        $sql = mysql_query("INSERT into 'pune' (
                        'pn_emri',
                        'pn_mbiemri',
                        'pn_kompania',
                        'pn_emaili',
                        'pn_telefoni',
                        'pn_titulli',
                        'pn_pershkrimi',
                        'pn_foto'
                                ) VALUES (
                        '$emri',
                        '$mbiemri',
                        '$kompania',
                        '$emaili',
                        '$telefoni',
                        '$titulli',
                        '$pershkrimi',
                        '$data'
                                )");


            if (!$sql) {
              echo mysql_error();
            } else {
                if ($sql) {
                echo "You have posted successfully your job.";  
                }
            }

    }
} 
?>

0 个答案:

没有答案