Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,156,059 members, 7,828,729 topics. Date: Wednesday, 15 May 2024 at 01:25 PM

Let's Learn PHP - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Let's Learn PHP (2785 Views)

Learn PHP(OOP) And Mysql With PDO By Building A P2P Donation Website / Learn Php On Nairaland Will Put You Guys Through / Let's Learn Javascript (2) (3) (4)

(1) (2) (Reply) (Go Down)

Let's Learn PHP by Software202(m): 12:41pm On Nov 09, 2015
Hello my fellow web developers; I am Erisan Olasheni from Lagos.
What brought me here is that I discovered many Nigerian web developers are having problems with programming codes from scratch. Because of this, I am ready to take PHP here in Nairaland for free and at the end of this tutorial, all of us will be able to program PHP from scratch for any task we want to carry out.
All I need from you before the start of this tutorial is 50 likes and 50 shares...
Am hoping....
If you need any enquiry contact me with: +2349094587121; cgi.helpcentre@gmail.com

1 Like 2 Shares

Re: Let's Learn PHP by Software202(m): 2:44pm On Nov 09, 2015
Now, let's start with: What is PHP?
PHP stands for "PHP: Hypertext Processor"... PHP is a server scripting language for a webpage. With PHP you can create dynamic websites like Facebook, Yahoo, Twitter and so on. IF ONLY YOU PAY ATTENTION.
- What Can PHP do?
PHP can be used to validate HTML forms.
- PHP can be used query the database.
- PHP can be used to send emails and other useful information.
And so on...

More shares if you want me to continue.

1 Like 2 Shares

Re: Let's Learn PHP by Adesege(m): 5:59pm On Nov 09, 2015
While this is a good initiative, though I know you will not finish what you started, I think you need to learn web security to secure your site.

Sometime last year, I pen tested tulzmaster and I noticed some vulnerabilities.

If I had any bad intentions, I would have gone further.

Also, if you want to teach, you teach. It's funny to ask for likes and shares before you teach.

I know those who must have read your post will be like, "who cares anyway". So, please change your attitude.

If people think you are doing a great job, they will willingly like and share.

See you at the top.

Best regards,
Adesege

1 Like

Re: Let's Learn PHP by semasir: 9:21pm On Nov 09, 2015
Adesege said it all.... I'm following! Teach and don't do further than that.

God bless you
Re: Let's Learn PHP by Software202(m): 6:35pm On Nov 12, 2015
No security is not vulnerable, so I believe you may penetrate the website...
But if the story is true, why not mail the mods instead of keeping it yourself?
I start the tutorial

What You Need To Know
The start learning PHP, you are expected to know HTML, CSS, (and or JavaScript)...
If you don't know any of these, don't worry: Just click on the link in my signature to start learning for free.

Loading,,,,,,,,
Re: Let's Learn PHP by Software202(m): 6:43pm On Nov 12, 2015
PHP Install
You need to get PHP installed on your computer... To get the coding running.
But before that let's install a web server.. I prefer using Apache, but if you are running on Windows Os, you can also use IIS. To get Apache, visit : http://www.apache.org after that, you get your PHP installed by downloading it at http://www.php.net click on downloads to get the latest PHP version..

Loading,,,,,
Re: Let's Learn PHP by kaykash007(m): 5:14pm On Nov 13, 2015
boss please can we have this class on Watsapp chat or bbm for easy access? thanks.
Re: Let's Learn PHP by Software202(m): 12:26pm On Nov 18, 2015
PHP Syntax
PHP syntax simply means how to, and what to write in PHP code.
A PHP code starts with <?php and ends with ?> that is every PHP code and syntax will be written in between the symbols:
Example
 <?php echo ('Live PHP on Nairaland!'); ?>
// This outputs: Live PHP on Nairaland!

1 Like

Re: Let's Learn PHP by DOCTORDONE: 6:02pm On Nov 18, 2015
I like your lecture. Ride on.
Re: Let's Learn PHP by Software202(m): 12:47pm On Nov 25, 2015
loading,,,,
Re: Let's Learn PHP by ZinoFego: 2:51pm On Nov 25, 2015
Good work.

Software202:
Hello my fellow web developers; I am Erisan Olasheni from Lagos.
What brought me here is that I discovered many Nigerian web developers are having problems with programming codes from scratch. Because of this, I am ready to take PHP here in Nairaland for free and at the end of this tutorial, all of us will be able to program PHP from scratch for any task we want to carry out.
All I need from you before the start of this tutorial is 50 likes and 50 shares...
Am hoping....
If you need any enquiry contact me with: +2349094587121; cgi.helpcentre@gmail.com
Re: Let's Learn PHP by paking(m): 4:18pm On Nov 26, 2015
I have a site hosted on VPS I intend to install phpmailer on this server. My question is do I need MySQL server on this VPS before phpmailer can be installed or I can just install it on the VPS and run it.




Software202:
Hello my fellow web developers; I am Erisan Olasheni from Lagos.
What brought me here is that I discovered many Nigerian web developers are having problems with programming codes from scratch. Because of this, I am ready to take PHP here in Nairaland for free and at the end of this tutorial, all of us will be able to program PHP from scratch for any task we want to carry out.
All I need from you before the start of this tutorial is 50 likes and 50 shares...
Am hoping....
If you need any enquiry contact me with: +2349094587121; cgi.helpcentre@gmail.com
Re: Let's Learn PHP by Adesege(m): 1:28am On Nov 27, 2015
paking:
I have a site hosted on VPS I intend to install phpmailer on this server. My question is do I need MySQL server on this VPS before phpmailer can be installed or I can just install it on the VPS and run it.





Except if you want to work with a database, mysql is not needed.

Regards,
Adesege
Re: Let's Learn PHP by paking(m): 2:32am On Nov 27, 2015
Thanks, Adesege
Re: Let's Learn PHP by Nobody: 7:32am On Nov 27, 2015
Why did you put the echoed statement inside bracket?
Re: Let's Learn PHP by Software202(m): 12:53am On Nov 30, 2015
go4gold:
Why did you put the echoed statement inside bracket?
I know you are asking that because you normally see some without bracket; isn't it? - Yes, the bracket is optional for the echo() function, meaning you can include or not.
Re: Let's Learn PHP by Software202(m): 12:56am On Nov 30, 2015
paking:
I have a site hosted on VPS I intend to install phpmailer on this server. My question is do I need MySQL server on this VPS before phpmailer can be installed or I can just install it on the VPS and run it.




No you don't except you want to manage a database/databases. Servers for sending mails through PHP is not concerned about the MySQL Server.
Re: Let's Learn PHP by Software202(m): 1:31am On Nov 30, 2015
,,,loading
PHP Variables
What Is a Variable?

A variable in all programming languages can be defined as a container for storing values.
This value can either be a text,number, php statements or another variabe: just as you see fit.
The variable can later be called in your code whenever the value is needed.
How To Declare Variable in PHP
Declaring a variable in PHP is the easiest thing! Congratulations! (lol)
All you need to know on that is:
* A PHP code starts with a dollar ($) sign.
* After the $ dollar sign, it must be followed by either the underscore (_) or alphabet; then can either be followed by even digits
* Varibles can be as long as you wish, but they are case-sensitive.That is $a is different from $A in PHP.
PHP Variable Examples
Here are some examples of what we've learnt so far:

<?php
$msg = "Hey! See how interesting PHP is on Nairaland!";
echo ($msg);//this will output: Hey! See how interesting PHP is on Nairaland!
?>
Re: Let's Learn PHP by Software202(m): 1:51pm On Dec 01, 2015
,,,loading
Re: Let's Learn PHP by CRAZYMADMAN(m): 3:14pm On Dec 01, 2015
**** just passing ******
Re: Let's Learn PHP by Software202(m): 9:57pm On Dec 03, 2015
who's here?
Re: Let's Learn PHP by kevoh(m): 5:36am On Dec 04, 2015
Software202:
who's here?
You are taking too long to post on PHP. 3 to 4 days interval sometimes a week, damn that's too long. Eager people will and are getting less interested. Drop it like it's hot and watch newbies follow the thread and even bombard you with PHP questions!

Good work all the same!
Re: Let's Learn PHP by Software202(m): 7:41am On Dec 11, 2015
PHP Data Output
Outputing Data In PHP simply means wrting directly into d web browser. As we know PHP is a server-side programming language, so all information will be processed on d server first before displaying on d web browser.
To write out anything in PHP, u make use of the echo() or print(). In btwn the brackets will be the value of ur output.
Example:

