Skip to main content

Posts

Showing posts from September, 2017

Install MongoDB on Ubuntu with these easy steps

Various methods are available online to install and use MongoDB on Ubuntu. However following are the least steps one can use to achieve this purpose. Steps: 1. Open the terminal and type: sudo apt-get install mongodb Enter password. 2. Copy paste:  sudo apt-get update 3. Start mongodb service. Type: sudo service mongodb start 4. Open mongodb. mongo 5. Use mongo commands. Let's start with: show dbs 6. Exit mongo. exit 7. After using, it is recommended that we stop the service. For this, type: sudo service mongodb stop

How to add buttons and its functionality dynamically using HTML,MySQL and PHP?

There are times when we wish to add button dynamically in a webpage based on the entries in the database. If that is true in your case, please read on. (This guide assumes you have the basic knowledge of HTML, PHP and MySQL.) Following are the steps one will need to apply to create buttons dynamically: 1. Use PHP to connect to the database. <?php  $db = mysqli_connect('localhost','root','','media') //root is the username and no password.  or die('Error connecting to MySQL server.'); ?> Here, 'media' is the database name and it is running on WAMP. 2. Use a while loop to fetch contents from the database.     For each entry add a Button.   <form method="POST">  <?php $query = "SELECT * FROM post"; mysqli_query($db, $query) or die('Error querying database.'); $result = mysqli_query($db, $query); while ($row = mysqli_fetch_array($result)) { $varid=$row['postID

How to access Wamp (Apache) server from mobile?

WAMP is by default configured to permit access to only the machine on which it is running. So if you try to access it from your mobile or any other device on the network it will give you the following error : “Forbidden You don't have permission to access /phpmyadmin/ on this server.”     To solve this you need to grant permission. For that follow the following steps: 1. Click on the WAMP icon. 2. Click on Apache. 3. Open httpd-vhosts.conf 4. Change 'Require local' to 'Require all granted'. 5. Restart your server. Remember, when the server and the client are not the same device, you cannot access via localhost. You need the IP address of the device. For that follow the following steps: 1. Open Command Prompt. 2. Type ipconfig. 3. Read the IPv4 address under the Wireless LAN adapter Wi-Fi. 4. Use this address to access the files from the mobile browser. (Make sure you are connected to the same wireless network.) Example: 192.168.1.5/temp/index.