Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying CentOS System Administration Essentials
  • Table Of Contents Toc
  • Feedback & Rating feedback
CentOS System Administration Essentials

CentOS System Administration Essentials

By : Andrew Mallett
4.2 (13)
close
close
CentOS System Administration Essentials

CentOS System Administration Essentials

4.2 (13)
By: Andrew Mallett

Overview of this book

If you are a Linux administrator who is looking to gain knowledge that differentiates yourself from the crowd, then this is the book for you. Beginners who have a keen interest to learn more about Linux administration will also progress quickly with this resourceful learning guide.
Table of Contents (13 chapters)
close
close
12
Index

Create dynamic web content


To demonstrate how easily we can create dynamic web pages that will connect to the database using PHP from the Nginx server, we will create a new PHP page in /var/www/html. So fire up your favorite editor, and we will create the page within the document root, /var/www/html/db.php:

<h2>Databases</h2>
<?php
      $dbh=mysqli_connect("localhost","root","Password1");
      $result=mysqli_query($dbh, "SHOW DATABASES");
      while ($row = mysqli_fetch_assoc($result)) {
        echo $row['Database'] . "<BR>";
      }
?>

The code again is kept as simple as possible, and ideally we would include the connection credentials stored within another file that was not accessible to the web server, allowing access only from the PHP process; however, keeping the code to a minimum does aide the learning process at this early stage.

In this PHP file, you can see that we mix a little HTML code with the PHP code, starting with heading tags before entering into...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
CentOS System Administration Essentials
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon