Skip to content
Snippets Groups Projects
Commit 6c46a622 authored by Sibidharan's avatar Sibidharan :speech_balloon:
Browse files

oops

parent 24615d46
No related branches found
No related tags found
No related merge requests found
<?php
$signup = false;
if (isset($_POST['username']) and isset($_POST['password']) and isset($_POST['email_address']) and isset($_POST['phone'])) {
if (isset($_POST['username']) and isset($_POST['password']) and !empty($_POST['password']) and isset($_POST['email_address']) and isset($_POST['phone'])) {
$username = $_POST['username'];
$password = $_POST['password'];
$email = $_POST['email_address'];
......
<?php
/**
* Access Specifiers
* -----------------
* pubic
* private
* protected
*/
class Mic
{
private $brand;
public $color;
public $usb_port;
public $model;
private $light;
public $price;
public function __construct($brand)
{
printf("Constructing object...");
$this->brand = ucwords($brand);
}
public function setLight($light)
{
$this->light = $light;
}
public function getBrand()
{
return $this->brand;
}
public function add($a, $b)
{
return $a+$b;
}
private function getModel()
{
return $this->model;
}
public function setModel($model)
{
$this->model = ucwords($model);
}
public function getModelProxy()
{
return $this->getModel();
}
}
<?php
include_once 'includes/Mic.class.php';
function load_template($name)
{
include $_SERVER['DOCUMENT_ROOT']."/app/_templates/$name.php"; //not consistant.
......
......@@ -16,11 +16,25 @@ include 'libs/load.php';
// print("_COOKIES \n");
// print_r($_COOKIE);
if (signup("sibidharan", "password", "sibi@selfmade.ninja", "9999999999")) {
echo "Success";
} else {
echo "Fail";
}
// if (signup("sibidharan", "password", "sibi@selfmade.ninja", "9999999999")) {
// echo "Success";
// } else {
// echo "Fail";
// }
$mic1 = new Mic("Roda"); //constructing the object
$mic2 = new Mic("HyperX"); //constructing the object
$mic1->setLight("White");
$mic2->setLight("Green");
print(ucwords("hyper quad cast"));
$mic1->setModel("hyper quad cast");
print("Model of 1st mic is ".$mic1->getModelProxy());
print("\n".$mic1->getBrand());
print("\n".$mic2->getBrand());
print("Value of 10+12 is ".$mic1->add(10, 12));
?>
</pre>
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment