Re: contant /

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Jack,

I have tons of errors like this and now I'm eliminating them, so I'll
tell what to do:
1. Put apostrophes (single quotes) around the array item:
$auth['company_name'] instead of $auth[company_name];
2. (Just a suggestion) It's better to put the SQL tables and
fields between grave accents (backquotes).

-- 
With best regards from Ukraine,
Andre
Skype: Francophile; Wlm&MSN: arthaelon @ yandex.ru; Jabber: arthaelon @ jabber.org
Yahoo! messenger: andre.polykanine; ICQ: 191749952
Twitter: m_elensule

----- Original message -----
From: Jack <JackListMail@xxxxxxxxx>
To: php-general@xxxxxxxxxxxxx <php-general@xxxxxxxxxxxxx>
Date: Thursday, April 8, 2010, 7:26:56 PM
Subject:  contant /

I get a couple of errors like this one for undefined variable:

PHP Notice:  Undefined variable: s_company_name

And this one for undefined contstant

PHP Notice:  Use of undefined constant account_type - assumed 'account_type'

 

I am putting a piece of code from each so that hopefully someone can explain
what I need to do to correct this, I know it still runs OK, but want to
eliminate error/warnings as much as possible.

 

 

CONSTANT CODE:

if($_POST) {

 

 

   if($username && $password)

      {

      f_db_open();

      $q = mysql_query("SELECT * FROM uas_users WHERE
user_email='$username'");

      $auth = mysql_fetch_array($q);

 

      if($auth['user_password'] == $password && $auth['user_email'] ==
$username && $auth['account_status'] == "Approved")

         {

 

 

         $type = $auth['account_type'];

 

                   mysql_query("INSERT INTO logon_log (user, date, time)
VALUES ('$username', NOW(), NOW())");

 

 
f_put_cookie($auth[user_name],$auth[user_email],$auth[account_type],$auth[co
mpany_name]);

 

 

VARIABLE CODE:

function f_option_menu($status_message ) {

global $s_url, $s_logo, $s_logo_h, $s_logo_w;

 

echo "

<table border='0' width='100%' cellpadding='0' cellspacing='0'>

  <tr>

    <td>

      <img border=0 src='images/".$s_logo."' width=".$s_logo_w."
height=".$s_logo_h.">

      <font face='Verdana, Arial' size='3'><b>".$s_company_name."
".$status_message."</b></font>

 

 

THANKS!!!!

 

 

 

Thanks!

Jack

 



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux