<?xml version='1.0' encoding='UTF-8'?><rss xmlns:atom="http://www.w3.org/2005/Atom" xmlns:openSearch="http://a9.com/-/spec/opensearchrss/1.0/" xmlns:blogger="http://schemas.google.com/blogger/2008" xmlns:georss="http://www.georss.org/georss" xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr="http://purl.org/syndication/thread/1.0" version="2.0"><channel><atom:id>tag:blogger.com,1999:blog-3879629789995591062</atom:id><lastBuildDate>Sun, 24 Nov 2024 10:57:51 +0000</lastBuildDate><category>form validation</category><category>php</category><category>website</category><category>MYSQL security</category><category>angular</category><category>best 3 web framework</category><category>code editors</category><category>form handling</category><category>frontend</category><category>html</category><category>react</category><category>web framework</category><category>website development</category><title>rbgtech</title><description>It deals with web development and other tech related content</description><link>https://rbgtech.blogspot.com/</link><managingEditor>noreply@blogger.com (renson)</managingEditor><generator>Blogger</generator><openSearch:totalResults>20</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3879629789995591062.post-7498969179588817518</guid><pubDate>Sun, 03 Oct 2021 12:52:00 +0000</pubDate><atom:updated>2021-10-03T06:23:19.384-07:00</atom:updated><title>Why github is the new Resume for web developers</title><description>&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;&amp;nbsp;Why learn Git hub as a programmer?&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;As a matter of fact, many recruiters in the field of programming or web development expect you as a programmer to use the new technology to sell your skills, for example, the recruiters expect to see your portfolio and not the paperwork, besides that you are also expected as a programmer to showcase the sample of the work you have done, and this forms the basis for learning Github.&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Basics of Git hub&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Git: This is software for tracking changes during a set of files with the aim of coordinating work among programmers working together developing ASCII text file during the software development process.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Github: it is a website and cloud-based service provider that allows programmers to store, manage and share source code.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Repository: It is a central place or a folder where programmers can store and manage their codes.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Fork: It means writing a second copy of the original code but with the aim of producing the same result and after it working you can now merge it to the original codebase. This applies especially when programmers are working as a community and they want to contribute to your source code though they cannot change your code and if their contributions are helpful you can now decide to merge or implement their code.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Pull request: This is a way developers can notify others in the team about the changes you have pushed to a branch in the repository on GitHub. This allows your teammates to review your code and discuss giving different suggestions if needed before the final copy can be merged to the base branch.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Git push: this is a time when you want to send your commits and ask them to update their branch&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Version control: this is often the practice of tracking and managing changes to the code or the software.&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;How to push code to GitHub&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;There are two ways, one of it is by using GitHub desktop or git command line&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Using command line&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;If you do not have a GitHub desktop and want to use the command line to commit your project to your git hub account, then you have to type in the browser github.com.It will direct you to the dashboard where you will see the green button to create the new repository.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Then on the same project page, you will click the green “Code” to display the URL that you will use to connect to that folder, copy the URL.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Connecting the local repository and the remote repository you will use:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;&lt;b&gt;$ git remote add origin&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Pushing the changes you have made from the local repository to the new remote repository you will use this command:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;&lt;b&gt;$ git push origin master&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;1. Using the terminal or the command line you have to make sure that you are in the correct file where your project is.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;2. use git status to check if git is initialized.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;In case you encounter a mistake message: fatal: Not a git repository (or any of the parent directories): .git, meaning that the folder where your project isn&#39;t being tracked. To correct the error, type &lt;b&gt;git init&lt;/b&gt; and then continue with the process of committing your project.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Also if other errors might appear, you can copy the error and paste it in google chrome to search.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Some Useful commands to note&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Pull request using command line&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;This allows others to make changes to your project without interfering with the original work.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Here are some useful commands to learn:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;1. git pull “remote name” “branch name”&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;2. git pull consists of both git fetch and git merge combined together.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;3. git fetch: it takes the recent commits in the local repository&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;4. git merge: it merges the branch from a remote to a local branch&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;5. git checkout –b “branch name”: It helps in making a new branch with its name.&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Using Git Hub desktop to push code&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;The first thing to do is to download the executable file for GitHub desktop and it is available for any operating system.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;You need to sign up or create an account with GitHub as a prerequisite.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Quick set up to GitHub desktop&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Click the button as shown below and a pop up will appear telling you to open GitHub desktop&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgNqjXZ6cv-xhyBaApnwlc0m-xHYesyiKH4z5fmPcBvKswvK76R3C3ImKoj25Ke2gUBeRDcy0fdnS-fD2D5-zkuwKgaaHOdZuN6SMQshYeAyszqVy0qaLBPSspLDvpOJePbbszDo7GSwlha8zYvDcnPHJi8hRGhyi6yveYMWJL7x6SLb5QX-RuME8s9=s1237&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;github set up&quot; border=&quot;0&quot; data-original-height=&quot;616&quot; data-original-width=&quot;1237&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgNqjXZ6cv-xhyBaApnwlc0m-xHYesyiKH4z5fmPcBvKswvK76R3C3ImKoj25Ke2gUBeRDcy0fdnS-fD2D5-zkuwKgaaHOdZuN6SMQshYeAyszqVy0qaLBPSspLDvpOJePbbszDo7GSwlha8zYvDcnPHJi8hRGhyi6yveYMWJL7x6SLb5QX-RuME8s9=s16000&quot; title=&quot;quick set up&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Clone a repository on desktop&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Cloning means a copy of a target repository&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Using GitHub desktop, click the clone button to create a copy of the repository or simply a folder.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjTLY3ZjDjyxesmYQ_JXZ6_TvbAONBH2iWgmAqqTBLmP1pNPLXk3LM2uFFTOdK90sxod1q-Fe6x2AMKt6ORZB6JwrOck-_W1G2d4NdCZITOa4333VYJg-Vxoh7sTM4Fg5aETbv5wcardx_jhnM-lqwI4twI1d2lRDZw50mkZ6JXx45aKo50Mv3unAz0=s1366&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;clone a repository&quot; border=&quot;0&quot; data-original-height=&quot;746&quot; data-original-width=&quot;1366&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEjTLY3ZjDjyxesmYQ_JXZ6_TvbAONBH2iWgmAqqTBLmP1pNPLXk3LM2uFFTOdK90sxod1q-Fe6x2AMKt6ORZB6JwrOck-_W1G2d4NdCZITOa4333VYJg-Vxoh7sTM4Fg5aETbv5wcardx_jhnM-lqwI4twI1d2lRDZw50mkZ6JXx45aKo50Mv3unAz0=s16000&quot; title=&quot;github desktop&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;When a new folder is created in your local computer, another hidden directory is also created with the “.git” extension.&lt;/span&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg_QzHiumSvBG08g7zj-3zxdpvHbBWPLPCYteScjq-j6tO9VPZ-RqiixQlI5NDaq0Q9SGbXjDWSrjhNoKuwLCX7DFwzKZbPZFP-TishxGo3MRqmO6SfwxYcTHy0gqR4D4s6uNcEe3Q1GVJC-7eiw_ZxgBKDwEqEE98yFgkRm9XICoeM-GknjbrEtAy2=s759&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img alt=&quot;cloned repository&quot; border=&quot;0&quot; data-original-height=&quot;328&quot; data-original-width=&quot;759&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEg_QzHiumSvBG08g7zj-3zxdpvHbBWPLPCYteScjq-j6tO9VPZ-RqiixQlI5NDaq0Q9SGbXjDWSrjhNoKuwLCX7DFwzKZbPZFP-TishxGo3MRqmO6SfwxYcTHy0gqR4D4s6uNcEe3Q1GVJC-7eiw_ZxgBKDwEqEE98yFgkRm9XICoeM-GknjbrEtAy2=s16000&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Copy all of your work to the cloned folder and that can include even the images and any other files.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgE81CipcC2MS1uc02Ncrx4T5EVt2OGP5c_zsuMKWbVJXdf9PJ_7calJopR65C8JQSNAEiKJq10cXHyq7Q6DUVSLInFAnZO3MY3rHKemYQ3Xkmo7cVKX-Sh7PM5IjRc1i9vy5wT2Tqloa780DDfpB30wR_robw0TYeRSzdICIcmZMmzGJy_XIRwwhCE=s833&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;new folder&quot; border=&quot;0&quot; data-original-height=&quot;539&quot; data-original-width=&quot;833&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEgE81CipcC2MS1uc02Ncrx4T5EVt2OGP5c_zsuMKWbVJXdf9PJ_7calJopR65C8JQSNAEiKJq10cXHyq7Q6DUVSLInFAnZO3MY3rHKemYQ3Xkmo7cVKX-Sh7PM5IjRc1i9vy5wT2Tqloa780DDfpB30wR_robw0TYeRSzdICIcmZMmzGJy_XIRwwhCE=s16000&quot; title=&quot;new cloned repository&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Commit to master on Github Desktop&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;All the files you added to the cloned folder can be seen on the GitHub desktop. You can give a comment on the files that you want to submit&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Image&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhQcNqbiGX5RvvYKYksT8x6nVqxSOVB41gMOOOPpZENGF0xgn89aKMc_KBIn9zZWWBzp2Zg08UDo_xbqWrav2GUr4GQvHr4awWdmV96wBUrTKE2hj1_Qfxbb0Wg232v_OxRz9wVq5i0Q_qDNaBhAeG10DQNox5mB3L-OPZDWMWx_KaEPJOqhO37m0it=s646&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;commit to master&quot; border=&quot;0&quot; data-original-height=&quot;646&quot; data-original-width=&quot;608&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEhQcNqbiGX5RvvYKYksT8x6nVqxSOVB41gMOOOPpZENGF0xgn89aKMc_KBIn9zZWWBzp2Zg08UDo_xbqWrav2GUr4GQvHr4awWdmV96wBUrTKE2hj1_Qfxbb0Wg232v_OxRz9wVq5i0Q_qDNaBhAeG10DQNox5mB3L-OPZDWMWx_KaEPJOqhO37m0it=s16000&quot; title=&quot;commit to github&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Publish branch to GitHub&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;You can publish your files to the GitHub space by clicking the “publish branch” button.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiB1r0F5XIdsEoYR9RLirX8c0XN6mOBXiJfN5Jq-Ie1TczKWP8xVq-Dd7t-om8bzgtkD3SApbMHMiNzU5Al2dJKhfnvrtDwAL9Xbvc7yqj25-PKgXBbBpHpMj9_8Bfwt4DcCJYjUj7fi2b6IrMf4ceigFFDpaYrgWBepnnJM-CdfniXqT7Y1Jc7bks4=s318&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;publish  branch&quot; border=&quot;0&quot; data-original-height=&quot;82&quot; data-original-width=&quot;318&quot; src=&quot;https://blogger.googleusercontent.com/img/a/AVvXsEiB1r0F5XIdsEoYR9RLirX8c0XN6mOBXiJfN5Jq-Ie1TczKWP8xVq-Dd7t-om8bzgtkD3SApbMHMiNzU5Al2dJKhfnvrtDwAL9Xbvc7yqj25-PKgXBbBpHpMj9_8Bfwt4DcCJYjUj7fi2b6IrMf4ceigFFDpaYrgWBepnnJM-CdfniXqT7Y1Jc7bks4=s16000&quot; title=&quot;publish branch to Github&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: large;&quot;&gt;Lastly, you can check if it has been successfully published.&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</description><link>https://rbgtech.blogspot.com/2021/10/why-github-is-new-resume-for-web.html</link><author>noreply@blogger.com (renson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/a/AVvXsEgNqjXZ6cv-xhyBaApnwlc0m-xHYesyiKH4z5fmPcBvKswvK76R3C3ImKoj25Ke2gUBeRDcy0fdnS-fD2D5-zkuwKgaaHOdZuN6SMQshYeAyszqVy0qaLBPSspLDvpOJePbbszDo7GSwlha8zYvDcnPHJi8hRGhyi6yveYMWJL7x6SLb5QX-RuME8s9=s72-c" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3879629789995591062.post-3668174743987899726</guid><pubDate>Mon, 13 Sep 2021 15:48:00 +0000</pubDate><atom:updated>2021-09-14T01:43:16.948-07:00</atom:updated><title>How to customize blogger theme</title><description>&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;How to change the blog template website&lt;/span&gt;&lt;/h1&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;The first step is to sign in to your blogger account&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;While at your blog on the left side menu click the theme and
it will direct you to the tab where you will be asked to back up the current theme
or directly click the restore tab where you will be able to upload the free theme which you should have downloaded.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;1.&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieVVMctbjhxmURWT4H5WPdQcqnrghN2ETmgGcdFtHYpkh_aZf8ME7TTbtoFUk235a4JzWd_p5YGfuwkmxgc5AbhgURI2DzBMmncvsYNAotVB-WLXwAzufJqQqJHSEaNVmQrZOfmDjYCFo/s1063/change-blogger-layout-dashboard-1.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;Theme&quot; border=&quot;0&quot; data-original-height=&quot;666&quot; data-original-width=&quot;1063&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieVVMctbjhxmURWT4H5WPdQcqnrghN2ETmgGcdFtHYpkh_aZf8ME7TTbtoFUk235a4JzWd_p5YGfuwkmxgc5AbhgURI2DzBMmncvsYNAotVB-WLXwAzufJqQqJHSEaNVmQrZOfmDjYCFo/w320-h200/change-blogger-layout-dashboard-1.jpg&quot; title=&quot;blogger theme customization&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;

&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;2.&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnkTS4yemFXjxBCWFUn_qGknYDgEUkCD7Zy5ltJajGd8X4M-VX0MwehWM_pEP-ep2-_rFVfqqRULb-gJ_oVYkyMHCZ0NxdsQq4J7pvzU16uyGrFxITRChKx5urqKW_-L66JojeoSeLdhU/s469/theme-settings-of-blogger-blog.webp&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;backup theme&quot; border=&quot;0&quot; data-original-height=&quot;281&quot; data-original-width=&quot;469&quot; height=&quot;167&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgnkTS4yemFXjxBCWFUn_qGknYDgEUkCD7Zy5ltJajGd8X4M-VX0MwehWM_pEP-ep2-_rFVfqqRULb-gJ_oVYkyMHCZ0NxdsQq4J7pvzU16uyGrFxITRChKx5urqKW_-L66JojeoSeLdhU/w353-h167/theme-settings-of-blogger-blog.webp&quot; title=&quot;blog&quot; width=&quot;353&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;br /&gt;&lt;/p&gt;

&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/jVoAF-NkZe4&quot; title=&quot;YouTube video player&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;How to get free themes for your website&lt;/span&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Visit &lt;a href=&quot;https://www.templatesyard.com/&quot;&gt;templatesyard.com&lt;/a&gt; and you will get very many blogs
templates&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Click one of the templates and download the free version&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV04XJw5DrbwrdIIOAlnmZ5HcQJ-ql5tsIUyoi3mE2eRqLOfVMK9m2Mpx0_jmTB4nj_zU5p1L3xqpcjVgDLDXC5-Aji16VliQLfZC4D4aYOZEuM9bRjep808BWC8v2OEg1y5nofLUfbTE/s291/free+web.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;free blog template&quot; border=&quot;0&quot; data-original-height=&quot;173&quot; data-original-width=&quot;291&quot; height=&quot;149&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiV04XJw5DrbwrdIIOAlnmZ5HcQJ-ql5tsIUyoi3mE2eRqLOfVMK9m2Mpx0_jmTB4nj_zU5p1L3xqpcjVgDLDXC5-Aji16VliQLfZC4D4aYOZEuM9bRjep808BWC8v2OEg1y5nofLUfbTE/w304-h149/free+web.jpg&quot; title=&quot;free website builder&quot; width=&quot;304&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj_raeSuUAAWDYCSCsEEJc8eFHnEwKt36zeMQ_G1GYfHooPZPEo-XLcCMo1vyukzSpFQZyGHbElaPl5LWK8UWArxfg_l1moKZF8X_EJrJYl3Y0p6cThQEr7BYXHgL_NoIHyeLNZOAwu04/s372/free+version.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;free download&quot; border=&quot;0&quot; data-original-height=&quot;106&quot; data-original-width=&quot;372&quot; height=&quot;91&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjj_raeSuUAAWDYCSCsEEJc8eFHnEwKt36zeMQ_G1GYfHooPZPEo-XLcCMo1vyukzSpFQZyGHbElaPl5LWK8UWArxfg_l1moKZF8X_EJrJYl3Y0p6cThQEr7BYXHgL_NoIHyeLNZOAwu04/w320-h91/free+version.png&quot; title=&quot;free template&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;After the download is complete extract the file to get the
XML document which will be uploaded to our blog.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyrw4WcybjCSaV0u4gNfJgAio4abyNjDbrhnhfYHW-57pb5IuckY6yQILOGR3LI9Or9GwuT8hDUBjc2cYqSQVzhti39lWypcHjfwgcmYWSDQGF9QjGYDTwgkUlKqYXfHhBdRRPQxKp2x4/s636/Extract-the-Zip-File.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;unzipped theme&quot; border=&quot;0&quot; data-original-height=&quot;460&quot; data-original-width=&quot;636&quot; height=&quot;171&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyrw4WcybjCSaV0u4gNfJgAio4abyNjDbrhnhfYHW-57pb5IuckY6yQILOGR3LI9Or9GwuT8hDUBjc2cYqSQVzhti39lWypcHjfwgcmYWSDQGF9QjGYDTwgkUlKqYXfHhBdRRPQxKp2x4/w475-h171/Extract-the-Zip-File.png&quot; title=&quot;downloaded template&quot; width=&quot;475&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;

&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;How to customize your blogger layout&lt;/span&gt;&lt;/h2&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1kqN4bez3zpz7KpzUTTbHNaSPWacNkA2KAiBiju0uhj7nBEpLet2CDTnCcRE1jTDITheMhf14Zse90N3ictLajdKysG-ikHveXImxennmm9_SPTeJxf_GsvAV9CiH6_oi9Cf7K_s7qB4/s1063/change-blogger-layout-dashboard-2.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;layout&quot; border=&quot;0&quot; data-original-height=&quot;330&quot; data-original-width=&quot;1063&quot; height=&quot;123&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1kqN4bez3zpz7KpzUTTbHNaSPWacNkA2KAiBiju0uhj7nBEpLet2CDTnCcRE1jTDITheMhf14Zse90N3ictLajdKysG-ikHveXImxennmm9_SPTeJxf_GsvAV9CiH6_oi9Cf7K_s7qB4/w320-h123/change-blogger-layout-dashboard-2.jpg&quot; title=&quot;change blog layout&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;While still on your blogger, on
the left menu click the layout tab and it will direct you to the different layout of the theme, make sure to click the writing icon in each part to change
or even delete the link.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;margin-left: 0.25in;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyyAqMdM5WQTtZ-98h4BglQX4BLvhkUQJodvsMZvN0K1HkkVDghnyuyIgMC8pZra_m_i_IW-S9KW2YISRhcHm9oDpgFFFxyt6ghNWixaDgKqMYdL5heu4iMnx9e1rqH3fma-yfqLg6W7w/s1068/blogger-layout-window-1068x600.webp&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;save or cancel&quot; border=&quot;0&quot; data-original-height=&quot;600&quot; data-original-width=&quot;1068&quot; height=&quot;180&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyyAqMdM5WQTtZ-98h4BglQX4BLvhkUQJodvsMZvN0K1HkkVDghnyuyIgMC8pZra_m_i_IW-S9KW2YISRhcHm9oDpgFFFxyt6ghNWixaDgKqMYdL5heu4iMnx9e1rqH3fma-yfqLg6W7w/w320-h180/blogger-layout-window-1068x600.webp&quot; title=&quot;blogger&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;

&lt;h2 style=&quot;margin-left: 0.25in; text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;How to change the social plugins&lt;/span&gt;&lt;/h2&gt;

&lt;p class=&quot;MsoListParagraphCxSpFirst&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;1. Visit the social plugin right from the
top to the bottom of the layout and click the pen icon to allow you to write.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;&lt;o:p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/o:p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;2. In case you do not have some social
sites for example YouTube you will then have to delete it but if you have it
you can link your YouTube channel by copying the link from the browser and
pasting it at the social plugin on the YouTube section. The same applies to other
social plugins&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQfbZ2AcunIe5SAMuDcIk81u0xcXS6roThkXnZcrucRevtdXhS9tfbcsYeN2TFsRe76MgMVesQN7e-GlhzNUIMFBB8q0EttiH8RFAfH2DwOC9kIziUL0rQQCQRDYNVW6wU-_jXykrxne0/s1347/social+plugin.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;social plugin&quot; border=&quot;0&quot; data-original-height=&quot;632&quot; data-original-width=&quot;1347&quot; height=&quot;158&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQfbZ2AcunIe5SAMuDcIk81u0xcXS6roThkXnZcrucRevtdXhS9tfbcsYeN2TFsRe76MgMVesQN7e-GlhzNUIMFBB8q0EttiH8RFAfH2DwOC9kIziUL0rQQCQRDYNVW6wU-_jXykrxne0/w320-h158/social+plugin.png&quot; title=&quot;customize social plugins&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;o:p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/o:p&gt;&lt;p&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpMiddle&quot;&gt;&lt;br /&gt;&lt;/p&gt;

&lt;p class=&quot;MsoListParagraphCxSpLast&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;3. After the whole changes are made make sure to
save on the layout section and the whole theme, the button found on the right
and bottom section of the theme. Then keep checking for every step on the changes you have made&lt;/span&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/p&gt;&lt;p class=&quot;MsoListParagraphCxSpLast&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;</description><link>https://rbgtech.blogspot.com/2021/09/how-to-customize-blogger-theme.html</link><author>noreply@blogger.com (renson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieVVMctbjhxmURWT4H5WPdQcqnrghN2ETmgGcdFtHYpkh_aZf8ME7TTbtoFUk235a4JzWd_p5YGfuwkmxgc5AbhgURI2DzBMmncvsYNAotVB-WLXwAzufJqQqJHSEaNVmQrZOfmDjYCFo/s72-w320-h200-c/change-blogger-layout-dashboard-1.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3879629789995591062.post-1778386629303491613</guid><pubDate>Sun, 12 Sep 2021 11:49:00 +0000</pubDate><atom:updated>2021-09-14T01:33:43.096-07:00</atom:updated><title>How and Why I became a blogger</title><description>&lt;h1 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;My Area of specialization&amp;nbsp;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: medium;&quot;&gt;Here I am introducing a niche that I will pursue in the online space and that is web development and its surrounding technology.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCzVMWEMeOoyvRa2HgdsO0x5O8ctUA35mZEdYk5l-TfcEJoT2MzFP3mLRRx-8tIkMFzzM27VADN5ynf5EFbdJhfWcQS2TYQsJDoqGtz3vI1uw_35ZTOSMqlx5c2VynBw0m1xLdU9i6rXk/s225/webtech.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img alt=&quot;web technology&quot; border=&quot;0&quot; data-original-height=&quot;225&quot; data-original-width=&quot;225&quot; height=&quot;149&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCzVMWEMeOoyvRa2HgdsO0x5O8ctUA35mZEdYk5l-TfcEJoT2MzFP3mLRRx-8tIkMFzzM27VADN5ynf5EFbdJhfWcQS2TYQsJDoqGtz3vI1uw_35ZTOSMqlx5c2VynBw0m1xLdU9i6rXk/w385-h149/webtech.jpg&quot; title=&quot;web&quot; width=&quot;385&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: medium;&quot;&gt;This comes after my own experience in my career life, I was learning different programming languages but could not combine them to create something that I could see with other samples of websites&amp;nbsp; but when it came to doing an exam I was good and scoring high but&amp;nbsp; was not fully satisfied for I could not do much or else it takes a lot of time to make something small.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: medium;&quot;&gt;With the experience I had to search for content on practical tutorials and this led me to different ways with different frameworks and programming languages, at first they were hard to even prepare the space for starting the first project and this is very common with all as long as it is the first time to do it.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: medium;&quot;&gt;It also was not enough to learn the frameworks and the new technology because there were also very many new technology and frameworks in the many tutorials that I found and this made me to even be confused , and this challenge made me launch my blogging work to analyze for many having the same&amp;nbsp; challenge as me and simplified the problem that many beginners in the web development career suffer from.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: medium;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: medium;&quot;&gt;Learning web development though not enough again without knowing how to deploy the website to the online space, has made me introduce the same to my audience who most of them are students or beginners but also can be helpful to those who want to launch online business through a website.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: medium;&quot;&gt;&amp;nbsp;There are many companies that offer hosting services and all seem to be offering the same services but strict analysis on the subject will help the audience to understand the variety of hosting companies available and how one is different from the other, the extensive analysis has helped&amp;nbsp; and will continue helping&amp;nbsp; the students to know the one that offers free hosting services for practicing purposes.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: medium;&quot;&gt;In conclusion,I would like to welcome all who are interested with web development and web technology as we explore the world of technology.&lt;/span&gt;&lt;/p&gt;</description><link>https://rbgtech.blogspot.com/2021/09/how-and-why-i-became-blogger.html</link><author>noreply@blogger.com (renson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCzVMWEMeOoyvRa2HgdsO0x5O8ctUA35mZEdYk5l-TfcEJoT2MzFP3mLRRx-8tIkMFzzM27VADN5ynf5EFbdJhfWcQS2TYQsJDoqGtz3vI1uw_35ZTOSMqlx5c2VynBw0m1xLdU9i6rXk/s72-w385-h149-c/webtech.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3879629789995591062.post-5493545580524396613</guid><pubDate>Fri, 10 Sep 2021 12:01:00 +0000</pubDate><atom:updated>2021-09-10T05:01:45.407-07:00</atom:updated><title>What is the best web hosting service in 2021?</title><description>&lt;h1 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; font-weight: normal; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;What is web hosting?&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;Web hosting services is an internet hosting service that permits individuals and corporates to make their website to be available to the worldwide web. Web hosts are companies that can  provide&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;data center space and also they can lease their server space to clients including other internet connectivity services.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMuwHHdv-gTmsXG8esYfeJFAciy3f8XtYBZpTXcFNORHtmapucIAG-_Hj4L-BasGu_gAPjdPHIt7cGwtkKRXBy66kYOa0kGwTDoO-R9janfxMiQnKRCBM2Z980DZydEch_lHW-ic2SNdQ/s288/web+hosting.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;175&quot; data-original-width=&quot;288&quot; height=&quot;186&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMuwHHdv-gTmsXG8esYfeJFAciy3f8XtYBZpTXcFNORHtmapucIAG-_Hj4L-BasGu_gAPjdPHIt7cGwtkKRXBy66kYOa0kGwTDoO-R9janfxMiQnKRCBM2Z980DZydEch_lHW-ic2SNdQ/w369-h186/web+hosting.png&quot; width=&quot;369&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h1 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; font-weight: normal; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;Web hosting providers&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;For  the better running of your website you need to make the best choice on the hosting company that  will meet your needs, the examples of the top hosting providers include:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt; text-align: left;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;Top 10 web hosting providers&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;div&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;1. Blue host&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;2. Hostgator&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;3. Hostinger&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;4.GoDaddy&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;5. Dreamhost&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;6. Hostpapa&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;7. IONOS&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;8. Network solutions&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;9.A2 Hosting&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; font-weight: normal; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;Which web hosting is best for beginners?&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;Concerning the web  best hosting that is friendly to the beginners include :&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; font-weight: normal; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;Top 3 web hosting for beginners&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;h4 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt; text-align: left;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;1. Bluehost&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;They offer a variety of solutions that include: shared hosting, VP hosting, WordPress hosting, dedicated hosting, and WooCommerse.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;Features for Bluehost&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;It offers a free domain name for the first year&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;It has a WordPress builder&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;It has 24/7 expert support&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;It has  a basic plan for the beginners at $2.95/mo*&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt; text-align: left;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;2. Hostinger&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;This is another hosting provider that has a starting basic plan of $2.59/mo*  plus a free .com domain for the first year including a free SSL.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;It also has a 30-day money payback if you are not satisfied with its services. Without forgetting 24/7 support,&lt;/span&gt;&lt;strong style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&amp;nbsp;&lt;/strong&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;Free Email,&lt;/span&gt;&lt;strong style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&amp;nbsp;&lt;/strong&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;Manages WordPress.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt; text-align: left;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;3. Hostgator&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;div&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;This is another site that can be considered when choosing to launch your website in the space, It has some free features that include: Unmetered bandwidth to help you bring the traffic you want, free domain registration, free SSL certificate to ensure your visitors are secured and also allows one-click installs. Most importantly it has the basic plan of $2.75/mo*.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; font-weight: normal; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;strong style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;Free web hosting for students&lt;/span&gt;&lt;/strong&gt;&lt;/h2&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;The best site that allows students to host their website for free is Heroku though not limited to students only but generally for beginners, it has extensive features that include backend capabilities.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;How to start with Heroku?&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW3j_UG2bv9euMIq0UzfOOzO2RiBbsuCsPR9AywtQ0hIZzfF2TF8n-MgP4-jvggeTA8ZvLuoI_XZxfnudGVfQlLmlPxkfi2vzJX4fibiEun3-MKa6n9Q7QdEPLntT5gj227D1hsKnbpeA/s310/webhost2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;163&quot; data-original-width=&quot;310&quot; height=&quot;142&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW3j_UG2bv9euMIq0UzfOOzO2RiBbsuCsPR9AywtQ0hIZzfF2TF8n-MgP4-jvggeTA8ZvLuoI_XZxfnudGVfQlLmlPxkfi2vzJX4fibiEun3-MKa6n9Q7QdEPLntT5gj227D1hsKnbpeA/w380-h142/webhost2.jpg&quot; width=&quot;380&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; font-weight: normal; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;strong style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;Offers to check on internet service providers&amp;nbsp;&lt;/span&gt;&lt;/strong&gt;&lt;/h2&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;For&lt;/span&gt;&lt;strong style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&amp;nbsp;&lt;/strong&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;you to land on the best hosting provider, it is best to check on some of the major tips on the hosting provider that carry your website, brand, and business in the online space.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;Here are some of the guides that will help you in making a budget.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt; text-align: left;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;1. The free domain&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;div&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;It is very nice to land on a company that offers free domain services but again take note of these:&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;a)Do they transfer the ownership to you or do they hold the ownership? If they own the ownership rights then it means you can not transfer later to another hosting company, or maybe pay a huge amount of money to get it back.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;b)What is the renewal fee after one year of a huge cutoff discount?&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;These are the questions that you need to understand before you decide on any.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt; text-align: left;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;2)Do they allow separate buying of the domain name and hosting?&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;div&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;Since the domain name is your identity in the online space then you must decide very well on the hosting company if it can allow you to buy the domain name from other companies or you are restricted to only using the one from them.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;It is safer to go for the one that gives you the freedom to get the domain name from other sites that suit you.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt; text-align: left;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;3.)Take note of the bandwidth and disk space Terms and conditions&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;div&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;It is very important to note that the hosting company can not offer more disk space and bandwidth than what they have stated in their terms. In case your website grows very fast then you would think of the expense that you will make to sustain the demand.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt; text-align: left;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;4)buy and save with commission coupons&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;div&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;It is also essential to check whether the hosting has an affiliate program that might earn you commission and even some free coups that might help in reducing the total cost of purchase.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt; text-align: left;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;5)Backup your data&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;div&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;It is good practice always to have an offline backup of your data and not to fully trust the hosting company to do it for you.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt; text-align: left;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;6.)Time duration of the contract with the hosting company&lt;/span&gt;&lt;/span&gt;&lt;/h4&gt;&lt;div&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span data-preserver-spaces=&quot;true&quot; style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;Try as much as possible to avoid long-term contracts with the hosting company unless you trust their services then you can go ahead.&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p style=&quot;background: transparent; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p style=&quot;background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; color: #0e101a; margin-bottom: 0pt; margin-top: 0pt;&quot;&gt;&lt;/p&gt;</description><link>https://rbgtech.blogspot.com/2021/09/what-is-best-web-hosting-service-in-2021.html</link><author>noreply@blogger.com (renson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMuwHHdv-gTmsXG8esYfeJFAciy3f8XtYBZpTXcFNORHtmapucIAG-_Hj4L-BasGu_gAPjdPHIt7cGwtkKRXBy66kYOa0kGwTDoO-R9janfxMiQnKRCBM2Z980DZydEch_lHW-ic2SNdQ/s72-w369-h186-c/web+hosting.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3879629789995591062.post-2254441003748767334</guid><pubDate>Sun, 05 Sep 2021 11:51:00 +0000</pubDate><atom:updated>2021-09-08T04:11:06.238-07:00</atom:updated><title>Impact Of Technology in Our Society</title><description>&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&amp;nbsp;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk7W2cGOZhwLbiyLQWc67ddcn5J9YJqVFyLZQoBzS4gEjA-NDK2W0OxyXxffTmpHLBm6Zss0TDN_MC_8xC7kavnI6qNMEKkaiFfX1YynwJgfOpSPYD0XjcwIkHWeXAIPq6goSZdYgumOs/s303/tech1.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;166&quot; data-original-width=&quot;303&quot; height=&quot;190&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk7W2cGOZhwLbiyLQWc67ddcn5J9YJqVFyLZQoBzS4gEjA-NDK2W0OxyXxffTmpHLBm6Zss0TDN_MC_8xC7kavnI6qNMEKkaiFfX1YynwJgfOpSPYD0XjcwIkHWeXAIPq6goSZdYgumOs/w443-h190/tech1.jpg&quot; width=&quot;443&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Impact Of Technology in Our Society&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Ancient and modern human civilization have in one way or another benefited with advancement in technology,complex tasks have been able to be performed with a lot of ease with a short period of time but also we can never fail to mention of its negative impacts that it has also caused in the society.&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Having realized the two phases that technology has brought to our society ,we therefore are going to dig deeper on the positive and negative impacts of technology&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&amp;nbsp;
  &lt;script async src=&quot;https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=ca-pub-1007879981664209&quot;
     crossorigin=&quot;anonymous&quot;&gt;&lt;/script&gt;
