Get a remote IP address in PHP
Getting the real remote IP address of the client can sometimes be quite tricky for PHP programmers. Receiving the correct remote IP address has a crucial role both for tracking activity and for the security purposes.
This tutorial is aimed at helping programmers to overcome such problems. Go ahead and see how to get the real remote IP address in PHP. Often, programmers try to use $_SERVER[‘REMOTE_ADDR’] for detecting the real IP address of the client:
How to redirect a web page with PHP
To perform a redirect in PHP, we use the header() function. This function sends HTTP headers to the server. To perform a redirection, you must send the Location header: followed by the URL of the new page. For this to work, it is advisable to use an absolute URL. A relative URL will however be taken into account in most cases. You must not display any text or HTML before, otherwise it will trigger the display of an error.
How to Create a Drop-Down Navigation Menu With CSS
A good attractive navigation menu is very important for your website. Navigation menus are essential for the good accessibility of your website. Users love well-designed websites.
Today's tutorial explains how to create a drop-down navigation menu on a web application. Let's create a good step-by-step drop-down navigation menu.
How To Create a form
The first article in our series gives you a very first experience of creating a form in HTML, including designing it, implementing it using the right HTML elements, adding some very simple decorations with CSS, and how the data is sent to a server.
How To Create a Search Bar
A search bar also known as a search field or search box is an integral part of modern websites where the user might use the search as a primary mode of discovering content on the site as opposed to fiddling with the navigation menu.
How to Display an Ordered List with Nested Counters
You can display an ordered list with nested counters like 1.1, 1.2 instead of 1, 2 by using CSS. In this snippet, you’ll find some methods of displaying such numbers.
How to Use the HTML <fieldset> Tag
The <fieldset> tag is used to visually group some logically related fields in the <form> tag. In this tutorial, you will find some examples of using the <fieldset> tag and find out why we need this tag at all.
In the example below, we place the <fieldset> element in a <form> tag. In the <fieldset>, we add the <legend>, <input>, and <label> elements.
How to Create a Table with a Fixed Header and Scrollable Body
find some methods of creating an HTML table, which has a fixed header and scrollable body. Of course, you need to use CSS. It is possible to achieve such a result by setting the position property to “sticky” and specifying 0 as a value of the top property for the <th> element.
How to Create Mailto Links
Mailto links are used to redirect to an email address instead of a web page URL. When a user clicks on the Mailto link, the default email client on the visitor's computer opens and suggests sending a message to the email address mentioned in the Mailto link.
To create a Mailto link, you need to use the HTML <a> tag with its href attribute, and insert a "mailto:" parameter after it, like the following:
Display a form in a block or controller drupal
Most often we may want to show our custom forms in blocks. Here are the simple steps to accomplish this.
In the below code we will create a form called “MymoduleExampleForm” and this form will be placed in a custom block called “MymoduleExampleBlock”.
Step 1 – Create a custom module say 'mymodule'. For details on how to create a custom module in Drupal
Step 2 – Create a php file named MymoduleForm.php in mymodule/src/Form and place the following code.