hello , i want to make like this . _

$m = $_GET["uion"];
class NewGo

{

public $username = '$m';
public $password = '1131';

 
}

but its not working . plz anyone tell me the exact correct code

post your requirement proper.

HERE is exact code

<form method="get" action="login.php">
<div>
<input type="hidden" name="send" value="yes" />
<input type="hidden" name="act" value="login" />
Nickname*:<br/>
<input type="text" name="loguid" value="" maxlength="50" /><br/>
Password*:<br/>
<input type="password" name="logpwd" value="" maxlength="50" /><br/>
<input type="submit" value="Login" />
</div>
</form>


$uid = $_GET["loguid"];
$pwd = $_GET["logpwd"];


class NewGo
{

public $username = '$uid';
public $password = '$pwd';

 
}

that class NewGo is not working properly. i mean class showing $username = NULL

You can not use class in this way.
you have to create object of class and then have to assign class member values.

class NewGo
{
	public $username;
	public $password; 
}

$obj = new NewGo();
$obj->username = $uid;
$obj->password = $pwd;
Member Avatar for rajarajan2017

Class and Object Sample:

<?php 
class Bear { 
    public $name; 
    public $weight; 
    public $age; 
    public $colour; 
     
    public function __construct() { 
        $this->age = 0; 
        $this->weight = 100; 
        $this->colour = "brown"; 
    } 
     
    // define methods 
} 

?>
<?php 

// create instance 
$baby = new Bear; 
$baby->name = "Baby Bear"; 
echo $baby->name." is ".$baby->colour." and weighs ".$baby->weight." units at birth"; 

?>
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.