&lt;!-- ads --&gt;
&lt;amp-ad width=&quot;100vw&quot; height=&quot;320&quot;
     type=&quot;adsense&quot;
     data-ad-client=&quot;ca-pub-1007879981664209&quot;
     data-ad-slot=&quot;5653894854&quot;
     data-auto-format=&quot;rspv&quot;
     data-full-width=&quot;&quot;&gt;
  &lt;div overflow=&quot;&quot;&gt;&lt;/div&gt;
&lt;/amp-ad&gt;
  &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Positive Impact Technology in Our Society&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-WsORcOdsFO_jbLLwAc3N04aYc1EqS08BBYs9HS0T8thUu5gnc5PD04nRvvGr-ivIm0y9tmvrjf0hg13Y3FVu8Ap75kb27yeNgatGvWh3ZteJMj1ds88ZDPaaOHPavAvihAixzu3DxPY/s251/tech3.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;201&quot; data-original-width=&quot;251&quot; height=&quot;197&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-WsORcOdsFO_jbLLwAc3N04aYc1EqS08BBYs9HS0T8thUu5gnc5PD04nRvvGr-ivIm0y9tmvrjf0hg13Y3FVu8Ap75kb27yeNgatGvWh3ZteJMj1ds88ZDPaaOHPavAvihAixzu3DxPY/w369-h197/tech3.jpg&quot; width=&quot;369&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;As we know that technology has become part of human lifestyle in terms of communication,education,transport,health,agriculture and many more&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Communication&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Many people all over the world are able to interact ,pass and receive information effectively due to advancement in telecommunication sector.The emerging of social media such as facebook,pinterest,Watsapp with advanced features such as video conferencing has made the world to appear as a small and reachable community.&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Education&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;The advancement of technology has boosted the education sector in Kenya and globally where knowledge is available on the internet &amp;nbsp;on almost everything ,besides that most learning institutions are going online and offering their services there to meet the demand of large population in need on knowledge.It has also helped cut off the heavy expenses that could have been used as most of online education is free.&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Transport&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;In the ancient times it was cumbersome to travel long distances and even to transport goods over long distances but with the advancement of technology on transportation sector such as introduction of air ,water and road transport has allowed the society to make a choice on what means of transport to use and hence has helped in shaping our modern world.&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Health&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;The health of people being very essential and a priority in all the countries in the world,we can therefore say that there has been a drastic advancement in this area and the most scaring diseases such as HIV &amp;amp; AIDS and other dangerous diseases in the world have been handled with ease and for others with the advancement in technology research has been easily conducted unlike in the ancient times when there was nothing to help even protect the doctors who were treating the patients and even the means of testing the patients was hard.&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Agriculture&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Ancient agricultural practices have radically been &lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;revolutionized&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&amp;nbsp;with the modern machines such as the use of tractors to plough ,plant and even harvest.The &amp;nbsp;modern way of preserving water has given room even for the excess to &amp;nbsp;be used in irrigating crops hence ensuring all year farming and not depending on seasonal changes.All this advancement has helped produce surplus produce to feed the high population.&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Negative Impacts of Technology in our society&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgekT9QL8s6Fz_0f0h5-Cp4LawRtGqROJ64v7Sais_Og9Dc4o_55yv2SKjoSgXOZt-zZiqBHGbhr9HD_1Y0O-1rnkkGPgK_e7qwGtHxX-3nPrpy1h2X7RbevJUio1-9-tmw0xLLj0ifRAs/s275/tech2.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;183&quot; data-original-width=&quot;275&quot; height=&quot;183&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgekT9QL8s6Fz_0f0h5-Cp4LawRtGqROJ64v7Sais_Og9Dc4o_55yv2SKjoSgXOZt-zZiqBHGbhr9HD_1Y0O-1rnkkGPgK_e7qwGtHxX-3nPrpy1h2X7RbevJUio1-9-tmw0xLLj0ifRAs/w381-h183/tech2.jpg&quot; width=&quot;381&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Even with the many positive impacts that the technology has brought in our society,there &lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&amp;nbsp;are &lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;also &lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;some &lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;negative impac&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;ts &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;that it has left&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&amp;nbsp;behind&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&amp;nbsp;and it is still causing.&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;They include:&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Time Wasting&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;The advancement of technology &amp;nbsp;has made many people to loose that social nature of being as most of their time is spent in watching ,listening,reading or even using the tools more than interacting and socializing with others ,to a point where families break up or quarrel &amp;nbsp;one another also the children lacking the parental guidance and love as both of them do not have time for the other.&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Psychological and Health Problems&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Due to more time being spent in the gadgets such as smart phones and laptops and cheap internet among other things has led to more harm to the health of persons using them oftelyn such as eye problems caused by light &amp;nbsp;of the same gadgets or even due to wrong body balance as you use the gadgets may lead to long term problems on the spinal cord and other parts of the body.Watching of horrifying movies and clips and even some containing pornographic acts which erode the good social values and tampers with the brain.&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;Conclusion:&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;The correct use of technology will ensure success in the society and for this to be achieved the effort of everybody from the family members at home to the religious institutions and to the government and the most affected generation is the younger one that needs direction and substitute sources of learning information need be used such as textbooks&lt;/span&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 12pt;&quot;&gt;&lt;span style=&quot;font-family: times;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;</description><link>https://rbgtech.blogspot.com/2021/09/impact-of-technology-in-our-society.html</link><author>noreply@blogger.com (renson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk7W2cGOZhwLbiyLQWc67ddcn5J9YJqVFyLZQoBzS4gEjA-NDK2W0OxyXxffTmpHLBm6Zss0TDN_MC_8xC7kavnI6qNMEKkaiFfX1YynwJgfOpSPYD0XjcwIkHWeXAIPq6goSZdYgumOs/s72-w443-h190-c/tech1.jpg" height="72" width="72"/><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3879629789995591062.post-8747757824493374221</guid><pubDate>Thu, 12 Aug 2021 12:06:00 +0000</pubDate><atom:updated>2021-08-12T22:44:37.485-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">code editors</category><title>Top 8 Web Development IDE&#39;s</title><description>&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&amp;nbsp;&amp;nbsp;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVFzu06UwiEJmwu_mg6PYJKLQHSxdqi6yLUrVenWkVGGOzAY283GaFaVxo1BMWu9iaVGuaZWMRKvufsW-RV5JZctZ2zWMV-q41ZSxRyWDI5ST56wMUmtfRRV2pwv3NqOrIzo08v3mdfI8/s275/best+IDes.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;183&quot; data-original-width=&quot;275&quot; height=&quot;170&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVFzu06UwiEJmwu_mg6PYJKLQHSxdqi6yLUrVenWkVGGOzAY283GaFaVxo1BMWu9iaVGuaZWMRKvufsW-RV5JZctZ2zWMV-q41ZSxRyWDI5ST56wMUmtfRRV2pwv3NqOrIzo08v3mdfI8/w488-h170/best+IDes.jpg&quot; width=&quot;488&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Web Development IDE&#39;s&lt;/span&gt;&lt;/h1&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;What is&amp;nbsp; an IDE?&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;An integrated development environment(IDE): is a software application that provides comprehensive facilities to computer programmers for software development. An IDE normally consists of at least a source code editor, build automation tools and a debugger.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Why do we need an IDE?&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;The major reason for the need of an IDE is that they offer a central interface with all the tools a developer needs, including:&amp;nbsp; a Debugger: Debuggers are used during testing and can help developers debug their application programs.&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Best IDE for web development 2021&lt;/span&gt;&lt;/h2&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;1.Visual studio code&lt;/span&gt;&lt;/h4&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWq57ugJaoW2PXQG_hrrxm8Lzhlya3HhILNxrGNHD3kiCxrUCeJWysqca9S173KsbWaXAWR8TlBToSag94FpTYb7kVq8u0oGnBMbWz5KdwKh-E5xUhuG2pu2Nwqme0EqO3nGQc_qIOk9k/s300/visual+studio+code.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;168&quot; data-original-width=&quot;300&quot; height=&quot;168&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjWq57ugJaoW2PXQG_hrrxm8Lzhlya3HhILNxrGNHD3kiCxrUCeJWysqca9S173KsbWaXAWR8TlBToSag94FpTYb7kVq8u0oGnBMbWz5KdwKh-E5xUhuG2pu2Nwqme0EqO3nGQc_qIOk9k/s0/visual+studio+code.png&quot; width=&quot;300&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Visual Studio Code is a source-code editor made by Microsoft for Windows, Linux and macOS. Features include support for debugging, syntax highlighting, intelligent code completion, snippets, code refactoring, and embedded Git. Users can change the theme, keyboard shortcuts, preferences, and install extensions that add additional functionality.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Visual studio code can be used&amp;nbsp; with a variety of programming languages which include: Java, JavaScript, Go, Node.js, Python and C++.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;2.Atom by Github&lt;/span&gt;&lt;/h4&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSEFgmLNZtIMiiIt6UbKRiaQ_DGyL0mHrB-B69Bo7BkCjH_hp7YH7mbaVZ8cYkwNSR0d4n7I9y1oNVYWDE-xZUILJHTPwxtKFmPd1fEWfh-uNqBpERmcit0A0XoRDL00OUAYeeU_x5s4k/s300/Atom.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;168&quot; data-original-width=&quot;300&quot; height=&quot;168&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSEFgmLNZtIMiiIt6UbKRiaQ_DGyL0mHrB-B69Bo7BkCjH_hp7YH7mbaVZ8cYkwNSR0d4n7I9y1oNVYWDE-xZUILJHTPwxtKFmPd1fEWfh-uNqBpERmcit0A0XoRDL00OUAYeeU_x5s4k/s0/Atom.jpg&quot; width=&quot;300&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Atom is a free and open-source text and source code editor for macOS, Linux, and Microsoft Windows with support for plug-ins written in JavaScript, and embedded Git Control, developed by GitHub. Atom is a desktop application built using web technologies&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Atom&#39;s default packages can apply syntax highlighting for multiple programming languages and file formats.Besides that it is easy to use even with the beginners.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;3.Sublime Text 3&lt;/span&gt;&lt;/h4&gt;&lt;div&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNSpFUMO-3AOoDT1yBsS1rzNa9RczBxE-AIEK9T1l2BBPvYD-UpkEGKvr2vXttotc_iC0y90G8CcO4wCLIijuZsKcrrBrnXaBeAGXOhm_SsQuchkNEszvpFHk7XmzLxi6MqqrdcoJ_lWs/s365/sublime+text.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;138&quot; data-original-width=&quot;365&quot; height=&quot;138&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhNSpFUMO-3AOoDT1yBsS1rzNa9RczBxE-AIEK9T1l2BBPvYD-UpkEGKvr2vXttotc_iC0y90G8CcO4wCLIijuZsKcrrBrnXaBeAGXOhm_SsQuchkNEszvpFHk7XmzLxi6MqqrdcoJ_lWs/w330-h138/sublime+text.jpg&quot; width=&quot;330&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Sublime Text is a commercial source code editor. It natively supports many programming languages and markup languages. Users can expand its functionality with plugins, typically community-built and maintained under free-software licenses. To facilitate plugins, Sublime Text features a Python API.&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Features of Sublime Text&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Auto-save, which attempts to prevent users from losing their work&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Customizable key assignments, a navigational tool which allows users to assign hotkeys to their choice of options in both the menus and the toolbar&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Find as you type, begins to look for the text being entered as the user types without requiring a separate dialog box&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Spell check function corrects as you type&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Repeat the last action&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;A wide selection of editing commands, including indenting and unindenting, paragraph reformatting and line joining&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;4.PYcharm&lt;/span&gt;&lt;/h4&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjguaL-dc6N6ixpe0yAfnyCgZATxhw9pAkzRHufnJs_R1ieI8OzNy9tX6AFYdqvJoRCCbXmQLPK5e7JsxRLk4jD5JbRagEESkaUnQWjJxz0ZlpZ3DL9vMOroDEOIRT7GqqChixbNFw_N7w/s225/pycharm.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;225&quot; data-original-width=&quot;225&quot; height=&quot;157&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjguaL-dc6N6ixpe0yAfnyCgZATxhw9pAkzRHufnJs_R1ieI8OzNy9tX6AFYdqvJoRCCbXmQLPK5e7JsxRLk4jD5JbRagEESkaUnQWjJxz0ZlpZ3DL9vMOroDEOIRT7GqqChixbNFw_N7w/w410-h157/pycharm.jpg&quot; width=&quot;410&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;PYcharm ide is used in computer programming, specifically for the Python language. It provides code analysis, a graphical debugger, an integrated unit tester, integration with version control systems (VCSes), and supports web development with Django as well as data science with Anaconda.&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Features of PYcharm&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Coding assistance and analysis, with code completion, syntax and error highlighting, linter integration, and quick fixes&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Project and code navigation: specialized project views, file structure views and quick jumping between files, classes, methods and usages&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Python refactoring: includes rename, extract method, introduce variable, introduce constant, pull up, push down and others&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Support for web frameworks: Django, web2py and Flask [professional edition only]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Integrated Python debugger&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Integrated unit testing, with line-by-line code coverage&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Google App Engine Python development [professional edition only]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Support for scientific tools like matplotlib, numpy and scipy [professional edition only]&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;It competes mainly with a number of other Python-oriented IDEs, including Eclipse&#39;s PyDev, and the more broadly focused Komodo IDE.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;PyCharm provides an API so that developers can write their own plugins to extend PyCharm features. Several plugins from other JetBrains IDE also work with PyCharm. There are more than 1000 plugins which are compatible with PyCharm.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;5.Intellij&lt;/span&gt;&lt;/h4&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhytM_HrA7by3jQwZx21gjC2dF7xFA2ThIfw8D-luQjDY1s5cKRl79bVy9Z72kGGVnCfJB8ta0vYhKuf45GyQhtmeyTFpOba4ANE1B1ffbfmI9AHJexetLa8QSeLTXw7fR0Bbw7fzEBqvk/s225/intellij.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;225&quot; data-original-width=&quot;225&quot; height=&quot;225&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhytM_HrA7by3jQwZx21gjC2dF7xFA2ThIfw8D-luQjDY1s5cKRl79bVy9Z72kGGVnCfJB8ta0vYhKuf45GyQhtmeyTFpOba4ANE1B1ffbfmI9AHJexetLa8QSeLTXw7fR0Bbw7fzEBqvk/w443-h225/intellij.jpg&quot; width=&quot;443&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;It&amp;nbsp; is an integrated development environment (IDE) written in Java for developing computer software developed by JetBrains .&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Features of Intellij&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Coding assistance:The IDE provides certain features&amp;nbsp; like code completion by analyzing the context, code navigation which allows jumping to a class or declaration in the code directly, code refactoring, code debugging.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;It supports many programming languages which include:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;HTML/XHTML/CSS&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;JavaScript&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;PHP (via a plugin)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Ruby/JRuby&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;SQL&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;TypeScript and many more.&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;System Requirement:&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Here are some of the key specifications to check on your computer before you install this IDE:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;i&gt;RAM: 2 GB RAM minimum, 8 GB RAM recommended.&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;&lt;i&gt;.Disk space:2.5 GB and another 1 GB for caches minimum, solid-state drive with at least 5 GB of free space recommended.&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;&lt;i&gt;.OS Version: 64 Bit Microsoft Windows 8 or later&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;macOS 10.13 or later&lt;span style=&quot;white-space: pre;&quot;&gt;	&lt;/span&gt;Any Linux distribution that supports Gnome, KDE, or Unity DE.&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;6.PHPStorm&lt;/span&gt;&lt;/h4&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBo9fhlmbuuRuIFJ3idrfkJXzG0GJNp-m5sbPdnLSR1cSR-d5JPvIA9Z0x6_XJQTvZezcZmvNG-wvSr8NfHMFZTwY_Ot34Vfdm3-OoUkWK5m-WAr_N4ZYDKaOrsU5197uhzeMLrFgpSrI/s225/phpStorm.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;225&quot; data-original-width=&quot;225&quot; height=&quot;191&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhBo9fhlmbuuRuIFJ3idrfkJXzG0GJNp-m5sbPdnLSR1cSR-d5JPvIA9Z0x6_XJQTvZezcZmvNG-wvSr8NfHMFZTwY_Ot34Vfdm3-OoUkWK5m-WAr_N4ZYDKaOrsU5197uhzeMLrFgpSrI/w439-h191/phpStorm.jpg&quot; width=&quot;439&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;PhpStorm provides an editor for PHP, HTML and JavaScript with on-the-fly code analysis, error prevention and automated refactorings for PHP and JavaScript code.&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Features of PHP Storm&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;PhpStorm provides a rich code editor[9] for PHP with syntax highlighting, extended code formatting configuration, on-the-fly error checking, and code completion.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Code autocompletion finalizes classes, methods, variable names, and PHP keywords, plus commonly used names for fields and variables depending on their type.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;7.WebStorm&lt;/span&gt;&lt;/h4&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhe80LgmUp1OMePjrglJfCSyOUwCFnoY2sNKIr_xIiF8IxJ4ikBTzldNwRFRbgpkAZpsqf8rc8NLJaip0N9qyV2toVPYB4ntL_rbaYroMufQS4eg5jV-UlhExL9NJUV4Rqla_RV9GSnBIo/s243/webStorm.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;208&quot; data-original-width=&quot;243&quot; height=&quot;163&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhe80LgmUp1OMePjrglJfCSyOUwCFnoY2sNKIr_xIiF8IxJ4ikBTzldNwRFRbgpkAZpsqf8rc8NLJaip0N9qyV2toVPYB4ntL_rbaYroMufQS4eg5jV-UlhExL9NJUV4Rqla_RV9GSnBIo/w432-h163/webStorm.jpg&quot; width=&quot;432&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;This IDE shares the same featurs with PHPStorm&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;8.NetBeans&lt;/span&gt;&lt;/h4&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLUf9xCgDv81WxBYDk08Hj7SD1PTyCz7tQup1B92Mc5nJREsoj7jX7l0CealmKKlRUG4hQheEThWmo5oeRxobddnWWJGbYMlZWFvJUaRFT9mt2e_vcjt0pE0MBvBptuIz49BPdXuI_YX4/s398/netbeans.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;127&quot; data-original-width=&quot;398&quot; height=&quot;115&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLUf9xCgDv81WxBYDk08Hj7SD1PTyCz7tQup1B92Mc5nJREsoj7jX7l0CealmKKlRUG4hQheEThWmo5oeRxobddnWWJGbYMlZWFvJUaRFT9mt2e_vcjt0pE0MBvBptuIz49BPdXuI_YX4/w320-h115/netbeans.png&quot; width=&quot;320&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;NetBeans is an integrated development environment (IDE) for Java. NetBeans allows applications to be developed from a set of modular software components called modules. NetBeans runs on Windows, macOS, Linux and Solaris. In addition to Java development, it has extensions for other languages like PHP, C, C++, HTML5, and JavaScript.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Conclusion&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;There is a need for you to choose the best tool and learn to use it ,for this is what makes a part of the best web developer.By using the IDE tool ,it will save your coding time and easy to identify errors in your code.&lt;/span&gt;&lt;/p&gt;</description><link>https://rbgtech.blogspot.com/2021/08/top-8-web-development-ides.html</link><author>noreply@blogger.com (renson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjVFzu06UwiEJmwu_mg6PYJKLQHSxdqi6yLUrVenWkVGGOzAY283GaFaVxo1BMWu9iaVGuaZWMRKvufsW-RV5JZctZ2zWMV-q41ZSxRyWDI5ST56wMUmtfRRV2pwv3NqOrIzo08v3mdfI8/s72-w488-h170-c/best+IDes.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3879629789995591062.post-7927240168299897591</guid><pubDate>Thu, 12 Aug 2021 06:49:00 +0000</pubDate><atom:updated>2021-08-12T00:30:16.292-07:00</atom:updated><title>Social Networking project part 2</title><description>&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjscEXm3gyDPza8x84pAKrORY5DqHnNt7DSRWKu2SoBWpZJzDO1schcdBvCHGxqlA5E1sE6cmvouQ184_PqavWprnRfzlCQyy9jJNB2gH1ALsYQcMxEPnB9LGky74w-eBafovjus0LCYKA/s310/social.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;162&quot; data-original-width=&quot;310&quot; height=&quot;186&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjscEXm3gyDPza8x84pAKrORY5DqHnNt7DSRWKu2SoBWpZJzDO1schcdBvCHGxqlA5E1sE6cmvouQ184_PqavWprnRfzlCQyy9jJNB2gH1ALsYQcMxEPnB9LGky74w-eBafovjus0LCYKA/w416-h186/social.jpg&quot; width=&quot;416&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h1&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Social Networking website part 2&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;This is the second part of the social networking project ,if you have not done the first part check it out first &lt;a href=&quot;https://rbgtech.blogspot.com/2021/08/all-that-we-have-learnt-together.html&quot; target=&quot;_blank&quot;&gt;here&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;profile.php&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;One of the first things that new users may want to do after signing up and logging&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: verdana; font-size: x-large;&quot;&gt;in is to create a profile.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: x-large;&quot;&gt;Here is a program to upload,resize and sharpen the images:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;. profile.php&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;
  