<?php
echo ("Hello Nairalanders!"wink;
print ("Hello Nairalanders!"wink;
?>

Those of the above code outputs " Hello Nairalanders! ". Both the echo() and print() functions perform the same task, it's now left for u to choose ur preference.
Outputing HTML Codes
Aside from mere texts, PHP can also be used to write out HTML codes. Just in d same way:

<?php
echo ("<b>Hello Nairalanders!</b>"wink;
?>

The above code outputs Hello Nairalanders! in a bold form. You can try any HTML code.
* What To Note
Please not that my values are within quotes.Yes that is how unless u want to
Re: Let's Learn PHP by Software202(m): 9:53am On Dec 11, 2015
.
Re: Let's Learn PHP by Webhost(m): 11:44pm On Dec 11, 2015
Now I need urgent help from php masters;

I have a table named symptoms with 2 columns (id) and (symptoms) for example

id Symptoms
1 I have an head ache
2 My anckle aches
3 My eyes hurt
4 I am vomiting once every day
5 I have an eczema

these symtopms will be on the home page in form of a question with a check box in front of each one.

Now if a user selects 1,2 and 5, nd submits, the next page will bring a message saying "you have Malaria"
1,2,4 and 5 will say "you have Typhoid"

Selecting 1 3 and 5 will say "you have Measles"

etc. I believe you get the gist.

How do I go about this? using the table ids above?

Mr Adesege, Software202 and others pls answer comprehensively and urgently.
Thanks
Re: Let's Learn PHP by Adesege(m): 1:16am On Dec 12, 2015
Webhost:

Mr Adesege pls answer comprehensively and urgently.
Thanks

Hello, what you will want to do is group the symptoms, and sickness table with the 'sick_symp' table.

For example, you can have a table called sickness with columns; ID, name. ID is the table's id.

You can have another table called sick _symp with sickness_id as a foreign key.

Symptoms_id is a foreign key here which will take the id of the symptoms table.

So you can, for example, have a row like this

SYMPTOMS table

ID Name
1 I have an head ache
2. My anckle aches
3. My eyes hurt
4. I am vomiting once every day
5. I have an eczema

And SICKNESS table

ID Name
1 Malaria
2 Typhoid
3 HIV

sick_symp table

ID sickness_id symptoms_id
1 1 2
2 1. 1
3 1 5

Then you can do a join statement on symptoms table, sickness table and sick_symp.

mysql_query("select * from sick_symp ss
INNER JOIN symptoms sm ON ss.symptoms_id=sm.ID
INNER JOIN sickness se ON se.ID=ss.sickness_id.

You can get the sickness name and id with that.

You should be familiar with the join statement anyway.
Re: Let's Learn PHP by Adesege(m): 1:37am On Dec 12, 2015
...
Re: Let's Learn PHP by RockMaxi: 10:58am On Dec 12, 2015

@OP, thumbs up to you but if you are going to teach PHP, make sure you do cos some of us are here to see what we can learn especially OOP. Don't dare to derail or delay and if you need help, I will gladly offer in my own little way.
Re: Let's Learn PHP by Software202(m): 12:15pm On Dec 12, 2015
You don't really need lot of SQL schemantics here. Since you know already that type of answer to give provide the options, then you do like this:
Let's make the names of the checkbox in your form be: 1,2,3,4and5 respectively.

$c1=$_POST['1'],$c2=$_POST['2'],$c3=POST['3'],$c4=POST['4'], $c5=$_POST["5"];
$q=mysqli_query($urConn,"select * from symptoms"wink;

echo '
<form method="post" action="'.$_SERVER['PHP_SELF'].'">';
while($fQ=msqli_fetch($q))
{
echo '<input type="checkbox" name="'.$fQ[0].'" value="'.$fQ[0].'" /> '.$fQ[1];
}
echo '</form>';
if(isset($c1)&&isset($c2)&&isset($c5)) //echo "You have malaria";
else if(isset($c1)&&isset($c2)&&isset($c4)&&isset($c5)) //echo "You have typhoid";
else if(isset($c1)&&isset($c3)&&isset($c5)) // echo "You have Measles;
Re: Let's Learn PHP by Adesege(m): 12:43pm On Dec 12, 2015
Software202:
You don't really need lot of SQL schemantics here. Since you know already that type of answer to give provide the options, then you do like this:
Let's make the names of the checkbox in your form be: 1,2,3,4and5 respectively.

$c1=$_POST['1'],$c2=$_POST['2'],$c3=POST['3'],$c4=POST['4'], $c5=$_POST["5"];
$q=mysqli_query($urConn,"select * from symptoms"wink;
while($fQ=mysqli_fetch($q))
{
echo '<input type="checkbox" value="'.$fQ[0]." /> '.$fQ[1];
}

if(isset($c1)&&isset($c2)&&isset($c5)) //echo "You have malaria";
else if(isset($c1)&&isset($c2)&&isset($c4)&&isset($c5)) //echo "You have typhoid";
else if(isset($c1)&&isset($c3)&&isset($c5)) // echo "You have Measles;

That's a bad way to write the code. It won't be easy to maintain

(1) (2) (Reply)

Recommend An Ad Network For A Low Traffic Blog / How To Get Morethan #20,000 Airtime On MTN Sim For Free! / I Want To Read 10 New Blogs Today. Only First Ten Blogs In The Thread.

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 57
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.