₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,326,356 members, 8,426,204 topics. Date: Saturday, 13 June 2026 at 08:48 PM

Toggle theme

Maekhel's Posts

Nairaland ForumMaekhel's ProfileMaekhel's Posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 (of 26 pages)

ProgrammingPHP File Inclusion by maekhel(op): 1:52pm On Feb 08, 2015
There are times you might want to reference a particular file in another file. These is mostly common in OOP. PHP provides function which can be used to reference another file from a calling file. These function are include() and require() and we will be looking at them shortly. These functions help in creating functions, headers, footers, or elements that can be reused on multiple pages. This will help developers to make it easy to change the layout of complete website with minimal effort. If there is any change required then instead of changing thousand of files just change included file.
The Include Function
The include() takes all the text in a specified file and copies it into the file that uses the include function. If there is any problem in loading a file then the include() function generates a warning but the script will continue execution. The include() has another variant called include_once(). What include_once does is to make sure the file is only included once so as to avoid referencing same file multiple times.
<?php
include('header.php');
?>

<?php
include_once('footer.php');
?>
The Require Function
The require() function takes all the text in a specified file and copies it into the file that uses the include function. Unlike the include(), the require() will terminate the execution of the script if there is any problem in loading the file. The require() also has another variant called the require_once(). This does exactly as the include_once does: make sure the file is only referenced once.
<?php
require('db.php');
?>

<?php
require_once('import.php');
?>
Conclusion
Now you have seen how to make use of the includes functions provided by PHP and seen their difference. I recommend using the require_once() when you are including a file because the script should not continue execution while your included failed.

I hope you find this tutorial helpful. You can leave your comments, questions and suggestions in the comment box below.
source: http://tutorialslodge.com/php-file-inclusion/
WebmastersRe: Web Guru Needed... I Need A Website .. by maekhel(m): 4:09pm On Feb 05, 2015
if still open, you can contact me meziemichael@gmail.com
Tech JobsRe: Are There Any Unemployed App/Software/Web Designers & Programmers On Nairaland? by maekhel(m): 9:35am On Feb 04, 2015
Username: maekhel
How many hours you have per day for freelance/remote work: 6
Skills: HTML5, CSS3, PHP, MySQL, JavaScript, JQuery
WebmastersRe: I Need A Webmail On Host Server. How To Install?? by maekhel(m): 4:41pm On Feb 03, 2015
have you tried mysite.com/webmail
WebmastersRe: Nigerian Bloggers And Web Masters! Post Your Websites Here For Review. by maekhel(m): 8:39am On Feb 03, 2015
DONOCSO:
Excellence meets perfection! The blog layout and typography is balanced.

Thank You.
Thanks for the review
WebmastersRe: Nigerian Bloggers And Web Masters! Post Your Websites Here For Review. by maekhel(m): 9:44am On Feb 02, 2015
WebmastersRe: Please Submit A Quote For This Website Job by maekhel(m): 7:47pm On Jan 31, 2015
76A38DB6, 07032047179 or meziemichael@gmail.com let discuss the project.
WebmastersDifference Between Div And Span by maekhel(op): 11:02am On Jan 31, 2015
I will be doing a very brief but concise difference between div and span. I some of you might have asked questions like, whats the difference between div and span? Whats the effect of using each? When should I use each of them? I will try as much as possible to give answers to the questions in the best understanding way I can.
Div stands for division and it was introduced basically for doing layouts. The div tag is a block level element and must be used only in places where block level elements are legal. As a block level element, div creates a line break. The content of the div does not determine the width of the div but the width size given to it through CSS or it will take the full width of the seen if none is given.
Span on the other hand is an inline level element and as an inline level element, it must only contain other inline elements. Span does not create line break. The width of span depends upon the content of itself.
Let me explain all this with some examples to make things more clearer.
<!DOCTYPE html>
<html>
<head>
<title>TutorialsLodge | Difference Between Div And Span</title>
</head>
<body>
<div style="background-color: red">This is a DIV</div>
<p></p>
<span style="background-color: blue">This is a Span</span>
</body>
</html>
You should get a screen similar to below.
<!DOCTYPE html>
<html>
<head>
<title>TutorialsLodge | Difference Between Div And Span</title>
</head>
<body>
<span><div>This is a DIV</div></span>
</body>
</html>
The code snippets above is wrong because I placed a block level element within an inline level element.
Conclusion
I hope this post has been helpful in differentiating between div and span. Kindly drop your comments, questions, views and suggestions in the comment box below.
source: http://tutorialslodge.com/difference-div-span/
WebmastersIntegrating Biometric Registration On Website by maekhel(op): 10:00am On Jan 29, 2015
Morning guys, a client of mine needs a website which has biometric registration. The thing is that have never done any biometric project before, so I need advice from you guys. How do I go about this?
Note: am a PHP guy.
ProgrammingIntegrating Biometric Registration On Website by maekhel(op): 8:51am On Jan 29, 2015
Morning guys, a client of mine needs a website which has biometric registration. The thing is that have never done any biometric project before, so I need advice from you guys. How do I go about this?
Note: am a PHP guy.
WebmastersRe: Urgently Need A Very Good Webdesign With A Good Knowledge In Wordpress,sql by maekhel(m): 10:53am On Jan 26, 2015
Name: Michael
phone: 07032047179
resident area: Lagos
WebmastersRe: Who Here Has Ever Heard Of Or Used Codeigniter? by maekhel(m): 9:38pm On Jan 24, 2015
2sExy1:
Have you heard of this application and as well used it?
I have
ProgrammingHND Or Bsc For IT World by maekhel(op): 7:32pm On Jan 24, 2015
Guys nid ur help on this one. which wud u advice someone with OND comp sci to go for?
WebmastersSetting Up Your Web Directory by maekhel(op): 9:42am On Jan 23, 2015
Having a good web directory is very important and necessary for web designers and developers, because it makes your work neat and much more easier in terms of linking and referencing. I decided to write Setting up your web directory to show my readers how I structure my directory while working on projects.
The screenshot above shows how my directory is set up for a particular project. As you can see I have different sub-directory (folders) within my main directory (which is usually public_html directory on a live server) and other files. I will go over each of the directory.
1. css: This is the directory (folder) that will contain all Cascading Style Sheet (CSS) files.
2. images: This is our images directory (folder), it will contain all our pictures, logos and images.
3. js: This is the directory (folder) that will contain all JavaScript files.
4. libs: This directory is not needed most times but if you will be using any external libraries then it is important to include them in this directory (folder). Example of external libraries is JQuery.
Once you have your directory set up, you can now focus on actual files (index.html in my case). Let me do a quick example on how to link an image with this our structure.
<img src="images/image.jpg" alt="Alternative Text">
The image link above is relative to the directory. There is no need to have to know the full path (which could be sitename/images/images.jpg) of the project.
Conclusion
To wrap this post up, let me quickly point out somethings. Your directory structure will be determined by the type of project you are working on. Take for install, if I were to working on a project using the OOP paradigm, I will have a classes directory in addition to the ones listed above. What am saying in essence is that you are not limited to the directory structure above.
I hope you find this post helpful. All comments, questions, suggestions and views are all welcome, kindly use the comment box below.
source: http://tutorialslodge.com/setting-web-directory/
WebmastersRe: Object Oriented Programing And Procedural Programing In Php What Is The Diff? by maekhel(m): 7:29am On Jan 19, 2015
osile2012:
[size=15pt]and the functions within the class are "OBJECTS"[/size]
thats not true
ProgrammingRe: Difference Between Arguments And Parameters In PHP by maekhel(op): 8:40pm On Jan 07, 2015
jboy01:
bro! i think u are mixing things up here, u are interchanging argument to parameter. function and procedure receive argument to parameter.
I think you are the one mixing it up.
ProgrammingRe: Single Vs Double Quotes In PHP by maekhel(op): 8:35pm On Jan 07, 2015
tobyemmanuel:
Very wrong. Try this out
your code is way different from mine. you didn't quote $variable, you only concatenated it to the quoted string.
WebmastersDifference Between Arguments And Parameters In PHP by maekhel(op): 8:58am On Jan 07, 2015
We will be looking at an interesting topic today: Difference Between Arguments And Parameters. No doubts most of us do use these two terms interchangeably while working with functions. New to functions? read my other tutorial Functions In PHP.
These two terms can be confusing and are mostly used in place of the other, but as a programmer you should be able to identify and use your terms properly.So what are arguments and parameter?
Let start with Arguments. Arguments are the passed to a function when the function is called. Those items supplied to a function are what is referred to as argument.
While Parameters on the other hand are passed to a function when it is declared or created. These items passed to a function are what the function is a excepting as arguments.
Sound confusing right? Let clarify things with a simple example:
<?php
/**let create a simple function to find the area of a rectangle
*$length and $breath are our parameters
*/

