Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
photogram project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
dharaneesh . r ravi
photogram project
Commits
d0f56e38
Commit
d0f56e38
authored
1 year ago
by
dharaneesh . r ravi
Browse files
Options
Downloads
Patches
Plain Diff
introduction to oops
parent
ff2e4a1c
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
_templates/_signup.php
+1
-1
1 addition, 1 deletion
_templates/_signup.php
libs/includes/Mic.class.php
+34
-0
34 additions, 0 deletions
libs/includes/Mic.class.php
libs/load.php
+2
-0
2 additions, 0 deletions
libs/load.php
test.php
+16
-6
16 additions, 6 deletions
test.php
with
53 additions
and
7 deletions
_templates/_signup.php
+
1
−
1
View file @
d0f56e38
<?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
!
empty
(
$_POST
[
'username'
])
and
isset
(
$_POST
[
'password'
])
and
!
empty
(
$_POST
[
'password'
])
and
isset
(
$_POST
[
'email_address'
])
and
!
empty
(
$_POST
[
'email_address'
])
and
isset
(
$_POST
[
'phone'
])
and
!
empty
(
$_POST
[
'phone'
]))
{
$username
=
$_POST
[
'username'
];
$password
=
$_POST
[
'password'
];
$email
=
$_POST
[
'email_address'
];
...
...
This diff is collapsed.
Click to expand it.
libs/includes/Mic.class.php
0 → 100644
+
34
−
0
View file @
d0f56e38
<?php
/**
*public
*private
*protected
*/
class
Mic
{
private
$brand
;
public
$color
;
public
$usb_port
;
public
$model
;
public
$price
;
public
$light
;
public
function
__construct
(
$brand
)
{
printf
(
"constructing object ...."
);
$this
->
brand
=
$brand
;
}
public
function
getbrand
()
{
return
$this
->
brand
;
}
public
function
setlight
(
$light
)
{
print
(
$light
);
print
(
$this
->
light
);
}
private
function
getmodel
()
{
return
$this
->
model
;
}
public
function
setmodel
(
$model
)
{
$this
->
model
=
ucwords
(
$model
);
}
public
function
getmodelprox
()
{
return
$this
->
getmodel
();
}
}
This diff is collapsed.
Click to expand it.
libs/load.php
+
2
−
0
View file @
d0f56e38
<?php
//including the class function
include_once
"includes/Mic.class.php"
;
//this function load all the file
function
load_templates
(
$name
)
{
// print("including $name.php");
...
...
This diff is collapsed.
Click to expand it.
test.php
+
16
−
6
View file @
d0f56e38
<?php
include
"libs/load.php"
;
// print("_SERVER\n");
...
...
@@ -12,9 +11,20 @@ include "libs/load.php";
// print("_COOKIE\n");
// print_r($_COOKIE);
// testing the signup function
if
(
signup
(
"sam"
,
"password"
,
"sam@123"
,
"6369239993"
))
{
echo
"success"
;
}
else
{
echo
"fail"
;
}
// if (signup("sam", "password", "sam@123", "6369239993")) {
// echo "success";
// } else {
// echo "fail";
// }
$mic1
=
new
Mic
(
"
\n
roda
\n
"
);
//constructing the object
$mic2
=
new
Mic
(
"hyper
\n
"
);
//constructing the object
// $mic1->brand ="roda\n";
// $mic2->brand="hyper\n";
// print($mic1->brand);
// print($mic2->brand);
// $mic1->light="rgb\n";
// $mic1->setlight("white\n");
// $mic1->setmodel("welcome to all");
// print("model of 1st mic is".$mic1->getmodelprox());
print
(
"the brand of mic1"
.
$mic1
->
getbrand
());
?>
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment