Maekhel's Posts
Nairaland Forum › Maekhel's Profile › Maekhel's Posts
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 (of 26 pages)
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. <?phpThe 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. <?phpConclusion 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/ |
if still open, you can contact me meziemichael@gmail.com |
Username: maekhel How many hours you have per day for freelance/remote work: 6 Skills: HTML5, CSS3, PHP, MySQL, JavaScript, JQuery |
have you tried mysite.com/webmail |
DONOCSO:Thanks for the review |
76A38DB6, 07032047179 or meziemichael@gmail.com let discuss the project. |
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>You should get a screen similar to below. <!DOCTYPE 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/ |
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. |
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. |
Name: Michael phone: 07032047179 resident area: Lagos |
2sExy1:I have |
Guys nid ur help on this one. which wud u advice someone with OND comp sci to go for? |
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/ |
osile2012:thats not true |
jboy01:I think you are the one mixing it up. |
tobyemmanuel:your code is way different from mine. you didn't quote $variable, you only concatenated it to the quoted string. |
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: <?phpConclusion 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/ |
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: <?phpConclusion 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/ |
whogoscam:I use WhoGoHost for all my sites and I don't have problems with them and their support is great. |
PenSoftCorp:lol |
emmyvet:Glad it was helpful |
blenyo11:it happens...thats why no one is an island of knowledge |
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 itWhen 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 itWhen 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/ |
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 itWhen 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 itWhen 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/ |
will like to knw too |
Youngler:how much is your budget |
onyengbu:tanks fr dis info |
Raiders: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. |
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. |
fattbabakay:Yea |
Vicben:read http://tutorialslodge.com/how-to-move-a-local-wordpress-blog-to-a-live-server/ |