function findArea($length, $breath){
return $length * $breath;
}
/**now let make use of our findArea()
*$len and $bre are our arguments
*/

$len = 4;

$bre = 9;

findArea($len, $bre);

//this will output: 36

?>
Conclusion
The example should make things more clearer now, so learn and start using the right terms. I hope this brief tutorial was helpful. Comments, questions, suggestions and views are all welcomed, will love to hear from you. Also remember to subscribe to our newsletter to receive more of great tutorials.
source: http://tutorialslodge.com/difference-arguments-parameters-php/
ProgrammingDifference Between Arguments And Parameters In PHP by maekhel(op): 8:52am On Jan 07, 2015
We will be looking at an interesting topic today: Difference Between Arguments And Parameters. No doubts most of us do use these two terms interchangeably while working with functions. New to functions? read my other tutorial Functions In PHP.
These two terms can be confusing and are mostly used in place of the other, but as a programmer you should be able to identify and use your terms properly.So what are arguments and parameter?
Let start with Arguments. Arguments are the passed to a function when the function is called. Those items supplied to a function are what is referred to as argument.
While Parameters on the other hand are passed to a function when it is declared or created. These items passed to a function are what the function is a excepting as arguments.
Sound confusing right? Let clarify things with a simple example:
<?php
/**let create a simple function to find the area of a rectangle
*$length and $breath are our parameters
*/

function findArea($length, $breath){
return $length * $breath;
}
/**now let make use of our findArea()
*$len and $bre are our arguments
*/

$len = 4;

$bre = 9;

findArea($len, $bre);

//this will output: 36

?>
Conclusion
The example should make things more clearer now, so learn and start using the right terms. I hope this brief tutorial was helpful. Comments, questions, suggestions and views are all welcomed, will love to hear from you. Also remember to subscribe to our newsletter to receive more of great tutorials.
source: http://tutorialslodge.com/difference-arguments-parameters-php/
WebmastersRe: I Dont Know What Is Wrong With Whogohost My Website Server Is Going Down by maekhel(m): 9:08pm On Jan 06, 2015
whogoscam:
Whogohost.com is a total fraud... Don't use them... They are bloody scammers

Your server will always be down. They stole your money.. Switch host

https://www.nairaland.com/2079083/whogohost.com-total-scam-fraud
I use WhoGoHost for all my sites and I don't have problems with them and their support is great.
WebmastersRe: Wordpress Guru, Help Me by maekhel(m): 8:58pm On Jan 06, 2015
PenSoftCorp:
ALSO wp rename is not a premium plugin
lol
WebmastersRe: Single Vs Double Quotes In PHP by maekhel(op): 3:04pm On Jan 06, 2015
emmyvet:
Ya is helpful thanks
Glad it was helpful
ProgrammingRe: Single Vs Double Quotes In PHP by maekhel(op): 1:51pm On Jan 06, 2015
blenyo11:
This is a good one. I have never noticed this
it happens...thats why no one is an island of knowledge
WebmastersSingle Vs Double Quotes In PHP by maekhel(op): 12:01pm On Jan 06, 2015
Today we will be taking a quick look at Single vs Double Quotes In PHP. This is going to be a very brief tutorial. Most people (myself inclusive) misuse this quotes. Now that I understand where and when they are being used, I decided to share it with you guys.
The Single Quotes (”)
The single quotes will not interpret the value of the variables enclosed in them. The single quotes will output the string as they are without any interpretation. Let demonstrate this with example:
//let declare a variable and assign value to it
$variable = "Tutorialslodge";
echo 'This lesson is from $variable';
When the code snippets above is executed, it will out put: This lesson is from $variable. This is to show that the single quotes will display whatever it contains as it is.
The Double Quotes (“”)
The Double Quotes unlike the Single Quotes will not only output values but also interpret any variables it contains. Let use the same example from above to demonstrate Double Quotes:
//let declare a variable and assign value to it
$variable = "Tutorialslodge";
echo "This lesson is from $variable";
When this code is executed, the PHP HyperText Preprocessor will parse the $variable in the double quotes and replace it with the value which that variable holds. So our code will output: This lesson is from Tutorialslodge.
So you now know when and where to use each of the quotes. Remember if you want your variables to be interpreted, use Double Quotes, hence use Single Quotes.
I hope this tutorial is helpful. Kindly drop your comments, questions, suggestions and views in the box below.
source: http://tutorialslodge.com/single-vs-double-quotes-php/
ProgrammingSingle Vs Double Quotes In PHP by maekhel(op): 11:54am On Jan 06, 2015
Today we will be taking a quick look at Single vs Double Quotes In PHP. This is going to be a very brief tutorial. Most people (myself inclusive) misuse this quotes. Now that I understand where and when they are being used, I decided to share it with you guys.
The Single Quotes (”)
The single quotes will not interpret the value of the variables enclosed in them. The single quotes will output the string as they are without any interpretation. Let demonstrate this with example:
//let declare a variable and assign value to it
$variable = "Tutorialslodge";
echo 'This lesson is from $variable';
When the code snippets above is executed, it will out put: This lesson is from $variable. This is to show that the single quotes will display whatever it contains as it is.
The Double Quotes (“”)
The Double Quotes unlike the Single Quotes will not only output values but also interpret any variables it contains. Let use the same example from above to demonstrate Double Quotes:
//let declare a variable and assign value to it
$variable = "Tutorialslodge";
echo "This lesson is from $variable";
When this code is executed, the PHP HyperText Preprocessor will parse the $variable in the double quotes and replace it with the value which that variable holds. So our code will output: This lesson is from Tutorialslodge.
So you now know when and where to use each of the quotes. Remember if you want your variables to be interpreted, use Double Quotes, hence use Single Quotes.
I hope this tutorial is helpful. Kindly drop your comments, questions, suggestions and views in the box below.
source: http://tutorialslodge.com/single-vs-double-quotes-php/
WebmastersRe: Nairaland ADS Or Google Adwords Which Is Better by maekhel(m): 7:13pm On Jan 03, 2015
will like to knw too
WebmastersRe: Need A Good Web Programmer by maekhel(m): 2:26pm On Dec 26, 2014
Youngler:
Who can design a site like www.tradot.com ?



How much will you do it?

And which other works have you done?
how much is your budget
WebmastersRe: How Does Nairalnad Fronpage Works by maekhel(op): 12:56pm On Dec 25, 2014
onyengbu:
I have done that stuff over and over again. Heres how it work:

1. you have a table named "frontpage" which is joined by the field "id_topic" for e.g referencing the "id" of the "topics" table.

2. You then have an admin accessible only "move to frontpage" link/button on each topic and if a topic is frontpage-worthy, click on this link and it takes you to a page or just lauch a modal where you will have the topic title in a text box. You can now modify the title the way you want it to appear on the frontpage. you can also have the link to the topic in another text box so you can modify it to add a permalink to a specific post on the thread.

3. When you are done, submit this to your frontpage table.

**** You can also place other fields in the frontpage table to control sticky et all.
tanks fr dis info
WebmastersRe: How Does Nairalnad Fronpage Works by maekhel(op): 11:21am On Dec 25, 2014
Raiders:
Contact the moderator in the section you upload your topic. If its a good topic I believe it would be move to the front page
Thanks fr the reply, am nt asking fr my post to be moved to frontpage, but want to know how it works so I can implement it on my project.
WebmastersHow Does Nairalnad Fronpage Works by maekhel(op): 11:14am On Dec 25, 2014
Merry Xmas fellow webmasters, please I will like to know nairaland frontpage works. I mean how is the moving thread to frontpage works, am currently working on a project that needs that frontpage feature. Please anybody that knows about this should comment.
WebmastersRe: Help: How To Transfer Wordpress To Server From Local Computer by maekhel(m): 9:21am On Dec 23, 2014
fattbabakay:
i can see u created dah site...U own it??
Yea
WebmastersRe: Help: How To Transfer Wordpress To Server From Local Computer by maekhel(m): 8:35am On Dec 23, 2014
Vicben:
Good day webmasters. I recently designed a website with Wordpress on my local computer using wamp.

Now I want to launch the site but do not know how to go about it. I have a domain name and have paid for hosting with Qservers.net

Your assistance will be greatly appreciated. thanks and God bless
read http://tutorialslodge.com/how-to-move-a-local-wordpress-blog-to-a-live-server/

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 (of 26 pages)