close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Undefined index: checkuser?

Thread began 10/15/2012 3:36 am by acaciasd344844 | Last modified 10/17/2012 1:05 am by acaciasd344844 | 2164 views | 7 replies |

acaciasd344844

Undefined index: checkuser?

Hi,

I wonder if you can help! I have an error appearing on my index page that I have never seen before and its appearing in the username login field. This is the message appearing...

<br /><b>Notice</b>: Undefined index: checkuser in <b>M:\xampp\htdocs\midas2demo\iphone\m_login.php</b> on line <b>350</b><br />.

Now the strange thing is that I have this page online and it has worked fine for over a year. I downloaded the web page to add more functions to it and the message just appears when I run the file on my localhost. If I clear the message and login. It logs me into the site but an error message appears on the next page... Notice: Undefined variable: totalRows_Recordsetsearchcustomers in M:\xampp\htdocs\midas2demo\iphone\m_schedule.php on line 179

Once again this has always worked properly, and does online I have dataAssist 2.0.6 Utility and Universal Email 4.0.1 Suite installed

I have tried the above with dataAssist switched off and the same happens. I copied the working file from online put it straight into my htdocs folder and the error still appears. Do you guys have any idea what it may be? I'm using xampp and everything is working OK. I'm stumped.


Thanks in advance


John

Sign in to reply to this post

mikehesson45442908

Hello John,

Can you provide the URL in which you get this errors.

Garry

Sign in to reply to this post

acaciasd344844

Originally Said By: mikehesson45442908
  Hello John,

Can you provide the URL in which you get this errors.

Garry  



its on my localhost, it doesn't happen on line. So i cant provide a URL

sorry

Here is the page working fine...

m_login.php

Hope that helps!

john

Sign in to reply to this post

Jason ByrnesWebAssist

the "error" is not really an error. it is a Notice. it means that you have code that is referencing variables that don't exist.

it may be that the variables being referenced don't get created when the page initially loads, but do get created at another time.

the Notices don't show on the live server because the error level on the live server does not show notices.

send a copy of the pages so i can see the code at those lines to tell why the Notices are happening and whether or not the are problems or can be ignored.

Sign in to reply to this post

acaciasd344844

Originally Said By: Jason Byrnes
  the "error" is not really an error. it is a Notice. it means that you have code that is referencing variables that don't exist.

it may be that the variables being referenced don't get created when the page initially loads, but do get created at another time.

the Notices don't show on the live server because the error level on the live server does not show notices.

send a copy of the pages so i can see the code at those lines to tell why the Notices are happening and whether or not the are problems or can be ignored.  



Hi Jason,

Thanks for responding. From what your saying then, it sounds like apache/xampp may be allowing the error messages to be displayed.

I will have a look into it. I have attached the 2 php files for your attention.

Thanks again Jason


John

Attached Files
undefined variable.zip
Sign in to reply to this post

acaciasd344844

Fixed by editing PHP.ini

Originally Said By: acaciasd344844
  Hi Jason,

Thanks for responding. From what your saying then, it sounds like apache/xampp may be allowing the error messages to be displayed.

I will have a look into it. I have attached the 2 php files for your attention.

Thanks again Jason


John  



Hi Jason,

After further investigation I found out that the latest version of xampp has the php error reporting on strict as well as show all errors. The solution was to edit the .ini file to the following...

;error_reporting = E_ALL | E_STRICT
error_reporting = E_COMPILE_ERROR|E_ERROR|E_CORE_ERROR

The errors are no longer showing, so thanks again


john

Sign in to reply to this post

Jason ByrnesWebAssist

the first error:
<br /><b>Notice</b>: Undefined index: checkuser in

is caused by this code in the login page:

<input name="username" type="text" class="style7" id="UserName" value="<?php echo $_SERVER['checkuser']; ?>" size="10" maxlength="30" />

you are using the variable $_SERVER['checkuser'] as the value, there is no such variable in the $_SERVER supper global.

you should set the value of the username element to be blank.

the second error is happening because code is out of order on the m_schedule.php page.


the following code block at lines 165 - 179:

php:
$queryString_Recordsetsearchcustomers = "";

if (!empty($_SERVER['QUERY_STRING'])) {
  $params = explode("&", $_SERVER['QUERY_STRING']);
  $newParams = array();
  foreach ($params as $param) {
    if (stristr($param, "pageNum_Recordsetsearchcustomers") == false && 
        stristr($param, "totalRows_Recordsetsearchcustomers") == false) {
      array_push($newParams, $param);
    }
  }
  if (count($newParams) != 0) {
    $queryString_Recordsetsearchcustomers = "&" . htmlentities(implode("&", $newParams));
  }
}
$queryString_Recordsetsearchcustomers = sprintf("&totalRows_Recordsetsearchcustomers=%d%s", $totalRows_Recordsetsearchcustomers, $queryString_Recordsetsearchcustomers);




needs to come after the following line at 216:

php:
$totalRows_Recordsetsearchcustomers = mysql_num_rows($Recordsetsearchcustomers);
Sign in to reply to this post

acaciasd344844

Thanks

A big thanks for that Jason :)

I'm pretty sure now the 'undefined variables' have come to light that their are a good few floating round my site.

Mind you the system works, customers are not complaining so that's a good thing.

Cheers


John

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...