HTML/UCP Coding Help!
#1

Hey guys! I ran my UCP, and on one of the pages it gives me this error:

Код:
Strict Standards: Non-static method utils::startsWith() should not be called statically in /home/fcrolepl/public_html/fortcarson-rp.com/ucp/resources/usrfuncs.class.php
This is line 138 in usrfuncs.class.php:

Код:
	if (utils::startsWith($data['gender'], "m")) {
	    $gender = "Male";
	} else {
	    $gender = "Female";
	}
Reply
#2

This isn't a PHP help forum. Regardless: the error says that you shouldn't call the startsWith method in the utils class with the scope resolution operator (the double colon); you must first instantiate the utils class and then call the method on that instance, i.e.:
PHP код:
$utilsInstance = new utils();
if(
$utilsInstance->startsWith($data['gender'], "m"))
{
    
// ...

Or make the startsWith method static in the utils class.

PHP код:
public static function startsWith(/* ... */
Reply
#3

@Vince - Works Dad, thanks!.. +REP
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)