&lt;/span&gt;&lt;/p&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;code&gt;&amp;lt;?php

 require_once &#39;header.php&#39;;

 if (!$loggedin) die();

 echo &quot;&amp;lt;div class=&#39;main&#39;&amp;gt;&amp;lt;h3&amp;gt;Your Profile&amp;lt;/h3&amp;gt;&quot;;

 $result = queryMysql(&quot;SELECT * FROM profiles WHERE user=&#39;$user&#39;&quot;);

 if (isset($_POST[&#39;text&#39;]))

 {

 $text = sanitizeString($_POST[&#39;text&#39;]);

 $text = preg_replace(&#39;/\s\s+/&#39;, &#39; &#39;, $text);

 if ($result-&amp;gt;num_rows)

queryMysql(&quot;UPDATE profiles SET text=&#39;$text&#39; where user=&#39;$user&#39;&quot;);

 else queryMysql(&quot;INSERT INTO profiles VALUES(&#39;$user&#39;, &#39;$text&#39;)&quot;);

 }

 else

 {

 if ($result-&amp;gt;num_rows)

 {

 $row = $result-&amp;gt;fetch_array(MYSQLI_ASSOC);

 $text = stripslashes($row[&#39;text&#39;]);

}

 else $text = &quot;&quot;;

 }

 $text = stripslashes(preg_replace(&#39;/\s\s+/&#39;, &#39; &#39;, $text));

 if (isset($_FILES[&#39;image&#39;][&#39;name&#39;]))

 {

 $saveto = &quot;$user.jpg&quot;;

 move_uploaded_file($_FILES[&#39;image&#39;][&#39;tmp_name&#39;], $saveto);

 $typeok = TRUE;

 switch($_FILES[&#39;image&#39;][&#39;type&#39;])

 {

 case &quot;image/gif&quot;: $src = imagecreatefromgif($saveto); break;

 case &quot;image/jpeg&quot;: // Both regular and progressive jpegs

 case &quot;image/pjpeg&quot;: $src = imagecreatefromjpeg($saveto); break;

 case &quot;image/png&quot;: $src = imagecreatefrompng($saveto); break;

 default: $typeok = FALSE; break;

 }

 if ($typeok)

{

 list($w, $h) = getimagesize($saveto);

 $max = 100;

 $tw = $w;

 $th = $h;

 if ($w &amp;gt; $h &amp;amp;&amp;amp; $max &amp;lt; $w)

 {

 $th = $max / $w * $h;

 $tw = $max;

 }

 elseif ($h &amp;gt; $w &amp;amp;&amp;amp; $max &amp;lt; $h)

 {

 $tw = $max / $h * $w;

 $th = $max;

 }

 elseif ($max &amp;lt; $w)

 {

 $tw = $th = $max;

 }

 $tmp = imagecreatetruecolor($tw, $th);

 imagecopyresampled($tmp, $src, 0, 0, 0, 0, $tw, $th, $w, $h);

 imageconvolution($tmp, array(array(-1, -1, -1),

 array(-1, 16, -1), array(-1, -1, -1)), 8, 0);

 imagejpeg($tmp, $saveto);

imagedestroy($tmp);

 imagedestroy($src);

 }

}

 showProfile($user);

 echo &amp;lt;&amp;lt;&amp;lt;_END

 &amp;lt;form method=&#39;post&#39; action=&#39;profile.php&#39; enctype=&#39;multipart/form-data&#39;&amp;gt;

 &amp;lt;h3&amp;gt;Enter or edit your details and/or upload an image&amp;lt;/h3&amp;gt;

 &amp;lt;textarea name=&#39;text&#39; cols=&#39;50&#39; rows=&#39;3&#39;&amp;gt;$text&amp;lt;/textarea&amp;gt;&amp;lt;br&amp;gt;

_END;

?&amp;gt;

 Image: &amp;lt;input type=&#39;file&#39; name=&#39;image&#39; size=&#39;14&#39;&amp;gt;

 &amp;lt;input type=&#39;submit&#39; value=&#39;Save Profile&#39;&amp;gt;

 &amp;lt;/form&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;br&amp;gt;

&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;
    
    &lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Explanation of the code:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Beginning the the HTML form at the end of the code,the form has the parameter&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;b&gt;&lt;i&gt;enctype=&#39;multipart/form-data&#39;.&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;This helps us send more than one type of data at a time eg: an image and text.There’s also an input type of file, which creates a&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: verdana; font-size: medium;&quot;&gt;Browse button that a user can press to select a file to be uploaded.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;When the form is submitted, the code at the start of the program is executed.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&amp;nbsp;The&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: verdana; font-size: medium;&quot;&gt;first thing it does is ensure that a user is logged in before the program execution to proceed.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Adding the “About Me” Text&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;The&amp;nbsp; Post variable text is checked if there is text that has been added.If so,then it undergoes sanitization for security purposes but If no text was posted, the database is queried to see whether any text already exists in&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: verdana; font-size: medium;&quot;&gt;order to prepopulate the textarea for the user to edit it.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Adding a Profile Image&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Here the $_FILES system variable is checked to see&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;whether an image has been uploaded. If so, a string variable called $saveto is created,&lt;/span&gt;&lt;span style=&quot;font-family: verdana; font-size: x-large;&quot;&gt;based on the user’s username followed by the extension .jpg. For example, user Jill will&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: verdana; font-size: x-large;&quot;&gt;cause $saveto to have the value Jill.jpg.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Then&amp;nbsp; the uploaded image type is examined and is accepted only if it is a&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: verdana; font-size: x-large;&quot;&gt;jpeg, png, or gif image.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Upon success, the variable $src is populated with the uploaded&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: verdana; font-size: x-large;&quot;&gt;image using one of the imagecreatefrom functions according to the image type&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: verdana; font-size: x-large;&quot;&gt;uploaded.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: x-large;&quot;&gt;&amp;nbsp;The image is now in a raw format that PHP can process. If the image is not&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: verdana; font-size: x-large;&quot;&gt;of an allowed type, the flag $typeok is set to FALSE, preventing the final section of&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: verdana; font-size: x-large;&quot;&gt;image upload code from being processed.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Processing the Image&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;First we store the image dimensions using this statement&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;list($w, $h) = getimagesize($saveto);&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;If you want a smaller or larger thumbnail we use $max (which is set to 100), which gets the new dimensions which will result in a new image.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;The function imagecreatetruecolor is called to create a new, blank canvas $tw&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: verdana; font-size: x-large;&quot;&gt;wide and $th high in $tmp. imagecopyresampled is called to resample the image&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;from $src, to the new $tmp&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Finally, the image is saved as a jpeg file in the location defined by the variable&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: verdana; font-size: x-large;&quot;&gt;$saveto, after which we remove both the original and the resized image canvases&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: verdana; font-size: x-large;&quot;&gt;from memory using the imagedestroy function, returning the memory that was&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: verdana; font-size: x-large;&quot;&gt;used.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;members.php&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Using members.php,your users will find other memebers and choose to add them as friends or drop them.Here is&amp;nbsp; code snippet that does that work.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;members.php&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;
      
&lt;/span&gt;&lt;/p&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;code&gt;&amp;lt;?php

 require_once &#39;header.php&#39;;

 if (!$loggedin) die();

 echo &quot;&amp;lt;div class=&#39;main&#39;&amp;gt;&quot;;

 if (isset($_GET[&#39;view&#39;]))

 {

 $view = sanitizeString($_GET[&#39;view&#39;]);

 if ($view == $user) $name = &quot;Your&quot;;

 else $name = &quot;$view&#39;s&quot;;

echo &quot;&amp;lt;h3&amp;gt;$name Profile&amp;lt;/h3&amp;gt;&quot;;

 showProfile($view);

 echo &quot;&amp;lt;a class=&#39;button&#39; href=&#39;messages.php?view=$view&#39;&amp;gt;&quot; .

 &quot;View $name messages&amp;lt;/a&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&quot;;

 die(&quot;&amp;lt;/div&amp;gt;&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&quot;);

 }

 if (isset($_GET[&#39;add&#39;]))

 {

 $add = sanitizeString($_GET[&#39;add&#39;]);

 $result = queryMysql(&quot;SELECT * FROM friends WHERE user=&#39;$add&#39;

 AND friend=&#39;$user&#39;&quot;);

if (!$result-&amp;gt;num_rows)

 queryMysql(&quot;INSERT INTO friends VALUES (&#39;$add&#39;, &#39;$user&#39;)&quot;);

 }

 elseif (isset($_GET[&#39;remove&#39;]))

 {

 $remove = sanitizeString($_GET[&#39;remove&#39;]);

 queryMysql(&quot;DELETE FROM friends WHERE user=&#39;$remove&#39; AND friend=&#39;$user&#39;&quot;);

 }

 $result = queryMysql(&quot;SELECT user FROM members ORDER BY user&quot;);

 $num = $result-&amp;gt;num_rows;

 echo &quot;&amp;lt;h3&amp;gt;Other Members&amp;lt;/h3&amp;gt;&amp;lt;ul&amp;gt;&quot;;

 for ($j = 0 ; $j &amp;lt; $num ; ++$j)

{

$row = $result-&amp;gt;fetch_array(MYSQLI_ASSOC);

 if ($row[&#39;user&#39;] == $user) continue;

 echo &quot;&amp;lt;li&amp;gt;&amp;lt;a href=&#39;members.php?view=&quot; .

 $row[&#39;user&#39;] . &quot;&#39;&amp;gt;&quot; . $row[&#39;user&#39;] . &quot;&amp;lt;/a&amp;gt;&quot;;

 $follow = &quot;follow&quot;;

 $result1 = queryMysql(&quot;SELECT * FROM friends WHERE

 user=&#39;&quot; . $row[&#39;user&#39;] . &quot;&#39; AND friend=&#39;$user&#39;&quot;);

 $t1 = $result1-&amp;gt;num_rows;

 $result1 = queryMysql(&quot;SELECT * FROM friends WHERE

 user=&#39;$user&#39; AND friend=&#39;&quot; . $row[&#39;user&#39;] . &quot;&#39;&quot;);

 $t2 = $result1-&amp;gt;num_rows;

 if (($t1 + $t2) &amp;gt; 1) echo &quot; &amp;amp;harr; is a mutual friend&quot;;

 elseif ($t1) echo &quot; &amp;amp;larr; you are following&quot;;

 elseif ($t2) { echo &quot; &amp;amp;rarr; is following you&quot;;

 $follow = &quot;recip&quot;; }

 if (!$t1) echo &quot; [&amp;lt;a href=&#39;members.php?add=&quot; .

 $row[&#39;user&#39;] . &quot;&#39;&amp;gt;$follow&amp;lt;/a&amp;gt;]&quot;;

 else echo &quot; [&amp;lt;a href=&#39;members.php?remove=&quot; .

 $row[&#39;user&#39;] . &quot;&#39;&amp;gt;drop&amp;lt;/a&amp;gt;]&quot;;

 }

?&amp;gt;

 &amp;lt;/ul&amp;gt;&amp;lt;/div&amp;gt;

 &amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;
        
        &lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;b&gt;&lt;u&gt;Explanation of the code:&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Adding and Dropping Friends&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;We can be able to add&amp;nbsp; or drop friends&amp;nbsp; by looking up the user in the MySQL friends table and either inserting a friend username or removing it from the table.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Listing All The Members&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;The final section of code issues a SQL query to list all usernames. The code places the&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: verdana; font-size: x-large;&quot;&gt;number returned in the variable $num before outputting the page heading.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;friends.php&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;This module shows a user&#39;s friends and followers.This is made possible by displaying afriend&#39;s table of a single user.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;All the followers are saved into an array called $followers, and all the people being&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: verdana; font-size: x-large;&quot;&gt;followed are placed in an array called $following. Then a neat piece of code is used&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: verdana; font-size: x-large;&quot;&gt;to extract all those who are both following and followed by the user, like this:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;i&gt;&lt;b&gt;$mutual = array_intersect($followers, $following);&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Here is the code snippet that does that work:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;b&gt;friends.php&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;
  
          &lt;/span&gt;&lt;/p&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;code&gt;friends.php

&amp;lt;?php

 require_once &#39;header.php&#39;;

 if (!$loggedin) die();

 if (isset($_GET[&#39;view&#39;])) $view = sanitizeString($_GET[&#39;view&#39;]);

 else $view = $user;

 if ($view == $user)

 {

 $name1 = $name2 = &quot;Your&quot;;

 $name3 = &quot;You are&quot;;

 }

 else

 {

 $name1 = &quot;&amp;lt;a href=&#39;members.php?view=$view&#39;&amp;gt;$view&amp;lt;/a&amp;gt;&#39;s&quot;;

 $name2 = &quot;$view&#39;s&quot;;

 $name3 = &quot;$view is&quot;;

 }

 echo &quot;&amp;lt;div class=&#39;main&#39;&amp;gt;&quot;;

 // Uncomment this line if you wish the user&#39;s profile to show here

 // showProfile($view);

$followers = array();

 $following = array();

 $result = queryMysql(&quot;SELECT * FROM friends WHERE user=&#39;$view&#39;&quot;);

 $num = $result-&amp;gt;num_rows;

 for ($j = 0 ; $j &amp;lt; $num ; ++$j)

 {

 $row = $result-&amp;gt;fetch_array(MYSQLI_ASSOC);

 $followers[$j] = $row[&#39;friend&#39;];

 }

 $result = queryMysql(&quot;SELECT * FROM friends WHERE friend=&#39;$view&#39;&quot;);

 $num = $result-&amp;gt;num_rows;

 for ($j = 0 ; $j &amp;lt; $num ; ++$j)

 {

 $row = $result-&amp;gt;fetch_array(MYSQLI_ASSOC);

 $following[$j] = $row[&#39;user&#39;];

 }

 $mutual = array_intersect($followers, $following);

 $followers = array_diff($followers, $mutual);

 $following = array_diff($following, $mutual);

 $friends = FALSE;

 if (sizeof($mutual))

 {

 echo &quot;&amp;lt;span class=&#39;subhead&#39;&amp;gt;$name2 mutual friends&amp;lt;/span&amp;gt;&amp;lt;ul&amp;gt;&quot;;

 foreach($mutual as $friend)

 echo &quot;&amp;lt;li&amp;gt;&amp;lt;a href=&#39;members.php?view=$friend&#39;&amp;gt;$friend&amp;lt;/a&amp;gt;&quot;;

 echo &quot;&amp;lt;/ul&amp;gt;&quot;;

$friends = TRUE;

 }

 if (sizeof($followers))

 {

 echo &quot;&amp;lt;span class=&#39;subhead&#39;&amp;gt;$name2 followers&amp;lt;/span&amp;gt;&amp;lt;ul&amp;gt;&quot;;

 foreach($followers as $friend)

 echo &quot;&amp;lt;li&amp;gt;&amp;lt;a href=&#39;members.php?view=$friend&#39;&amp;gt;$friend&amp;lt;/a&amp;gt;&quot;;

 echo &quot;&amp;lt;/ul&amp;gt;&quot;;

 $friends = TRUE;

 }

 if (sizeof($following))

 {

 echo &quot;&amp;lt;span class=&#39;subhead&#39;&amp;gt;$name3 following&amp;lt;/span&amp;gt;&amp;lt;ul&amp;gt;&quot;;

 foreach($following as $friend)

 echo &quot;&amp;lt;li&amp;gt;&amp;lt;a href=&#39;members.php?view=$friend&#39;&amp;gt;$friend&amp;lt;/a&amp;gt;&quot;;

 echo &quot;&amp;lt;/ul&amp;gt;&quot;;

 $friends = TRUE;

 }

if (!$friends) echo &quot;&amp;lt;br&amp;gt;You don&#39;t have any friends yet.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&quot;;

 echo &quot;&amp;lt;a class=&#39;button&#39; href=&#39;messages.php?view=$view&#39;&amp;gt;&quot; .

 &quot;View $name2 messages&amp;lt;/a&amp;gt;&quot;;

?&amp;gt;

 &amp;lt;/div&amp;gt;&amp;lt;br&amp;gt;

 &amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;
&lt;/span&gt;&lt;p&gt;&lt;/p&gt;</description><link>https://rbgtech.blogspot.com/2021/08/web-dev-project-part-2.html</link><author>noreply@blogger.com (renson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjscEXm3gyDPza8x84pAKrORY5DqHnNt7DSRWKu2SoBWpZJzDO1schcdBvCHGxqlA5E1sE6cmvouQ184_PqavWprnRfzlCQyy9jJNB2gH1ALsYQcMxEPnB9LGky74w-eBafovjus0LCYKA/s72-w416-h186-c/social.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3879629789995591062.post-3455358640006338854</guid><pubDate>Mon, 09 Aug 2021 09:12:00 +0000</pubDate><atom:updated>2021-08-12T00:33:08.612-07:00</atom:updated><title>Social Networking Project part 1</title><description>&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;&lt;u&gt;&lt;b&gt;Bringing all that we have learnt together&lt;/b&gt;&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Designing a Social Networking Site&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Things that are needed include:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;• A sign-up process&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;• A login form&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;• A logout facility&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;• Session control&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;• User profiles with uploaded thumbnails&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;• A member directory&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;• Adding members as friends&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;• Public and private messaging between members&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;• How to style the project&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnQKqX7zIJ7pY0m7ACgjw_UHBMZq6CvjMJESs4xyVTEAZm6R_YrEza5-TCGBjsg-KUdNKcMgl6ioIx-DH3uxGKwX7QzNxTShyamYJe6wo-70rzGS-sT60XW5fpqesQQw3VZj_46zg8__c/s310/social.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;162&quot; data-original-width=&quot;310&quot; height=&quot;187&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnQKqX7zIJ7pY0m7ACgjw_UHBMZq6CvjMJESs4xyVTEAZm6R_YrEza5-TCGBjsg-KUdNKcMgl6ioIx-DH3uxGKwX7QzNxTShyamYJe6wo-70rzGS-sT60XW5fpqesQQw3VZj_46zg8__c/w358-h187/social.jpg&quot; width=&quot;358&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;functions.php&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;The functions uses five main functions:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;createTable&lt;/b&gt;:Checks whether a table already exists and, if not, creates it&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;queryMysql&lt;/b&gt;:Issues a query to MySQL, outputting an error message if it fails&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;destroySession&lt;/b&gt;:Destroys a PHP session and clears its data to log users out&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;sanitizeString&lt;/b&gt;:Removes potentially malicious code or tags from user input&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;showProfile&lt;/b&gt;:Displays a user’s image and&amp;nbsp; “about me” message if he has one&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;1.functions.php&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;
  
&lt;/span&gt;&lt;/p&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;code&gt;&amp;lt;?php

 $dbhost = &#39;localhost&#39;; // Unlikely to require changing

 $dbname = &#39;rbgtech&#39;; // Modify these...

 $dbuser = &#39;root&#39;; // ...variables according

 $dbpass = &#39; &#39;; // ...to your installation

 $appname = &quot;RBG Tech App&quot;; // ...and preference

 $connection = new mysqli($dbhost, $dbuser, $dbpass, $dbname);

 if ($connection-&amp;gt;connect_error) die($connection-&amp;gt;connect_error);

function createTable($name, $query)

 {

 queryMysql(&quot;CREATE TABLE IF NOT EXISTS $name($query)&quot;);

 echo &quot;Table &#39;$name&#39; created or already exists.&amp;lt;br&amp;gt;&quot;;

 }

 function queryMysql($query)

{

 global $connection;

$result = $connection-&amp;gt;query($query);

 if (!$result) die($connection-&amp;gt;error);

 return $result;

 }

 function destroySession( )

 {

 $_SESSION=array();

 if (session_id() != &quot;&quot; || isset($_COOKIE[session_name()]))

 setcookie(session_name(), &#39;&#39;, time()-2592000, &#39;/&#39;);

 session_destroy();

 }

 function sanitizeString($var)

 {

 global $connection;

$var = strip_tags($var);

 $var = htmlentities($var);

 $var = stripslashes($var);

 return $connection-&amp;gt;real_escape_string($var);

 }

function showProfile($user)

 {

 if (file_exists(&quot;$user.jpg&quot;))

 echo &quot;&amp;lt;img src=&#39;$user.jpg&#39; style=&#39;float:left;&#39;&amp;gt;&quot;;

 $result = queryMysql(&quot;SELECT * FROM profiles WHERE user=&#39;$user&#39;&quot;);

 if ($result-&amp;gt;num_rows)

 {

 $row = $result-&amp;gt;fetch_array(MYSQLI_ASSOC);

 echo stripslashes($row[&#39;text&#39;]) . &quot;&amp;lt;br style=&#39;clear:left;&#39;&amp;gt;&amp;lt;br&amp;gt;&quot;;

 }

 }

?&amp;gt;


&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-size: large;&quot;&gt;
    
    &lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;header.php&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;For uniformity, each page of the project needs to have access to the same set of fea‐&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;tures. Therefore,I placed these things in header.php&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;2&lt;b&gt;.header.php&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;
      
&lt;/span&gt;&lt;/p&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;code&gt;&amp;lt;?php

 session_start();

 echo &quot;&amp;lt;!DOCTYPE html&amp;gt;\n&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&quot;;

 require_once &#39;functions.php&#39;;

 $userstr = &#39; (Guest)&#39;;

 if (isset($_SESSION[&#39;user&#39;]))

 {

 $user = $_SESSION[&#39;user&#39;];

 $loggedin = TRUE;

 $userstr = &quot; ($user)&quot;;

 }

 else $loggedin = FALSE;

 echo &quot;&amp;lt;title&amp;gt;$appname$userstr&amp;lt;/title&amp;gt;&amp;lt;link rel=&#39;stylesheet&#39; &quot; .

 &quot;href=&#39;styles.css&#39; type=&#39;text/css&#39;&amp;gt;&quot; .

 &quot;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;&amp;lt;center&amp;gt;&amp;lt;canvas id=&#39;logo&#39; width=&#39;624&#39; &quot; .

 &quot;height=&#39;96&#39;&amp;gt;$appname&amp;lt;/canvas&amp;gt;&amp;lt;/center&amp;gt;&quot; .

 &quot;&amp;lt;div class=&#39;appname&#39;&amp;gt;$appname$userstr&amp;lt;/div&amp;gt;&quot; .

 &quot;&amp;lt;script src=&#39;javascript.js&#39;&amp;gt;&amp;lt;/script&amp;gt;&quot;;

 if ($loggedin)

 echo &quot;&amp;lt;br &amp;gt;&amp;lt;ul class=&#39;menu&#39;&amp;gt;&quot; .

 &quot;&amp;lt;li&amp;gt;&amp;lt;a href=&#39;members.php?view=$user&#39;&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&quot; .

 &quot;&amp;lt;li&amp;gt;&amp;lt;a href=&#39;members.php&#39;&amp;gt;Members&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&quot; .

 &quot;&amp;lt;li&amp;gt;&amp;lt;a href=&#39;friends.php&#39;&amp;gt;Friends&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&quot; .

 &quot;&amp;lt;li&amp;gt;&amp;lt;a href=&#39;messages.php&#39;&amp;gt;Messages&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&quot; .

 &quot;&amp;lt;li&amp;gt;&amp;lt;a href=&#39;profile.php&#39;&amp;gt;Edit Profile&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&quot; .

 &quot;&amp;lt;li&amp;gt;&amp;lt;a href=&#39;logout.php&#39;&amp;gt;Log out&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;lt;br&amp;gt;&quot;;

 else

 echo (&quot;&amp;lt;br&amp;gt;&amp;lt;ul class=&#39;menu&#39;&amp;gt;&quot; .

&quot;&amp;lt;li&amp;gt;&amp;lt;a href=&#39;index.php&#39;&amp;gt;Home&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&quot; .

 &quot;&amp;lt;li&amp;gt;&amp;lt;a href=&#39;signup.php&#39;&amp;gt;Sign up&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&quot; .

 &quot;&amp;lt;li&amp;gt;&amp;lt;a href=&#39;login.php&#39;&amp;gt;Log in&amp;lt;/a&amp;gt;&amp;lt;/li&amp;gt;&amp;lt;/ul&amp;gt;&amp;lt;br&amp;gt;&quot; .

 &quot;&amp;lt;span class=&#39;info&#39;&amp;gt;&amp;amp;#8658; You must be logged in to &quot; .

 &quot;view this page.&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&quot;);

?&amp;gt;
&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-size: large;&quot;&gt;
        
        
        &lt;/span&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;setup.php&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;With the pair of included files written, it’s now time to set up the MySQL tables they&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;will use.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;The tables created here have the following columns and names:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;• &lt;b&gt;members&lt;/b&gt;: username user (indexed), password pass&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;•&lt;b&gt; messages&lt;/b&gt;: ID id (indexed), author auth (indexed), recipient recip, message type&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;pm, message message&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;• &lt;b&gt;friends&lt;/b&gt;: username user (indexed), friend’s username friend&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;• profiles: username user (indexed), “about me” text&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Because the functio..&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;3. setup.php&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;
          
&lt;/span&gt;&lt;/p&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;

&amp;lt;html&amp;gt;

 &amp;lt;head&amp;gt;

 &amp;lt;title&amp;gt;Setting up database&amp;lt;/title&amp;gt;

 &amp;lt;/head&amp;gt;

 &amp;lt;body&amp;gt;

 &amp;lt;h3&amp;gt;Setting up...&amp;lt;/h3&amp;gt;

&amp;lt;?php

 require_once &#39;functions.php&#39;;

 createTable(&#39;members&#39;,

 &#39;user VARCHAR(16),

 pass VARCHAR(16),

 INDEX(user(6))&#39;);

 createTable(&#39;messages&#39;,

 &#39;id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,

 auth VARCHAR(16),

 recip VARCHAR(16),

 pm CHAR(1),

 time INT UNSIGNED,

 message VARCHAR(4096),

 INDEX(auth(6)),

 INDEX(recip(6))&#39;);

 createTable(&#39;friends&#39;,

 &#39;user VARCHAR(16),

 friend VARCHAR(16),

 INDEX(user(6)),

 INDEX(friend(6))&#39;);

 createTable(&#39;profiles&#39;,

 &#39;user VARCHAR(16),

 text VARCHAR(4096),

 INDEX(user(6))&#39;);

?&amp;gt;

 &amp;lt;br&amp;gt;...done.

 &amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;


&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-size: large;&quot;&gt;
            
            
            &lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;index.php&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;This file gives the project a home page.All&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;it does is display a simple welcome message. In a finished application, this would be&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;where you sell the virtues of your site to encourage sign-ups.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Incidentally, seeing as all the MySQL tables have been created and the include files saved,you can now load&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;4.index.php&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;
              
             &lt;/span&gt;&lt;/p&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;code&gt;&amp;lt;?php

 require_once &#39;header.php&#39;;

 echo &quot;&amp;lt;br&amp;gt;&amp;lt;span class=&#39;main&#39;&amp;gt;Welcome to $appname,&quot;;

 if ($loggedin) echo &quot; $user, you are logged in.&quot;;

 else echo &#39; please sign up and/or log in to join in.&#39;;

?&amp;gt;

 &amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;

&amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;


&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-size: large;&quot;&gt;
                
                &lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;signup.php&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Now we need a module that will allow users to join the social site.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;5.signup.php&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;
                  
&lt;/span&gt;&lt;/p&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;code&gt;&amp;lt;?php

 require_once &#39;header.php&#39;;

 echo &amp;lt;&amp;lt;&amp;lt;_END

 &amp;lt;script&amp;gt;

 function checkUser(user)

 {

 if (user.value == &#39;&#39;)

 {

 O(&#39;info&#39;).innerHTML = &#39;&#39;

 return

 }

 params = &quot;user=&quot; + user.value

 request = new ajaxRequest()

 request.open(&quot;POST&quot;, &quot;checkuser.php&quot;, true)

 request.setRequestHeader(&quot;Content-type&quot;,

 &quot;application/x-www-form-urlencoded&quot;)

 request.setRequestHeader(&quot;Content-length&quot;, params.length)

 request.setRequestHeader(&quot;Connection&quot;, &quot;close&quot;)

 request.onreadystatechange = function()

 {

if (this.readyState == 4)

 if (this.status == 200)

 if (this.responseText != null)

 O(&#39;info&#39;).innerHTML = this.responseText

 }

 request.send(params)

 }

 function ajaxRequest()

 {

 try { var request = new XMLHttpRequest() }

 catch(e1) {

 try { request = new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;) }

 catch(e2) {

 try { request = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;) }

 catch(e3) {

 request = false

 } } }

 return request

}

 &amp;lt;/script&amp;gt;

 &amp;lt;div class=&#39;main&#39;&amp;gt;&amp;lt;h3&amp;gt;Please enter your details to sign up&amp;lt;/h3&amp;gt;

_END;

$error = $user = $pass = &quot;&quot;;

 if (isset($_SESSION[&#39;user&#39;])) destroySession();

 if (isset($_POST[&#39;user&#39;]))

 {

 $user = sanitizeString($_POST[&#39;user&#39;]);

 $pass = sanitizeString($_POST[&#39;pass&#39;]);

 if ($user == &quot;&quot; || $pass == &quot;&quot;)

 $error = &quot;Not all fields were entered&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&quot;;

 else

 {

 $result = queryMysql(&quot;SELECT * FROM members WHERE user=&#39;$user&#39;&quot;);

 if ($result-&amp;gt;num_rows)

 $error = &quot;That username already exists&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&quot;;

 else

 {

 queryMysql(&quot;INSERT INTO members VALUES(&#39;$user&#39;, &#39;$pass&#39;)&quot;);

 die(&quot;&amp;lt;h4&amp;gt;Account created&amp;lt;/h4&amp;gt;Please Log in.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&quot;);

 }

 }

 }

 echo &amp;lt;&amp;lt;&amp;lt;_END



&amp;lt;form method=&#39;post&#39; action=&#39;signup.php&#39;&amp;gt;$error

 &amp;lt;span class=&#39;fieldname&#39;&amp;gt;Username&amp;lt;/span&amp;gt;

 &amp;lt;input type=&#39;text&#39; maxlength=&#39;16&#39; name=&#39;user&#39; value=&#39;$user&#39;

onBlur=&#39;checkUser(this)&#39;&amp;gt;&amp;lt;span id=&#39;info&#39;&amp;gt;&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;

 &amp;lt;span class=&#39;fieldname&#39;&amp;gt;Password&amp;lt;/span&amp;gt;

 &amp;lt;input type=&#39;text&#39; maxlength=&#39;16&#39; name=&#39;pass&#39;

 value=&#39;$pass&#39;&amp;gt;&amp;lt;br&amp;gt;

_END;

?&amp;gt;

&amp;lt;span class=&#39;fieldname&#39;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;

 &amp;lt;input type=&#39;submit&#39; value=&#39;Sign up&#39;&amp;gt;

 &amp;lt;/form&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;br&amp;gt;

 &amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;


&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-size: large;&quot;&gt;
                    
                    &lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;checkuser.php&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;To go with signup.php,checkuser.php looks for the username in the database and returns a string indicating&amp;nbsp; whether it has already been registered.Because it&amp;nbsp; relies on the functions sanitizeString and queryMysql, the program first&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;includes the file functions.php.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Then, if the $_POST variable user has a value, the function looks it up in the database&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;and, depending on whether it exists as a username, outputs either “Sorry, this user&lt;/span&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;name is taken” or “This username is available.” Just checking the function&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;mysql_num_rows against the result is sufficient for this, as it will return 0 for not&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;found, or 1 if it is found.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;The HTML entities &amp;amp;#x2718; and &amp;amp;#x2714; are also used to preface the string with&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;either a cross or a checkmark.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;6.checkuser.php&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;
                      
&lt;/span&gt;&lt;/p&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;code&gt;&amp;lt;?php

 require_once &#39;functions.php&#39;;

 if (isset($_POST[&#39;user&#39;]))

 {

 $user = sanitizeString($_POST[&#39;user&#39;]);

 $result = queryMysql(&quot;SELECT * FROM members WHERE user=&#39;$user&#39;&quot;);

 if ($result-&amp;gt;num_rows)

 echo &quot;&amp;lt;span class=&#39;taken&#39;&amp;gt;&amp;amp;nbsp;&amp;amp;#x2718; &quot; .

 &quot;This username is taken&amp;lt;/span&amp;gt;&quot;;

 else

 echo &quot;&amp;lt;span class=&#39;available&#39;&amp;gt;&amp;amp;nbsp;&amp;amp;#x2714; &quot; .

 &quot;This username is available&amp;lt;/span&amp;gt;&quot;;

 }

?&amp;gt;


&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-size: large;&quot;&gt;
                        
                        &lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;login.php&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Having signed up to the site,we therefore will need a login.php to allow people to access the site.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;The main thing to note here is that, upon successful verification of the username and&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;password, the session variables user and pass are given the username and password&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;values. As long as the current session remains active, these variables will be accessible&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;by all the programs in the project, allowing them to automatically provide access to&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;logged-in users&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;7.login.php&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&amp;nbsp;
                          
&lt;/span&gt;&lt;/p&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;code&gt;&amp;lt;?php

 require_once &#39;header.php&#39;;

 echo &quot;&amp;lt;div class=&#39;main&#39;&amp;gt;&amp;lt;h3&amp;gt;Please enter your details to log in&amp;lt;/h3&amp;gt;&quot;;

 $error = $user = $pass = &quot;&quot;;

 if (isset($_POST[&#39;user&#39;]))

 {

 $user = sanitizeString($_POST[&#39;user&#39;]);

 $pass = sanitizeString($_POST[&#39;pass&#39;]);

 if ($user == &quot;&quot; || $pass == &quot;&quot;)

 $error = &quot;Not all fields were entered&amp;lt;br&amp;gt;&quot;;

 else

 {

 $result = queryMySQL(&quot;SELECT user,pass FROM members

 WHERE user=&#39;$user&#39; AND pass=&#39;$pass&#39;&quot;);

 if ($result-&amp;gt;num_rows == 0)

 {

 $error = &quot;&amp;lt;span class=&#39;error&#39;&amp;gt;Username/Password

 invalid&amp;lt;/span&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&quot;;

 }

 else

 {

 $_SESSION[&#39;user&#39;] = $user;

 $_SESSION[&#39;pass&#39;] = $pass;

 die(&quot;You are now logged in. Please &amp;lt;a href=&#39;members.php?view=$user&#39;&amp;gt;&quot; .

 &quot;click here&amp;lt;/a&amp;gt; to continue.&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&quot;);

 }

}

 }

 echo &amp;lt;&amp;lt;&amp;lt;_END

 &amp;lt;form method=&#39;post&#39; action=&#39;login.php&#39;&amp;gt;$error

 &amp;lt;span class=&#39;fieldname&#39;&amp;gt;Username&amp;lt;/span&amp;gt;&amp;lt;input type=&#39;text&#39;

 maxlength=&#39;16&#39; name=&#39;user&#39; value=&#39;$user&#39;&amp;gt;&amp;lt;br&amp;gt;

 &amp;lt;span class=&#39;fieldname&#39;&amp;gt;Password&amp;lt;/span&amp;gt;&amp;lt;input type=&#39;password&#39;

 maxlength=&#39;16&#39; name=&#39;pass&#39; value=&#39;$pass&#39;&amp;gt;

_END;

?&amp;gt;

 &amp;lt;br&amp;gt;

 &amp;lt;span class=&#39;fieldname&#39;&amp;gt;&amp;amp;nbsp;&amp;lt;/span&amp;gt;

 &amp;lt;input type=&#39;submit&#39; value=&#39;Login&#39;&amp;gt;

 &amp;lt;/form&amp;gt;&amp;lt;br&amp;gt;&amp;lt;/div&amp;gt;

 &amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;
&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;</description><link>https://rbgtech.blogspot.com/2021/08/all-that-we-have-learnt-together.html</link><author>noreply@blogger.com (renson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnQKqX7zIJ7pY0m7ACgjw_UHBMZq6CvjMJESs4xyVTEAZm6R_YrEza5-TCGBjsg-KUdNKcMgl6ioIx-DH3uxGKwX7QzNxTShyamYJe6wo-70rzGS-sT60XW5fpqesQQw3VZj_46zg8__c/s72-w358-h187-c/social.jpg" height="72" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3879629789995591062.post-54731105532120976</guid><pubDate>Thu, 05 Aug 2021 12:56:00 +0000</pubDate><atom:updated>2021-08-05T06:41:13.510-07:00</atom:updated><title>Essential tools that a web developer  should know</title><description>&lt;h2 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;Best tools that a Web developer should know&lt;/h2&gt;&lt;p&gt;Here is a detailed list of tools that a web developer should know as you continue learning&amp;nbsp; and advancing in skills:&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;1.Hosting and deployment of your site&lt;/h2&gt;&lt;p&gt;It is very true that most developers build a website and they need it running but the challange comes when deploying it ,here comes an easier and&amp;nbsp; free way,by using Netlify you can deploy your website though it is limited to a website without its backend&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;How to deploy your website for free using Netlify:&lt;/h4&gt;&lt;p&gt;1.Have your static website,in other words the one that does not have any linkage with a database.&lt;/p&gt;&lt;p&gt;2.Push your code to GitHub ,BitBucket or GitLab,and if you don&#39;t have the account you can create with one of the site.&lt;/p&gt;&lt;p&gt;3.Create a netlify Account by signing up with the &lt;a href=&quot;https://www.netlify.com/&quot;&gt;Netlify&lt;/a&gt;&lt;/p&gt;&lt;p&gt;4.In your &quot;Overview&quot; page select New site from Git.&lt;/p&gt;&lt;p&gt;5.Select the repo you want to deploy&amp;nbsp;&lt;/p&gt;&lt;p&gt;6.Wait for your app to deploy as Netlify starts building and deploying your website&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;
  &lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/ADD3744hZqw&quot; title=&quot;YouTube video player&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;&amp;nbsp;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;How to deploy your website on heroku for free:&lt;/h3&gt;&lt;p&gt;Heroku is one ofthe most popular cloud service provider and it helps in hosting websites for free&lt;/p&gt;&lt;p&gt;&lt;u&gt;.Prerequisite&lt;/u&gt; for using heroku is &lt;u&gt;having github&lt;/u&gt; and &lt;u&gt;heroku account.&lt;/u&gt;&lt;/p&gt;&lt;p&gt;Note carefully that Heroku only hosts and supports applications and not static web pages as on netlify,this means that you need to have a backend and this can be done with PHP or any other language that supports backend .&lt;/p&gt;&lt;p&gt;
  &lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/aUW5GAFhu6s&quot; title=&quot;YouTube video player&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;Get heroku &lt;a href=&quot;https://www.heroku.com/&quot;&gt;here&lt;/a&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;2.Royalty free images and videos for your Web&lt;/h3&gt;&lt;p&gt;This is a very important tool for use especially when you want to beautify your website with informative images,videos and music that is copyright free.Examples of the site to get this content is:&lt;a href=&quot;http://pexels.com&quot;&gt;pexels.com&lt;/a&gt;,&lt;a href=&quot;https://coverr.co/&quot;&gt;coverr.com&lt;/a&gt;,&lt;a href=&quot;https://unsplash.com/&quot;&gt;unsplash.com&lt;/a&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;3.Mockup tools&lt;/h3&gt;&lt;p&gt;This is also another tool to learn and be aware of&amp;nbsp; if you want to be a website designer.A website mockup tool is a high fidelity simulation of how a website will look like,it is like an image of how your website will look like.The sites to visit include: &lt;a href=&quot;https://www.figma.com/&quot;&gt;figma.com&lt;/a&gt;,&lt;a href=&quot;https://zeplin.io/&quot;&gt;zeplin.com&lt;/a&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;Why is it important to use&amp;nbsp; a web design mockup?&lt;/h4&gt;&lt;p&gt;They are useful for visualization in such a way that :&lt;/p&gt;&lt;p&gt;a)You can decide on the color schemes and check on the color contrast&lt;/p&gt;&lt;p&gt;b)Choose the font type and sizes&lt;/p&gt;&lt;p&gt;c)Implement images,videos and other visuals&lt;/p&gt;&lt;p&gt;d)Ensure that every page is consistent with the overall design&lt;/p&gt;&lt;p&gt;.They also help in getting client feedback before building the project&lt;/p&gt;&lt;p&gt;.Learning mockup is for anyone who is interested in web development.Sites to get this tool&amp;nbsp; is figma.com and zeplin.com&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;4.Project design ideas&lt;/h3&gt;&lt;p&gt;Beacuse most of us are developers and not designers then this tool is most important to us as it exposes you to the best web designers and developers who have shared their ideas and from them we can make our own more better.The best sites to use are :&lt;a href=&quot;https://www.awwwards.com/&quot;&gt;awwwards.com&lt;/a&gt; and dribble.com&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;5.Icons and fonts&lt;/h3&gt;&lt;p&gt;As we know that website design is&amp;nbsp; very important for any company to attract customers.Having&amp;nbsp; appropriate and consistent icons and fonts is part of what makes the design so effective and successful.The sites to easily access this tools include but not limited to &lt;a href=&quot;https://www.flaticon.com/free-icons/font&quot;&gt;flaticon.com&lt;/a&gt;,fontawesome.com,animated icons and googlefonts .&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;6.Exercises and algorithms&lt;/h3&gt;&lt;p&gt;If you want to practice to improve in your skills,then try this sites :&lt;a href=&quot;https://leetcode.com/&quot;&gt;leetcode.com&lt;/a&gt;,&lt;a href=&quot;https://www.codewars.com/&quot;&gt;codewars.com&lt;/a&gt;-&amp;gt;this helps developers achieve code mastery through challenge&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://exercism.io/&quot;&gt;exercism.io&lt;/a&gt;-&amp;gt;choose a language to master,complete coding challange,upload your solution and review it with a mentor&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;7.General tools-&amp;gt;css tricks.com,caniuse.com,image compressor,emailjs.com&lt;/p&gt;&lt;p&gt;Here are some other important tools to note:&lt;/p&gt;&lt;p&gt;&lt;a href=&quot;https://css-tricks.com/&quot;&gt;css-tricks.com&lt;/a&gt;-&amp;gt;this site helps in getting css code snippets ready to help design your web easily .&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;In conclusion&lt;/i&gt;&lt;/b&gt;,these are just but among the top on the list that you should know though the list is endless.You can share of the ones that need to be included on the comment section below.&lt;/p&gt;</description><link>https://rbgtech.blogspot.com/2021/08/essential-tools-that-web-developer.html</link><author>noreply@blogger.com (renson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://img.youtube.com/vi/ADD3744hZqw/default.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3879629789995591062.post-5521342817543354332</guid><pubDate>Tue, 03 Aug 2021 16:25:00 +0000</pubDate><atom:updated>2021-08-03T09:41:29.438-07:00</atom:updated><title>Ajax programming</title><description>&lt;h1 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;Using Ajax&lt;/h1&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5dImnNQPfNrrWiHmuS-eOovVVaIDqui7sC3r2CauiJf5zdt3gatCM3lCh85OsHU64DcoJVQSQ_7zdxRnKdK2L8FbpjQhTVvTYYk_Tx8vbRag2n97TQC6XPeDPxb30Tvm-XjRldMmcBvM/s569/ajax.gif&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;324&quot; data-original-width=&quot;569&quot; height=&quot;218&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5dImnNQPfNrrWiHmuS-eOovVVaIDqui7sC3r2CauiJf5zdt3gatCM3lCh85OsHU64DcoJVQSQ_7zdxRnKdK2L8FbpjQhTVvTYYk_Tx8vbRag2n97TQC6XPeDPxb30Tvm-XjRldMmcBvM/w551-h218/ajax.gif&quot; width=&quot;551&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;Ajax stands for Asynchronous JavaScript and XML,which, in simple terms, means using a set of methods built in to JavaScript to transfer data between the browser and a server in the background.&lt;/p&gt;&lt;p&gt;&amp;nbsp;An excellent example of this technology is Google Maps in which new sections&lt;/p&gt;&lt;p&gt;of a map are downloaded from the server when needed, without requiring a page refresh.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Using Ajax not only substantially reduces the amount of data that must be sent back&lt;/p&gt;&lt;p&gt;and forth, but also makes web pages seamlessly dynamic—allowing them to behave&lt;/p&gt;&lt;p&gt;more like self-contained applications. The results are a much improved user interface&lt;/p&gt;&lt;p&gt;and better responsiveness.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;Implementing Ajax using Javascript&lt;/h4&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Using XMLHttpRequest&lt;/p&gt;&lt;p&gt;There are three ways of creating an XMLHttpRequest object:&lt;/p&gt;&lt;p&gt;• IE 5: request = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;)&lt;/p&gt;&lt;p&gt;• IE 6+: request = new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;)&lt;/p&gt;&lt;p&gt;• All others: request = new XMLHttpRequest()&lt;/p&gt;&lt;p&gt;This is the case because Microsoft chose to implement a change with the release of&lt;/p&gt;&lt;p&gt;Internet Explorer 6, while all other browsers use a slightly different method.Therefore, the code below will work for all major browsers released over the last few years.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;A cross-browser Ajax function&lt;/h4&gt;&lt;p&gt;&amp;lt;script&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;function ajaxRequest()&lt;/p&gt;&lt;p&gt;&amp;nbsp;{&lt;/p&gt;&lt;p&gt;try // Non IE Browser?&lt;/p&gt;&lt;p&gt;&amp;nbsp;{ // Yes&lt;/p&gt;&lt;p&gt;&amp;nbsp;var request = new XMLHttpRequest()&lt;/p&gt;&lt;p&gt;&amp;nbsp;}&lt;/p&gt;&lt;p&gt;&amp;nbsp;catch(e1)&lt;/p&gt;&lt;p&gt;&amp;nbsp;{&lt;/p&gt;&lt;p&gt;&amp;nbsp;try // IE 6+?&lt;/p&gt;&lt;p&gt;&amp;nbsp;{ // Yes&lt;/p&gt;&lt;p&gt;&amp;nbsp;request = new ActiveXObject(&quot;Msxml2.XMLHTTP&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp;}&lt;/p&gt;&lt;p&gt;&amp;nbsp;catch(e2)&lt;/p&gt;&lt;p&gt;&amp;nbsp;{&lt;/p&gt;&lt;p&gt;&amp;nbsp;try // IE 5?&lt;/p&gt;&lt;p&gt;&amp;nbsp;{ // Yes&lt;/p&gt;&lt;p&gt;&amp;nbsp;request = new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;)&lt;/p&gt;&lt;p&gt;&amp;nbsp;}&lt;/p&gt;&lt;p&gt;&amp;nbsp;catch(e3) // There is no AJAX Support&lt;/p&gt;&lt;p&gt;&amp;nbsp;{&lt;/p&gt;&lt;p&gt;&amp;nbsp;request = false&lt;/p&gt;&lt;p&gt;&amp;nbsp;}&lt;/p&gt;&lt;p&gt;&amp;nbsp;}&lt;/p&gt;&lt;p&gt;&amp;nbsp;}&lt;/p&gt;&lt;p&gt;&amp;nbsp;return request&lt;/p&gt;&lt;p&gt;&amp;nbsp;}&lt;/p&gt;&lt;p&gt;&amp;lt;/script&amp;gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;Explanation of the code:&lt;/h4&gt;&lt;p&gt;Here we are using&amp;nbsp; try...catch construct.The try keyword executes the non internet Explorer Ajax command,and upon success, jumps on to the final return statement, where the new object is returned.&lt;/p&gt;&lt;p&gt;Otherwise, a catch traps the error, and the subsequent command is executed. Again,&lt;/p&gt;&lt;p&gt;upon success, the new object is returned; otherwise, the final of the three commands is tried.. If that attempt fails, then the browser doesn’t support Ajax and the request&lt;/p&gt;&lt;p&gt;object is set to false; otherwise, the object is returned. So there you have it: a cross browser Ajax request function that you may wish to add to your library of useful JavaScript functions.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;XMLHttpRequest object’s properties&lt;/h4&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;u&gt;onreadystatechange :&amp;nbsp;&lt;/u&gt;&lt;/span&gt;&lt;/span&gt; Specifies an event-handling function to be called whenever the readyState property of an object changes.&lt;/h4&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;readyState :&lt;/u&gt;&lt;/b&gt;&amp;nbsp; An integer property that reports on the status of a request. It can have any of these values: 0 =Uninitialized, 1 = Loading, 2 = Loaded, 3 = Interactive, and 4 = Completed.&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;responseText:&lt;/u&gt;&lt;/b&gt;&amp;nbsp; &amp;nbsp;The data returned by the server in text format.&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;responseXML:&lt;/u&gt;&lt;/b&gt;&amp;nbsp; &amp;nbsp;The data returned by the server in XML format.&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;status:&amp;nbsp;&lt;/u&gt;&lt;/b&gt; &amp;nbsp; &amp;nbsp; The HTTP status code returned by the server.&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;u&gt;statusText :&lt;/u&gt;&lt;/b&gt;&amp;nbsp; The HTTP status&amp;nbsp; text returned by the server.&lt;/h3&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;b&gt;An XMLHttpRequest object’s methods&lt;/b&gt;&lt;/h3&gt;&lt;p style=&quot;text-align: left;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;abort() :&lt;/u&gt;&lt;/b&gt; Aborts the current request.&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;getAllResponseHeaders() :&lt;/u&gt;&lt;/b&gt;&amp;nbsp; Returns all headers as a string.&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;getResponseHeader(param) : &lt;/u&gt;&lt;/b&gt;Returns the value of param as a string.&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;open(&#39;method&#39;, &#39;url&#39;, &#39;asynch&#39;):&lt;/u&gt;&lt;/b&gt;&amp;nbsp; &amp;nbsp;Specifies the HTTP method to use (Get or Post), the target URL, and whether the request should be handled asynchronously (true or false).&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;send(data) :&lt;/u&gt;&lt;/b&gt;Sends data to the target server using the specified HTTP method.&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;u&gt;setRequestHeader(&#39;param&#39;, &#39;value&#39;) :&lt;/u&gt;&lt;/b&gt;&amp;nbsp; Sets a header with a parameter/value pair.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;The need for properties and methods:&lt;/span&gt;&lt;/i&gt;&lt;/p&gt;&lt;p&gt;These properties and methods give you control over what data you send to the server&lt;/p&gt;&lt;p&gt;and receive back, as well as a choice of send and receive methods. For example, you&lt;/p&gt;&lt;p&gt;can choose whether to request data in plain text (which could include HTML and&lt;/p&gt;&lt;p&gt;other tags) or in XML format. You can also decide whether you wish to use the Post&lt;/p&gt;&lt;p&gt;or Get method to send to the server.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Let’s look at the Post method first by creating a very simple pair of documents: a com‐&lt;/p&gt;&lt;p&gt;bination of HTML and JavaScript, and a PHP program to interact via Ajax with the&lt;/p&gt;&lt;p&gt;first.&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Your First Ajax Program&lt;/h3&gt;&lt;p&gt;Type or copy the code and save it as given:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;urlpost.html&lt;/p&gt;&lt;p&gt;
  
  &lt;pre style=&quot;font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%&quot;&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;

&amp;lt;html&amp;gt;

 &amp;lt;head&amp;gt;

 &amp;lt;title&amp;gt;AJAX Example&amp;lt;/title&amp;gt;

 &amp;lt;/head&amp;gt;

 &amp;lt;body style=&#39;text-align:center&#39;&amp;gt;

 &amp;lt;h1&amp;gt;Loading a web page into a DIV&amp;lt;/h1&amp;gt;

 &amp;lt;div id=&#39;info&#39;&amp;gt;This sentence will be replaced&amp;lt;/div&amp;gt;

 &amp;lt;script&amp;gt;

 params = &amp;quot;url=amazon.com/gp/aw&amp;quot;

 request = new ajaxRequest()

 request.open(&amp;quot;POST&amp;quot;, &amp;quot;urlpost.php&amp;quot;, true)

request.setRequestHeader(&amp;quot;Content-type&amp;quot;,

 &amp;quot;application/x-www-form-urlencoded&amp;quot;)

 request.setRequestHeader(&amp;quot;Content-length&amp;quot;, params.length)

 request.setRequestHeader(&amp;quot;Connection&amp;quot;, &amp;quot;close&amp;quot;)

 request.onreadystatechange = function()

 {

 if (this.readyState == 4)

 {

 if (this.status == 200)

 {

 if (this.responseText != null)

 {

 document.getElementById(&#39;info&#39;).innerHTML =

 this.responseText

 }

 else alert(&amp;quot;Ajax error: No data received&amp;quot;)

 }

 else alert( &amp;quot;Ajax error: &amp;quot; + this.statusText)

}

 }

 request.send(params)

 function ajaxRequest()

 {

 try

 {

 var request = new XMLHttpRequest()

 }

 catch(e1)

 {

 try

 {

 request = new ActiveXObject(&amp;quot;Msxml2.XMLHTTP&amp;quot;)

 }

catch(e2)

 {

 try

 {

 request = new ActiveXObject(&amp;quot;Microsoft.XMLHTTP&amp;quot;)

 }

 catch(e3)

 {

 request = false

 }

 }

 }

 return request

}

 &amp;lt;/script&amp;gt;

 &amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;


&lt;/code&gt;&lt;/pre&gt;
  
&lt;/p&gt;&lt;p&gt;&lt;b&gt;Note&lt;/b&gt;:Do not run it until you add its second part&lt;/p&gt;&lt;p&gt;&lt;b&gt;urlpost.php&lt;/b&gt;&lt;/p&gt;&lt;p&gt;
  
&lt;pre style=&quot;font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%&quot;&gt;&lt;code&gt;&amp;lt;?php // urlpost.php

 if (isset($_POST[&#39;url&#39;]))

 {

 echo file_get_contents(&#39;http://&#39; . SanitizeString($_POST[&#39;url&#39;]));

 }

 function SanitizeString($var)

 {

 $var = strip_tags($var);

 $var = htmlentities($var);

 return stripslashes($var);

}

?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;Explanation of the code:&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;SanitizeString function helps in securing all posted data against hackers.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;This program uses the file_get_contents PHP function to load in the web page at&lt;/p&gt;&lt;p&gt;the URL supplied to it in the Post variable $_POST[&#39;url&#39;]. The file_get_contents&lt;/p&gt;&lt;p&gt;function is versatile in that it loads in the entire contents of a file or web page from&lt;/p&gt;&lt;p&gt;either a local or a remote server; it even takes into account moved pages and other&lt;/p&gt;&lt;p&gt;redirects.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Using Get Instead of Post&lt;/h3&gt;&lt;p&gt;As with submitting any form data,you can submit your data with Get though it is insecure.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Using Frameworks for Ajax&lt;/h3&gt;&lt;p&gt;Now that you know how to code your own Ajax routines, you might like to investi‐&lt;/p&gt;&lt;p&gt;gate some of the free frameworks that are available to make it even easier, and which&lt;/p&gt;&lt;p&gt;offer many more advanced features,example :jQuery.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;.Now we have reached a point where we will implement&amp;nbsp; everything we have learnt by developing a social networking website make sure to check the next publish.&lt;/p&gt;</description><link>https://rbgtech.blogspot.com/2021/08/ajax-programming.html</link><author>noreply@blogger.com (renson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5dImnNQPfNrrWiHmuS-eOovVVaIDqui7sC3r2CauiJf5zdt3gatCM3lCh85OsHU64DcoJVQSQ_7zdxRnKdK2L8FbpjQhTVvTYYk_Tx8vbRag2n97TQC6XPeDPxb30Tvm-XjRldMmcBvM/s72-w551-h218-c/ajax.gif" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3879629789995591062.post-2822478712100766300</guid><pubDate>Mon, 02 Aug 2021 06:48:00 +0000</pubDate><atom:updated>2021-08-02T00:15:20.327-07:00</atom:updated><title>Form Validation In PHP</title><description>&lt;h1 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1jaHwA0U0idQot8QHakuKqDe8-7JX0AOLnM9fRN1h5ctFHAnwdULZEBJadACxipjEmnyj5P_1zrfWcb4epriI8lGRVn3HtChaTlwY0fcxHOYUVVh8-QaTOrXGPV9x7Mhe-iq70CYHrgU/s310/phpform.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;162&quot; data-original-width=&quot;310&quot; height=&quot;194&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1jaHwA0U0idQot8QHakuKqDe8-7JX0AOLnM9fRN1h5ctFHAnwdULZEBJadACxipjEmnyj5P_1zrfWcb4epriI8lGRVn3HtChaTlwY0fcxHOYUVVh8-QaTOrXGPV9x7Mhe-iq70CYHrgU/w484-h194/phpform.png&quot; width=&quot;484&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h1&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;Redisplaying&amp;nbsp; Forms with values already filled&lt;/h1&gt;&lt;p&gt;Let&#39;s create adduser.php to receive the posted form perform its own val‐&lt;/p&gt;&lt;p&gt;idation, and then present the form again to the visitor if the validation fails.&lt;/p&gt;&lt;p&gt;Copy the code snippet below:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;
  
  
 &lt;/p&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;&amp;lt;?php // adduser.php

 // The PHP code

 $forename = $surname = $username = $password = $age = $email = &quot;&quot;;

 if (isset($_POST[&#39;forename&#39;]))

 $forename = fix_string($_POST[&#39;forename&#39;]);

 if (isset($_POST[&#39;surname&#39;]))

 $surname = fix_string($_POST[&#39;surname&#39;]);

 if (isset($_POST[&#39;username&#39;]))

 $username = fix_string($_POST[&#39;username&#39;]);

 if (isset($_POST[&#39;password&#39;]))

 $password = fix_string($_POST[&#39;password&#39;]);

 if (isset($_POST[&#39;age&#39;]))

 $age = fix_string($_POST[&#39;age&#39;]);

if (isset($_POST[&#39;email&#39;]))

 $email = fix_string($_POST[&#39;email&#39;]);

 $fail = validate_forename($forename);

$fail .= validate_surname($surname);

 $fail .= validate_username($username);

 $fail .= validate_password($password);

 $fail .= validate_age($age);

 $fail .= validate_email($email);

 echo &quot;&amp;lt;!DOCTYPE html&amp;gt;\n&amp;lt;html&amp;gt;&amp;lt;head&amp;gt;&amp;lt;title&amp;gt;An Example Form&amp;lt;/title&amp;gt;&quot;;

 if ($fail == &quot;&quot;)

 {

 echo &quot;&amp;lt;/head&amp;gt;&amp;lt;body&amp;gt;Form data successfully validated:

 $forename, $surname, $username, $password, $age, $email.&amp;lt;/body&amp;gt;&amp;lt;/html&amp;gt;&quot;;

 // This is where you would enter the posted fields into a database,

 // preferably using hash encryption for the password.

 exit;

 }

 echo &amp;lt;&amp;lt;&amp;lt;_END

 &amp;lt;!-- The HTML/JavaScript section --&amp;gt;

 &amp;lt;style&amp;gt;

 .signup {

 border: 1px solid #999999;

 font: normal 14px helvetica; color:#444444;

 }

 &amp;lt;/style&amp;gt;

 &amp;lt;script&amp;gt;

 function validate(form)

 {

 fail = validateForename(form.forename.value)

 fail += validateSurname(form.surname.value)

 fail += validateUsername(form.username.value)

 fail += validatePassword(form.password.value)

 fail += validateAge(form.age.value)

 fail += validateEmail(form.email.value)

 if (fail == &quot;&quot;) return true

 else { alert(fail); return false }

 }

 function validateForename(field)

 {

 return (field == &quot;&quot;) ? &quot;No Forename was entered.\n&quot; : &quot;&quot;

 }



function validateSurname(field)

 {

 return (field == &quot;&quot;) ? &quot;No Surname was entered.\n&quot; : &quot;&quot;

 }

 function validateUsername(field)

 {

 if (field == &quot;&quot;) return &quot;No Username was entered.\n&quot;

 else if (field.length &amp;lt; 5)

 return &quot;Usernames must be at least 5 characters.\n&quot;

 else if (/[^a-zA-Z0-9_-]/.test(field))

 return &quot;Only a-z, A-Z, 0-9, - and _ allowed in Usernames.\n&quot;

 return &quot;&quot;

 }

 function validatePassword(field)

 {

 if (field == &quot;&quot;) return &quot;No Password was entered.\n&quot;

 else if (field.length &amp;lt; 6)

return &quot;Passwords must be at least 6 characters.\n&quot;

 else if (!/[a-z]/.test(field) || ! /[A-Z]/.test(field) ||

 !/[0-9]/.test(field))

 return &quot;Passwords require one each of a-z, A-Z and 0-9.\n&quot;

 return &quot;&quot;

 }

 function validateAge(field)

 {

 if (isNaN(field)) return &quot;No Age was entered.\n&quot;

 else if (field &amp;lt; 18 || field &amp;gt; 110)

 return &quot;Age must be between 18 and 110.\n&quot;

 return &quot;&quot;

 }

 function validateEmail(field)

 {

 if (field == &quot;&quot;) return &quot;No Email was entered.\n&quot;

 else if (!((field.indexOf(&quot;.&quot;) &amp;gt; 0) &amp;amp;&amp;amp;

 ((field.indexOf(&quot;.&quot;) &amp;gt; 0) &amp;amp;&amp;amp;

 (field.indexOf(&quot;@&quot;) &amp;gt; 0)) ||

 /[^a-zA-Z0-9.@_-]/.test(field))

 return &quot;The Email address is invalid.\n&quot;

 return &quot;&quot;

 }

 &amp;lt;/script&amp;gt;

 &amp;lt;/head&amp;gt;

 &amp;lt;body&amp;gt;

 &amp;lt;table border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;5&quot; bgcolor=&quot;#eeeeee&quot;&amp;gt;

 &amp;lt;th colspan=&quot;2&quot; align=&quot;center&quot;&amp;gt;Signup Form&amp;lt;/th&amp;gt;

 &amp;lt;tr&amp;gt;&amp;lt;td colspan=&quot;2&quot;&amp;gt;Sorry, the following errors were found&amp;lt;br&amp;gt;

in your form: &amp;lt;p&amp;gt;&amp;lt;font color=red size=1&amp;gt;&amp;lt;i&amp;gt;$fail&amp;lt;/i&amp;gt;&amp;lt;/font&amp;gt;&amp;lt;/p&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;

 &amp;lt;form method=&quot;post&quot; action=&quot;adduser.php&quot; onSubmit=&quot;return validate(this)&quot;&amp;gt;

 &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Forename&amp;lt;/td&amp;gt;

 &amp;lt;td&amp;gt;&amp;lt;input type=&quot;text&quot; maxlength=&quot;32&quot; name=&quot;forename&quot; value=&quot;$forename&quot;&amp;gt;

 &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Surname&amp;lt;/td&amp;gt;

 &amp;lt;td&amp;gt;&amp;lt;input type=&quot;text&quot; maxlength=&quot;32&quot; name=&quot;surname&quot; value=&quot;$surname&quot;&amp;gt;

 &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Username&amp;lt;/td&amp;gt;

 &amp;lt;td&amp;gt;&amp;lt;input type=&quot;text&quot; maxlength=&quot;16&quot; name=&quot;username&quot; value=&quot;$username&quot;&amp;gt;

 &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Password&amp;lt;/td&amp;gt;

 &amp;lt;td&amp;gt;&amp;lt;input type=&quot;text&quot; maxlength=&quot;12&quot; name=&quot;password&quot; value=&quot;$password&quot;&amp;gt;

 &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Age&amp;lt;/td&amp;gt;

 &amp;lt;td&amp;gt;&amp;lt;input type=&quot;text&quot; maxlength=&quot;3&quot; name=&quot;age&quot; value=&quot;$age&quot;&amp;gt;

 &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Email&amp;lt;/td&amp;gt;

 &amp;lt;td&amp;gt;&amp;lt;input type=&quot;text&quot; maxlength=&quot;64&quot; name=&quot;email&quot; value=&quot;$email&quot;&amp;gt;

 &amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;&amp;lt;tr&amp;gt;&amp;lt;td colspan=&quot;2&quot; align=&quot;center&quot;&amp;gt;&amp;lt;input type=&quot;submit&quot;

 value=&quot;Signup&quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;

 &amp;lt;/form&amp;gt;

 &amp;lt;/table&amp;gt;

 &amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;



 // The PHP functions

 function validate_forename($field)

 {

 return ($field == &quot;&quot;) ? &quot;No Forename was entered&amp;lt;br&amp;gt;&quot;: &quot;&quot;;

 }

 function validate_surname($field)

 {

 return($field == &quot;&quot;) ? &quot;No Surname was entered&amp;lt;br&amp;gt;&quot; : &quot;&quot;;

 }

 function validate_username($field)

 {

 if ($field == &quot;&quot;) return &quot;No Username was entered&amp;lt;br&amp;gt;&quot;;

 else if (strlen($field) &amp;lt; 5)

 return &quot;Usernames must be at least 5 characters&amp;lt;br&amp;gt;&quot;;

 else if (preg_match(&quot;/[^a-zA-Z0-9_-]/&quot;, $field))

 return &quot;Only letters, numbers, - and _ in usernames&amp;lt;br&amp;gt;&quot;;

 return &quot;&quot;;

 }

 function validate_password($field)

 {

 if ($field == &quot;&quot;) return &quot;No Password was entered&amp;lt;br&amp;gt;&quot;;

 else if (strlen($field) &amp;lt; 6)

 return &quot;Passwords must be at least 6 characters&amp;lt;br&amp;gt;&quot;;

else if (!preg_match(&quot;/[a-z]/&quot;, $field) ||

 !preg_match(&quot;/[A-Z]/&quot;, $field) ||

 !preg_match(&quot;/[0-9]/&quot;, $field))

 return &quot;Passwords require 1 each of a-z, A-Z and 0-9&amp;lt;br&amp;gt;&quot;;

 return &quot;&quot;;

 }

 function validate_age($field)

 {

 if ($field == &quot;&quot;) return &quot;No Age was entered&amp;lt;br&amp;gt;&quot;;

 else if ($field &amp;lt; 18 || $field &amp;gt; 110)

 return &quot;Age must be between 18 and 110&amp;lt;br&amp;gt;&quot;;

 return &quot;&quot;;

 }

 function validate_email($field)

 {

 if ($field == &quot;&quot;) return &quot;No Email was entered&amp;lt;br&amp;gt;&quot;;

 else if (!((strpos($field, &quot;.&quot;) &amp;gt; 0) &amp;amp;&amp;amp;

 (strpos($field, &quot;@&quot;) &amp;gt; 0)) ||

 preg_match(&quot;/[^a-zA-Z0-9.@_-]/&quot;, $field))

 return &quot;The Email address is invalid&amp;lt;br&amp;gt;&quot;;

 return &quot;&quot;;

 }

 function fix_string($string)

 {

 if (get_magic_quotes_gpc()) $string = stripslashes($string);

 return htmlentities ($string);

 }

?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR-4qcRue8cgpZZDkbVkaWqFwflngamVjLwhYHhm963pmHFn79mbEC357eWrVVTSMhOTH-R3yuGg4lF4D-IsVNPxDTrpa4MCcMaaXlnrlpQ1MgeL9KMSStRjfDsLD8CyyyS2iAfMo6Wrk/s263/formphp2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;263&quot; data-original-width=&quot;192&quot; height=&quot;263&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhR-4qcRue8cgpZZDkbVkaWqFwflngamVjLwhYHhm963pmHFn79mbEC357eWrVVTSMhOTH-R3yuGg4lF4D-IsVNPxDTrpa4MCcMaaXlnrlpQ1MgeL9KMSStRjfDsLD8CyyyS2iAfMo6Wrk/w339-h263/formphp2.png&quot; width=&quot;339&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;In this example ,all input are sanitized before use, even passwords, because they may contain characters used to format HTML eg:&amp;lt; will become &amp;amp;lt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;Explanation of the code:&lt;/h4&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;The&lt;b&gt; fix_string function&lt;/b&gt; (right at the end) is used to sanitize each field and prevent any attempts at code injection from&lt;/p&gt;&lt;p&gt;succeeding.&lt;/p&gt;&lt;p&gt;Also, you will see that the HTML&amp;nbsp; form has been used within php in a&amp;nbsp; &lt;b&gt;&amp;lt;&amp;lt;&amp;lt;_END..._END;&lt;/b&gt; structure,displaying the form with the values that were entered previously.&lt;/p&gt;&lt;p&gt;You do this by simply adding an extra value parameter to each &amp;lt;input&amp;gt; tag (such as value=&quot;$forename&quot;).&lt;/p&gt;&lt;p&gt;&amp;nbsp;This courtesy is highly recommended so that the user has to edit only the previously entered values, and doesn’t have to type the fields all over again.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;Using Regular Expressions in PHP&lt;/h4&gt;&lt;p&gt;The most common regular expression functions that you are likely to use in PHP are:&lt;/p&gt;&lt;p&gt;preg_match, preg_match_all, and preg_replace.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;.preg_match:&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;Used to test wether a certain word appears anywhere within a string,in any combination of upper-case or lower-case&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;.preg_match_all:&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;If you wish to locate all matches, you use the preg_match_all function, like this:&lt;/p&gt;&lt;p&gt;$n = preg_match_all(&quot;/cats/i&quot;, &quot;Cats are strange. I like cats.&quot;, $match);&lt;/p&gt;&lt;p&gt;echo &quot;$n Matches: &quot;;&lt;/p&gt;&lt;p&gt;for ($j=0 ; $j &amp;lt; $n ; ++$j) echo $match[0][$j].&quot; &quot;;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;i&gt;preg_replace:&lt;/i&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;When you want to replace part of a string, you can use preg_replace as shown here.&lt;/p&gt;&lt;p&gt;This example replaces all occurrences of the word cats with the word dogs, regardless&lt;/p&gt;&lt;p&gt;of case:&lt;/p&gt;&lt;p&gt;echo preg_replace(&quot;/cats/i&quot;, &quot;dogs&quot;, &quot;Cats are furry. I like cats.&quot;);&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;.&lt;/span&gt;&lt;/b&gt;Now that you’ve seen how to bring all of PHP, HTML, and JavaScript together, the next publishing&amp;nbsp; will introduce Ajax (Asynchronous JavaScript and XML), which uses&lt;/p&gt;&lt;p&gt;JavaScript calls to the server in the background to seamlessly update portions of a web page, without having to resubmit the entire page to the web server.&lt;/p&gt;&lt;p&gt;Feel free to comment and&amp;nbsp; subscribe to get latest updates .&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</description><link>https://rbgtech.blogspot.com/2021/08/form-validation-in-php.html</link><author>noreply@blogger.com (renson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh1jaHwA0U0idQot8QHakuKqDe8-7JX0AOLnM9fRN1h5ctFHAnwdULZEBJadACxipjEmnyj5P_1zrfWcb4epriI8lGRVn3HtChaTlwY0fcxHOYUVVh8-QaTOrXGPV9x7Mhe-iq70CYHrgU/s72-w484-h194-c/phpform.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3879629789995591062.post-1203472422402600407</guid><pubDate>Sun, 01 Aug 2021 10:39:00 +0000</pubDate><atom:updated>2021-08-01T03:40:54.256-07:00</atom:updated><title>Top 7 backend frameworks to learn in 2021</title><description>&lt;h1 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;BEST BACKEND FRAMEWORKS 2021&lt;/h1&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;.&lt;/span&gt;&lt;/b&gt;Backend frameworks are libraries of server-side programming languages that help construct the backend structure of a site. It helps in building web applications easily.&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;.&lt;/span&gt;&lt;/b&gt;While backend frameworks are written in different languages,they all serve the same purpose.So the type of framework that you choose is dependent on the preference of the language you know and love.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Here are some of the popular frameworks for 2021&lt;/p&gt;&lt;p&gt;&lt;b&gt;1.LARAVEL FRAMEWORK&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIzh0hBE_pc2zDIwKwAaLozO2ynZpKSCM-1PlMnJC5UqLhWN9X8FDRYdPmuaWHCFKzBowq9XVFaIUDxPv1Fjzo1piaWfUerAQt6uu3Q-Yibs35eUtV0nFC20PyYP1CKeNIFWX3QX11jbE/s304/laravel.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;166&quot; data-original-width=&quot;304&quot; height=&quot;188&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIzh0hBE_pc2zDIwKwAaLozO2ynZpKSCM-1PlMnJC5UqLhWN9X8FDRYdPmuaWHCFKzBowq9XVFaIUDxPv1Fjzo1piaWfUerAQt6uu3Q-Yibs35eUtV0nFC20PyYP1CKeNIFWX3QX11jbE/w328-h188/laravel.jpg&quot; width=&quot;328&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;Laravel is a Model-View-Controller framework that comes with an intuitive interface, out-of-the-box API support, as well as tools, packages, and libraries that greatly simplify the development of modern and secure web applications.&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;.&lt;/span&gt;&lt;/b&gt;It is one of the youngest framework though popular,it uses PHP language in web development&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;2.DJANGO&lt;/h2&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuXWxDSolqioLZNYsVlsMrCvx-_vS4LhYsZKS0LH0zZ_Fh-OV65olowD6E7bSFUZA7_EuQCOzXOo46IBQ65h9la8dkbwjK6AQv5oVD9e92p39vWW0vENLlCjWHnLo7vS6gcZ34PyFJ3hE/s389/django.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;129&quot; data-original-width=&quot;389&quot; height=&quot;135&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhuXWxDSolqioLZNYsVlsMrCvx-_vS4LhYsZKS0LH0zZ_Fh-OV65olowD6E7bSFUZA7_EuQCOzXOo46IBQ65h9la8dkbwjK6AQv5oVD9e92p39vWW0vENLlCjWHnLo7vS6gcZ34PyFJ3hE/w431-h135/django.png&quot; width=&quot;431&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;Django is a high-level, Model-View-Template (MVT) framework that supports the rapid development of backend web apps with less coding involved.Big companies such as Youtube,Instagram and Google use this frameworks.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;3.Express.Js&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0l7wF7ICIJVdAQ3SWl7II-VZkeuZ6k8siia8yG1yD47UfcUCDpPKEj3asntwBfaW4rAkvz1Rpdpy8d_SMjRPye8lPHTEAAhvGJVUE9ij0etJd0qB2YlCFnBg3G2c0jlYjR2rPPRYMBUk/s318/expressjs.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;158&quot; data-original-width=&quot;318&quot; height=&quot;176&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0l7wF7ICIJVdAQ3SWl7II-VZkeuZ6k8siia8yG1yD47UfcUCDpPKEj3asntwBfaW4rAkvz1Rpdpy8d_SMjRPye8lPHTEAAhvGJVUE9ij0etJd0qB2YlCFnBg3G2c0jlYjR2rPPRYMBUk/w466-h176/expressjs.jpg&quot; width=&quot;466&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Express.js is a fast, lightweight framework that provides a set of great features for web and mobile applications&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;4. Spring&lt;/b&gt;&lt;/h2&gt;&lt;p&gt;Spring Framework&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmOlu28WlR1g5yg0zxuSy-RnTyvMUFV9D69Bh21XAEwxhGCKxMfOWwf1gqiTKAjdK3o5_lJ_61X3qwvdJ9HiAUrUo-m2HsbZhlTLEH9sqUHbJB87Q8RurncvoKnkLXTYdPISbeVUM0Ajc/s343/springFramework.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;147&quot; data-original-width=&quot;343&quot; height=&quot;182&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmOlu28WlR1g5yg0zxuSy-RnTyvMUFV9D69Bh21XAEwxhGCKxMfOWwf1gqiTKAjdK3o5_lJ_61X3qwvdJ9HiAUrUo-m2HsbZhlTLEH9sqUHbJB87Q8RurncvoKnkLXTYdPISbeVUM0Ajc/w402-h182/springFramework.png&quot; width=&quot;402&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;Spring is a Model-View-Controller application framework and inversion of controll container for java platform,it also has an extension for buiding web applocations on top of java enterprise edition platform.Websites like wix,TicketMaster&amp;nbsp; and Billguard use this framework&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;5.FLASK FRAMEWORK&lt;/h2&gt;&lt;p&gt;Flask python framework&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOQLwgVGZHr_Drredr7xKAJMWW21YIHF21_3fty3pb_o869hPtgV-H36wPQ0IRVRWwkrQBSizXSfmFsQYH0IuEfkmrldceJVSBKE1oq6leq-nAjcdkgSrgb4V4lAvEqmZiw-sGZd6ykaw/s262/flaskPY.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;193&quot; data-original-width=&quot;262&quot; height=&quot;203&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgOQLwgVGZHr_Drredr7xKAJMWW21YIHF21_3fty3pb_o869hPtgV-H36wPQ0IRVRWwkrQBSizXSfmFsQYH0IuEfkmrldceJVSBKE1oq6leq-nAjcdkgSrgb4V4lAvEqmZiw-sGZd6ykaw/w377-h203/flaskPY.jpg&quot; width=&quot;377&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;It is a web micro framework that uses python.It is classiffied as microframework because it does not require particular tools or libraries but accepts extentions that can add application features .Applications such as Pinterest and LinkedIn uses this framework&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;6.RUBY ON RAILS/RAILS FRAMEWORK&lt;/h2&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_2TXvX-waxFvOhNxEXsgL-xUSk32Vc0iVswZvgeKkfOjFGi7z36hysl6-33rew7SoL8toaKCVR6dRsnXKovMFE3Iv8erAoBueI9x9lIF0AA-txt9NBoPndUrK5W4qoHfxcjJA3RTkJWE/s366/ruby.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;138&quot; data-original-width=&quot;366&quot; height=&quot;151&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_2TXvX-waxFvOhNxEXsgL-xUSk32Vc0iVswZvgeKkfOjFGi7z36hysl6-33rew7SoL8toaKCVR6dRsnXKovMFE3Iv8erAoBueI9x9lIF0AA-txt9NBoPndUrK5W4qoHfxcjJA3RTkJWE/w420-h151/ruby.png&quot; width=&quot;420&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;It is a server side web application framework that uses MVC pattern and is&amp;nbsp; written in Ruby. It encourages and facilitates the use of web standards such as JSON or XML for data transfer and HTML, CSS and JavaScript for user interfacing. In addition to MVC, Rails emphasizes the use of other well-known software engineering patterns and paradigms, including convention over configuration (CoC), don&#39;t repeat yourself (DRY), and the active record pattern.&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;Some well known sites that use Ruby on Rails include Airbnb, Crunchbase, Bloomberg,Dribbble,Github,shoppify,and Hulu.&lt;/p&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;7.Meteor Js FRAMEWORK&lt;/h2&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyDZ1lWopfdJ08gCAVDpqwVsH0PhRupnYDPCVTVCLlSC7Znxjg7tIDwGcLSaa1HkCwbENpAMkNv22Qwy7phi8xVgo96fHMNthW2Mo3gmQds2ozkd_DRxH7aODALZK7sWr832d0wJ_yT40/s301/meteorJS.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;167&quot; data-original-width=&quot;301&quot; height=&quot;175&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyDZ1lWopfdJ08gCAVDpqwVsH0PhRupnYDPCVTVCLlSC7Znxjg7tIDwGcLSaa1HkCwbENpAMkNv22Qwy7phi8xVgo96fHMNthW2Mo3gmQds2ozkd_DRxH7aODALZK7sWr832d0wJ_yT40/w356-h175/meteorJS.jpg&quot; width=&quot;356&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: large;&quot;&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;MeteorJS, is a free and open-source isomorphic JavaScript web framework written using Node.js.&amp;nbsp; It is a full-stack framework that uses JavaScript at the backend and frontend, allowing users to build real-time apps faster.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;i&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;.&lt;/span&gt;In conclusion&lt;/b&gt;&lt;/i&gt;,we need these backend frameworks to help us do alot of work within a short time and as we know that time is money then most of us would&amp;nbsp; prefer using them but you must have basics of the language you would like to specialize and then choose the framework that uses that language .&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</description><link>https://rbgtech.blogspot.com/2021/08/top-7-backend-frameworks-to-learn-in.html</link><author>noreply@blogger.com (renson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIzh0hBE_pc2zDIwKwAaLozO2ynZpKSCM-1PlMnJC5UqLhWN9X8FDRYdPmuaWHCFKzBowq9XVFaIUDxPv1Fjzo1piaWfUerAQt6uu3Q-Yibs35eUtV0nFC20PyYP1CKeNIFWX3QX11jbE/s72-w328-h188-c/laravel.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3879629789995591062.post-3698089972006810504</guid><pubDate>Thu, 29 Jul 2021 11:39:00 +0000</pubDate><atom:updated>2021-07-29T07:14:51.869-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">form validation</category><title>Javascript form validation</title><description>&lt;h2 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;JavaScript and PHP Validation&lt;br /&gt;and Error Handling&lt;/h2&gt;&lt;p&gt;With some foundation in both PHP and JavaScript, it’s time to bring these technologies together to create web forms that are as user-friendly&amp;nbsp; as possible.&lt;/p&gt;&lt;p&gt;We’ll be using PHP to create the forms and JavaScript to perform client-side validation to ensure that the data is as complete and correct as it can be before it is submitted.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Final validation of the input will then be made by PHP, which will, if necessary,present the form again to the user for further modification.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;In the process, we will cover validation and regular expressions in both JavaScript and PHP.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Validating User input with javascript&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;The best types of validation to do in JavaScript are checking that fields have content if they are not to be left empty, ensuring that email addresses conform to the proper format, and ensuring that values entered are within expected bounds.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The validate.html Document&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Let’s begin with a general sign-up form, common on most sites that offer memberships or registered users. The inputs requested will be forename, surname, username,password, age, and email address. Example below provides a good template for such a form please copy and compile it to check results.&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;A form with JavaScript validation&amp;nbsp;&lt;/h3&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;
  
&lt;/p&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;&amp;lt;!DOCTYPE html&amp;gt;

&amp;lt;html&amp;gt;

 &amp;lt;head&amp;gt;

 &amp;lt;title&amp;gt;rbgtech form&amp;lt;/title&amp;gt;

 &amp;lt;style&amp;gt;

 .signup {

 border:1px solid #999999;

 font: normal 14px helvetica;

 color: #444444;

 }

 &amp;lt;/style&amp;gt;

 &amp;lt;script&amp;gt;

 function validate(form)

 {

 fail = validateForename(form.forename.value)

 fail += validateSurname(form.surname.value)

 fail += validateUsername(form.username.value)

 fail += validatePassword(form.password.value)

 fail += validateAge(form.age.value)

 fail += validateEmail(form.email.value)

 if (fail == &quot;&quot;) return true

 else { alert(fail); return false }

 }

function validateForename(field)

{

 return (field == &quot;&quot;) ? &quot;No Forename was entered.\n&quot; : &quot;&quot;

}

function validateSurname(field)

{

 return (field == &quot;&quot;) ? &quot;No Surname was entered.\n&quot; : &quot;&quot;

}

function validateUsername(field)

{

 if (field == &quot;&quot;) return &quot;No Username was entered.\n&quot;

 else if (field.length &amp;lt; 5)

 return &quot;Usernames must be at least 5 characters.\n&quot;

 else if (/[^a-zA-Z0-9_-]/.test(field))

 return &quot;Only a-z, A-Z, 0-9, - and _ allowed in Usernames.\n&quot;

 return &quot;&quot;

}

function validatePassword(field)

{

 if (field == &quot;&quot;) return &quot;No Password was entered.\n&quot;

 else if (field.length &amp;lt; 6)

 return &quot;Passwords must be at least 6 characters.\n&quot;

 else if (!/[a-z]/.test(field) || ! /[A-Z]/.test(field) ||

 !/[0-9]/.test(field))

 return &quot;Passwords require one each of a-z, A-Z and 0-9.\n&quot;

 return &quot;&quot;

}

function validateAge(field)

{

 if (isNaN(field)) return &quot;No Age was entered.\n&quot;

 else if (field &amp;lt; 18 || field &amp;gt; 110)

 return &quot;Age must be between 18 and 110.\n&quot;

 return &quot;&quot;

}

function validateEmail(field)

{

 if (field == &quot;&quot;) return &quot;No Email was entered.\n&quot;

 else if (!((field.indexOf(&quot;.&quot;) &amp;gt; 0) &amp;amp;&amp;amp;

 (field.indexOf(&quot;@&quot;) &amp;gt; 0)) ||

 /[^a-zA-Z0-9.@_-]/.test(field))

 return &quot;The Email address is invalid.\n&quot;

 return &quot;&quot;

}

 &amp;lt;/script&amp;gt;

 &amp;lt;/head&amp;gt;

 &amp;lt;body&amp;gt;

 &amp;lt;table border=&quot;0&quot; cellpadding=&quot;2&quot; cellspacing=&quot;5&quot; bgcolor=&quot;#eeeeee&quot;&amp;gt;

 &amp;lt;th colspan=&quot;2&quot; align=&quot;center&quot;&amp;gt;Signup Form&amp;lt;/th&amp;gt;

 &amp;lt;form method=&quot;post&quot; action=&quot;adduser.php&quot; onsubmit=&quot;return validate(this)&quot;&amp;gt;

 &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Forename&amp;lt;/td&amp;gt;

 &amp;lt;td&amp;gt;&amp;lt;input type=&quot;text&quot; maxlength=&quot;32&quot; name=&quot;forename&quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;

 &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Surname&amp;lt;/td&amp;gt;

 &amp;lt;td&amp;gt;&amp;lt;input type=&quot;text&quot; maxlength=&quot;32&quot; name=&quot;surname&quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;

 &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Username&amp;lt;/td&amp;gt;

 &amp;lt;td&amp;gt;&amp;lt;input type=&quot;text&quot; maxlength=&quot;16&quot; name=&quot;username&quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;

 &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Password&amp;lt;/td&amp;gt;

 &amp;lt;td&amp;gt;&amp;lt;input type=&quot;text&quot; maxlength=&quot;12&quot; name=&quot;password&quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;

 &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Age&amp;lt;/td&amp;gt;

 &amp;lt;td&amp;gt;&amp;lt;input type=&quot;text&quot; maxlength=&quot;3&quot; name=&quot;age&quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;

 &amp;lt;tr&amp;gt;&amp;lt;td&amp;gt;Email&amp;lt;/td&amp;gt;

 &amp;lt;td&amp;gt;&amp;lt;input type=&quot;text&quot; maxlength=&quot;64&quot; name=&quot;email&quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;

&amp;lt;tr&amp;gt;&amp;lt;td colspan=&quot;2&quot; align=&quot;center&quot;&amp;gt;&amp;lt;input type=&quot;submit&quot;

 value=&quot;Signup&quot;&amp;gt;&amp;lt;/td&amp;gt;&amp;lt;/tr&amp;gt;

 &amp;lt;/form&amp;gt;

 &amp;lt;/table&amp;gt;

 &amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;


&lt;/code&gt;&lt;/pre&gt;


&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCWT3IHAUh9eiErHBEiA-oVTN7_ZDin-o71hCgSg_WQ2rls1ZMoFRuHXDhZDID7eAnCubCmMRNUR44I5NZffvv0HUyyfbaLZXlE8uvRiGPYx0VvIrgeTsPVJlYoD_PNTnB-RPHWbQHCwk/s310/javascript+form.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;162&quot; data-original-width=&quot;310&quot; height=&quot;232&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCWT3IHAUh9eiErHBEiA-oVTN7_ZDin-o71hCgSg_WQ2rls1ZMoFRuHXDhZDID7eAnCubCmMRNUR44I5NZffvv0HUyyfbaLZXlE8uvRiGPYx0VvIrgeTsPVJlYoD_PNTnB-RPHWbQHCwk/w566-h232/javascript+form.jpg&quot; width=&quot;566&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Explanation of the code:&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Between the &amp;lt;script&amp;gt; and &amp;lt;/script&amp;gt; tags lies a single function called validate that itself calls up six other functions to validate each of the form’s input fields.&amp;nbsp;&lt;/p&gt;&lt;p&gt;We’ll get to these functions shortly. For now I’ll just explain that they return either an empty string if a field validates, or an error message if it fails.&lt;/p&gt;&lt;p&gt;&amp;nbsp;If there are any errors, the final line of the script pops up an alert box to display them.&lt;/p&gt;&lt;p&gt;Upon passing validation, the validate function returns a value of true; otherwise, it returns false. The return values from validate are important, because if it returns false, the form is prevented from being submitted.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;This allows the user to close the alert pop up and make changes. If true is returned, no errors were encountered in the form’s fields and so the form is allowed to be submitted.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The second part of this example features the HTML for the form with each field and its name placed within its own row of a table.&lt;/p&gt;&lt;p&gt;&amp;nbsp;This is pretty straightforward HTML,with the exception of the onSubmit=&quot;return validate(this)&quot; statement within the opening &amp;lt;form&amp;gt; tag.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Using onSubmit, you can cause a function of your choice to be called when a form is submitted. That function can perform some checking and return a value of either true or false to signify whether the form should be allowed to be submitted.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The this parameter is the current object (i.e., this form) and is passed to the validate function just discussed. The validate function receives this parameter as the object form.&lt;/p&gt;&lt;p&gt;As you can see, the only JavaScript used within the form’s HTML is the call to return buried in the onSubmit attribute. Browsers with JavaScript disabled or not available will simply ignore the onSubbmit attribute, and the HTML will display just fine.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Validating the forename&lt;/h3&gt;&lt;p&gt;validateForename is quite a short function that accepts the parameter field, which is the value of the forename passed to it by the validate function.&lt;/p&gt;&lt;p&gt;If this value is the empty string, an error message is returned; otherwise, an empty string is returned to signify that no error was encountered.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Validating the surname&lt;/h3&gt;&lt;p&gt;The validateSurname function is almost identical to validateForename in that an error is returned only if the surname supplied was an empty string.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Validating the username&lt;/h3&gt;&lt;p&gt;The validateUsername function has to allow through only the characters a-z, A-Z, 0-9, _ and -, and ensure that usernames are at least five characters long.&lt;/p&gt;&lt;p&gt;The if...else statements commence by returning an error if field has not been filled in. If it’s not the empty string, but is fewer than five characters in length,&lt;/p&gt;&lt;p&gt;another error message is returned.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Validating the password&lt;/b&gt;&lt;/h4&gt;&lt;p&gt;Similar techniques are used in the validatePassword function. First the function checks whether field is empty, and if it is, returns an error.&amp;nbsp;&lt;/p&gt;&lt;p&gt;Next, an error message is returned if a password is shorter than six characters.&lt;/p&gt;&lt;p&gt;One of the requirements we’re imposing on passwords is that they must have at least one each of a lowercase, uppercase, and numerical character, so the test function is called three times, once for each of these cases.&lt;/p&gt;&lt;p&gt;&amp;nbsp;If any one of them returns false, one of the requirements was not met and so an error message is returned. Otherwise, the empty string is returned to signify that the password was OK.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;Validating the age&lt;/h3&gt;&lt;p&gt;validateAge returns an error message if field is not a number (determined by a call to the isNaN function), or if the age entered is lower than 18 or greater than 110.&lt;/p&gt;&lt;p&gt;&amp;nbsp;Your applications may well have different or no age requirements. Again, upon successful validation,the empty string is returned.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;Validating the email&lt;/h4&gt;&lt;p&gt;In the last and most complicated example, the email address is validated with validateEmail. After checking whether anything was actually entered, and returning an error message if it wasn’t, the function calls the JavaScript indexOf function twice.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;The first time a check is made to ensure there is a period (.) somewhere from at least the second character of the field, and the second checks that an @ symbol appears somewhere at or after the second character.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;If those two checks are satisfied, the test function is called to see whether any disallowed characters appear in the field. If any of these tests fail, an error message is returned. The allowed characters in an email address are uppercase and lowercase letters, numbers, and the _, -, period, and @ characters, as detailed in the regular expression passed to the test method.&amp;nbsp;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;If no errors are found, the empty string is returned&lt;/p&gt;&lt;p&gt;to indicate successful validation. On the last line, the script and document are closed.&lt;/p&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;</description><link>https://rbgtech.blogspot.com/2021/07/javascript-form-validation.html</link><author>noreply@blogger.com (renson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhCWT3IHAUh9eiErHBEiA-oVTN7_ZDin-o71hCgSg_WQ2rls1ZMoFRuHXDhZDID7eAnCubCmMRNUR44I5NZffvv0HUyyfbaLZXlE8uvRiGPYx0VvIrgeTsPVJlYoD_PNTnB-RPHWbQHCwk/s72-w566-h232-c/javascript+form.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3879629789995591062.post-4129954841800584109</guid><pubDate>Wed, 28 Jul 2021 04:47:00 +0000</pubDate><atom:updated>2021-07-27T22:25:22.072-07:00</atom:updated><title>Javascript</title><description>&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1YWrtow2sxVhJb_5PfywZLzEDrsLu_Waav1t0jRbFnAO04haVktQI6QTlgu2OQ2EGEF7uF0YwVcwiGAJdwBvmI9RQI9Bml0IxK3fGLT869WXyIY21iS1bSkGk_Ho3iLtZ68j8WRGV0ZU/s367/javascript.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;137&quot; data-original-width=&quot;367&quot; height=&quot;149&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1YWrtow2sxVhJb_5PfywZLzEDrsLu_Waav1t0jRbFnAO04haVktQI6QTlgu2OQ2EGEF7uF0YwVcwiGAJdwBvmI9RQI9Bml0IxK3fGLT869WXyIY21iS1bSkGk_Ho3iLtZ68j8WRGV0ZU/w470-h149/javascript.jpg&quot; width=&quot;470&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;div&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;JavaScript and HTML Text&lt;/span&gt;&lt;/h2&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;JavaScript is a client-side scripting language that runs entirely inside the web browser.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;To call it up, you place it between opening &amp;lt;script&amp;gt; and closing &amp;lt;/script&amp;gt; HTML tags. A typical HTML&amp;nbsp; “Hello World” document using JavaScript might look like:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;“Hello World” displayed using JavaScript&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
  
&lt;/p&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&amp;lt;html&amp;gt;

 &amp;lt;head&amp;gt;&amp;lt;title&amp;gt;Hello World&amp;lt;/title&amp;gt;&amp;lt;/head&amp;gt;

 &amp;lt;body&amp;gt;

 &amp;lt;script type=&quot;text/javascript&quot;&amp;gt;

 document.write(&quot;Hello World&quot;)

 &amp;lt;/script&amp;gt;

 &amp;lt;noscript&amp;gt;

 Your browser doesn&#39;t support or has disabled JavaScript

 &amp;lt;/noscript&amp;gt;

 &amp;lt;/body&amp;gt;

&amp;lt;/html&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Explanation of the code&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&amp;lt;noscript&amp;gt; and &amp;lt;/noscript&amp;gt;:These are used when you wish to offer alternative HTML to users whose browser does not support JavaScript or who have it disabled.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Using these tags is up to you, as they are not required, but you really ought to use them because it’s usually not that difficult to provide static HTML alternatives to the operations you provide using JavaScript. However, the remaining examples to come will omit &amp;lt;noscript&amp;gt; tags,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;because we are focusing on what javascript can do.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Including JavaScript Files&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;In addition to writing JavaScript code directly in HTML documents, you can include files of JavaScript code either from your website or from anywhere on the Internet.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;The syntax for this is as follows:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&amp;lt;script type=&quot;text/javascript&quot; src=&quot;script.js&quot;&amp;gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Debugging JavaScript Errors&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;When you’re learning JavaScript, it’s important to be able to track typing or other coding errors. Unlike PHP, which displays error messages in the browser, JavaScript handles error messages in a way that changes according to the browser used.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&amp;nbsp;How to access JavaScript error messages in each of the&amp;nbsp; most commonly used browser&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Google Chrome: Click the menu icon that looks like a page with a corner turned; then select&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Developer→JavaScript Console. You can also use the shortcut Ctrl-Shift-J on a PC, or Command Shift-J on a Mac.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Opera: Select Tools→Advanced→Error Console.&lt;/span&gt;&lt;/p&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Functions&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;As with PHP, JavaScript functions are used to separate out sections of code that perform a particular task. To create a function, declare it in the manner shown in&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;b&gt;A simple function declaration&lt;/b&gt;&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&amp;lt;script&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&amp;nbsp;function product(a, b)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&amp;nbsp;return a*b&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&amp;lt;/script&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;This function takes the two parameters passed, multiplies them together, and returns the product.&lt;/span&gt;&lt;/p&gt;&lt;div&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;The program opens a window where we see&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Type something here&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;a textbox and a button called ClickMe. We enter some text in the textbox, for example rbgtech. Then we click at the Button ClickMe. The method alert opens a dialog box and displays&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;The value of the textbox is: rbgtech&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Then click OK to close the dialog box.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Real Life Example&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;
  
&lt;/p&gt;&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&amp;lt;HTML&amp;gt;

&amp;lt;COMMENT&amp;gt; Function.html &amp;lt;/COMMENT&amp;gt;

&amp;lt;HEAD&amp;gt;

&amp;lt;SCRIPT LANGUAGE=&quot;JavaScript&quot;&amp;gt;

function sqrttable(myWindow)

{

myWindow.document.write(&quot;&amp;lt;B&amp;gt; Square Root Table &amp;lt;/B&amp;gt;&amp;lt;BR&amp;gt;&quot;);

myWindow.document.write(&quot;&amp;lt;HR&amp;gt;&quot;);

myWindow.document.write(&quot;&amp;lt;TABLE BORDER=1 CELLSPACING=5&amp;gt;&quot;);

myWindow.document.write(&quot;&amp;lt;TR&amp;gt;&amp;lt;TD&amp;gt;Number&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;Squareroot&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&quot;);

for(var i=1;i&amp;lt;=20;i++)

{

myWindow.document.write(&quot;&amp;lt;TR&amp;gt;&amp;lt;TD&amp;gt;&quot; + i + &quot;&amp;lt;/TD&amp;gt;&amp;lt;TD&amp;gt;&quot; + Math.sqrt(i) +

&quot;&amp;lt;/TD&amp;gt;&amp;lt;/TR&amp;gt;&quot;);

}

myWindow.document.write(&quot;&amp;lt;/TABLE&amp;gt;&quot;);

myWindow.document.write(&quot;&amp;lt;HR&amp;gt;&quot;);

}

function display()

{

var dynWindow = window.open(&quot;&quot;,&quot;Title&quot;,&quot;width=200,height=300,scrollbars&quot;,

+ &quot;resizable&quot;);

sqrttable(dynWindow);

}

&amp;lt;/SCRIPT&amp;gt;

&amp;lt;/HEAD&amp;gt;

&amp;lt;BODY&amp;gt;

&amp;lt;FORM name=&quot;Show it&quot;&amp;gt;

&amp;lt;input type=button value=&quot;show table&quot; onClick=&quot;display()&quot;&amp;gt;

&amp;lt;/FORM&amp;gt;

&amp;lt;/BODY&amp;gt;

&amp;lt;/HTML&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Explanation of the code&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;In the&amp;nbsp; example&amp;nbsp; above we show the use of two functions. The HTML commands to display a table of the square roots of the integers from 1 to 20 are embedded in the JavaScript code.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;The Document Object Model(DOM)&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Within JavaScript, there is a hierarchy of parent and child objects, which is what is known as the Document Object Model&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;DOM helps in modifying&amp;nbsp; and reading&amp;nbsp; links e.t.c&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;About document.write&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;It’s necessary to have a quick and easy way to display&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;the results of expressions. In PHP (for example) there are the echo and print statements, which simply send text to the browser, so that’s easy. In JavaScript, though,there are the following&amp;nbsp; alternatives.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Using console.log&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;The console.log function will output the result of any value or expression passed to&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;it in the console of the current browser. This is a special mode with a frame or win‐&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;dow separate to the browser window, and in which errors and other messages can be&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;made to display&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Using alert&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;The alert function displays values or expressions passed to it in a pop-up window,&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;which requires you to click a button to close.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Writing into Elements&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;It is possible to write directly into the text of an HTML element, which is a fairly elegant solution&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Using document.write&lt;/span&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;The document.write function writes a value or expression at the current browser&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;location, and is therefore the perfect choice for quickly displaying results, because it&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;keeps all the examples short and sweet, by placing the output right there in the&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;browser next to the web content and code&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana; font-size: large;&quot;&gt;Having gone through an overview of javascript,download some books already posted on Books Downloads tab to read more,the next publish will be implementing javascript and php keep following&lt;/span&gt;&lt;/p&gt;</description><link>https://rbgtech.blogspot.com/2021/07/and-html-text-javascript-is-client-side.html</link><author>noreply@blogger.com (renson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1YWrtow2sxVhJb_5PfywZLzEDrsLu_Waav1t0jRbFnAO04haVktQI6QTlgu2OQ2EGEF7uF0YwVcwiGAJdwBvmI9RQI9Bml0IxK3fGLT869WXyIY21iS1bSkGk_Ho3iLtZ68j8WRGV0ZU/s72-w470-h149-c/javascript.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3879629789995591062.post-7251806195107269872</guid><pubDate>Tue, 27 Jul 2021 05:29:00 +0000</pubDate><atom:updated>2021-07-26T23:42:37.064-07:00</atom:updated><title>SESSION IN WEB</title><description>&lt;h1 style=&quot;text-align: left;&quot;&gt;&amp;nbsp;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0Ir7QoMYuntrfOxyHoEAHUgziUfDLl8upPvCb1g-mIkJjUcFLUplAYvHX4ZqDyg_gKdr3OGoJsaq14kQDPNr3HfQZuXBA9Is1cxQv2jG3cAO4i6LIVEaBn9JccwKhs7W_nu08cZiy0EI/s850/session1.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;364&quot; data-original-width=&quot;850&quot; height=&quot;364&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0Ir7QoMYuntrfOxyHoEAHUgziUfDLl8upPvCb1g-mIkJjUcFLUplAYvHX4ZqDyg_gKdr3OGoJsaq14kQDPNr3HfQZuXBA9Is1cxQv2jG3cAO4i6LIVEaBn9JccwKhs7W_nu08cZiy0EI/w578-h364/session1.png&quot; width=&quot;578&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;/h1&gt;&lt;h1 style=&quot;text-align: left;&quot;&gt;&lt;span&gt;Using Sessions&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;i&gt;&lt;u&gt;Sessions&lt;/u&gt;&lt;/i&gt;:These are groups of variables that are stored on the server but relate only to the current user. To ensure that the right variables are applied to the right users, PHP saves a cookie in the users’ web browsers to uniquely identify them.&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;This cookie has meaning only to the web server and cannot be used to ascertain any information about a user sessions provide a solid way of keeping track of your users.&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Starting a session requires calling the PHP function session_start before any HTML has been output, similarly to how cookies are sent during header exchanges.&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Then, to begin saving session variables, you just assign them as part of the &lt;/span&gt;&lt;span&gt;$_SESSION&amp;nbsp;&lt;/span&gt;array, like this:&lt;/h2&gt;&lt;h2&gt;&lt;span&gt;$_SESSION[&#39;variable&#39;] = $value;&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;They can then be read back just as easily in later program runs, like this:&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span&gt;$variable = $_SESSION[&#39;variable&#39;];&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Now assume that you have an application that always needs access to the username,&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;password, first name, and last name of each user, as stored in the table users, which you should have created a little earlier. So let’s further modify authenticate.php from&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Setting a session after successful authentication&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;
  
 
  
  &lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;&amp;lt;?php //authenticate2.php
 require_once &#39;login.php&#39;;
 $connection =
 new mysqli($db_hostname, $db_username, $db_password, $db_database);
 if ($connection-&amp;gt;connect_error) die($connection-&amp;gt;connect_error);
 if (isset($_SERVER[&#39;PHP_AUTH_USER&#39;]) &amp;amp;&amp;amp;
 isset($_SERVER[&#39;PHP_AUTH_PW&#39;]))
 {
 $un_temp =
mysql_entities_fix_string($connection, $_SERVER[&#39;PHP_AUTH_USER&#39;]);
 $pw_temp = mysql_entities_fix_string($connection, $_SERVER[&#39;PHP_AUTH_PW&#39;]);
 $query = &quot;SELECT * FROM users WHERE username=&#39;$un_temp&#39;&quot;;
 $result = $connection-&amp;gt;query($query);
 if (!$result) die($connection-&amp;gt;error);
elseif ($result-&amp;gt;num_rows)
 {
 $row = $result-&amp;gt;fetch_array(MYSQLI_NUM);
 $result-&amp;gt;close();
 $salt1 = &quot;qm&amp;amp;h*&quot;;
$salt2 = &quot;pg!@&quot;;
 $token = hash(&#39;ripemd128&#39;, &quot;$salt1$pw_temp$salt2&quot;);
 if ($token == $row[3])
 {
 session_start();
 $_SESSION[&#39;username&#39;] = $un_temp;
 $_SESSION[&#39;password&#39;] = $pw_temp;
 $_SESSION[&#39;forename&#39;] = $row[0];
 $_SESSION[&#39;surname&#39;] = $row[1];
 echo &quot;$row[0] $row[1] : Hi $row[0],
 you are now logged in as &#39;$row[2]&#39;&quot;;
 die (&quot;&amp;lt;p&amp;gt;&amp;lt;a href=continue.php&amp;gt;Click here to continue&amp;lt;/a&amp;gt;&amp;lt;/p&amp;gt;&quot;);
 }
 else die(&quot;Invalid username/password combination&quot;);
 }
 else die(&quot;Invalid username/password combination&quot;);
 }
 else
 {
 header(&#39;WWW-Authenticate: Basic realm=&quot;Restricted Section&quot;&#39;);
 header(&#39;HTTP/1.0 401 Unauthorized&#39;);
 die (&quot;Please enter your username and password&quot;);
 }
 $connection-&amp;gt;close();
 function mysql_entities_fix_string($connection, $string)
 {
 return htmlentities(mysql_fix_string($connection, $string));
 }
 function mysql_fix_string($connection, $string)
 {
 if (get_magic_quotes_gpc()) $string = stripslashes($string);
 return $connection-&amp;gt;real_escape_string($string);
 }
?&amp;gt;

&lt;/code&gt;&lt;/pre&gt;
    
    
    &lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmDQNAcjgkQq32MDM-LS_Py76kR0xkOUu-MAUV8jfP9TNLXDdPQIuhwBiyBXCjdOl8Fd4UDSz99Jgw5QVXjHPAPzn7S9Ch7yIZig3_9EdEDFOgWttoGkavb3YfDW9V1Ied2T8UQNbL0Ok/s300/session+after+login.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;168&quot; data-original-width=&quot;300&quot; height=&quot;239&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmDQNAcjgkQq32MDM-LS_Py76kR0xkOUu-MAUV8jfP9TNLXDdPQIuhwBiyBXCjdOl8Fd4UDSz99Jgw5QVXjHPAPzn7S9Ch7yIZig3_9EdEDFOgWttoGkavb3YfDW9V1Ied2T8UQNbL0Ok/w411-h239/session+after+login.png&quot; width=&quot;411&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;&lt;span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;One other addition to the program is the &lt;/span&gt;&lt;i&gt;“Click here to continue”&lt;/i&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt; link with a destination URL of continue.php. This will be used to illustrate how the session will transfer to another program or PHP web page. So create continue.php by typing/copying the program in Example&amp;nbsp; below and saving it.&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span&gt;&lt;span style=&quot;font-size: large;&quot;&gt;Retrieving session variables&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;
  
 &lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;&amp;lt;?php // continue.php
 session_start();
 if (isset($_SESSION[&#39;username&#39;]))
 {
$username = $_SESSION[&#39;username&#39;];
 $password = $_SESSION[&#39;password&#39;];
 $forename = $_SESSION[&#39;forename&#39;];
 $surname = $_SESSION[&#39;surname&#39;];
 echo &quot;Welcome back $forename.&amp;lt;br&amp;gt;
 Your full name is $forename $surname.&amp;lt;br&amp;gt;
 Your username is &#39;$username&#39;
 and your password is &#39;$password&#39;.&quot;;
 }
 else echo &quot;Please &amp;lt;a href=&#39;authenticate2.php&#39;&amp;gt;click here&amp;lt;/a&amp;gt; to log in.&quot;;
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
    
    
    &lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Now you are ready to call up&lt;i&gt; authenticate2.php&lt;/i&gt; into your browser. Enter a username of bsmith and password of mysecret (or pjones and acrobat) when prompted, and click the link to load in continue.php.&amp;nbsp;&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span&gt;Explanation of the code:&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;Sessions neatly confine to a single program the extensive code required to authenticate and log in a user. Once a user has been authenticated, and you have created a session, your program code becomes very simple indeed. You need only to call up session_start and look up any variables to which you need access from $_SESSION.&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;A quick test of whether &lt;/span&gt;&lt;i&gt;$_SESSION[&#39;username&#39;] &lt;/i&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;has a value is enough to let you know that the current user is authenticated, because session variables are stored on the server (unlike cookies, which are stored on the web browser)&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;and can therefore be trusted.&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;If &lt;/span&gt;&lt;span&gt;$_SESSION[&#39;username&#39;]&lt;/span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt; has not been assigned a value, no session is active, so the&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;last line of code in Example above directs users to the login page at authenticate2.php.&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span&gt;Ending a Session&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;When the time comes to end a session, usually when a user requests to log out from your site, you can use the session_destroy function in association, as in&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&amp;nbsp;The example provides a useful function for totally destroying a session, logging a user out, and unsetting all session variables.&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;A handy function to destroy a session and its data&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;
      
&lt;pre style=&quot;background-color: #eeeeee; border: 1px dashed rgb(153, 153, 153); color: black; font-family: &amp;quot;Andale Mono&amp;quot;, &amp;quot;Lucida Console&amp;quot;, Monaco, fixed, monospace; font-size: 12px; line-height: 14px; overflow: auto; padding: 5px; width: 100%;&quot;&gt;&lt;code&gt;&amp;lt;?php
 function destroy_session_and_data()
 {
 session_start();
 $_SESSION = array();
 setcookie(session_name(), &#39;&#39;, time() - 2592000, &#39;/&#39;);
 session_destroy();
 }
?&amp;gt;
To see this in action, you could modify continue.php as in Example below:
 Retrieving session variables and then destroying the session
&amp;lt;?php
 session_start();
 if (isset($_SESSION[&#39;username&#39;]))
 {
 $username = $_SESSION[&#39;username&#39;];
 $password = $_SESSION[&#39;password&#39;];
 $forename = $_SESSION[&#39;forename&#39;];
 $surname = $_SESSION[&#39;surname&#39;];
 destroy_session_and_data();
 echo &quot;Welcome back $forename.&amp;lt;br&amp;gt;
 Your full name is $forename $surname.&amp;lt;br&amp;gt;
 Your username is &#39;$username&#39;
 and your password is &#39;$password&#39;.&quot;;
 }
 else echo &quot;Please &amp;lt;a href=&#39;authenticate2.php&#39;&amp;gt;click here&amp;lt;/a&amp;gt; to log in.&quot;;
 function destroy_session_and_data()
 {
 $_SESSION = array();
 setcookie(session_name(), &#39;&#39;, time() - 2592000, &#39;/&#39;);
 session_destroy();
 }
?&amp;gt;

&lt;/code&gt;&lt;/pre&gt;
        
        &lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZDlikHs2tf_5UQ2_EeevBcPkTAao2XQHEDGro3A5gW94NnIjCwGC0EHJaXhUNGBmi_kfvn-KoL8IUfDM4OgSPTqeVAEuspTbJN31owR9ZOxnPQ05VL_McaThyohtYC2p3UMbzYlpzq0g/s259/sessiontimeout.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;194&quot; data-original-width=&quot;259&quot; height=&quot;278&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZDlikHs2tf_5UQ2_EeevBcPkTAao2XQHEDGro3A5gW94NnIjCwGC0EHJaXhUNGBmi_kfvn-KoL8IUfDM4OgSPTqeVAEuspTbJN31owR9ZOxnPQ05VL_McaThyohtYC2p3UMbzYlpzq0g/w412-h278/sessiontimeout.jpg&quot; width=&quot;412&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;h2&gt;&lt;span&gt;Explanation of the code:&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;The first time you navigate from &lt;/span&gt;&lt;i&gt;authenticate2.php&lt;/i&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt; to &lt;/span&gt;&lt;i&gt;continue.php&lt;/i&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;, it will display all the session variables. But, because of the call to destroy_session_and_data, if you&lt;/span&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;then click your browser’s Reload button, the session will have been destroyed and you’ll be prompted to return to the login page.&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/h2&gt;&lt;h2&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;At this point,we have &lt;u&gt;&lt;i&gt;learnt enough on PHP and MYSQL&lt;/i&gt;&lt;/u&gt; we are going to learn on Javascript ,&lt;i&gt;keep updated on our latest&lt;/i&gt; &lt;i&gt;publish by following us.&lt;/i&gt;&lt;/span&gt;&lt;/h2&gt;&lt;div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuvFz2ANgGgc09mVbe_k_oXPheY4xQCN16iYrwWS7pgrCDmwgguI3osYYsRjPZDlqO0LGux8WpjAe3FAmjE7BgnElLy-cDhm60M6qucss2atXuSu8FqhDifLbbqFfq6GhTT2CrVffAZ-w/s300/completephp.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;168&quot; data-original-width=&quot;300&quot; height=&quot;221&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjuvFz2ANgGgc09mVbe_k_oXPheY4xQCN16iYrwWS7pgrCDmwgguI3osYYsRjPZDlqO0LGux8WpjAe3FAmjE7BgnElLy-cDhm60M6qucss2atXuSu8FqhDifLbbqFfq6GhTT2CrVffAZ-w/w370-h221/completephp.jpg&quot; width=&quot;370&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;</description><link>https://rbgtech.blogspot.com/2021/07/session-in-web.html</link><author>noreply@blogger.com (renson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0Ir7QoMYuntrfOxyHoEAHUgziUfDLl8upPvCb1g-mIkJjUcFLUplAYvHX4ZqDyg_gKdr3OGoJsaq14kQDPNr3HfQZuXBA9Is1cxQv2jG3cAO4i6LIVEaBn9JccwKhs7W_nu08cZiy0EI/s72-w578-h364-c/session1.png" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3879629789995591062.post-1371954180060960446</guid><pubDate>Mon, 26 Jul 2021 06:13:00 +0000</pubDate><atom:updated>2021-07-26T06:34:13.591-07:00</atom:updated><title>Cookies  and Authentication in web</title><description>&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;u&gt;&lt;b&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifXkOox2h9BwAUd7hFVAgcopTDoOI-XpXY7V5CEdHw5KZOmnVi7BqGFo5kgruOwB09w2UgVG30hbm0y4q84U8pAbo7eFoVvz7q-ZE_d45fwntLNdRp1psnrIIDEf3_O_cMZ3MHeOpyJF0/s533/authCookies.gif&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;516&quot; data-original-width=&quot;533&quot; height=&quot;295&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifXkOox2h9BwAUd7hFVAgcopTDoOI-XpXY7V5CEdHw5KZOmnVi7BqGFo5kgruOwB09w2UgVG30hbm0y4q84U8pAbo7eFoVvz7q-ZE_d45fwntLNdRp1psnrIIDEf3_O_cMZ3MHeOpyJF0/w450-h295/authCookies.gif&quot; width=&quot;450&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;/b&gt;&lt;/u&gt;&lt;/h2&gt;&lt;h2 style=&quot;text-align: left;&quot;&gt;&lt;u&gt;&lt;b&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Cookies, Sessions, and Authentication&lt;/span&gt;&lt;/b&gt;&lt;/u&gt;&lt;/h2&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As your web projects grow larger and more complicated, you will find an increasing need to keep track of your users. Even if you aren’t offering logins and passwords, you will still often need to store details about a user’s current session and possibly also recognize him/her when he/she returns to your site.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Several technologies support this kind of interaction, ranging from simple browser cookies to session handling and HTTP authentication.&amp;nbsp;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;Using Cookies in PHP&lt;/h4&gt;&lt;div&gt;A cookie is an item of data that a web server saves to your computer’s hard disk via a web browser.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;u&gt;Importance of using cookies:&lt;/u&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;1.It helps in session tracking&lt;/div&gt;&lt;div&gt;2.Maintaining data across multiple visits&lt;/div&gt;&lt;div&gt;3.Holding shopping cart contents&lt;/div&gt;&lt;div&gt;4.Storing login details&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Setting a Cookie&lt;/b&gt;&lt;/h4&gt;&lt;div&gt;Setting a cookie in PHP is a simple matter. As long as no HTML has yet been transferred, you can call the setcookie function, which has the following syntax:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;setcookie(name, value, expire, path, domain, secure, httponly);&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;name:&lt;/b&gt; The name of the cookie. This is the name that your server will use to access the&lt;/div&gt;&lt;div&gt;cookie on subsequent browser requests. e.g:Username&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;value &lt;/b&gt;:The value of the cookie, or the cookie’s contents. This can contain up to 4 KB of&lt;/div&gt;&lt;div&gt;alphanumeric text. eg:Hannah&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;expire (Optional)&lt;/b&gt; :Unix timestamp of the expiration date. Generally, you will probably use&lt;/div&gt;&lt;div&gt;time() plus a number of seconds. If not set, the cookie expires when the browser&lt;/div&gt;&lt;div&gt;closes.eg:time() + 2592000&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;path (Optional):&lt;/b&gt; The path of the cookie on the server. If this is a / (forward slash), the&lt;/div&gt;&lt;div&gt;cookie is available over the entire domain, such as www.rbgtech.blogspot.com If it is a&lt;/div&gt;&lt;div&gt;subdirectory, the cookie is available only within that subdirectory. The default is&lt;/div&gt;&lt;div&gt;the current directory that the cookie is being set in, and this is the setting you will&lt;/div&gt;&lt;div&gt;normally use. eg: /&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;domain (Optional):&lt;/b&gt;The Internet domain of the cookie.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;So, to create a cookie with the name username and the value Hannah that is accessible across the entire web server on the current domain, and will be removed from the browser’s cache in seven days, use the following:&lt;/div&gt;&lt;div&gt;&lt;b&gt;setcookie(&#39;username&#39;, &#39;Hannah&#39;, time() + 60 * 60 * 24 * 7, &#39;/&#39;);&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Accessing a Cookie&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Reading the value of a cookie is as simple as accessing the $_COOKIE system array. For&lt;/div&gt;&lt;div&gt;example, if you wish to see whether the current browser has the cookie called user name already stored and, if so, to read its value, use the following:&lt;/div&gt;&lt;div&gt;&lt;b&gt;if (isset($_COOKIE[&#39;username&#39;])) $username = $_COOKIE[&#39;username&#39;];&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;Note that you can read a cookie back only after it has been sent to a web browser.&lt;/div&gt;&lt;div&gt;This means that when you issue a cookie, you cannot read it in again until the browser reloads the page (or another with access to the cookie) from your website&lt;/div&gt;&lt;div&gt;and passes the cookie back&amp;nbsp; to the server in the process.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;Destroying a Cookie&lt;/h4&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;To delete a cookie, you must issue it again and set a date in the past. It is important for all parameters in your new setcookie call except the timestamp to be identical to the parameters when the cookie was first issued; otherwise, the deletion will fail.&lt;/div&gt;&lt;div&gt;Therefore, to delete the cookie created earlier, you would use the following:&lt;/div&gt;&lt;div&gt;&lt;b&gt;setcookie(&#39;username&#39;, &#39;Hannah&#39;, time() - 2592000, &#39;/&#39;);&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;As long as the time given is in the past, the cookie should be deleted. However, I have used a time of 2,592,000 seconds (one month) in the past in case the client computer’s date and time are not correctly set.&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;HTTP Authentication&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;HTTP authentication uses the web server to manage users and passwords for the application. It’s adequate for most applications that ask users to log in.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;PHP authentication example&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&amp;lt;?php&lt;/div&gt;&lt;div&gt;&amp;nbsp;if (isset($_SERVER[&#39;PHP_AUTH_USER&#39;]) &amp;amp;&amp;amp;&lt;/div&gt;&lt;div&gt;&amp;nbsp;isset($_SERVER[&#39;PHP_AUTH_PW&#39;]))&lt;/div&gt;&lt;div&gt;&amp;nbsp;{&lt;/div&gt;&lt;div&gt;&amp;nbsp;echo &quot;Welcome User: &quot; . $_SERVER[&#39;PHP_AUTH_USER&#39;] .&lt;/div&gt;&lt;div&gt;&amp;nbsp;&quot; Password: &quot; . $_SERVER[&#39;PHP_AUTH_PW&#39;];&lt;/div&gt;&lt;div&gt;&amp;nbsp;}&lt;/div&gt;&lt;div&gt;&amp;nbsp;else&lt;/div&gt;&lt;div&gt;&amp;nbsp;{&lt;/div&gt;&lt;div&gt;&amp;nbsp;header(&#39;WWW-Authenticate: Basic realm=&quot;Restricted Section&quot;&#39;);&lt;/div&gt;&lt;div&gt;&amp;nbsp;header(&#39;HTTP/1.0 401 Unauthorized&#39;);&lt;/div&gt;&lt;div&gt;&amp;nbsp;die(&quot;Please enter your username and password&quot;);&lt;/div&gt;&lt;div&gt;&amp;nbsp;}&lt;/div&gt;&lt;div&gt;?&amp;gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHYwp8JCexFmgWrs0VfMdakl8vJmEjnUriXQsQIKG9l8bGo17k7JtH2hDXY9OGvE-um4042oxi_mfeyN1bXryiJYogRbxAG2qUdUsybgnMjx19HRazotnKHxcewCwry62izA4Sp61KZwY/s341/authentication.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;148&quot; data-original-width=&quot;341&quot; height=&quot;148&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHYwp8JCexFmgWrs0VfMdakl8vJmEjnUriXQsQIKG9l8bGo17k7JtH2hDXY9OGvE-um4042oxi_mfeyN1bXryiJYogRbxAG2qUdUsybgnMjx19HRazotnKHxcewCwry62izA4Sp61KZwY/w384-h148/authentication.jpg&quot; width=&quot;384&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;How the code works:&lt;/h4&gt;&lt;div&gt;The first thing the program does is look for two particular array values:&lt;/div&gt;&lt;div&gt;&lt;b&gt;$_SERVER[&#39;PHP_AUTH_USER&#39;] and $_SERVER[&#39;PHP_AUTH_PW&#39;]&lt;/b&gt;.&amp;nbsp;&lt;/div&gt;&lt;div&gt;If they both exist, they represent the username and password entered by a user into an authentication&lt;/div&gt;&lt;div&gt;prompt&lt;/div&gt;&lt;div&gt;Basic realm is the name of the section that is protected and appears as part of the pop-up prompt:&lt;/div&gt;&lt;div&gt;&lt;b&gt;WWW-Authenticate: Basic realm=&quot;Restricted Area&quot;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;If the user fills out the fields, the PHP program runs again from the top. But if the user clicks the Cancel button, the program proceeds to the following two lines, which send the following header and an error message:&lt;/div&gt;&lt;div&gt;&lt;b&gt;HTTP/1.0 401 Unauthorized&lt;/b&gt;&lt;/div&gt;&lt;div&gt;The &lt;u&gt;die&lt;/u&gt; statement causes the text “Please enter your username and password” to be displayed.&lt;/div&gt;
&lt;iframe allow=&quot;accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen=&quot;&quot; frameborder=&quot;0&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/NKfQnzj9Y7w&quot; title=&quot;YouTube video player&quot; width=&quot;560&quot;&gt;&lt;/iframe&gt;

&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;PHP authentication with input checking&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;$username = &#39;admin&#39;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;$password = &#39;letmein&#39;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;if (isset($_SERVER[&#39;PHP_AUTH_USER&#39;]) &amp;amp;&amp;amp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;isset($_SERVER[&#39;PHP_AUTH_PW&#39;]))&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;if ($_SERVER[&#39;PHP_AUTH_USER&#39;] == $username &amp;amp;&amp;amp;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;$_SERVER[&#39;PHP_AUTH_PW&#39;] == $password)&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;echo &quot;You are now logged in&quot;;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;else die(&quot;Invalid username / password combination&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;else&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;header(&#39;WWW-Authenticate: Basic realm=&quot;Restricted Section&quot;&#39;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;header(&#39;HTTP/1.0 401 Unauthorized&#39;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;die (&quot;Please enter your username and password&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;Storing Usernames and Passwords&lt;/b&gt;&lt;/h4&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Obviously, MySQL is the natural way to store usernames and passwords. But again,we don’t want to store the passwords as clear text, because our website could be compromised if the database were accessed by a hacker. Instead, we’ll use a neat trick&lt;/div&gt;&lt;div&gt;called a one-way function.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;This type of function is easy to use and converts a&amp;nbsp; string of text into a seemingly random string.&amp;nbsp;&lt;/div&gt;&lt;div&gt;So now I have moved on to using the PHP hash function, passing it a version of the ripemd algorithm, which was designed by the open academic community and which (like md5) returns a 32-character hexadecimal number—so it can easily replace md5&lt;/div&gt;&lt;div&gt;in most databases. Use it like this:&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;$token = hash(&#39;ripemd128&#39;, &#39;mypassword&#39;);&lt;/b&gt;&lt;/div&gt;&lt;div&gt;That example happens to give $token this value:&lt;/div&gt;&lt;div&gt;7b694600c8a2a2b0897c719958713619&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;Salting&lt;/h4&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Unfortunately, hash on its own is not enough to protect a database of passwords,because it could still be susceptible to a brute force attack that uses another database of known 32-character hexadecimal tokens. Such databases do exist, as a quick Google search will verify, although probably only for md5 and sha1 or sha2 at the moment.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Salting is simply a matter of adding some text that only we know about to each parameter to be encrypted, like this (with the salt highlighted in bold):&lt;/div&gt;&lt;div&gt;$token = hash(&#39;ripemd128&#39;, &#39;saltstringmypassword&#39;);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;In this example, the text saltstring has been prepended to the password. Of course, the more obscure you can make the salt, the better. I like to use salts such as this:&lt;/div&gt;&lt;div&gt;$token = hash(&#39;ripemd128&#39;, &#39;&lt;b&gt;hqb$t&lt;/b&gt;mypassword&lt;b&gt;cg*l&lt;/b&gt;&#39;);&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Here some random characters have been placed both before and after the password.Given just the database, and without access to your PHP code, it should now be next to impossible to work out the stored passwords.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEtw8pT2Dh3Fwg0JamAnltYKLallsKhYxbPJzVh29jVQVk7JOiMaF4ryg8vQ0PVeeHrkv95aA61geGTM19ZKQ0XIOtoymKYlUOK_k60dPVhIZXaaqDON684hsWhXEueLiOOIImB2vTQeA/s317/saltingPHP.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;159&quot; data-original-width=&quot;317&quot; height=&quot;185&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiEtw8pT2Dh3Fwg0JamAnltYKLallsKhYxbPJzVh29jVQVk7JOiMaF4ryg8vQ0PVeeHrkv95aA61geGTM19ZKQ0XIOtoymKYlUOK_k60dPVhIZXaaqDON684hsWhXEueLiOOIImB2vTQeA/w423-h185/saltingPHP.png&quot; width=&quot;423&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;Let’s create a MySQL table to hold some user details and add a couple of accounts. So type and save the program in example below as setupusers.php, and then open it in your browser.&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;Creating a users table and adding two accounts:&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;
  
  
  &lt;pre&gt;
 &lt;code id=&quot;htmlViewer&quot; style=&quot;color:rgb(68, 68, 68); font-weight:400;background-color:rgb(240, 240, 240);background:rgb(240, 240, 240);display:block;padding: .5em;&quot;&gt;&lt;span style=&quot;color:rgb(31, 113, 153); font-weight:400;&quot;&gt;&amp;lt;?php&lt;/span&gt; &lt;span style=&quot;color:rgb(136, 136, 136); font-weight:400;&quot;&gt;// setupusers.php&lt;/span&gt;
 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;require_once&lt;/span&gt; &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;login.php&amp;#x27;&lt;/span&gt;;
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt; =
 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;new&lt;/span&gt; mysqli(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$db_hostname&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$db_username&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$db_password&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$db_database&lt;/span&gt;);
 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt;-&amp;gt;connect_error) &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;die&lt;/span&gt;(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt;-&amp;gt;connect_error);
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$query&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;CREATE TABLE users (
 forename VARCHAR(32) NOT NULL,
 surname VARCHAR(32) NOT NULL,
 username VARCHAR(32) NOT NULL UNIQUE,
 password VARCHAR(32) NOT NULL
 )&amp;quot;&lt;/span&gt;;
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt; = &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt;-&amp;gt;query(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$query&lt;/span&gt;);
 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;if&lt;/span&gt; (!&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;) &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;die&lt;/span&gt;(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt;-&amp;gt;error);
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$salt1&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;qm&amp;amp;h*&amp;quot;&lt;/span&gt;;
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$salt2&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;pg!@&amp;quot;&lt;/span&gt;;
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$forename&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;Bill&amp;#x27;&lt;/span&gt;;
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$surname&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;Smith&amp;#x27;&lt;/span&gt;;
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$username&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;bsmith&amp;#x27;&lt;/span&gt;;
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$password&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;mysecret&amp;#x27;&lt;/span&gt;;
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$token&lt;/span&gt; = hash(&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;ripemd128&amp;#x27;&lt;/span&gt;, &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$salt1&lt;/span&gt;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$password&lt;/span&gt;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$salt2&lt;/span&gt;&amp;quot;&lt;/span&gt;);

 add_user(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$forename&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$surname&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$username&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$token&lt;/span&gt;);
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$forename&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;Pauline&amp;#x27;&lt;/span&gt;;
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$surname&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;Jones&amp;#x27;&lt;/span&gt;;
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$username&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;pjones&amp;#x27;&lt;/span&gt;;
&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$password&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;acrobat&amp;#x27;&lt;/span&gt;;
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$token&lt;/span&gt; = hash(&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;ripemd128&amp;#x27;&lt;/span&gt;, &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$salt1&lt;/span&gt;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$password&lt;/span&gt;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$salt2&lt;/span&gt;&amp;quot;&lt;/span&gt;);

 add_user(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$forename&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$surname&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$username&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$token&lt;/span&gt;);
 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:700;&quot;&gt;add_user&lt;/span&gt;(&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$fn&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$sn&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$un&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$pw&lt;/span&gt;&lt;/span&gt;)
 &lt;/span&gt;{
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$query&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;INSERT INTO users VALUES(&amp;#x27;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$fn&lt;/span&gt;&amp;#x27;, &amp;#x27;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$sn&lt;/span&gt;&amp;#x27;, &amp;#x27;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$un&lt;/span&gt;&amp;#x27;, &amp;#x27;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$pw&lt;/span&gt;&amp;#x27;)&amp;quot;&lt;/span&gt;;
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt; = &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt;-&amp;gt;query(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$query&lt;/span&gt;);
 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;if&lt;/span&gt; (!&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;) &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;die&lt;/span&gt;(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt;-&amp;gt;error);
 }
&lt;span style=&quot;color:rgb(31, 113, 153); font-weight:400;&quot;&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
    
    &lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;PHP authentication using MySQL example&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;&lt;div&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;
  
  
  &lt;pre&gt;
 &lt;code id=&quot;htmlViewer&quot; style=&quot;color:rgb(68, 68, 68); font-weight:400;background-color:rgb(240, 240, 240);background:rgb(240, 240, 240);display:block;padding: .5em;&quot;&gt;&lt;span style=&quot;color:rgb(31, 113, 153); font-weight:400;&quot;&gt;&amp;lt;?php&lt;/span&gt; &lt;span style=&quot;color:rgb(136, 136, 136); font-weight:400;&quot;&gt;// authenticate.php&lt;/span&gt;
 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;require_once&lt;/span&gt; &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;login.php&amp;#x27;&lt;/span&gt;;
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt; =
 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;new&lt;/span&gt; mysqli(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$db_hostname&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$db_username&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$db_password&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$db_database&lt;/span&gt;);
 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt;-&amp;gt;connect_error) &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;die&lt;/span&gt;(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt;-&amp;gt;connect_error);
 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;isset&lt;/span&gt;(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$_SERVER&lt;/span&gt;[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;PHP_AUTH_USER&amp;#x27;&lt;/span&gt;]) &amp;amp;&amp;amp;
 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;isset&lt;/span&gt;(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$_SERVER&lt;/span&gt;[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;PHP_AUTH_PW&amp;#x27;&lt;/span&gt;]))
 {
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$un_temp&lt;/span&gt; = mysql_entities_fix_string(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$_SERVER&lt;/span&gt;[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;PHP_AUTH_USER&amp;#x27;&lt;/span&gt;]);
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$pw_temp&lt;/span&gt; = mysql_entities_fix_string(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$_SERVER&lt;/span&gt;[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;PHP_AUTH_PW&amp;#x27;&lt;/span&gt;]);
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$query&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;SELECT * FROM users WHERE username=&amp;#x27;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$un_temp&lt;/span&gt;&amp;#x27;&amp;quot;&lt;/span&gt;;
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt; = &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt;-&amp;gt;query(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$query&lt;/span&gt;);
 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;if&lt;/span&gt; (!&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;) &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;die&lt;/span&gt;(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt;-&amp;gt;error);
 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;elseif&lt;/span&gt; (&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;-&amp;gt;num_rows)
 {
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$row&lt;/span&gt; = &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;-&amp;gt;fetch_array(MYSQLI_NUM);
&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;-&amp;gt;close();
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$salt1&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;qm&amp;amp;h*&amp;quot;&lt;/span&gt;;
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$salt2&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;pg!@&amp;quot;&lt;/span&gt;;
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$token&lt;/span&gt; = hash(&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;ripemd128&amp;#x27;&lt;/span&gt;, &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$salt1&lt;/span&gt;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$pw_temp&lt;/span&gt;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$salt2&lt;/span&gt;&amp;quot;&lt;/span&gt;);

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$token&lt;/span&gt; == &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$row&lt;/span&gt;[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;3&lt;/span&gt;]) &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$row&lt;/span&gt;[0] &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$row&lt;/span&gt;[1] :
Hi &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$row&lt;/span&gt;[0], you are now logged in as &amp;#x27;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$row&lt;/span&gt;[2]&amp;#x27;&amp;quot;&lt;/span&gt;;

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;die&lt;/span&gt;(&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;Invalid username/password combination&amp;quot;&lt;/span&gt;);
 }
 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;else&lt;/span&gt; &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;die&lt;/span&gt;(&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;Invalid username/password combination&amp;quot;&lt;/span&gt;);
 }
 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;else&lt;/span&gt;
 {
 header(&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;WWW-Authenticate: Basic realm=&amp;quot;Restricted Section&amp;quot;&amp;#x27;&lt;/span&gt;);
 header(&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;HTTP/1.0 401 Unauthorized&amp;#x27;&lt;/span&gt;);
 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;die&lt;/span&gt; (&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;Please enter your username and password&amp;quot;&lt;/span&gt;);
 }
 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt;-&amp;gt;close();

&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:700;&quot;&gt;mysql_entities_fix_string&lt;/span&gt;(&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$string&lt;/span&gt;&lt;/span&gt;)
 &lt;/span&gt;{
 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;return&lt;/span&gt; htmlentities(mysql_fix_string(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$string&lt;/span&gt;));
 }
 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:700;&quot;&gt;mysql_fix_string&lt;/span&gt;(&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$string&lt;/span&gt;&lt;/span&gt;)
 &lt;/span&gt;{
 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;if&lt;/span&gt; (get_magic_quotes_gpc()) &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$string&lt;/span&gt; = stripslashes(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$string&lt;/span&gt;);
 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$connection&lt;/span&gt;-&amp;gt;real_escape_string(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$string&lt;/span&gt;);
 }
&lt;span style=&quot;color:rgb(31, 113, 153); font-weight:400;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
    
    
    &lt;/span&gt;&lt;/div&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;Explanation of the code&lt;/h4&gt;&lt;div&gt;Now all that’s necessary is to check $token against the value stored in the database,which happens to be in the fourth column—which is column 3 when starting from 0.So $row[3] contains the previous token calculated for the salted password. If the two match, a friendly welcome string is output, calling the user by his or her first name.Otherwise, an error message is displayed.&lt;/div&gt;</description><link>https://rbgtech.blogspot.com/2021/07/cookies-and-authentication-in-web.html</link><author>noreply@blogger.com (renson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifXkOox2h9BwAUd7hFVAgcopTDoOI-XpXY7V5CEdHw5KZOmnVi7BqGFo5kgruOwB09w2UgVG30hbm0y4q84U8pAbo7eFoVvz7q-ZE_d45fwntLNdRp1psnrIIDEf3_O_cMZ3MHeOpyJF0/s72-w450-h295-c/authCookies.gif" height="72" width="72"/><thr:total>1</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3879629789995591062.post-5130026124734085532</guid><pubDate>Sun, 25 Jul 2021 05:38:00 +0000</pubDate><atom:updated>2021-07-27T01:04:03.505-07:00</atom:updated><title>PHP and MYSQL Web development</title><description>&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZXD9iLn9YEHvh9Y3WO9zm5UpIKr4y1LRFkbT2DTiH_dO0FC0XZtxmjUd6e7fLXDWcyhPCYvFultSXOuDYRs0LOur1f491ArufvlwGebPOiI4mnUuFu8aa8qtN8QTFYC3H8r_ww-GEhGw/s284/database+and+php+build+website.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;177&quot; data-original-width=&quot;284&quot; height=&quot;200&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZXD9iLn9YEHvh9Y3WO9zm5UpIKr4y1LRFkbT2DTiH_dO0FC0XZtxmjUd6e7fLXDWcyhPCYvFultSXOuDYRs0LOur1f491ArufvlwGebPOiI4mnUuFu8aa8qtN8QTFYC3H8r_ww-GEhGw/w418-h200/database+and+php+build+website.jpg&quot; width=&quot;418&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;Querying a MySQL Database with PHP&lt;/span&gt;&lt;/u&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;The reason for using PHP as an interface to MySQL is to format the results of SQL queries in a form visible in a web page. As long as you can log into your MySQL installation using your username and password, you can also do so from PHP.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;However, instead of using MySQL’s command line to enter instructions and view output, you will create query strings that are passed to MySQL. When MySQL returns its response, it will come as a data structure that PHP can recognize instead of the formatted output you see when you work on the command line. Further PHP com&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;‐&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;mands can retrieve the data and&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;format it for the web page&lt;/span&gt;
  &lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;https://www.youtube.com/embed/p-akZRkTIPo&quot; title=&quot;YouTube video player&quot; frameborder=&quot;0&quot; allow=&quot;accelerometer; autoplay=1; clipboard-write; encrypted-media; gyroscope; picture-in-picture&quot; allowfullscreen&gt;&lt;/iframe&gt;
  
  &lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;The Process of connecting MYSQL with PHP&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;The process of using MySQL with PHP is as follows:&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;1. Connect to MySQL and select the database to use.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;2. Build a query string&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;3. Perform the query.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;4. Retrieve the results and output them to a web page.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;5. Repeat steps 2 to 4 until all desired data has been retrieved.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;6. Disconnect from MySQL.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/u&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;u&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3S7O8lvw14V5VwDSO2rpsFoGGhVN0ds1-3j4vKOXpg4YsgqDWY97Rl_jYZ5dxqwhZCPQZrAa4f3KkDemH5Q6W0_mjsn3aTmXeFr9kWyNXKsVpCRQMKto-pjE2uX-iIA1FSrQXkD-Kx6w/s310/php+with+database.png&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;163&quot; data-original-width=&quot;310&quot; height=&quot;174&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3S7O8lvw14V5VwDSO2rpsFoGGhVN0ds1-3j4vKOXpg4YsgqDWY97Rl_jYZ5dxqwhZCPQZrAa4f3KkDemH5Q6W0_mjsn3aTmXeFr9kWyNXKsVpCRQMKto-pjE2uX-iIA1FSrQXkD-Kx6w/w310-h174/php+with+database.png&quot; width=&quot;310&quot; /&gt;&lt;/a&gt;&lt;/u&gt;&lt;/div&gt;&lt;u&gt;&lt;br /&gt;&lt;/u&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/u&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/u&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;Creating a Login File&lt;/span&gt;&lt;/u&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Most websites developed with PHP contain multiple program files that will require &amp;nbsp;access to MySQL and will thus need the login and password details.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Therefore, it’s sensible to create a single file to store these and then include that file wherever it’s needed. Example:&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;lt;?php // login.php&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;$hn = &#39;localhost&#39;;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;$db = &#39;publications&#39;;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;$un = &#39;username&#39;;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;$pw = &#39;password&#39;;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Type the example, replacing username and password with the values you use for your MySQL database, and save it to the document root directory We’ll be making use of the file shortly.The hostname &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;localhost&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;should work as long as you’re using a&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;MySQL database on your local system, and the database publications should work if you’re typing the same as the one in the xammp or any other local server you are using.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;lt;?php and ?&amp;gt; &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;tags mean that the lines between can be interpreted only as PHP code. &lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;The $hn &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;variable will tell PHP which computer to use when connecting to a database.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;Connecting to a PHP MySQL Database&amp;nbsp;&lt;/span&gt;&lt;/u&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Now that you have the &lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;login.php &lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;file saved, you can include it in any PHP files that will need to access the database by using the &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;require_once &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;statement. This is preferable to an &lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;include&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;statement, as it will generate a fatal error if the file is not found.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;And believe me, not finding the file containing the login details to your database is a fatal error.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Also, using &lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;require_once &lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;instead of &lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;require&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;means that the file will be read in only when it has not previously been included, which prevents wasteful duplicate disk accesses. &lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;Connecting to a MySQL server with mysqli&lt;/span&gt;&lt;/u&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;require_once &#39;login.php&#39;;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;$conn = new mysqli($hn, $un, $pw, $db);&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;if ($conn-&amp;gt;connect_error) die($conn-&amp;gt;connect_error);&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;This example creates a new object called &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;$conn &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;by calling a new instance of the mysqli method, passing all the values retrieved from the login.php file. Error checking is achieved by referencing the&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;&amp;nbsp;$conn-&amp;gt;connect_error &lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;property.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;The -&amp;gt; operator indicates that the item on the right is a property or method of the object on the left. In this case, if connect_error has a value, then there was an error,so we call the die function and display that property, which details the connection error.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;The $conn object is used in the following examples to access the MySQL database.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Building and executing a query&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Sending a query to MySQL from PHP is as simple as issuing it using the query method of a connection&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;object.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTc1ar4JVlJim2g3B55GD9FV1ZW5a61Ya-dpbniAC5lZbqP38zF7hI_HnQuYNSViauYhcRYkcEBBISRg-LBMUbd6tyBH8h9gIZO-hrIEoHmsXl-sGrm28k8VRucSL3O31T45QWj0HK7Lw/s308/phpMysql+querying.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;164&quot; data-original-width=&quot;308&quot; height=&quot;199&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTc1ar4JVlJim2g3B55GD9FV1ZW5a61Ya-dpbniAC5lZbqP38zF7hI_HnQuYNSViauYhcRYkcEBBISRg-LBMUbd6tyBH8h9gIZO-hrIEoHmsXl-sGrm28k8VRucSL3O31T45QWj0HK7Lw/w325-h199/phpMysql+querying.jpg&quot; width=&quot;325&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;br /&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;Querying a database with mysqli&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;lt;?php&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;$query = &quot;SELECT * FROM classics&quot;;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;$result = $conn-&amp;gt;query($query);&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;if (!$result) die($conn-&amp;gt;error);&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;?&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Here the variable &lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;$query &lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;is assigned a string containing the query to be made, and then passed to the query method of the &lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;$conn &lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;object, which returns a result that we place in the object &lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;$result&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;. If $result is FALSE, there was a problem and the error property of the connection object will contain the details, so the die function is called to display that error.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;All the data returned by MySQL is now stored in an easily interrogatable format in the &lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;$result &lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;object.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Fetching a result&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Once you have an object returned in &lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;$result&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;, you can use it to extract the data you want, one item at a time, using the &lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;fetch_assoc &lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;method of the object. &lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Fetching results one cell at a time&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;
    
&lt;pre&gt;
 &lt;code id=&quot;htmlViewer&quot; style=&quot;color:rgb(68, 68, 68); font-weight:400;background-color:rgb(240, 240, 240);background:rgb(240, 240, 240);display:block;padding: .5em;&quot;&gt;&lt;span style=&quot;color:rgb(31, 113, 153); font-weight:400;&quot;&gt;&amp;lt;?php&lt;/span&gt; &lt;span style=&quot;color:rgb(136, 136, 136); font-weight:400;&quot;&gt;// query.php&lt;/span&gt;

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;require_once&lt;/span&gt; &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;login.php&amp;#x27;&lt;/span&gt;;

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt; = &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;new&lt;/span&gt; mysqli(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$hn&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$un&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$pw&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$db&lt;/span&gt;);

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;-&amp;gt;connect_error) &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;die&lt;/span&gt;(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;-&amp;gt;connect_error);

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$query&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;SELECT * FROM classics&amp;quot;&lt;/span&gt;;

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt; = &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;-&amp;gt;query(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$query&lt;/span&gt;);

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;if&lt;/span&gt; (!&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;) &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;die&lt;/span&gt;(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;-&amp;gt;error);

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$rows&lt;/span&gt; = &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;-&amp;gt;num_rows;

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$j&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;0&lt;/span&gt; ; &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$j&lt;/span&gt; &amp;lt; &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$rows&lt;/span&gt; ; ++&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$j&lt;/span&gt;)

 {

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;-&amp;gt;data_seek(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$j&lt;/span&gt;);

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;Author: &amp;#x27;&lt;/span&gt; . &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;-&amp;gt;fetch_assoc()[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;author&amp;#x27;&lt;/span&gt;] . &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;&amp;lt;br&amp;gt;&amp;#x27;&lt;/span&gt;;

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;-&amp;gt;data_seek(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$j&lt;/span&gt;);

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;Title: &amp;#x27;&lt;/span&gt; . &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;-&amp;gt;fetch_assoc()[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;title&amp;#x27;&lt;/span&gt;] . &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;&amp;lt;br&amp;gt;&amp;#x27;&lt;/span&gt;;

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;-&amp;gt;data_seek(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$j&lt;/span&gt;);

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;Category: &amp;#x27;&lt;/span&gt; . &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;-&amp;gt;fetch_assoc()[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;category&amp;#x27;&lt;/span&gt;] . &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;&amp;lt;br&amp;gt;&amp;#x27;&lt;/span&gt;;

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;-&amp;gt;data_seek(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$j&lt;/span&gt;);

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;Year: &amp;#x27;&lt;/span&gt; . &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;-&amp;gt;fetch_assoc()[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;year&amp;#x27;&lt;/span&gt;] . &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;&amp;lt;br&amp;gt;&amp;#x27;&lt;/span&gt;;

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;-&amp;gt;data_seek(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$j&lt;/span&gt;);

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;ISBN: &amp;#x27;&lt;/span&gt; . &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;-&amp;gt;fetch_assoc()[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;isbn&amp;#x27;&lt;/span&gt;] . &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;#x27;&lt;/span&gt;;

 }

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;-&amp;gt;close();

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;-&amp;gt;close();

&lt;span style=&quot;color:rgb(31, 113, 153); font-weight:400;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Fetching a row&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;To fetch one row at a time, replace the for loop from Example &amp;nbsp;above with the one highlighted in bold&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Fetching results one row at a time&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;
  
  
&lt;pre style=&quot;font-family: Andale Mono, Lucida Console, Monaco, fixed, monospace; color: #000000; background-color: #eee;font-size: 12px;border: 1px dashed #999999;line-height: 14px;padding: 5px; overflow: auto; width: 100%&quot;&gt;&lt;code&gt;&amp;lt;?php //fetchrow.php

 require_once &#39;login.php&#39;;

 $conn = new mysqli($hn, $un, $pw, $db);

 if ($conn-&amp;gt;connect_error) die($conn-&amp;gt;connect_error);

 $query = &amp;quot;SELECT * FROM classics&amp;quot;;

 $result = $conn-&amp;gt;query($query);

 if (!$result) die($conn-&amp;gt;error);

 $rows = $result-&amp;gt;num_rows;

 for ($j = 0 ; $j &amp;lt; $rows ; ++$j)

 {

 $result-&amp;gt;data_seek($j);

 $row = $result-&amp;gt;fetch_array(MYSQLI_ASSOC);

 echo &#39;Author: &#39; . $row[&#39;author&#39;] . &#39;&amp;lt;br&amp;gt;&#39;;

 echo &#39;Title: &#39; . $row[&#39;title&#39;] . &#39;&amp;lt;br&amp;gt;&#39;;

 echo &#39;Category: &#39; . $row[&#39;category&#39;] . &#39;&amp;lt;br&amp;gt;&#39;;

 echo &#39;Year: &#39; . $row[&#39;year&#39;] . &#39;&amp;lt;br&amp;gt;&#39;;

 echo &#39;ISBN: &#39; . $row[&#39;isbn&#39;] . &#39;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&#39;;

 }

 $result-&amp;gt;close();

 $conn-&amp;gt;close();

?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
    
    &lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;In this modified code, only one-fifth of the interrogations of the $result object are made (compared to the previous example), and only one seek into the object is made in each iteration of the loop, because each row is fetched in its entirety via &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;the fetch_array &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;method. This returns a single row of data as an array, which is then assigned to the array $row.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;The fetch_array method can return three types of array according to the value&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;passed to it:&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;MYSQLI_NUM&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Numeric array. Each column appears in the array in the order in which you defined it when you created (or altered) the table. In our case, the zeroth element of the array contains the Author column, element 1 contains the Title, and so on.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Querying a MySQL Database with PHP &lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;MYSQLI_ASSOC&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Associative array. Each key is the name of a column. Because items of data are referenced by column name (rather than index number), use this option where possible in your code to make debugging easier and help other programmers better manage your code.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;MYSQLI_BOTH&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Associative and numeric array.Associative arrays are usually more useful than numeric ones because you can refer to each column by name, such as$row[&#39;author&#39;], instead of trying to remember where&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;it is in the column order. So this script uses an&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;associative array, leading us to pass&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;MYSQLI_ASSOC.&lt;/span&gt;&lt;/b&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Closing a connection PHP will eventually return the memory it has allocated for objects after you have finished with the script, so in small scripts, you don’t usually need to worry about releasing memory yourself. &lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;However, if you’re allocating a lot of result objects or fetching large amounts of data, it can be a good idea to free the memory you have been using to prevent problems later in your script.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;This becomes particularly important on higher-traffic pages, because the amount of memory consumed in a session can rapidly grow. Therefore, note the calls to the close methods of the objects $result and $conn in the preceding scripts, as soon as each object is no longer needed, like this:&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;$result-&amp;gt;close();&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;$conn-&amp;gt;close();&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;A Practical Example&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;It’s time to write our first example of inserting data in and deleting it from a MySQL table using PHP.&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;
  
  &lt;pre&gt;
 &lt;code id=&quot;htmlViewer&quot; style=&quot;color:rgb(68, 68, 68); font-weight:400;background-color:rgb(240, 240, 240);background:rgb(240, 240, 240);display:block;padding: .5em;&quot;&gt;&lt;span style=&quot;color:rgb(31, 113, 153); font-weight:400;&quot;&gt;&amp;lt;?php&lt;/span&gt; &lt;span style=&quot;color:rgb(136, 136, 136); font-weight:400;&quot;&gt;// sqltest.php&lt;/span&gt;

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;require_once&lt;/span&gt; &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;login.php&amp;#x27;&lt;/span&gt;;

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt; = &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;new&lt;/span&gt; mysqli(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$hn&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$un&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$pw&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$db&lt;/span&gt;);

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;-&amp;gt;connect_error) &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;die&lt;/span&gt;(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;-&amp;gt;connect_error);

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;isset&lt;/span&gt;(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$_POST&lt;/span&gt;[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;delete&amp;#x27;&lt;/span&gt;]) &amp;amp;&amp;amp; &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;isset&lt;/span&gt;(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$_POST&lt;/span&gt;[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;isbn&amp;#x27;&lt;/span&gt;]))

 {

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$isbn&lt;/span&gt; = get_post(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;, &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;isbn&amp;#x27;&lt;/span&gt;);

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$query&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;DELETE FROM classics WHERE isbn=&amp;#x27;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$isbn&lt;/span&gt;&amp;#x27;&amp;quot;&lt;/span&gt;;

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt; = &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;-&amp;gt;query(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$query&lt;/span&gt;);

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;if&lt;/span&gt; (!&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;) &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;DELETE failed: &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$query&lt;/span&gt;&amp;lt;br&amp;gt;&amp;quot;&lt;/span&gt; .

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;-&amp;gt;error . &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;quot;&lt;/span&gt;;

 }

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;if&lt;/span&gt; (&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;isset&lt;/span&gt;(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$_POST&lt;/span&gt;[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;author&amp;#x27;&lt;/span&gt;]) &amp;amp;&amp;amp;

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;isset&lt;/span&gt;(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$_POST&lt;/span&gt;[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;title&amp;#x27;&lt;/span&gt;]) &amp;amp;&amp;amp;

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;isset&lt;/span&gt;(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$_POST&lt;/span&gt;[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;category&amp;#x27;&lt;/span&gt;]) &amp;amp;&amp;amp;

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;isset&lt;/span&gt;(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$_POST&lt;/span&gt;[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;year&amp;#x27;&lt;/span&gt;]) &amp;amp;&amp;amp;

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;isset&lt;/span&gt;(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$_POST&lt;/span&gt;[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;isbn&amp;#x27;&lt;/span&gt;]))

 {

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$author&lt;/span&gt; = get_post(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;, &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;author&amp;#x27;&lt;/span&gt;);

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$title&lt;/span&gt; = get_post(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;, &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;title&amp;#x27;&lt;/span&gt;);

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$category&lt;/span&gt; = get_post(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;, &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;category&amp;#x27;&lt;/span&gt;);

&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$year&lt;/span&gt; = get_post(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;, &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;year&amp;#x27;&lt;/span&gt;);

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$isbn&lt;/span&gt; = get_post(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;, &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;#x27;isbn&amp;#x27;&lt;/span&gt;);

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$query&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;INSERT INTO classics VALUES&amp;quot;&lt;/span&gt; .

 &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;(&amp;#x27;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$author&lt;/span&gt;&amp;#x27;, &amp;#x27;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$title&lt;/span&gt;&amp;#x27;, &amp;#x27;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$category&lt;/span&gt;&amp;#x27;, &amp;#x27;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$year&lt;/span&gt;&amp;#x27;, &amp;#x27;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$isbn&lt;/span&gt;&amp;#x27;)&amp;quot;&lt;/span&gt;;

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt; = &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;-&amp;gt;query(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$query&lt;/span&gt;);

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;if&lt;/span&gt; (!&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;) &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;echo&lt;/span&gt; &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;INSERT failed: &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$query&lt;/span&gt;&amp;lt;br&amp;gt;&amp;quot;&lt;/span&gt; .

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;-&amp;gt;error . &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&amp;quot;&lt;/span&gt;;

 }

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;echo&lt;/span&gt; &amp;lt;&amp;lt;&amp;lt;_END

 &amp;lt;form action=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;sqltest.php&amp;quot;&lt;/span&gt; method=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;post&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;pre&amp;gt;

 Author &amp;lt;input type=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt; name=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;author&amp;quot;&lt;/span&gt;&amp;gt;

 Title &amp;lt;input type=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt; name=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;title&amp;quot;&lt;/span&gt;&amp;gt;

 Category &amp;lt;input type=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt; name=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;category&amp;quot;&lt;/span&gt;&amp;gt;

 Year &amp;lt;input type=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt; name=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;year&amp;quot;&lt;/span&gt;&amp;gt;

 ISBN &amp;lt;input type=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;text&amp;quot;&lt;/span&gt; name=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;isbn&amp;quot;&lt;/span&gt;&amp;gt;

 &amp;lt;input type=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;submit&amp;quot;&lt;/span&gt; value=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;ADD RECORD&amp;quot;&lt;/span&gt;&amp;gt;

 &amp;lt;/pre&amp;gt;&amp;lt;/form&amp;gt;

_END;

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$query&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;SELECT * FROM classics&amp;quot;&lt;/span&gt;;

&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt; = &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;-&amp;gt;query(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$query&lt;/span&gt;);

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;if&lt;/span&gt; (!&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;) &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;die&lt;/span&gt; (&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;Database access failed: &amp;quot;&lt;/span&gt; . &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;-&amp;gt;error);

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$rows&lt;/span&gt; = &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;-&amp;gt;num_rows;

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;for&lt;/span&gt; (&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$j&lt;/span&gt; = &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;0&lt;/span&gt; ; &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$j&lt;/span&gt; &amp;lt; &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$rows&lt;/span&gt; ; ++&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$j&lt;/span&gt;)

 {

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;-&amp;gt;data_seek(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$j&lt;/span&gt;);

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$row&lt;/span&gt; = &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;-&amp;gt;fetch_array(MYSQLI_NUM);

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;echo&lt;/span&gt; &amp;lt;&amp;lt;&amp;lt;_END

 &amp;lt;pre&amp;gt;

 Author &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$row&lt;/span&gt;[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;0&lt;/span&gt;]

 Title &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$row&lt;/span&gt;[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;1&lt;/span&gt;]

 Category &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$row&lt;/span&gt;[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;2&lt;/span&gt;]

 Year &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$row&lt;/span&gt;[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;3&lt;/span&gt;]

 ISBN &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$row&lt;/span&gt;[&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;4&lt;/span&gt;]

 &amp;lt;/pre&amp;gt;

 &amp;lt;form action=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;sqltest.php&amp;quot;&lt;/span&gt; method=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;post&amp;quot;&lt;/span&gt;&amp;gt;

 &amp;lt;input type=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;hidden&amp;quot;&lt;/span&gt; name=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;delete&amp;quot;&lt;/span&gt; value=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;yes&amp;quot;&lt;/span&gt;&amp;gt;

 &amp;lt;input type=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;hidden&amp;quot;&lt;/span&gt; name=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;isbn&amp;quot;&lt;/span&gt; value=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;$row&lt;/span&gt;[4]&amp;quot;&lt;/span&gt;&amp;gt;

 &amp;lt;input type=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;submit&amp;quot;&lt;/span&gt; value=&lt;span style=&quot;color:rgb(136, 0, 0); font-weight:400;&quot;&gt;&amp;quot;DELETE RECORD&amp;quot;&lt;/span&gt;&amp;gt;&amp;lt;/form&amp;gt;

_END;

 }

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$result&lt;/span&gt;-&amp;gt;close();

 &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;-&amp;gt;close();

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;function&lt;/span&gt; &lt;span style=&quot;color:rgb(136, 0, 0); font-weight:700;&quot;&gt;get_post&lt;/span&gt;(&lt;span style=&quot;color:rgb(68, 68, 68); font-weight:400;&quot;&gt;&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;, &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$var&lt;/span&gt;&lt;/span&gt;)

 &lt;/span&gt;{

 &lt;span style=&quot;color:rgb(68, 68, 68); font-weight:700;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$conn&lt;/span&gt;-&amp;gt;real_escape_string(&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$_POST&lt;/span&gt;[&lt;span style=&quot;color:rgb(188, 96, 96); font-weight:400;&quot;&gt;$var&lt;/span&gt;]);

 }

&lt;span style=&quot;color:rgb(31, 113, 153); font-weight:400;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
    
    
    &lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;

&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;N/B:The &lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;get_post function&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;, &amp;nbsp;passes each item it retrieves through the&lt;/span&gt;&lt;b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-ansi-font-weight: bold; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;real_escape_string method &lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;of the connection object to strip out any characters that&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;a &lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%;&quot;&gt;hacker&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;may have inserted in order to break into or alter your database, like this:&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;function get_post($conn, $var)&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;{&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;return $conn-&amp;gt;real_escape_string($_POST[$var]);&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;}&lt;/span&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Verdana; font-size: 16pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;</description><link>https://rbgtech.blogspot.com/2021/07/php-and-mysql-web-development.html</link><author>noreply@blogger.com (renson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhZXD9iLn9YEHvh9Y3WO9zm5UpIKr4y1LRFkbT2DTiH_dO0FC0XZtxmjUd6e7fLXDWcyhPCYvFultSXOuDYRs0LOur1f491ArufvlwGebPOiI4mnUuFu8aa8qtN8QTFYC3H8r_ww-GEhGw/s72-w418-h200-c/database+and+php+build+website.jpg" height="72" width="72"/><thr:total>2</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3879629789995591062.post-3255059315912542929</guid><pubDate>Fri, 23 Jul 2021 11:13:00 +0000</pubDate><atom:updated>2021-07-23T05:04:22.998-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">angular</category><category domain="http://www.blogger.com/atom/ns#">best 3 web framework</category><category domain="http://www.blogger.com/atom/ns#">frontend</category><category domain="http://www.blogger.com/atom/ns#">react</category><category domain="http://www.blogger.com/atom/ns#">web framework</category><category domain="http://www.blogger.com/atom/ns#">website</category><category domain="http://www.blogger.com/atom/ns#">website development</category><title>Best Frontend Frameworks To learn in 2021</title><description>&lt;h3 style=&quot;text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&amp;nbsp;What is a framework?&lt;/span&gt;&lt;/h3&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;It is a universal, reusable software environment that provides particular functionality as part of a larger software platform to facilitate the development of software applications, products and solutions. Software frameworks may include support programs, compilers, code libraries, toolsets, and application programming interfaces (APIs) that bring together all the different components to enable development of a project or system.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;Key features of a framework&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;1.&lt;/b&gt;In aframework,the overall program&#39;s flow of control is not dictated by the caller, but by the framework.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;2.&lt;/b&gt;The framework code, in general, is not supposed to be modified, while accepting user-implemented extensions. In other words, users can extend the framework, but cannot modify its code&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;.&lt;b&gt;Why we use frameworks for web development&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;1.Accelerated Development&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;One of the main advantages of using web frameworks is that you don’t need to write extensive lines of code. With a pre-defined template and an intuitive coding interface, developers can save hours of strenuous coding effort. Besides, frameworks offer quick prototyping, easy debugging, and real-time code changes to implement custom functionalities.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;Best frontend frameworks&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;1.React&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3xSG7E-mJWmp5Q6e-bOByW0ketx8svy2fy0_C7FzrTsxWG-YlqAh7MH8iIReyhO-lqoVCpJ3xexZKm__OpNq3aEI88Mq-9lgtubhHC4S4dZUL7gySYS93a5yUqBul5UgcfQI_3pixNV4/s257/download.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;96&quot; data-original-width=&quot;257&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3xSG7E-mJWmp5Q6e-bOByW0ketx8svy2fy0_C7FzrTsxWG-YlqAh7MH8iIReyhO-lqoVCpJ3xexZKm__OpNq3aEI88Mq-9lgtubhHC4S4dZUL7gySYS93a5yUqBul5UgcfQI_3pixNV4/s0/download.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;2.Angular&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;3.Vuejs&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;3.jQuery&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;4.Emberjs&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;5.Backbonejs&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;6.Semantic-UI&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;7.Foundation&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;8.Svelte&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;Top 3 Frontend Frameworks of 2021&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;The State of JavaScript 2019 concludes that React, Angular, and Vue are most popular among developers, which makes them the top three frontend frameworks of 2021 as well.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Reasons for their popularity:&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;1 React&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;One of the simplest frameworks to learn – React – was developed at Facebook to fix code maintainability issues due to the constant addition of features in the app. An open-source framework now, React stands out because of its virtual Document Object Model (DOM), which offers its exceptional functionality. An ideal framework for those who anticipate high traffic and need a stable platform to handle it.single-page web applications and PWAs.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;.It works best when dealing with&amp;nbsp; single-page web applications and PWAs projects.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;&lt;u&gt;Advantages&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;1.&lt;/b&gt;Reusability of components makes it easy to collaborate and reuse them in other parts of the application&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;2.&lt;/b&gt;Consistent and seamless performance with the use of virtual DOM&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;3.&lt;/b&gt;The best alternative to writing components in React hooks, it allows you to write components without classes and lets you learn React more easily&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;4.&lt;/b&gt;React dev tools are advanced and super useful&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;&lt;u&gt;disadvantage&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;1.&lt;/b&gt;Due to multiple and constant updates in the framework, it is difficult to make the proper documentation and so does it impacts the learning curve for beginners&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;2.&lt;/b&gt;Developers find it hard to understand the complexities of JSX while beginning with the framework&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;3.&lt;/b&gt;It only gives frontend solutions&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;When to use React:&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;React is used for building the user interface, especially when you want to develop single-page applications. It is the most robust frontend framework when you want to develop an interactive interface with less time since you can reuse the components.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;When not to use React:&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;When you don’t have hands-on experience with Javascript, React isn’t the recommended option. Also, for inexperienced developers, the JSX learning curve is a bit tough.&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;2. Angular&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Unlike React, Angular is unique with its two-way data binding feature. It means there is a real-time synchronization between the model and the view, where any change in the model reflects instantly on the view and vice versa.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;If your project involves building mobile or web apps, Angular is perfect! Besides, you can also use this framework to develop multi-page as well as progressive web apps.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Compared to React, Angular is not easy to learn. Though there is innumerable documentation available, they are either too complex or confusing to read.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;Advantages&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;1)&lt;/b&gt;In-built functionality to update the changes made in model to the view and so does vice-versa&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;2)&lt;/b&gt;Reduces the amount of code since most of the prominent features like two-way data binding are provided by default&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;3)&lt;/b&gt;Decouples the components from the dependencies by defining them external elements&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;4)&lt;/b&gt;Components are reusable and easy to manage using the dependency injection&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;5)&lt;/b&gt;A vast community for learning and support&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;&lt;u&gt;disadvantages&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;1)&lt;/b&gt;Since Angular is the complete dynamic solution, there are multiple ways you can perform the task, so the learning curve is steeper. However, the large community of Angular makes it easy for new learners to learn about concepts and technology&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;2)&lt;/b&gt;It happens that dynamic apps don’t perform well sometimes because of their complex structure and size. However, code optimization and best practices of Angular&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;When to use Angular:&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Angular augments the performance of browser-based applications by dynamically updating the contents in no time since it uses two-way data binding. For enterprise based applications and dynamic web apps, using Angular is the best bet.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;When not to use Angular:&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Angular is a complete solution as a frontend framework. If you want to build applications with limited scopes, you will not be able to use the resources that Angular provides. Also, when you have a more minor size team, opt for a smaller framework with fewer complexities and simple syntax.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;h4 style=&quot;text-align: left;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;3 Vuejs&lt;/span&gt;&lt;/b&gt;&lt;/h4&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Vue Js&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;One of the most popular front-end frameworks nowadays, Vue is a simple and straightforward framework. It is good at removing the complexities that Angular developers face. It is smaller in size and offers two major advantages – visual DOM and component-based. It is also a 2-way binding.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Vue is versatile, and it helps you with multiple tasks. From building web applications and mobile apps to progressive web applications, it can handle both simple and dynamic processes with ease.&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;Though it is built to optimize app performance and tackle complexities, it is not widely popular among market giants.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;&lt;u&gt;advantages&lt;/u&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;1)&lt;/b&gt;Extensive and detailed documentation&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;2)&lt;/b&gt;Simple syntax – programmers with the javascript background can easily get started with Vuejs&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;3)&lt;/b&gt;Flexibility to design the app structure&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;4)&lt;/b&gt;Typescript support&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;&lt;u&gt;disadvantages&lt;/u&gt;&lt;/b&gt;:&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;1)&lt;/b&gt;Lack of stability in components&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;2)&lt;/b&gt;Relatively small community&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;3)&lt;/b&gt;Language barrier with plugins and components (most plugins written in Chinese language)&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;When to use:&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;Vuejs is recommended for flexible design structures. It lets you design everything from scratch and is successful in developing giant projects as well.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;When not to use:&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;b&gt;.&lt;/b&gt;If you think the support community would be there to answer the complexities, Vuejs is not the right path to go. Also, the applications requiring stable components aren’t suitable to be built with Vuejs since the framework has shown problems with the stability of components.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;I&lt;b&gt; recommend&lt;/b&gt; you to &lt;b&gt;subscribe&lt;/b&gt; to the&lt;b&gt; newsletter&lt;/b&gt; to receive more updates&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;and comment on any subject you need to be included in the next publish@&lt;b&gt;rbgtech.blogspot.com&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description><link>https://rbgtech.blogspot.com/2021/07/best-frontend-frameworks-to-learn-in.html</link><author>noreply@blogger.com (renson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3xSG7E-mJWmp5Q6e-bOByW0ketx8svy2fy0_C7FzrTsxWG-YlqAh7MH8iIReyhO-lqoVCpJ3xexZKm__OpNq3aEI88Mq-9lgtubhHC4S4dZUL7gySYS93a5yUqBul5UgcfQI_3pixNV4/s72-c/download.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3879629789995591062.post-2493269056383034821</guid><pubDate>Fri, 23 Jul 2021 09:06:00 +0000</pubDate><atom:updated>2021-07-23T05:05:34.759-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">form validation</category><category domain="http://www.blogger.com/atom/ns#">MYSQL security</category><category domain="http://www.blogger.com/atom/ns#">php</category><title>How to validate and sanitize user input with php</title><description>&lt;h3 style=&quot;line-height: 114%; margin-bottom: 10pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: Calibri; line-height: 114%;&quot;&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;Sanitizing User Input with PHP&lt;/span&gt;&lt;/span&gt;&lt;/h3&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;line-height: 114%;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;Now we return to PHP programming. It can never be emphasized enough that han‐&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;dling user data is a security minefield, and that it is essential to learn to treat all such&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;data with utmost caution from the word go. It’s actually not that difficult to sanitize&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;user input from potential hacking attempts, but it must be done.&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;line-height: 114%;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;Therefore, you must never trust any variable that you fetch from either the $_GET or&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;$_POST arrays until you have processed it. If you don’t, users may try to inject Java‐&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;Script into the data to interfere with your site’s operation, or even attempt to add&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;MySQL commands to compromise your database.&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;line-height: 114%;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;Therefore, instead of just using code such as the following when reading in user&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;input:&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;$variable = $_POST[&#39;user_input&#39;];&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&amp;nbsp;For example, to pre‐&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;vent escape characters from being injected into a string that will be presented to&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;MySQL, use the following:&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;$variable = $connection-&amp;gt;real_escape_string($variable);&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;.You will, however, still need to sanitize input when&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;including it within HTML.&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;.To get rid of unwanted slashes, use this:&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;$variable = stripslashes($variable);&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;And to remove any HTML from a string, use the following:&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;$variable = htmlentities($variable);&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;For example, this would change a string of interpretable HTML code like &amp;lt;b&amp;gt;hi&amp;lt;/b&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;into &amp;lt;b&amp;gt;hi&amp;lt;/b&amp;gt;, which displays as text, and won’t be interpreted as&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;HTML tags.&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;line-height: 114%;&quot;&gt;&lt;span style=&quot;font-size: large;&quot;&gt;.&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;Finally, if you wish to strip HTML entirely from an input, use the following (but&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;ensure you use it before calling htmlentities, which replaces any angle brackets&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;used as part of HTML tags):&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;.$variable = strip_tags($variable);&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;In fact, until you know exactly what &lt;u&gt;sanitization&lt;/u&gt; you require for a program,&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;Example below shows a pair of functions that brings all these checks together to pro‐&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;vide a very good level of security.&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;
 &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;code&gt; 
  &amp;lt;?php&lt;/code&gt;&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&amp;nbsp;function sanitizeString($var)&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&amp;nbsp;$var = stripslashes($var);&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&amp;nbsp;$var = strip_tags($var);&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&amp;nbsp;$var = htmlentities($var);&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&amp;nbsp;return $var;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&amp;nbsp;function sanitizeMySQL($connection, $var)&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&amp;nbsp;{ &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&amp;nbsp;$var = $connection-&amp;gt;real_escape_string($var);&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&amp;nbsp;$var = sanitizeString($var);&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&amp;nbsp;return $var;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;?&amp;gt;
  &lt;/span&gt;&lt;/span&gt;&lt;/p&gt; &lt;span style=&quot;font-size: 11pt; line-height: 114%;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;div&gt;&lt;h4 style=&quot;line-height: 114%; margin-bottom: 10pt; text-align: left;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Real life Example Program&lt;/span&gt;&lt;/h4&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;So let’s look at how a real-life PHP program integrates with an HTML form by creat‐&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;ing the program convert.php listed .&lt;/span&gt;&lt;u&gt;&lt;span style=&quot;line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Type it as shown and try it for&lt;/span&gt;&lt;span style=&quot;line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/u&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;u&gt;yourself&lt;/u&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;. A program to convert values between Fahrenheit and Celsius&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: 11pt; line-height: 16.72px;&quot;&gt;
  &lt;/span&gt;&lt;/p&gt;
  &lt;pre&gt;&lt;code&gt;&lt;span style=&quot;font-family: verdana; font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;lt;?php // convert.php&lt;span style=&quot;font-family: verdana; font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;
&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;$f = $c = &#39;&#39;;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;if (isset($_POST[&#39;f&#39;])) $f = sanitizeString($_POST[&#39;f&#39;]);&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;if (isset($_POST[&#39;c&#39;])) $c = sanitizeString($_POST[&#39;c&#39;]);&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;if ($f != &#39;&#39;)&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;$c = intval((5 / 9) * ($f - 32));&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;$out = &quot;$f °f equals $c °c&quot;;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;elseif($c != &#39;&#39;)&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;$f = intval((9 / 5) * $c + 32);&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;$out = &quot;$c °c equals $f °f&quot;;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;else $out = &quot;&quot;;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;echo &amp;lt;&amp;lt;&amp;lt;_END;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;&amp;lt;title&amp;gt;Temperature Converter&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;&amp;lt;pre&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;Enter either Fahrenheit or Celsius and click on Convert&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;&amp;lt;b&amp;gt;$out&amp;lt;/b&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;&amp;lt;form method=&quot;post&quot; action=&quot;convert.php&quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;Fahrenheit &amp;lt;input type=&quot;text&quot; name=&quot;f&quot; size=&quot;7&quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;Celsius &amp;lt;input type=&quot;text&quot; name=&quot;c&quot; size=&quot;7&quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;&amp;lt;input type=&quot;submit&quot; value=&quot;Convert&quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;&amp;lt;/pre&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;_END;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;function sanitizeString($var)&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;{&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;$var = stripslashes($var);&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;$var = strip_tags($var);&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;$var = htmlentities($var);&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;return $var;&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana;&quot;&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&amp;nbsp;}&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: 11pt; line-height: 16.72px; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 18.24px; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: 11pt; line-height: 16.72px;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span style=&quot;font-family: verdana; font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEPNIB4tb3w2r8IIxumqKONccHrEduysFUJtNSrlk9Uu4IVzfelzoFfNn1M35G_x-4pVgxEAbGsX5NdZTsah9ZO_vOm_PLH9WwbLzyTGodo153hxBsH5zn-9qQsuDN8cDqYMbXJSo8p0I/s352/form+sanitization.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;143&quot; data-original-width=&quot;352&quot; height=&quot;136&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEPNIB4tb3w2r8IIxumqKONccHrEduysFUJtNSrlk9Uu4IVzfelzoFfNn1M35G_x-4pVgxEAbGsX5NdZTsah9ZO_vOm_PLH9WwbLzyTGodo153hxBsH5zn-9qQsuDN8cDqYMbXJSo8p0I/w320-h136/form+sanitization.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/span&gt;&lt;/div&gt;&lt;span style=&quot;font-family: verdana; font-size: 11pt; line-height: 16.72px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

  
</description><link>https://rbgtech.blogspot.com/2021/07/how-to-validate-and-sanitize-user-input.html</link><author>noreply@blogger.com (renson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEPNIB4tb3w2r8IIxumqKONccHrEduysFUJtNSrlk9Uu4IVzfelzoFfNn1M35G_x-4pVgxEAbGsX5NdZTsah9ZO_vOm_PLH9WwbLzyTGodo153hxBsH5zn-9qQsuDN8cDqYMbXJSo8p0I/s72-w320-h136-c/form+sanitization.jpg" height="72" width="72"/><thr:total>0</thr:total></item><item><guid isPermaLink="false">tag:blogger.com,1999:blog-3879629789995591062.post-3103624261856368531</guid><pubDate>Tue, 20 Jul 2021 07:13:00 +0000</pubDate><atom:updated>2021-07-26T06:01:34.151-07:00</atom:updated><category domain="http://www.blogger.com/atom/ns#">form handling</category><category domain="http://www.blogger.com/atom/ns#">html</category><category domain="http://www.blogger.com/atom/ns#">php</category><category domain="http://www.blogger.com/atom/ns#">website</category><title>PHP FORM HANDLING</title><description>&lt;p&gt;&lt;b&gt;&lt;u&gt;&lt;br /&gt;&amp;nbsp;PHP FORM HANDLING-rbgtech.blogspot.com&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;.&lt;/span&gt;&lt;/b&gt;To build a form, you must have at least the following elements:&lt;/p&gt;&lt;p&gt;a) An opening &amp;lt;form&amp;gt; and closing &amp;lt;/form&amp;gt; tag&lt;/p&gt;&lt;p&gt;b) A submission type specifying either a Get or Post method&lt;/p&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;c) One or more input fields&lt;/p&gt;&lt;p&gt;d) The destination URL to which the form data is to be submitted&lt;/p&gt;&lt;p&gt;SIMPLE PHP FORM HANDLER&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&lt;p&gt;&lt;b&gt;&amp;lt;?php // formtest.php&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;nbsp;echo &amp;lt;&amp;lt;&amp;lt;_END&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;nbsp;&amp;lt;html&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;nbsp;&amp;lt;head&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;nbsp;&amp;lt;title&amp;gt;Form Test&amp;lt;/title&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;nbsp;&amp;lt;/head&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;nbsp;&amp;lt;body&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;nbsp;&amp;lt;form method=&quot;post&quot; action=&quot;formtest.php&quot;&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;nbsp;What is your name?&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;nbsp;&amp;lt;input type=&quot;text&quot; name=&quot;name&quot;&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;nbsp;&amp;lt;input type=&quot;submit&quot;&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;nbsp;&amp;lt;/form&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;nbsp;&amp;lt;/body&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&amp;nbsp;&amp;lt;/html&amp;gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;_END;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;?&amp;gt;&lt;/b&gt;&lt;/p&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidJHNOmAR4MAkbGFIaGrlA1o0tc4h9cYmXEjUliO4Y8Qv_CDk3us0NyCP9uaBbI_GJvyJ2a1NPBT-NpHIs6-uXkfy7aFU2vBQ0qcm49wgV3aB6DKbPQ6YsLomsyjWcBaPF4h8eZA_1gfg/s963/formtest1.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em; text-align: center;&quot;&gt;&lt;img border=&quot;0&quot; data-original-height=&quot;520&quot; data-original-width=&quot;963&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidJHNOmAR4MAkbGFIaGrlA1o0tc4h9cYmXEjUliO4Y8Qv_CDk3us0NyCP9uaBbI_GJvyJ2a1NPBT-NpHIs6-uXkfy7aFU2vBQ0qcm49wgV3aB6DKbPQ6YsLomsyjWcBaPF4h8eZA_1gfg/s320/formtest1.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;N/B&lt;/b&gt;:Rather than dropping in and out of PHP code, the echo &amp;lt;&amp;lt;&amp;lt;_END..._END con‐&lt;/p&gt;&lt;p&gt;struct is used whenever multiline HTML must be output.&lt;/p&gt;&lt;p&gt;UPDATED VERSION OF formtest.php&lt;/p&gt;&lt;blockquote style=&quot;border: none; margin: 0px 0px 0px 40px; padding: 0px; text-align: left;&quot;&gt;&lt;p&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;
  &lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;background-color: #eeeeee;&quot;&gt;
&lt;span style=&quot;color: #444444;&quot;&gt; &lt;pre&gt;&lt;code&gt;
&amp;lt;?php // formtest2.php&lt;/span&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #eeeeee; color: #444444;&quot;&gt;&amp;nbsp;if (isset($_POST[&#39;name&#39;])) $name = $_POST[&#39;name&#39;];&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #eeeeee; color: #444444;&quot;&gt;&amp;nbsp;else $name = &quot;(Not entered)&quot;;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #eeeeee; color: #444444;&quot;&gt;&amp;nbsp;echo &amp;lt;&amp;lt;&amp;lt;_END&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #eeeeee; color: #444444;&quot;&gt;&amp;nbsp;&amp;lt;html&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #eeeeee; color: #444444;&quot;&gt;&amp;nbsp;&amp;lt;head&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #eeeeee; color: #444444;&quot;&gt;&amp;nbsp;&amp;lt;title&amp;gt;Form Test&amp;lt;/title&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #eeeeee; color: #444444;&quot;&gt;&amp;nbsp;&amp;lt;/head&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #eeeeee; color: #444444;&quot;&gt;&amp;nbsp;&amp;lt;body&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #eeeeee; color: #444444;&quot;&gt;&amp;nbsp;Your name is: $name&amp;lt;br&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #eeeeee; color: #444444;&quot;&gt;&amp;nbsp;&amp;lt;form method=&quot;post&quot; action=&quot;formtest2.php&quot;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #eeeeee; color: #444444;&quot;&gt;&amp;nbsp;What is your name?&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #eeeeee; color: #444444;&quot;&gt;&amp;nbsp;&amp;lt;input type=&quot;text&quot; name=&quot;name&quot;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #eeeeee; color: #444444;&quot;&gt;&amp;nbsp;&amp;lt;input type=&quot;submit&quot;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #eeeeee; color: #444444;&quot;&gt;&amp;nbsp;&amp;lt;/form&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #eeeeee; color: #444444;&quot;&gt;&amp;nbsp;&amp;lt;/body&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #eeeeee; color: #444444;&quot;&gt;&amp;nbsp;&amp;lt;/html&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #eeeeee; color: #444444;&quot;&gt;_END;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;background-color: #eeeeee; color: #444444;&quot;&gt;?&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;


&lt;p&gt;&lt;/p&gt;
  
  &lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj48_YENrM4h4ht-XqiR3QGgR3lha-z6M7rJjtkOgc7ofZMwcwqS_kFfrYwMVI1Q0WbAWivBbuZ77CDcaT0sbrsYLMlvYUuop5PwvcEdbkifLXc0L0csmglewm02X2kIJSaQq-tdA09pOM/s942/formtest2.jpg&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;
    &lt;img border=&quot;0&quot; data-original-height=&quot;502&quot; data-original-width=&quot;942&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj48_YENrM4h4ht-XqiR3QGgR3lha-z6M7rJjtkOgc7ofZMwcwqS_kFfrYwMVI1Q0WbAWivBbuZ77CDcaT0sbrsYLMlvYUuop5PwvcEdbkifLXc0L0csmglewm02X2kIJSaQq-tdA09pOM/s320/formtest2.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-family: times; font-size: x-large;&quot;&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;The only changes are a couple of lines at the start that check the $_POST associative&lt;/p&gt;&lt;p&gt;array for the field name having been submitted&lt;/p&gt;&lt;p&gt;&amp;nbsp;.the $_POST associative array, which contains an element for each field in an HTML form&lt;/p&gt;&lt;p&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;&lt;b&gt;.&lt;/b&gt;&lt;/span&gt;The PHP isset function is used to test whether $_POST[&#39;name&#39;] has been assigned a&lt;/p&gt;&lt;p&gt;value
&lt;/p&gt;&lt;pre&gt;&lt;code&gt;
&lt;p&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;form method=&quot;post&quot; action=&quot;calc.php&quot;&amp;gt;&amp;lt;pre&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Loan Amount &amp;lt;input type=&quot;text&quot; name=&quot;principle&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;Monthly Repayment &amp;lt;input type=&quot;text&quot; name=&quot;monthly&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Number of Years &amp;lt;input type=&quot;text&quot; name=&quot;years&quot; value=&quot;25&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;Interest Rate &amp;lt;input type=&quot;text&quot; name=&quot;rate&quot; value=&quot;6&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;&amp;lt;input type=&quot;submit&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;/pre&amp;gt;&amp;lt;/form&amp;gt;&lt;/p&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;b&gt;&lt;u&gt;THE INPUT TYPES&lt;/u&gt;&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;1)&lt;/b&gt;&lt;span style=&quot;font-size: medium;&quot;&gt;&lt;b&gt;Text boxes&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;.&lt;/span&gt;&lt;/b&gt;It accepts a wide&lt;/p&gt;&lt;p&gt;range of alphanumeric text and other characters in a single-line box.&lt;/p&gt;&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;.&lt;/span&gt;&lt;/b&gt;The general for‐&lt;/p&gt;&lt;p&gt;mat of a text box input is as follows:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&lt;p&gt;&amp;lt;input type=&quot;text&quot; name=&quot;name&quot; size=&quot;size&quot; maxlength=&quot;length&quot; value=&quot;value&quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;
&lt;/b&gt;&lt;/p&gt;&lt;/code&gt;&lt;/pre&gt;
2)Text areas&lt;p&gt;&lt;b&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;.&lt;/span&gt;&lt;/b&gt;When you need to accept input of more than a short line of text, use a text area. This&lt;/p&gt;&lt;p&gt;is similar to a text box, but, because it allows multiple lines, it has some different&lt;/p&gt;&lt;p&gt;attributes. Its general format looks like this:&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;&lt;pre&gt;&lt;ocde&gt;
&amp;lt;textarea name=&quot;name&quot; cols=&quot;width&quot; rows=&quot;height&quot; wrap=&quot;type&quot;&amp;gt;&lt;/ocde&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;/textarea&amp;gt;&lt;/p&gt;&lt;p&gt;
&lt;/p&gt;
&lt;b&gt;&lt;span style=&quot;font-size: x-large;&quot;&gt;.&lt;/span&gt;&lt;/b&gt;To control the width and height, use the cols and rows attributes. Both use the char‐&lt;p&gt;acter spacing of the current font to determine the size of the area. If you omit these&lt;/p&gt;&lt;p&gt;values, a default input box will be created that will vary in dimensions depending on&lt;/p&gt;&lt;p&gt;the browser used, so you should always define them to be certain about how your&lt;/p&gt;&lt;p&gt;form will appear.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;b&gt;3)Checkboxes&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;When you want to offer a number of different options to a user, from which he can&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;select one or more items, checkboxes are the way to go. Here is the format to use:&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;code&gt;&amp;lt;
  &lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;pre&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;code&gt;input type=&quot;checkbox&quot; name=&quot;name&quot; value=&quot;value&quot; checked=&quot;checked&quot;&amp;gt;
  &lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;
  &lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;
  &lt;/span&gt;&lt;pre&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/pre&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;If you wish to offer a newsletter to your readers when submitting&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;a form, you might want to have the checkbox already checked as the default value:&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Subscribe?
    &lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;pre&gt;&lt;code&gt; &amp;lt;input type=&quot;checkbox&quot; name=&quot;news&quot; checked=&quot;checked&quot;&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Offering multiple Checkboxes&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Vanilla &amp;lt;input type=&quot;checkbox&quot; name=&quot;ice&quot; value=&quot;Vanilla&quot;&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;Chocolate &amp;lt;input type=&quot;checkbox&quot; name=&quot;ice&quot; value=&quot;Chocolate&quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Strawberry &amp;lt;input type=&quot;checkbox&quot; name=&quot;ice&quot; value=&quot;Strawberry&quot;&amp;gt;&lt;/span&gt;&lt;/p&gt;

&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;b&gt;
  4)Radio buttons&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;They are used when you want only a single value to be returned from a selection of&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;two or more options. All the buttons in a group must use the same name and,&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;because only a single value is returned, you do not have to pass an array.&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;For example, if your website offers a choice of delivery times for items purchased&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;from your store, you might use HTML like that.&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;
      &lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;code&gt;8am-Noon&amp;lt;input type=&quot;radio&quot; name=&quot;time&quot; value=&quot;1&quot;&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Noon-4pm&amp;lt;input type=&quot;radio&quot; name=&quot;time&quot; value=&quot;2&quot; checked=&quot;checked&quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;4pm-8pm&amp;lt;input type=&quot;radio&quot; name=&quot;time&quot; value=&quot;3&quot;&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;lt;select&amp;gt;
  &lt;/span&gt;&lt;/p&gt;
&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;The&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/span&gt;&amp;lt;
     select&amp;gt; tag lets you create a drop-down list of options, offering either single or&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;multiple selections. It conforms to the following syntax:&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;b&gt;&amp;lt;select name=&quot;name&quot; size=&quot;size&quot; multiple=&quot;multiple&quot;&amp;gt;&lt;/b&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-size: large;&quot;&gt;.&lt;/span&gt;&lt;/b&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;The attribute size is the number of lines to display. Clicking on the display causes a&lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;list to drop down, showing all the options. If you use the multiple attribute, a user&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;can select multiple options from the list by pressing the Ctrl key when clicking. So to&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;ask a user for his favorite vegetable from a choice of five, you might use HTML as in:&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;Vegetables&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;
        &lt;/span&gt;&lt;/p&gt;&lt;pre&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;code&gt;
      &amp;lt;select name=&quot;veg&quot; size=&quot;1&quot;&amp;gt;&lt;/code&gt;&lt;/span&gt;&lt;/pre&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&amp;lt;option value=&quot;Peas&quot;&amp;gt;Peas&amp;lt;/option&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&amp;lt;option value=&quot;Beans&quot;&amp;gt;Beans&amp;lt;/option&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&amp;lt;option value=&quot;Carrots&quot;&amp;gt;Carrots&amp;lt;/option&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&amp;lt;option value=&quot;Cabbage&quot;&amp;gt;Cabbage&amp;lt;/option&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&amp;lt;option value=&quot;Broccoli&quot;&amp;gt;Broccoli&amp;lt;/option&amp;gt;&lt;/span&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;lt;/select&amp;gt;&lt;/span&gt;&lt;/p&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;p class=&quot;MsoNormal&quot; style=&quot;line-height: 114%; margin-bottom: 10pt;&quot;&gt;&lt;span style=&quot;font-family: Calibri; font-size: 11pt; line-height: 114%; mso-font-kerning: 1.0000pt; mso-spacerun: &#39;yes&#39;;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;</description><link>https://rbgtech.blogspot.com/2021/07/learn-web-building.html</link><author>noreply@blogger.com (renson)</author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEidJHNOmAR4MAkbGFIaGrlA1o0tc4h9cYmXEjUliO4Y8Qv_CDk3us0NyCP9uaBbI_GJvyJ2a1NPBT-NpHIs6-uXkfy7aFU2vBQ0qcm49wgV3aB6DKbPQ6YsLomsyjWcBaPF4h8eZA_1gfg/s72-c/formtest1.jpg" height="72" width="72"/><thr:total>1</thr:total></item></channel></rss>