#how to store multiple select values in database using php
Explore tagged Tumblr posts
Text
What Is Linux Web Hosting? A Beginner's Guide
In the ever-evolving digital landscape, the choice of web hosting can significantly impact your online presence. One of the most popular options available is Linux web hosting. But what exactly does it entail, and why is it so widely preferred? This beginner’s guide aims to demystify Linux web hosting, its features, benefits, and how it stands against other hosting types.
Introduction to Web Hosting
Web hosting is a fundamental service that enables individuals and organisations to make their websites accessible on the internet. When you create a website, it consists of numerous files, such as HTML, images, and databases, which need to be stored on a server. A web host provides the server space and connectivity required for these files to be accessed by users online.
There are several types of web hosting, each designed to cater to different needs and budgets. Shared hosting is a cost-effective option where multiple websites share the same server resources. Virtual Private Server (VPS) hosting offers a middle ground, providing dedicated portions of a server for greater performance and control. Dedicated hosting provides an entire server exclusively for one website, ensuring maximum performance but at a higher cost. Cloud hosting uses multiple servers to balance the load and maximise uptime, offering a scalable solution for growing websites.
Web hosting services also include various features to enhance the performance and security of your website. These can range from basic offerings like email accounts and website builders to more advanced features like SSL certificates, automated backups, and DDoS protection. The choice of web hosting can significantly influence your website’s speed, security, and reliability, making it crucial to choose a solution that aligns with your specific requirements.
Understanding the different types of web hosting and the features they offer can help you make an informed decision that suits your needs. Whether you are running a personal blog, a small business website, or a large e-commerce platform, selecting the right web hosting service is a critical step in establishing a successful online presence.
What Is Linux Web Hosting?
Linux web hosting is a type of web hosting service that utilises the Linux operating system to manage and serve websites. Renowned for its open-source nature, Linux provides a stable and secure platform that supports a wide array of programming languages and databases, making it a favoured choice amongst developers and businesses. This hosting environment typically includes support for popular technologies such as Apache web servers, MySQL databases, and PHP scripting, which are integral to modern website development.
One of the distinguishing features of Linux web hosting is its cost-effectiveness. As an open-source system, Linux eliminates the need for costly licensing fees associated with proprietary software, thereby reducing overall hosting expenses. This makes it an attractive option for individuals and organisations operating on a budget.
Moreover, Linux is celebrated for its robust performance and high stability. Websites hosted on Linux servers experience less downtime and faster loading times, which are critical factors for maintaining user engagement and search engine rankings. The operating system’s extensive community of developers continuously works on updates and improvements, ensuring that Linux remains a cutting-edge choice for web hosting.
Linux web hosting also offers considerable flexibility and customisation options. Users have the freedom to configure their hosting environment to meet specific needs, whether they are running simple static websites or complex dynamic applications. This versatility extends to compatibility with various content management systems (CMS) like WordPress, Joomla, and Drupal, which often perform optimally on Linux servers.
In summary, Linux web hosting provides a reliable, secure, and cost-effective solution that caters to a diverse range of web hosting requirements. Its compatibility with essential web technologies and its inherent flexibility make it a preferred choice for many web developers and site owners.
Key Benefits of Linux Web Hosting
Linux web hosting offers several compelling advantages that contribute to its widespread adoption. One of its primary benefits is cost-effectiveness. The open-source nature of Linux eliminates the need for expensive licensing fees, allowing users to allocate their resources more efficiently. This makes it an ideal choice for individuals and organisations with budget constraints. Additionally, Linux is celebrated for its high stability and robust performance. Websites hosted on Linux servers often experience minimal downtime and faster loading speeds, which are essential for maintaining user engagement and achieving favourable search engine rankings.
Another significant benefit is the extensive community support that comes with Linux. The active community of developers and enthusiasts continuously works on updates, patches, and security enhancements, ensuring that Linux remains a secure and reliable platform for web hosting. This ongoing development also means that any issues or vulnerabilities are promptly addressed, offering peace of mind for website owners.
Flexibility is another key advantage of Linux web hosting. The operating system supports a wide range of programming languages, including PHP, Python, and Ruby, making it suitable for various types of web applications. Additionally, Linux servers are highly customisable, allowing users to configure their environment to meet specific needs, whether they are running simple static sites or complex dynamic applications.
Moreover, Linux web hosting is highly compatible with popular content management systems (CMS) like WordPress, Joomla, and Drupal. This compatibility ensures that users can easily deploy and manage their websites using these platforms, benefiting from their extensive plugin and theme ecosystems.
Lastly, Linux's superior security features are worth noting. The operating system is inherently secure and offers various built-in security measures. When combined with best practices such as regular updates and strong passwords, Linux web hosting provides a highly secure environment for any website.
Understanding Linux Distributions in Web Hosting
Linux comes in a variety of distributions, each tailored to meet specific needs and preferences. Among the most popular for web hosting are Ubuntu, CentOS, and Debian. Ubuntu is celebrated for its ease of use and extensive community support, making it a great choice for those new to Linux. CentOS, a favourite in enterprise environments, offers impressive stability and long-term support, which ensures a dependable hosting experience. Debian stands out with its robust package management system and commitment to open-source principles, providing a reliable and secure foundation.
Each distribution brings its own strengths to the table. For example, Ubuntu’s frequent updates ensure access to the latest features and security patches, while CentOS’s extended support cycles make it a solid choice for those requiring a stable, long-term hosting environment. Debian’s extensive repository of packages and minimalistic approach offers flexibility and customisation, catering to the needs of experienced users.
Selecting the right Linux distribution largely depends on your specific requirements and technical expertise. If you prioritise user-friendliness and a wealth of resources for troubleshooting, Ubuntu might be the ideal pick. On the other hand, if you need a rock-solid, stable platform for an enterprise-level application, CentOS could be more appropriate. For those seeking maximum control and a commitment to open-source principles, Debian is a compelling option.
Ultimately, understanding the nuances of these distributions will enable you to choose a Linux environment that aligns with your web hosting needs, ensuring optimal performance and reliability.
Linux Hosting vs Windows Hosting: A Comparative Analysis
When evaluating Linux hosting against Windows hosting, several critical factors come into play. Cost is a significant differentiator; Linux hosting is generally more affordable due to its open-source nature, which eliminates the need for expensive licensing fees. In contrast, Windows hosting often incurs additional costs related to proprietary software licenses.
Compatibility is another important aspect to consider. Linux hosting is renowned for its compatibility with a broad array of open-source software and applications, including popular content management systems like WordPress, Joomla, and Magento. These platforms typically perform better on Linux servers due to optimised server configurations. On the other hand, Windows hosting is the go-to option for websites that rely on Microsoft-specific technologies such as ASP.NET, MSSQL, and other .NET frameworks.
Performance and stability are also crucial elements in this comparison. Linux hosting often provides superior uptime and faster loading speeds due to the lightweight nature of the Linux operating system. The robust performance of Linux servers is further enhanced by the active community that continuously works on optimisations and security patches. Windows hosting, while also reliable, can sometimes be more resource-intensive, potentially affecting performance.
Customisation and control levels differ significantly between the two. Linux offers greater flexibility and customisation options, allowing users to tweak server settings and configurations extensively. This level of control is particularly beneficial for developers who need a tailored hosting environment. Conversely, Windows hosting is typically easier to manage for those familiar with the Windows operating system but may offer less flexibility in terms of customisation.
Security measures also vary between Linux and Windows hosting. Linux is often praised for its strong security features, which are bolstered by a large community dedicated to promptly addressing vulnerabilities. While Windows hosting is secure, it may require more frequent updates and maintenance to ensure the same level of protection.
Common Use Cases for Linux Web Hosting
Linux web hosting is versatile and caters to a broad range of applications, making it a popular choice across various sectors. One of the most common use cases is hosting blogs and personal websites, particularly those built on platforms like WordPress. The open-source nature of Linux and its compatibility with PHP make it an ideal environment for WordPress, which powers a significant portion of the web.
E-commerce websites also benefit greatly from Linux web hosting. Solutions like Magento, PrestaShop, and OpenCart often perform better on Linux servers due to their need for a robust, secure, and scalable hosting environment. The flexibility to configure server settings allows online store owners to optimise performance and ensure a smooth shopping experience for their customers.
Content Management Systems (CMS) such as Joomla and Drupal are another prime use case. These systems require reliable and flexible hosting solutions to manage complex websites with large amounts of content. Linux's support for various databases and scripting languages ensures seamless integration and optimal performance for CMS-based sites.
Developers frequently turn to Linux web hosting for custom web applications. The operating system supports a variety of programming languages, including Python, Ruby, and Perl, making it suitable for a wide array of development projects. Its command-line interface and extensive package repositories allow developers to install and manage software efficiently.
Additionally, Linux web hosting is commonly used for educational and non-profit websites. The low cost and high reliability make it a practical choice for schools, universities, and charitable organisations that need a dependable online presence without breaking the bank.
Setting Up a Linux Web Hosting Environment
Setting up a Linux web hosting environment can be straightforward with the right approach. Begin by selecting a reputable hosting provider that offers Linux-based plans. After signing up, you'll typically be granted access to a control panel, such as cPanel or Plesk, which simplifies the management of your hosting environment. Through the control panel, you can manage files, databases, email accounts, and more.
Next, if you're using a content management system (CMS) like WordPress, Joomla, or Drupal, you can often find one-click installation options within the control panel. This feature makes it easy to get your website up and running quickly. Additionally, ensure that you configure your domain name to point to your new hosting server, which usually involves updating your domain's DNS settings.
For those who prefer more control or are comfortable using the command line, you can manually set up your web server using SSH access. This method allows you to install and configure web server software like Apache or Nginx, as well as databases such as MySQL or PostgreSQL.
Regardless of the setup method you choose, it's crucial to secure your server from the outset. This includes setting up a firewall, enabling SSH key authentication for secure access, and regularly updating all software to protect against vulnerabilities. Regularly monitoring your server's performance and security logs can help you stay ahead of potential issues, ensuring a stable and secure hosting environment for your website.
Security Best Practices for Linux Web Hosting
Securing your Linux web hosting environment is paramount to safeguarding your website against potential threats. Begin by ensuring your server software and all installed applications are up to date. Regular updates often include patches for security vulnerabilities, making this a critical step. Utilise strong, unique passwords for all user accounts, and consider employing SSH key authentication for added security when accessing your server remotely.
Setting up a firewall is another essential measure. Tools like iptables or firewalld can help you configure firewall rules to control incoming and outgoing traffic, thereby reducing the risk of unauthorised access. Implementing intrusion detection systems (IDS), such as Fail2Ban, can provide an additional layer of security by monitoring and blocking suspicious activities.
Consider deploying an SSL certificate to encrypt data transmitted between your server and users' browsers. This not only enhances security but also boosts user trust and can improve your search engine rankings. Additionally, limit the use of root privileges; create separate user accounts with the necessary permissions to minimise potential damage in the event of a breach.
Regularly backup your data to mitigate the impact of data loss due to hardware failure, cyber-attacks, or human error. Automated backup solutions can simplify this process, ensuring your data is consistently protected. Monitoring your server's logs can also be invaluable for identifying unusual activity early. Tools like Logwatch or the ELK Stack can assist in log management and analysis, enabling you to take swift action if anomalies are detected.
Common Challenges and How to Overcome Them
Setting up and maintaining a Linux web hosting environment can present various challenges, especially for those new to the platform. One frequent issue is navigating the command line, which can be daunting for beginners. Engaging with online tutorials, forums, and communities like Stack Overflow can be invaluable for learning the basics and troubleshooting problems. Another common challenge is software incompatibility. Ensuring your web applications are compatible with the Linux distribution you choose is crucial; consulting documentation and support resources can help mitigate these issues.
Security configuration can also be a complex task. Implementing best practices such as setting up firewalls, regular updates, and using strong authentication methods requires a good understanding of Linux security principles. Managed hosting services can offer a solution here by handling these technical aspects for you, allowing you to focus on your website content.
Resource management is another area where users might struggle. Monitoring server performance and managing resources effectively ensures your website runs smoothly. Utilising monitoring tools and performance optimisation techniques can help you stay ahead of potential issues. Lastly, when it comes to server backups, regular, automated solutions are essential to prevent data loss and minimise downtime. Being proactive in addressing these challenges will ensure a more seamless and secure Linux web hosting experience.
Popular Control Panels for Linux Web Hosting
Control panels are invaluable for simplifying the management of your Linux web hosting environment. Among the most popular are cPanel, Plesk, and Webmin. cPanel is renowned for its intuitive interface and extensive feature set, making it a favourite among users who need a straightforward yet powerful management tool. Plesk offers robust functionality and supports both Linux and Windows servers, providing versatility for those who manage multiple server environments. Webmin stands out as a free, open-source option that allows comprehensive server management through a web interface, catering to those who prefer a customisable and cost-effective solution. Each control panel brings unique strengths, helping to streamline tasks such as file management, database administration, and security configurations.
Choosing the Right Linux Web Hosting Provider
Choosing the right Linux web hosting provider involves several key considerations. Firstly, evaluate the quality of customer support offered. Responsive and knowledgeable support can be invaluable, especially when troubleshooting technical issues or during the initial setup phase. Check if the provider offers 24/7 support and multiple contact methods such as live chat, email, and phone.
Another crucial factor is the security measures in place. Opt for providers that offer robust security features, including regular backups, SSL certificates, firewalls, and DDoS protection. These features help safeguard your website against potential threats and ensure data integrity.
Reliability and uptime guarantees are also vital. Aim for providers that offer at least a 99.9% uptime guarantee, as frequent downtimes can significantly affect your website’s accessibility and user experience. Additionally, look into the provider’s data centre infrastructure and redundancy measures, which can impact overall performance and reliability.
Scalability is another important aspect to consider. As your website grows, you’ll need the flexibility to upgrade your hosting plan seamlessly. Check if the provider offers scalable solutions, such as easy transitions to VPS or dedicated hosting, without causing disruptions to your site.
Lastly, consider the hosting plans and pricing structures available. While cost-effectiveness is a significant benefit of Linux web hosting, ensure the plans align with your specific needs. Compare the features, storage, bandwidth, and other resources included in different plans to find the best value for your money.
Reading customer reviews and seeking recommendations can also provide insights into the provider’s reputation and service quality. By carefully evaluating these factors, you can choose a Linux web hosting provider that meets your requirements and supports your online endeavours effectively.
Conclusion and Final Thoughts
Linux web hosting stands out as an optimal choice for both beginners and seasoned web developers. Its open-source nature provides an affordable, highly customisable, and secure environment, suitable for a diverse range of websites, from personal blogs to large e-commerce platforms. The extensive community support ensures ongoing improvements and prompt resolution of issues, contributing to its reliability and performance. Choosing the right hosting provider is crucial; look for robust security measures, excellent customer support, and scalability to accommodate your website's growth. By leveraging the strengths of Linux web hosting, you can build a resilient and efficient online presence that meets your specific needs and goals.
4 notes
·
View notes
Text
Online Php Programs in Community Development | kodlogs.com
We provide the latest news and articles on advanced software development topics. Our aim to help solve coding problems, develops new skills, and finds job opportunities. For more details, visit our website. online php programs in community development
#valueerror invalid literal for int with base 10#online php programs in community development#what is microsoft au daemon#how to insert multiple array values into database php#how to store multiple select values in database using php#c++ read file line by line
1 note
·
View note
Text
Something awesome - web research
In order to better understand web exploitation as a concept, I need to first gain a better understanding of how networks are structured, and how information is sent over the internet.
You can read the notes I’ve compiled below:
How does the Internet work?
Modern life would be very different without computer networks. Computer networks are generally made up of multiple computers that are all connected together to share data and resources. The computer network that we all know is The Internet, which specifically connects computers that use the Internet Protocol or ‘IP’.
This is what a basic computer network looks like:
In our diagram, we have two things labelled “end system”, where one is the client and one is the server. These are all called ‘nodes’. The way that these nodes are connected, are through the lines made through the ISP (Internet Service Provider) and the Router. You can imagine the router as a traffic signaller. This router has only one job - it makes sure that a message sent from a given computer arrives at the right destination computer.
Website Basics:
Information on the Internet is divided into different areas by websites. Websites are referred to by a ‘domain name’ (like google.com, facebook.com), and each web page is referred to by its URL or Uniform Resource Locator. A website is a collection of web pages - so a website would be like a house and each webpage would be a room inside the house.
A URL can be broken down into different sections. Some of these sections are essential, and some others are only optional. Let’s go through each one, and discuss what each section does using the following example URL:
http://www.example.com:80/path/to/myfile.html?key1=value1&key2=value2
Protocol:
This is the http:// part. A protocol is basically a set method for sending data around a computer network. Usually for websites it is the HTTP protocol or its secured version, HTTPS.
Domain Name
Something that you should be familiar with, this domain name is a way for humans to easily remember websites that they want to visit, rather than remembering an IP address.
Port
It indicates the technical "gate" used to access the resources on the web server. It is usually omitted if the web server uses the standard ports of the HTTP protocol (80 for HTTP and 443 for HTTPS) to grant access to its resources. Otherwise it is mandatory.
Path to File
/path/to/myfile.html is the path to the resource on the Web server. In the early days of the Web, a path like this represented a physical file location on the Web server.
Parameters
?key1=value1&key2=value2 are extra parameters provided to the Web server. Those parameters are a list of key/value pairs separated with the & symbol.
The Web server can use those parameters to do extra stuff before returning the resource.
Each Web server has its own rules regarding parameters, and the only reliable way to know if a specific Web server is handling parameters is by asking the Web server owner.
Have a full read here
Different parts of a website and how to mess with it:
The building blocks of websites are HTML, CSS and Javascript which are all different programming languages with their own set of rules that you have to learn. If we think of a website like a fancy birthday cake then:
HTML is the base of the cake - it’s the main body and content of the website
CSS is the icing and decorations on top of the cake - it makes the cake look pretty and distinguishes the cake from other similar cakes
Javascript are the candles and sparklers - in terms of a website, javascript lets you make dynamic and interactive web pages
Like we said before, HTML is the base of your cake. HTML describes the structure of a Web page and consists of a series of elements which are represented by things called tags. HTML elements basically tell the browser how to display the content
HTML:
Tags look something like this:
<tagname>content goes here...</tagname>
There are some basic tags:
<!DOCTYPE html> declaration defines this document to be HTML5
<html> element is the root element of an HTML page
<head> element contains meta information about the document
<title> element specifies a title for the document
<body> element contains the visible page content
<h1> element defines a large heading
<p> element defines a paragraph
You can find the full HTML breakdown here
CSS:
For the sake of web-exploitation, you don’t need to know much about CSS. Here is a basic tutorial for those who want to learn how to make their websites look pretty!
Javascript:
One of the reasons why Javascript is used because it allows us to add interactivity between the user and the website. Javascript allows the user to interact with the website and have the website respond.
By right clicking on a website on Google Chrome or Firefox you can select the option “Inspect” to see the code that the website is running on your computer. It allows you to see the HTML and CSS that is running on the website and it will also let you see the Javascript scripts running on your computer. The best part is, that you can edit the HTML directly and see it affect the website, so it lets you modify the website as you desire. You can also select “Inspect Element” to see the code that is running in a specific part of a website.
What is HTTP?
It provides a standardised way for computers to communicate with each other over the internet. HTTP is a communication protocol, that is used to deliver data (HTML files, image files, query results, etc.) over the internet. HTTP dictates how data is sent between clients (you) and servers.
GET and POST requests:
GET is used to request data from a specified resource.
GET is one of the most common HTTP methods.
POST is used to send data to a server to create/update a resource.
Full link: https://www.w3schools.com/tags/ref_httpmethods.asp
Cookies:
HTTP cookies, also called web cookies or browser cookies are basically small bits of data that servers send to a user’s web browser. The browser can store it, and may also send the cookie back when it next requests information from the same server. Normally cookies are used to tell if two requests came from the same browser. For example, cookies can help users stay logged-in to websites. Cookies have three main purposes:
Session management - logins, shopping carts, game scores and any other information that the server should remember about the user
Personalisation - user preferences, themes and other settings
Tracking - recording and analysing user behaviour
How to perform a basic SQL injection:
SQL is a language that is used to basically fetch information from databases in websites. These databases can contain information like usernames and passwords for accounts for that website. If the code that is written isn’t secured, we can perform what’s called an SQL injection to gain access to data that we normally wouldn’t have access to.
<?php
$username = $_GET['username'];
$result = mysql_query("SELECT * FROM users WHERE username='$username'");
?>
If we look at the ‘$username’, this variable is where the username for a log in attempt would be stored. Normally the username would be something like, ‘user123’, but a malicious user might submit a different kind of data. For example, consider if the input was '?
The application would crash because the resulting SQL query is incorrect.
SELECT * FROM users WHERE username='''
Note the extra red quote at the end. Knowing that a single quote will cause an error, we can expand a little more on SQL Injection.
What if our input was ' OR 1=1?
SELECT * FROM users WHERE username='' OR 1=1
1 is indeed equal to 1, which equates to true in SQL. If we reinterpret this the SQL statement is really saying
SELECT * FROM users WHERE username='' OR true
This will return every row in the table because each row that exists must be true. Using this, we can easily gain access to information that we aren’t supposed to!
3 notes
·
View notes
Text
How Big Retailers Have Utilised Laravel Effectively | 8 Top Laravel Websites
The article was initially published in WebMeridian blog.
Laravel allows you to use proven solutions created for the needs of e-commerce. This doesn’t prevent you from building your solutions from scratch, but it certainly saves time if the deadline for making the eСommerce site is one of the most critical issues on the project.
Why use Laravel framework? This PHP framework, Laravel, enables you to customise the application, which is crucial if you want your customers to feel delighted when interacting with your business. The security of your customers can be ensured by simply integrating different solutions, such as payment and marketing automation systems.
Let’s dive into The Best Laravel Site Examples.
B2B Websites
You may build a highly-functional tool using Laravel that will enable your B2B clients to outsource various tasks and organise the task chaos that could result from employing external services without the proper task management tools. Due to routine component upgrades, Laravel-built applications ensure a high level of security for users. Also, this framework enables you to develop sophisticated business solutions quickly and include third-party apps.
One such website is Contentoo. The customer can choose contractors for a specific product on this website. You may use a messenger to communicate and manage your contacts with ease, thanks to the solution. A feature that alerts the user to deadlines is also available.
Systems for Company Management
CRM, CMS, marketing automation technologies, and other specialised solutions are now needed for business management. Experienced businesses understand the value of selecting tailored solutions because their adoption will improve both internal and external processes’ effectiveness.
A remarkable technology for developing such systems is Laravel. Work on the database goes smoothly when you use it. Eloquent, which is used to construct databases using PHP classes, is a helpful tool in this situation. As a result, programming becomes more straightforward and more pleasurable. You may build a practical solution with a wide range of functions using Laravel, which is essential for content management.
A trendy, user-friendly content management platform is the free source October CMS. On a website devoted to the CMS, you may view a list of its features and find out how the company feels about using PHP Laravel. The top PHP framework, Laravel, is the foundation of October. The framework includes all the tools and classes required to create high-quality websites and applications.
Do you require an accounting management tool with multiple features? Invoice Ninja is another excellent Laravel-based product. The application has a gentle delete feature thanks to Laravel. Using this function doesn’t remove the data from the database permanently. The database will track when it was “removed,” and it will only be excluded from subsequent procedures. It can be compared to a trash can where erased data is stored. This makes it possible to recover the erased data if needed.
E-learning and Blog Platforms
Many people run blogs, and just as many people read them regularly. If you want to build a website to share your ideas or knowledge, Laravel might be an exceptional option. This framework enables the website designer to use various functionality, such as the simple sharing of material across multiple communication channels and the addition of features like registration for the website or newsletter subscription. With Laravel, you can access effective databases and tools that make managing the website’s content accessible and enjoyable.
MyRank, a website for online learning, is an illustration of a platform created using Laravel. Scalability is a feature the framework gives MyRank, allowing it to manage constantly expanding databases.
Todd Austin’s simple Canvas blogging program perfectly shows how attractive design and practicality can coexist. Authors can add artwork, tag posts, schedule posts for publication, and write in the Summernote WYSIWYG editor, which automatically saves text, on Canvas. Thanks to these few functions, the app is light, simple to use, and simple to expand in the future.
Booking Platforms
The simplicity of payment integration allows for creating a PHP website of this kind. When a company grows and wants to offer more services, applications and websites can also be upgraded with new features at any moment.
Using solutions like Tably, restaurants may automate reserving tables and providing customer care. The Laravel-developed application enables effective and practical management of reservations and the storage of crucial data on customer orders. Such a solution can be customised to meet the requirements of a particular chain or establishment of restaurants.
Another app, BonAppetour, connects guests and hosts worldwide, enabling them to organise tastes of regional cuisine quickly. This PHP framework enables excellent platform management and database data collection.
Forums
One software program that enables you to create intricate and secure modern forums is Flarum. You may design interesting, attractive, responsive, quick, and efficient forums that are suited to different communities’ requirements and expectations thanks to various functionalities.
In this situation, Laravel is a fantastic option because it lets you quickly build a primary platform that you can later expand with various useful features. Those who are logged in will undoubtedly value features like real-time notifications.
The Laracasts portal, devoted to Laravel, is an example of one of these forums. This forum’s backend was created using Laravel. This framework’s knowledge base is appropriately organised. Together with a discussion group, there are also a ton of podcasts, courses, and articles for programmers to access.
The WeStryve website, which uses Laravel to give forum users protection and the possibility to exchange expertise, is a comparable community for developers.
How Big Retailers Have Used Laravel
Laravel is a popular PHP framework that has gained popularity among developers due to its features, performance, and ease of use. Several prominent retailers have used Laravel in their applications. Here are some of the best examples:
Walmart Canada
One of the biggest retailers in the world, Walmart Canada, uses Laravel in their online store. With the use of Laravel, Walmart Canada developed a responsive and effective website that includes functions like order processing, real-time inventory management, and interaction with various payment methods.
Nike
Nike is a well-known name in the retail sector, and it has adopted Laravel. Nike’s eCommerce website is one of many online apps that utilise Laravel. Nike uses the following Laravel features:
Routing: Laravel’s routing system allows developers to define application routes that can be accessed through URLs. This makes it easy for Nike to manage its application URLs and provide a seamless user experience.
Controllers: Laravel controllers are used to handling user requests and responses. Nike uses controllers to handle user requests on its e-commerce site, enabling it to provide a responsive user interface.
Models: Laravel models are used to interact with databases. Nike uses models to retrieve and store data from its database, making managing its eСommerce site’s data easy.
Blade Templating Engine: Laravel’s Blade templating engine allows developers to create reusable application templates. Nike uses Blade to create reusable templates for its e-commerce site, making it easy to maintain its user interface.
Authentication: Laravel’s authentication system provides a secure and easy-to-use authentication mechanism. Nike uses Laravel’s authentication system to ensure that its e-commerce site is secure and only accessible to authorised users.
Artisan Command-Line Interface: Laravel’s Artisan command-line interface provides developers with tools to manage their applications. Nike uses Artisan to perform various tasks like database migrations and application setup.
Nike gained by using Laravel since it will run faster, require less upkeep, and be more secure. Before implementing Laravel, Nike did a lot of research and trained its developers.
Etsy
Etsy is an online marketplace that links millions of customers and merchants worldwide. Etsy utilised Laravel to provide a stable and scalable framework for its application. Real-time chat, order management, and payment processing are just a few of the capabilities that Laravel provides to help Etsy build a smooth customer experience.
Target
The well-known US retailer Target has also chosen Laravel for its web apps. Target uses several Laravel capabilities, including views, controllers, and routing. Using Laravel for Target has advantages such as faster performance, simpler maintenance, and enhanced security. By first developing a prototype and then progressively integrating it into its current system, Target implemented Laravel.
Zara
Famous clothing manufacturer Zara has used Laravel in their online store. By integrating capabilities like real-time inventory management, order processing, and interaction with numerous payment processors, Laravel assisted Zara in building a responsive and high-performing website.
Hootsuite
A social media management tool, Hootsuite, uses Laravel in one of its applications. Hootsuite was able to build a scalable and modular platform with Laravel’s assistance, including scheduling, analytics, and real-time social media monitoring tools.
Amazon
One of the most prominent online merchants in the world, Amazon, has chosen Laravel for its web applications. Among other capabilities, Amazon uses Laravel’s routing, controllers, and database migrations. Using Laravel for Amazon has advantages such as quicker development, simpler maintenance, and enhanced security. Amazon adopted Laravel by gradually integrating it into its current infrastructure.
Barchart
The financial data and technology firm Barchart uses Laravel in one of its applications. With the aid of Laravel, Barchart developed a scalable and effective platform that includes tools for real-time financial reporting, graphing, and analytics.
Takeaways
Build a website with Laravel as well as boost your eCommerce store conversions with this trendy PHP framework.
In conclusion, Laravel has become popular with big retailers due to its ease of use, versatility, and security features. Walmart, Nike, Amazon, and Target are just a few examples of big retailers that have adopted Laravel for their web applications. Laravel’s features, performance, and ease of use make it ideal for building robust and scalable applications.
Laravel has enabled these retailers to streamline operations, enhance customer experience, and improve security. The prospects of Laravel in the retail industry are promising, and more retailers are likely to adopt Laravel for their web applications. You can skyrocket your eCommerce store performance with the guidance of a Laravel web development company.
0 notes
Text
Five Common PHP Problems and Solutions
PHP is a vast subject that needs lots of study to get done. It is a most-used open fount general-purpose scripting language that is particularly satisfied for web development and can be inserted into HTML. Today we are giving answers of top Php related question which will help you to done the process. Here solutions are provided by the top PHP Development Company, AResourcePool.
How to store image in core Php using input type file?
Are you looking for the ways to upload or store an image in core Php using input type file? If yes, so here we are.
Php script is very popular as it is using with a HTML form to let the users to upload files to the different server. At first the files are uploaded into a transitory directory as well as, it moved to a target by a PHP script.
Here are some procedures of uploading a file. So, here you go:
· Open a page which contains a HTML where you can feature an image, text files, and browser button as well as submit button.
· Now, click on the browser button and select the desired file to upload from your computer or laptop.
· You will now see the entire file of the selected path. So, choose where you wanna store it and press submit button.
· The file will send to the directory which is only temporary on the server.
· Php script was particular as the outline handler in the form’s action attribute. Now check is the file exist and then copy to the directory.
· You can make sure your success by using PHP script.
Meanwhile, it is really important to seek permission when writing files for permanent location or for temporary location. Whatever file you are uploading can be the image file or it can be the text file or whatever document you are uploading.
How to create an upload form?
To create an upload form you will need HTM coding because it has certain attribute of post as well as enctype attribute which is set to multipart.
<?php
if(isset($_FILES[‘image’])){
$errors= array();
$file_name = $_FILES['image’]['name’];
$file_size =$_FILES['image’]['size’];
$file_tmp =$_FILES['image’]['tmp_name’];
$file_type=$_FILES['image’]['type’];
$file_ext=strtolower(end(explode(’.’,$_FILES['image’]['name’])));
$extensions= array(“jpeg”,“jpg”,“png”);
if(in_array($file_ext,$extensions)=== false){
$errors[]=“extension not allowed, please choose a JPEG or PNG file.”;
}
if($file_size > 2097152){
$errors[]='File size must be excately 2 MB’;
}
if(empty($errors)==true){
move_uploaded_file($file_tmp,“images/”.$file_name);
echo “Success”;
}else{
print_r($errors);
}
}
?>
<html>
<body>
<form action=“” method=“POST” enctype=“multipart/form-data”>
<input type=“file” name=“image” />
<input type=“submit”/>
</form>
</body>
</html>
How can I test to see if value is 0 or null in PHP?
Php is a vast subject that contains many elements and one of the major elements of Php is to check 0, null or empty and isset status. It has various functions to check whether it is good or not or to test the value of the variables. There are three important functions of Php such as isset(), empty() and is_null(). This factors help to return a Boolean value. Boolean value is the used to determine the value of these functions. The result would be unexpected if it is not used in a right ways. There are two functions which functions opposite isset() and empty(). Well, it is not always true there is certain difference between all. So, here have a look at these functions:
1. isset()From PHP manual – isset():
Isset is used to decide that if a variable is set and is not NULL. If we say in other words then, it is used to determine the return is true only when not null is the variable.
2. empty()From PHP Manual – empty():
Empty is used to decide that if a variable is empty.If we talk in other terms then, it will return true if the variable is empty. It will show false, array(), NULL, “0?, 0, and an unset variable.
3. is_null()From PHP Manual – is_null():
Null is used to find if a variable is Null or not. In other words if we say then the returns true then, only when the variable shows null result. is_null() is opposite of isset(), except for one difference that isset() can be applied to unknown variables, but is_null() only to declared variables.
How to delete row from table using PHP pdo?
You can utilize the assignments table in the example database for the showing. Before going ahead with this instructional exercise, you ought to pursue the PHP MySQL make table instructional exercise to make the errands table and addition test information for rehearsing.
PHP MySQL Delete: Tasks Table:To erase information in a table, you utilize the accompanying advances: Associate with the MySQL database by making another case of the PDO object.
First of all, build a DELETE explanation to erase a column, numerous lines, or all lines in a table. On the off chance that you need to erase all columns in a major table rapidly and all the more proficiently, you utilize the TRUNCATE TABLE proclamation. Execute the DELETE articulation by calling the executive() strategy for the PDO object or the execute() technique for the PDOStatement object.
· PHP MySQL Delete information models
· PHP MySQL: erase a solitary column model
· To erase a solitary column in a table, you utilize the DELETE articulation with a WHERE condition that determines which line to erase.
· The accompanying content erases a column with id 2 in the assignments table.
How it functions?
When we talk about__construct() technique for the DeleteDataDemo class, we interface with the MySQL database by starting a case of the PDO class, and in the __destruct() strategy, we close the database association. The erase() technique acknowledges the id as the contention. In the first place, we call the get ready() technique for the PDO item to set up the DELETE explanation for execution, and after that we pass an exhibit that contains values comparing to the named placeholders in the DELETE proclamation to the execute() strategy for the PDOStatement object.
To erase the undertaking with id 2, we make an example of the DeleteDataDemo class and call the erase() strategy.
PHP MySQL: erase all columns in a table precedents
There are two different ways to erase all columns in a table:
· Issue a DELETE explanation without a WHERE statement.
· Issue a TRUNCATE TABLE explanation.
Getting Data from Multiple Databases:
There can be different issues which can face while fetching data from multiple databases but, issue you will have is consolidating the information. In a solitary database you keep up information honesty by characterizing outside keys. Different tables may have things identified with clients, so they may have a user_id field.
In a solitary database you would characterize a remote key connection between that user_id field and the id field on the client table, which means just existing id esteems from the client table, could be embedded in the othertable::user_id field. You can’t do outside key connections between tables in various databases, so I don’t have the foggiest idea how you’re going to interface the two arrangements of information into a solitary dataset.
Notwithstanding, expect you have a pseudo remote key, as above, however itwon’t be utilized by the databases to look after honesty. At that point need to do some sort of for/for each circle more than one dataset, remove the key which joins it to the next dataset, at that point glance through the second dataset for the coordinating key.
So, there are certain steps which involved in it so, have a look:
· make first association config ($conn1 = mysqli_connect($server1, $username, $password, $dbname)
· make second association config ($conn2 = mysqli_connect($server2, $username, $password, $dbname2);)
· select information with $conn config and store into $result variable (exhibit)
· for each $result, embed it into second database utilizing $conn2
How to display data record in database from vertical to horizontal:
There are many different ways to arrange data in a vertical to the horizontal database in Php. You will get two favourable circumstances and weaknesses to these strategies for social database information association. I completely depend on the requirements of the business as well it also depends on the need for the development.
The traditional way of any data in a table is a horizontal layout. Whatever data is recorded is go in a row and columns format runs horizontally. On the other hand, the second way is vertical. This way is very specific as well as it stores data that only have a column for real data. Here have a look at the example of data record in database from vertical to horizontal.
Table for Horizontal:
ID
First_Name
Last_Name
Dept
Sex
123
Vlad
Kofman
IT
M
234
Jim
Cramer
Marketing
M
456
Olimpia
Dukakis
Accounting
F
Table for Vertical
ID
Key
Value
123
First_Name
Vlad
234
First_Name
Jim
456
First_Name
Olimpia
123
Last_Name
Kofman
234
Last_Name
Cramer
456
Last_Name
Dukakis
123
Dept
IT
234
Dept
Marketing
456
Dept
Accounting
123
Sex
M
234
Sex
M
456
Sex
F
How enable in php long query strings:
Selecting Encrypted Username from DB:
There is very common question always hit the mind of the users that how Selecting Encrypted Username from DB? So, to encrypt the process does the data in the database unreadable from data in word processors. There can be no one decipher of its data when the database is encrypted.
Any database can be encrypted by utilizing the standard access menus. In both, the cases database that you are encrypting cannot be opened.
Follow this step to Encrypted Username from DB:
· Step 1: Select the tool by going to the setting. You will get options like Encrypt/Decrypt Database in the menu options.
· Step 2: You will see the encrypt/decrypt database dialogue from which choose the file which you want to encrypt. Press Okay.
· Step 3: If a user chooses the name which already exists in the files then, access will remove the original file after it concludes the process of encryption is successful. One of the best things that you can do in this situation is to take back up of the original database.
Encrypting with Code:
If you have used runtime version of Access to distribute your application and wants to give all the Php users the capability to encrypt the database you have to enter database course such as ADO. The following code will look like this:
Sub Encrypt(strDBNotEncrypted As String, _
strDBEncrypted As String)
Dim je As Nwe JRO.JetEngine
Je.CompactDatabase SourceConnection:=“Data Source=” _
& strDBNotEncrypted & “;”, _
DestConnection:=“Data Source=” & strDBEncrypted & _
"; Jet OLEDB:Encrypt Database=True"
End Sub
That’s all the folk about Php. If you are looking for such services you can contact Aresourcepool. The company has the best solution for all the above mentioned concept.
0 notes
Text
MySQL Shell get_auto_increment_value() method – Python mode
These days, I mostly program in PHP with MySQL as the database, which is just fine by me. I have had a long-time interest in MySQL (SQL in general), and after several steady months of programming in PHP, I must say I have really come into the language and developed a fondness for it. All that being said, I still enjoy using and learning the MySQL Shell in Python mode. As Database Developers, we often need the LAST INSERT ID value from a previous INSERT statement on a column that has the AUTO_INCREMENT attribute. MySQL Shell has a get_auto_increment_value() method we can call against a Shell object result and retrieve that value. Continue reading and see examples of the MySQL Shell get_auto_increment_value() method used in Python mode… Photo by Pierpaolo Riondato on Unsplash OS and DB used: Linux Mint 20 “Ulyana” MySQL 8.0.21 Self-Promotion: If you enjoy the content written here, by all means, share this blog and your favorite post(s) with others who may benefit from or like it as well. Since coffee is my favorite drink, you can even buy me one if you would like! MySQL Shell get_auto_increment_value() method simple example Getting started, I’ll create a practice table containing 2 columns: an ‘id’ column with the AUTO_INCREMENT attribute and a ‘name’ column of type VARCHAR, using the MySQL Shell in py mode. I’ll store the CREATE TABLE statement in a variable name ‘CREATE_TBL’ for easier processing: mysql-py [learning]> CREATE_TBL = """ CREATE TABLE auto_test(id INTEGER AUTO_INCREMENT, name VARCHAR(20), PRIMARY KEY at_id (id)) ENGINE=InnoDB""" The CREATE TABLE command itself does not have a dedicated shell method (at the time of writing that I am aware of). In order to execute that type of MySQL command, we must call the sql() method against a session object, providing the MySQL statement as the argument: mysql-py [learning]> db.session.sql(CREATE_TBL).execute() Query OK, 0 rows affected (2.0548 sec) With the table named, ‘auto_test’, I’ll pass in ‘auto_test’ as the parameter to the get_table() method, creating a working access handle on the table itself. We can see in calling the count() method against the ‘auto_test’ table object, that the ‘auto_test’ table as of now, is empty: mysql-py [learning]> auto_test = db.get_table('auto_test') mysql-py [learning]> auto_test.count()0 Using the insert() and values() methods, I’ll add a single row to the ‘auto_test’ table, chaining on the execute() method and completing the INSERT: mysql-py [learning]> auto_test.insert('name').values('Joshua').execute() Query OK, 1 item affected (0.3200 sec) Since the ‘id’ column has been created with the AUTO_INCREMENT attribute, we can retrieve the LAST_INSERT_ID value by executing the MySQL statement, SELECT LAST_INSERT_ID(). Again, we need to use the sql() method for this query: mysql-py [learning]> last_insert_id = db.session.sql("SELECT LAST_INSERT_ID()").execute().fetch_one() mysql-py [learning]> last_insert_id[ 1] The output shows the value of 1 as the last inserted id. Confirming with a follow-up select(), we see that is correct: mysql-py [learning]> auto_test.select().execute()+----+--------+| id | name |+----+--------+| 1 | Joshua |+----+--------+1 row in set (0.0009 sec) Inherently, there is nothing wrong or incorrect in doing this. However, there is another Shell type of way we can use. Let’s insert another row into the ‘auto_test’ table: mysql-py [learning]> result = auto_test.insert('name').values('Jessica').execute() However, this time around, we use the MySQL Shell get_auto_increment_value() method and retrieve the most recently inserted id: mysql-py [learning]> last_insert_id = result.get_auto_increment_value() mysql-py [learning]> last_insert_id2 In querying with the select() method, we see the expected results: mysql-py [learning]> auto_test.select().execute()+----+---------+| id | name |+----+---------+| 1 | Joshua || 2 | Jessica |+----+---------+2 rows in set (0.0009 sec) MySQL Shell get_auto_increment_value() method with multiple connections Shown in the following example queries, we can see that the MySQL Shell get_auto_increment_value() method works in other sessions just as it should. Let’s establish another connection, insert() a row, and then check the get_auto_increment_value(): --session 2 mysql-py [learning]> auto_test2 = db.get_table('auto_test') mysql-py [learning]> result2 = auto_test2.insert('name').values('Jeremy').execute() mysql-py [learning]> sess_2_insert_id = result2.get_auto_increment_value() mysql-py [learning]> sess_2_insert_id3 Executing this select(), we can see the last inserted id is 3: --session 1 mysql-py [learning]> auto_test.select().execute()+----+---------+| id | name |+----+---------+| 1 | Joshua || 2 | Jessica || 3 | Jeremy |+----+---------+3 rows in set (0.0009 sec) Now back in session 1, I’ll execute() a multi-valued insert() by chaining multiple values() methods together and assigning the results to a result object named ‘another’: mysql-py [learning]> another = auto_test.insert('name').values('Malory').values('Manny').execute() mysql-py [learning]> another.get_auto_increment_value()4 In the query results above, the call to get_auto_increment_value() shows 4 as the last inserted id, which is for the ‘Malory’ row as that particular row is the first one in the multi-row insert: mysql-py [learning]> auto_test.select().execute()+----+---------+| id | name |+----+---------+| 1 | Joshua || 2 | Jessica || 3 | Jeremy || 4 | Malory || 5 | Manny |+----+---------+5 rows in set (0.0011 sec) Semi-related: I mentioned in the opening paragraph that I program in PHP a great deal. Check out the post, PHP PDO lastInsertId() method with examples in MySQL, where I cover examples of retrieving the last insert id using PHP’s PDO. Once again, the MySQL Shell is right on the mark, providing DBA’s and Developers the get_auto_increment_value() for these specific types of queries in which we need the value for that last inserted id value. Recommended Reading I’ve written several blog posts on MySQL Shell Python mode so do visit any of the below posts that you are interested in: Basic Data Analysis with MySQL Shell Python mode MySQL Shell Python mode for multiple ALTER TABLE statements – easily Exploring .count() and COUNT() – MySQL Shell Python mode Transaction in MySQL Shell – Python mode with examples CREATE TABLE using Python in the MySQL Shell – with examples. ALTER TABLE ADD COLUMN – MySQL Shell Python style For in-depth information on the methods used in the post and other MySQL Shell Python mode related material, visit the online X DevAPI User Guide for MySQL Shell in Python Mode documentation. As always, if you see any corrections in the code I need to make or improve on, please let me know via the comments below. MySQL Shell is a fantastic, alternative environment in which to work with data. If you need to retrieve the last insert id from a MySQL column with the AUTO_INCREMENT attribute, try the get_auto_increment_value() method. Like what you have read? See anything incorrect? Please comment below and thank you for reading!!! A Call To Action! Thank you for taking the time to read this post. I truly hope you discovered something interesting and enlightening. Please share your findings here, with someone else you know who would get the same value out of it as well. Visit the Portfolio-Projects page to see blog post/technical writing I have completed for clients. To receive email notifications (Never Spam) from this blog (“Digital Owl’s Prose”) for the latest blog posts as they are published, please subscribe (of your own volition) by clicking the ‘Click To Subscribe!’ button in the sidebar on the homepage! (Feel free at any time to review the Digital Owl’s Prose Privacy Policy Page for any questions you may have about: email updates, opt-in, opt-out, contact forms, etc…) Be sure and visit the “Best Of” page for a collection of my best blog posts. Josh Otwell has a passion to study and grow as a SQL Developer and blogger. Other favorite activities find him with his nose buried in a good book, article, or the Linux command line. Among those, he shares a love of tabletop RPG games, reading fantasy novels, and spending time with his wife and two daughters. Disclaimer: The examples presented in this post are hypothetical ideas of how to achieve similar types of results. They are not the utmost best solution(s). The majority, if not all, of the examples provided, are performed on a personal development/learning workstation-environment and should not be considered production quality or ready. Your particular goals and needs may vary. Use those practices that best benefit your needs and goals. Opinions are my own. The post MySQL Shell get_auto_increment_value() method – Python mode appeared first on Digital Owl's Prose. https://joshuaotwell.com/mysql-shell-get_auto_increment_value-method-python-mode/
0 notes
Text
Social Networking App Development: Features and Technology Stack for a New-age App!

Do you know?
“The number of social media users is projected to cross 3.43 billion in 2023, which will be nearly half of the total population of the world then.“
These numbers provided by Statista, a reputed online statistics portal, are astonishing! They showcase that this industry is growing by leaps and bound. Not only individuals but even professionals and business enterprises use these platforms for their growth. As a result, a plethora of social networking app development services has emerged across the globe. These apps have evolved over time with innumerable trendy features and tools. So one needs to keep abreast with the latest trends for each platform to build a top-of-the-line social media app.
This blog instills a detailed overview, features, and technology stack for architecting social media or social network apps. Let us delve into them.
Major Types of Social Media Apps
Photo/media-sharing platforms like Instagram, Snapchat, YouTube, etc.
Social network apps like Facebook, Twitter, etc.
Chatting apps like WhatsApp.
Blogging and publishing sites like Medium
Internet discussion forums like Reddit, Quora, etc.
Business networking sites like LinkedIn.
Consumer review platforms like TripAdvisor.
Anonymous social networks like Anonyfish, Minds.com, etc
These apps have a general set of features embedded in them which are a must-have for any social media app. Let us have a glance at them:
Fundamental Features of Social Media Apps

Captivating user interface: The UI should form a great impression on users enabling easy navigation through the app. It should have a powerful and interactive visual design.
Easy registration and login: Considering the short attention span of today’s users, the registration and login processes must be as easy as possible.
Easier search functionality: Users should easily be able to search for anything by user names, tags, location, etc. As they start searching, the results should be filtered out and shown in a drop-down style at the earliest.
Private chatting and calling functionalities: A convenient chat feature for sending messages, photos, or other media and a calling feature to connect seamlessly are vital for these apps.
Message status: The users should be able to know if their message was read by the other users; they should also be able to hide their status if needed.
Ease of connectivity and expand user following: These apps must allow the users to easily access millions of people with ease and thus, build a following at a fast rate.
Creating and editing user profile: A thoughtful user profile that helps users to attract their target audience is essential for a social app. Users must be able to edit or customize it as well.
Push notifications: For keeping the users notified of recent activities and also about promotional activities, this feature is a must-have in the apps.
Appealing and real-time news feed: Relevant, real-time, and engaging news feed helps the users to stay tuned with information from friends and other communities. This potential feature compels the users to keep scrolling continuously.
Commenting, liking, and sharing: These features also ensure more engagement of the users.
Ability to add posts: Users should be able to express their thoughts on the platform. They should be able to share or upload files in the form of text, image, audio, video, etc. formats.
Group or community creating feature: Users, whether individuals or business entities, having common goals, interests, and values should be able to form groups or communities.
Add or remove friends/connections feature: Users must have the freedom to add, remove, or block their connections and also report if needed. This feature is extremely important in a world where unknown people connect so fast.
Emojis, GIFs, and stickers: These functionalities are necessary for ensuring that the apps give a more interactive and intuitive feel to the users.
Ability to integrate with other social media platforms: This feature helps the app owners to increase their user-base and drive adoption, thereby increasing its popularity.
Top-level security and privacy of information: Higher security and privacy features must be employed in the social apps to ensure secure interactions, prevent sensitive information of users, gain their confidence and thus, maintain the good reputation of the social network app.
A few more Advanced Features
Go live or broadcast feature
Hosting Watch Parties
Ability to highlight best stories
Ability to edit, crop or rotate images
Collaborative stories i.e. short-lived stories for one-day or limited time-span
Person-to-person (P-2-P) payment
Now as we are done with the features part, let us move to the technology stack requirements of these apps. There are two major parts- frontend and backend. Apart from this, we will also discuss the admin panel and database.
Social networking app development: Aspects to look for in Technology Stack
Frontend
Frontend development depends on several factors like frontend features to be inculcated, the framework to be chosen for faster development, best performance, and the flexibility of the app.
For developing a web frontend, AngularJs and Bootstrap are considered reliable. Some can also use ReactJs. After deciding these platforms, one can combine them with HTML and CSS for styling capabilities and develop outstanding social apps.
For developing native apps, native languages like the below can be preferred:
Android- Java or Kotlin
iOS- Objective C or Swift
For developing hybrid apps, one can use frameworks like Ionic, React Native, Flutter, Cordova/PhoneGap, etc.
Backend
Backend is a crucial part of development for determining what logic will be used and how. Node.js is being widely used for backend development of dynamic social apps that focus on real-time events that need quick data processing with minimal latency. Apart from Node.js, PHP and Ruby are also being used for backend development.
Admin Panel
The Admin panel can dramatically impact the budgets. Admin panel can be either developed in-house or with the help of other development companies, depending on your requirements and goals. Since it is a time and money intensive process, several companies don’t build their Admin panels from scratch and work with a third-party service. However, with third-party services, there are limitations as customization is not possible.
Database
Social apps need a huge amount of data to be accessed, stored, and processed. There are multiple databases available for the diverse needs of the apps. One can select any database: MySQL, PostgreSQL, SQLite or NoSQL database- for instance, MongoDB. However, we recommend using PostgreSQL or MySQL. For cloud services, Amazon Web Services are highly recommended as storage for all the data.
Wrap-up:
The best social network apps on the internet attract millions of users daily. This fact has inspired several business enthusiasts, investors, and entrepreneurs to break into this arena. We hope this blog has guided you in your social app development journey with the features and the technology stack to be used.
Please feel free to comment below to let us know your thoughts on this.
You may drop us a mail at [email protected] for any doubts!
0 notes
Photo

Comparing the 5 Best PHP Form Builders (and 4 Free Scripts)
If you’re using PHP to build a website, chances are at you’ll need to add a form to the site.
The most common forms on the average website are contact forms. They enable visitors to contact you quickly and easily. But other forms can come in handy as well. For example, you may want to add a PHP email form as an alternative to the PHP contact form, or add a form to get feedback from your visitors on some aspect of your service or products. Whatever kind of form you need, you’re going to want to have one up and running quickly and easily.
That’s where a PHP form builder script comes in—also known as a PHP form generator script. Today we’ll take a look at the five best PHP form builders available at Envato Market and compare them in terms of functionality, flexibility, and aesthetic appeal. But first, let’s look at exactly what a PHP form builder is.
What Is a PHP Form Builder or Generator?
A PHP form is a form on a web page that allows visitors to the page to input information and send it to a server to be processed in some way. In essence, it’s an online version of a paper form where users fill out particular fields and then hand them in to be processed.
A PHP form builder is a tool you can add to your website that enables you to create a variety of well-designed PHP forms quickly and easily. You don't even have to know how to code!
Why Should You Use a PHP Form Builder?
The best thing about a PHP form generator is that it speeds up the job of creating and adding forms to your site. And the forms you create will look good and work well! The best-designed PHP form generators allow you or your client to create a variety of professionally-designed web forms and add them to a web page quickly and easily.
When someone fills out and submits a form, the form builder will allow the website owner to easily receive a notification via a computer or mobile device. It also allows the website owner to collect, browse, or download the data received from the form.
Not everyone who needs to add a form to their website wants or needs the same functionality, so the right PHP form generator for you isn’t necessarily the one with the most bells and whistles. Instead, it is the one that best meets your needs.
PHP Form Builder Scripts on CodeCanyon
At the time of writing this article, there are more than 100 PHP form builder scripts available on CodeCanyon. Most of these form generator and form creator scripts give you drag and drop functionality to create your form.
They also offer ready to use pre-built forms of various types that you can start using in your website right away. Once you purchase any of these scripts, you will get free lifetime updates and 6 months of free support.
Comparison of the 5 Best PHP Form Builders
1. Easy Forms: Advanced Form Builder and Manager
Easy Forms PHP form builder checks all the boxes when it comes to the ideal form generator and is the perfect choice for the inexperienced developer. This form creator script uses a drag-and-drop system that allows you to create forms in minutes right from your browser with little coding knowledge. It also offers a good selection of themes and templates for a variety of taste and branding needs.
Easy Forms enables you to create the usual forms you’d expect—like contact forms, order forms, registration forms and online surveys. But you can also create specialised forms like multi-page forms and multi-column forms.
Your forms can then be placed anywhere on your webpage and, once they're embedded, you can track views, submissions, geographical data, abandonment rates, and other important performance information. What’s more, Easy Forms offers form analytics to help you learn more about your data, the ability to create reports based on the analytics, and the ability to export data collected by your forms.
Additional features:
user management
geolocation
email notification
autoresponder
mobile friendly
and more
This plugin is being actively updated. The latest update adds a couple of new and useful features to the form builder. This includes things like:
upload multiple files with a single file field
evaluate maths expressions with multiple fields
generate QR code to share forms
auto-suggest to help users quickly fill out a form
and a lot more
User imagesthataspire says:
"This is an excellent script and, if you need online forms, will almost certainly meet your needs."
2. Just Forms Full
The Just Forms Full form builder is a budget-friendly form builder that will help you create all kinds of forms quickly. You can use it to create classic forms, multi-step forms and pop-up forms as well.
It already comes with over 120 fully functional forms that you can start using right away. Other than that, you can use over 100 form templates to quickly create your own forms. Using the form builder does not require you to have any knowledge of PHP or JavaScript.
All the forms and form elements have been tested on multiple operating systems like Windows, iOS and Android. They have also been tested on a lot of browsers going back up to IE9.
The forms are also compatible with Bootstrap 3 if you are using that framework.
Once the form has been successfully submitted, it gives you multiple options to process the information. The simplest things you can do is just send an email. However, you can also tell the form builder to export the data in either a CSV file or as a PDF document. The data can also be copied easily to a MySQL database.
You should definitely check out this plugin if you are looking for a basic form builder to help you get up and running quickly.
3. PHP Form Builder
A powerhouse among form builders, the PHP Form Builder allows you to create just about any type of form you need using simple functions. This form designer and creator also provides options for horizontal, vertical and inline layouts to suit your page design and accepts any HTML5 form elements, including field sets, multiple selects, opt groups, and button groups.
You can customise the HTML with wrappers, IDs, classes and attributes, JavaScript events, and custom code almost anywhere. The builder comes with excellent documentation suitable for both novice PHP users and experienced programmers.
Additional features:
build any form with any framework
validate posted values
send your emails using customisable HTML/CSS templates
connect your database and insert, update, or delete records
over 120+ pre-built templates included
and more
This script is also under active development, and the latest update added a lot of new features, improved old features and fixed a few bugs. Here are a few of its new features:
signature pad to add electronic signatures in forms
a new lightweight date range picker plugin
the date range picker is now available in multiple form templates
the drag and drop form builder now has much better JSON support
User MonicePetkovska says of this incredible PHP form builder:
“The support is great, I'm really impressed. The product is easy to implement. Thank you again for your support. I'm beginner in PHP and I learned a lot of things from you."
4. Zigaform PHP Form Builder: Contact & Survey
Zigaform: Contact & Survey enables you to build a range of forms for any PHP website in a matter of minutes. The builder uses a handy grid system into which you can drag and drop over 40 form elements to create whatever kind of form meets your need. You can use their Skin Customiser and over 700 icons, 650 fonts, and 80 animation effects to fine-tune every part of your form so that it fits nicely into the webpage on which it’s located.
Once a user has completed a form, they receive an acknowledgement email and you receive a notification email, both of which are completely customisable. All data submitted via the Zigaform is stored in the admin panel, from where it can be exported in CSV or PDF format. The builder also allows you to filter and search submitted data, which can then be used to create graphic charts for trend and other analysis.
Additional features:
extensive documentation
translation ready
spam protection
cross-browser compatibility
form validation
and more
User orlandobcr says:
“I had found the product very useful. Lots of details to customise, lots of options to implement. Nice work!”
5. Zigaform: PHP Calculator & Cost Estimation Form Builder
Zigaform: PHP Calculator & Cost Estimation Form Builder is the sister of the Zigaform Contact & Survey Form Builder mentioned above and specialises in helping you to build your own eCommerce and invoicing forms, summary estimate forms, and instant checkout payment forms to give your buyers a simplified checkout experience.
Other than these specialised forms, the PHP form generator has the same great features as the Zigaform Contact & Survey Form Builder. You can drag and drop the numerous form elements provided into an organising grid and use the Skin Customiser, numerous icons, fonts, and animation effects to customise your form. The builder also offers the same great notification and data processing as its sister form builder.
Additional features:
advanced search for entries
import and export your custom forms
option to duplicate forms and fields
detailed entries report by form
mobile friendly
and more
User davinci7 says:
“This form is absolutely brilliant! I had previously spent more than $400 having a complex form developed for me (in the end it didn't even work), but I built the same form myself using this software in around 30 minutes. The customer support I received was amazing. I was very reluctant to buy it, but now I can't recommend it enough.”
The Best Free PHP Form Builders
You can also use some free PHP form builders if you don't want to spend the money for a premium script. However, most of these forms will not be as user-friendly as the scripts listed above. For example, you will not get a drag-and-drop interface with most of them.
1. PHP Form Builder
This is a simple open-source PHP form builder class that will help you quickly create forms using PHP and output the required HTML. The script still works, but keep in mind that the source code was last updated 6 years ago so new features are not being added by the author. This script is great if you want to create forms using code, not with a graphical interface.
2. Laravel Form Builder
This is a free and open-source PHP form builder that is based on the Laravel framework in PHP. The UI of the form is styled using Bootstrap 3 framework. Again, this is a script for creating forms using PHP code, not using drag-and-drop.
3. Form
This form builder allows you to quickly create a form using PHP. It also comes with some useful functionality such as remembering old input for per-populating the form fields and displaying error messages. This is an open-source form builder script, so you can get it for free and modify the code as much as you like. But be warned, this script is no longer maintained so it may be out of date.
4. pForm
This one is not a downloadable script. Instead it's a website that lets you create simple forms using drag-and-drop, without any knowledge of PHP. Best of all, it's absolutely free to use!
Tips for Creating PHP Forms
Here are a few tips that might be helpful when you create your own forms:
1. Sanitize User Input
It is very important that you validate and sanitize all input that you receive through a form. Some users might unknowingly provide data in a wrong format while others with a malicious motive might try to do more harm using SQL injections. Even if your form is generated by a PHP form creator script, you still need to sanitize the results before using them in your code!
2. Show Informative Error Messages
Always make sure that you provide users with all the details that they need to fill out the form. If the username can only be between 4 and 10 characters long, you should mention it even before they start filling out and submit the form. If the users do fill out something in improper format, try to tell them exactly what they did wrong. This will create a much more user friendly experience.
Choosing the Right PHP Form Builder for You
From the five PHP form builders covered here, you can see that form builders come in various sizes and functionality. For someone looking for a simple and reliable contact form, the Zigaform: Contact and Survey Form Builder is the right choice. For someone who needs invoicing and e-commerce forms, the Zigaform: PHP Calculator and Cost Estimation Form Builder is a better pick. For someone else who needs a large degree of flexibility in creating a variety of forms, the Easy Forms: Advanced Form Builder and Manager is one of the best choices.
In other words, any of the form builders featured here would be a great choice depending on what you need.
The first step when choosing a form generator script is to be clear about what you want from your form builder. Once you’ve gotten clear, take another look at these form builders to decide which one’s right for you. If none of them are quite what you’re looking for, don’t worry—we’ve got more great PHP form builders at Envato Market, so head over there and check them out.
Other PHP Scripts on CodeCanyon
There are a huge variety of scripts available on CodeCanyon. These range from calendar, navigation, and form scripts, to shopping carts and social networking.
The marketplace includes over 4000 different PHP scripts that will help you add all kinds of functionality to your website.
Here are a few of the best-selling and up-and-coming PHP scripts available on CodeCanyon for 2020.
PHP
12 Best PHP Event Calendar and Booking Scripts... and 3 Free Options
Monty Shokeen
PHP
10 Best PHP URL Shortener Scripts
Monty Shokeen
PHP
12 Best Contact Form PHP Scripts for 2020
Esther Vaati
PHP
Comparing the 5 Best PHP Form Builders
Nona Blackman
PHP
Create Beautiful Forms With PHP Form Builder
Ashraff Hathibelagal
by Monty Shokeen via Envato Tuts+ Code https://ift.tt/2UQce1q
0 notes
Text
How We Tagged Google Fonts and Created goofonts.com
GooFonts is a side project signed by a developer-wife and a designer-husband, both of them big fans of typography. We’ve been tagging Google Fonts and built a website that makes searching through and finding the right font easier.
GooFonts uses WordPress in the back end and NuxtJS (a Vue.js framework) on the front end. I’d love to tell you the story behind goofonts.com and share a few technical details regarding the technologies we’ve chosen and how we adapted and used them for this project.
Why we built GooFonts
At the moment of writing this article, there are 977 typefaces offered by Google Fonts. You can check the exact number at any moment using the Google Fonts Developer API. You can retrieve the dynamic list of all fonts, including a list of the available styles and scripts for each family.
The Google Fonts website provides a beautiful interface where you can preview all fonts, sorting them by trending, popularity, date, or name.
But what about the search functionality?
You can include and exclude fonts by five categories: serif, sans-serif, display, handwriting, and monospace.
You can search within scripts (like Latin Extended, Cyrillic, or Devanagari (they are called subsets in Google Fonts). But you cannot search within multiple subsets at once.
You can search by four properties: thickness, slant, width, and "number of styles." A style, also called variant, refers both to the style (italic or regular) and weights (100, 200, up to 900). Often, the body font requires three variants: regular, bold, and italic. The “number of styles” property sorts out fonts with many variants, but it does not allow to select fonts that come in the “regular, bold, italic” combo.
There is also a custom search field where you can type your query. Unfortunately, the search is performed exclusively over the names of the fonts. Thus, the results often include font families uniquely from services other than Google Fonts.
Let's take the "cartoon" query as an example. It results in "Cartoon Script" from an external foundry Linotype.
I can remember working on a project that demanded two highly stylized typefaces — one evoking the old Wild West, the other mimicking a screenplay. That was the moment when I decided to tag Google Fonts. :)
GooFonts in action
Let me show you how GooFonts works. The dark sidebar on the right is your “search” area. You can type your keywords in the search field — this will perform an “AND” search. For example, you can look for fonts that are at once cartoon and slab.
We handpicked a bunch of keywords — click any of them! If your project requires some specific subsets, check them in the subsets sections. You can also check all the variants that you need for your font.
If you like a font, click its heart icon, and it will be stored in your browser’s localStorage. You can find your bookmarked fonts on the goofonts.com/bookmarks page. Together with the code, you might need to embed them.
How we built it: the WordPress part
To start, we needed some kind of interface where we could preview and tag each font. We also needed a database to store those tags.
I had some experience with WordPress. Moreover, WordPress comes with its REST API, which opens multiple possibilities for dealing with the data on the front end. That choice was made quickly.
I went for the most straightforward possible initial setup. Each font is a post, and we use post tags for keywords. A custom post type could have worked as well, but since we are using WordPress only for the data, the default content type works perfectly well.
Clearly, we needed to add all the fonts programmatically. We also needed to be able to programmatically update the fonts, including adding new ones or adding new available variants and subsets.
The approach described below can be useful with any other data available via an external API. In a custom WordPress plugin, we register a menu page from which we can check for updates from the API. For simplicity, the page will display a title, a button to activate the update and a progress bar for some visual feedback.
/** * Register a custom menu page. */ function register_custom_menu_page() { add_menu_page( 'Google Fonts to WordPress', 'WP GooFonts', 'manage_options', 'wp-goofonts-menu', function() { ?> <h1>Google Fonts API</h1> <button type="button" id="wp-goofonts-button">Run</button> <p id="info"></p> <progress id="progress" max="100" value="0"></progress> <?php } ); } add_action( 'admin_menu', 'register_custom_menu_page' );
Let's start by writing the JavaScript part. While most of the examples of using Ajax with WordPress implements jQuery and the jQuery.ajax method, the same can be obtained without jQuery, using axios and a small helper Qs.js for data serialization.
We want to load our custom script in the footer, after loading axios and qs:
add_action( 'admin_enqueue_scripts' function() { wp__script( 'axios', 'https://unpkg.com/axios/dist/axios.min.js' ); wp_enqueue_script( 'qs', 'https://unpkg.com/qs/dist/qs.js' ); wp_enqueue_script( 'wp-goofonts-admin-script', plugin_dir_url( __FILE__ ) . 'js/wp-goofonts.js', array( 'axios', 'qs' ), '1.0.0', true ); });
Let’s look how the JavaScript could look like:
const BUTTON = document.getElementById('wp-goofonts-button') const INFO = document.getElementById('info') const PROGRESS = document.getElementById('progress') const updater = { totalCount: 0, totalChecked: 0, updated: [], init: async function() { try { const allFonts = await axios.get('https://www.googleapis.com/webfonts/v1/webfonts?key=API_KEY&sort=date') this.totalCount = allFonts.data.items.length INFO.textContent = `Fetched ${this.totalCount} fonts.` this.updatePost(allFonts.data.items, 0) } catch (e) { console.error(e) } }, updatePost: async function(els, index) { if (index === this.totalCount) { return } const data = { action: 'goofonts_update_post', font: els[index], } try { const apiRequest = await axios.post(ajaxurl, Qs.stringify(data)) this.totalChecked++ PROGRESS.setAttribute('value', Math.round(100*this.totalChecked/this.totalCount)) this.updatePost(els, index+1) } catch (e) { console.error(e) } } } BUTTON.addEventListener('click', () => { updater.init() })
The init method makes a request to the Google Fonts API. Once the data from the API is available, we call the recursive asynchronous updatePost method that sends an individual font in the POST request to the WordPress server.
Now, it’s important to remember that WordPress implements Ajax in its specific way. First of all, each request must be sent to wp-admin/admin-ajax.php. This URL is available in the administration area as a global JavaScript variable ajaxurl.
Second, all WordPress Ajax requests must include an action argument in the data. The value of the action determines which hook tag will be used on the server-side.
In our case, the action value is goofonts_update_post. That means what happens on the server-side is determined by the wp_ajax_goofonts_update_post hook.
add_action( 'wp_ajax_goofonts_update_post', function() { if ( isset( $_POST['font'] ) ) { /* the post tile is the name of the font */ $title = wp_strip_all_tags( $_POST['font']['family'] ); $variants = $_POST['font']['variants']; $subsets = $_POST['font']['subsets']; $category = $_POST['font']['category']; /* check if the post already exists */ $object = get_page_by_title( $title, 'OBJECT', 'post' ); if ( NULL === $object ) { /* create a new post and set category, variants and subsets as tags */ goofonts_new_post( $title, $category, $variants, $subsets ); } else { /* check if $variants or $subsets changed */ goofonts_update_post( $object, $variants, $subsets ); } } }); function goofonts_new_post( $title, $category, $variants, $subsets ) { $post_id = wp_insert_post( array( 'post_author' => 1, 'post_name' => sanitize_title( $title ), 'post_title' => $title, 'post_type' => 'post', 'post_status' => 'draft', ) ); if ( $post_id > 0 ) { /* the easy part of tagging ;) append the font category, variants and subsets (these three come from the Google Fonts API) as tags */ wp_set_object_terms( $post_id, $category, 'post_tag', true ); wp_set_object_terms( $post_id, $variants, 'post_tag', true ); wp_set_object_terms( $post_id, $subsets, 'post_tag', true ); } }
This way, in less than a minute, we end up with almost one thousand post drafts in the dashboard — all of them with a few tags already in place. And that’s the moment when the crucial, most time-consuming part of the project begins. We need to start manually add tags for each font one by one. The default WordPress editor does not make much sense in this case. What we needed is a preview of the font. A link to the font’s page on fonts.google.com also comes in handy.
A custom meta box does the job very well. In most cases, you will use meta boxes for custom form elements to save some custom data related to the post. In fact, the content of a meta box can be practically any HTML.
function display_font_preview( $post ) { /* font name, for example Abril Fatface */ $font = $post->post_title; /* font as in url, for example Abril+Fatface */ $font_url_part = implode( '+', explode( ' ', $font )); ?> <div class="font-preview"> <link href="<?php echo 'https://fonts.googleapis.com/css?family=' . $font_url_part . '&display=swap'; ?>" rel="stylesheet"> <header> <h2><?php echo $font; ?></h2> <a href="<?php echo 'https://fonts.google.com/specimen/' . $font_url_part; ?>" target="_blank" rel="noopener">Specimen on Google Fonts</a> </header> <div contenteditable="true" style="font-family: <?php echo $font; ?>"> <p>The quick brown fox jumps over a lazy dog.</p> <p style="text-transform: uppercase;">The quick brown fox jumps over a lazy dog.</p> <p>1 2 3 4 5 6 7 8 9 0</p> <p>& ! ; ? {}[]</p> </div> </div> <?php } add_action( 'add_meta_boxes', function() { add_meta_box( 'font_preview', /* metabox id */ 'Font Preview', /* metabox title */ 'display_font_preview', /* content callback */ 'post' /* where to display */ ); });
Tagging fonts is a long-term task with a lot of repetition. It also requires a big dose of consistency. That’s why we started by defining a set of tag “presets.” That could be, for example:
{ /* ... */ comic: { tags: 'comic, casual, informal, cartoon' }, cursive: { tags: 'cursive, calligraphy, script, manuscript, signature' }, /* ... */ }
Next with some custom CSS and JavaScript, we “hacked” the WordPress editor and tags form by enriching it with the set of preset buttons.
How we built it: The front end part (using NuxtJS)
The goofonts.com interface was designed by Sylvain Guizard, a french graphic and web designer (who also happens to be my husband). We wanted something simple with a distinguished “search” area. Sylvain deliberately went for colors that are not too far from the Google Fonts identity. We were looking for a balance between building something unique and original while avoiding user confusion.
While I did not hesitate choosing WordPress for the back-end, I didn’t want to use it on front end. We were aiming for an app-like experience and I, personally, wanted to code in JavaScript, using Vue.js in particular.
I came across an example of a website using NuxtJS with WordPress and decided to give it a try. The choice was made immediately. NuxtJS is a very popular Vue.js framework, and I really enjoy its simplicity and flexibility. I’ve been playing around with different NuxtJS settings to end up with a 100% static website. The fully static solution felt the most performant; the overall experience seemed the most fluid.That also means that my WordPress site is only used during the build process. Thus, it can run on my localhost. This is not negligible since it eliminates the hosting costs and most of all, lets me skip the security-related WordPress configuration and relieves me of the security-related stress. ;)
If you are familiar with NuxtJS, you probably know that the full static generation is not (yet) a part of NuxtJS. The prerendered pages try to fetch the data again when you are navigating.
That’s why we have to somehow “hack” the 100% static generation. In this case, we are saving the useful parts of the fetched data to a JSON file before each build process. This is possible, thanks to Nuxt hooks, in particular, its builder hooks.
Hooks are typically used in Nuxt modules:
/* modules/beforebuild.js */ const fs = require('fs') const axios = require('axios') const sourcePath = 'http://wpgoofonts.local/wp-json/wp/v2/' const path = 'static/allfonts.json' module.exports = () => { /* write data to the file, replacing the file if it already exists */ const storeData = (data, path) => { try { fs.writeFileSync(path, JSON.stringify(data)) } catch (err) { console.error(err) } } async function getData() { const fetchedTags = await axios.get(`${sourcePath}tags?per_page=500`) .catch(e => { console.log(e); return false }) /* build an object of tag_id: tag_slug */ const tags = fetchedTags.data.reduce((acc, cur) => { acc[cur.id] = cur.slug return acc }, {}) /* we want to know the total number or pages */ const mhead = await axios.head(`${sourcePath}posts?per_page=100`) .catch(e => { console.log(e); return false }) const totalPages = mhead.headers['x-wp-totalpages'] /* let's fetch all fonts */ let fonts = [] let i = 0 while (i < totalPages) { i++ const response = await axios.get(`${sourcePath}posts?per_page=100&page=${i}`) fonts.push.apply(fonts, response.data) } /* and reduce them to an object with entries like: {roboto: {name: Roboto, tags: ["clean","contemporary", ...]}} */ fonts = (fonts).reduce((acc, el) => { acc[el.slug] = { name: el.title.rendered, tags: el.tags.map(i => tags[i]), } return acc }, {}) /* save the fonts object to a .json file */ storeData(fonts, path) } /* make sure this happens before each build */ this.nuxt.hook('build:before', getData) }
/* nuxt.config.js */ module.exports = { // ... buildModules: [ ['~modules/beforebuild'] ], // ... }
As you can see, we only request a list of tags and a list posts. That means we only use default WordPress REST API endpoints, and no configuration is required.
Final thoughts
Working on GooFonts was a long-term adventure. It is also this kind of projects that needs to be actively maintained. We regularly keep checking Google Fonts for the new typefaces, subsets, or variants. We tag new items and update our database. Recently, I was genuinely excited to discover that Bebas Neue has joint the family. We also have our personal favs among the much lesser-known specimens.
As a trainer that gives regular workshops, I can observe real users playing with GooFonts. At this stage of the project, we want to get as much feedback as possible. We would love GooFonts to be a useful, handy and intuitive tool for web designers. One of the to-do features is searching a font by its name. We would also love to add a possibility to share the bookmarked sets and create multiple "collections" of fonts.
As a developer, I truly enjoyed the multi-disciplinary aspect of this project. It was the first time I worked with the WordPress REST API, it was my first big project in Vue.js, and I learned so much about typography.
Would we do anything differently if we could? Absolutely. It was a learning process. On the other hand, I don't think we would change the main tools. The flexibility of both WordPress and Nuxt.js proved to be the right choice. Starting over today, I would definitely took time to explore GraphQL, and I will probably implement it in the future.
I hope that you find some of the discussed methods useful. As I said before, your feedback is very precious. If you have any questions or remarks, please let me know in the comments!
The post How We Tagged Google Fonts and Created goofonts.com appeared first on CSS-Tricks.
How We Tagged Google Fonts and Created goofonts.com published first on https://deskbysnafu.tumblr.com/
0 notes
Text
300+ TOP MongoDB Interview Questions and Answers
MongoDB Interview Questions for freshers experienced :-
1. What is MongoDB? Mongo-DB is a document database which provides high performance, high availability and easy scalability. 2. Which are the different languages supported by MongoDB? MonggoDB provides official driver support for C, C++, C#, Java, Node.js, Perl, PHP, Python, Ruby, Scala, Go and Erlang. You can use MongoDB with any of the above languages. There are some other community supported drivers too but the above mentioned ones are officially provided by MongoDB. 3. What are the different types of NoSQL databases? Give some example. NoSQL database can be classified as 4 basic types: Key value store NoSQL database Document store NoSQL database Column store NoSQL database Graph base NoSQL databse There are many NoSQL databases. MongoDB, Cassandra, CouchBD, Hypertable, Redis, Riak, Neo4j, HBASE, Couchbase, MemcacheDB, Voldemort, RevenDB etc. are the examples of NoSQL databases. 4. Is MongoDB better than other SQL databases? If yes then how? MongoDB is better than other SQL databases because it allows a highly flexible and scalable document structure. For example: One data document in MongoDB can have five columns and the other one in the same collection can have ten columns. MongoDB database are faster than SQL databases due to efficient indexing and storage techniques. 5. What type of DBMS is MongoDB? MongoDB is a document oriented DBMS 6. What is the difference between MongoDB and MySQL? Although MongoDB and MySQL both are free and open source databases, there is a lot of difference between them in the term of data representation, relationship, transaction, querying data, schema design and definition, performance speed, normalization and many more. To compare MySQL with MongoDB is like a comparison between Relational and Non-relational databases. 7. Why MongoDB is known as best NoSQL database? MongoDb is the best NoSQL database because, it is: Document Oriented Rich Query language High Performance Highly Available Easily Scalable 8. Does MongoDB support primary-key, foreign-key relationship? No. By Default, MongoDB doesn't support primary key-foreign key relationship. 9. Can you achieve primary key - foreign key relationships in MongoDB? We can achieve primary key-foreign key relationship by embedding one document inside another. For example: An address document can be embedded inside customer document. 10. Does MongoDB need a lot of RAM? No. There is no need a lot of RAM to run MongoDB. It can be run even on a small amount of RAM because it dynamically allocates and de-allocates RAM according to the requirement of the processes.
MongoDB Interview Questions 11. Explain the structure of ObjectID in MongoDB. ObjectID is a 12-byte BSON type. These are: 4 bytes value representing seconds 3 byte machine identifier 2 byte process id 3 byte counter 12. Is it true that MongoDB uses BSON to represent document structure? Yes. 13. What are Indexes in MongoDB? In MondoDB, Indexes are used to execute query efficiently. Without indexes, MongoDB must perform a collection scan, i.e. scan every document in a collection, to select those documents that match the query statement. If an appropriate index exists for a query, MongoDB can use the index to limit the number of documents it must inspect. 14. By default, which index is created by MongoDB for every collection? By default, the_id collection is created for every collection by MongoDB. 15. What is a Namespace in MongoDB? Namespace is a concatenation of the database name and the collection name. Collection, in which MongoDB stores BSON objects. 16. Can journaling features be used to perform safe hot backups? Yes. 17. Why does Profiler use in MongoDB? MongoDB uses a database profiler to perform characteristics of each operation against the database. You can use a profiler to find queries and write operations 18. If you remove an object attribute, is it deleted from the database? Yes, it be. Remove the attribute and then re-save(. the object. 19. In which language MongoDB is written? MongoDB is written and implemented in C++. 20. Does MongoDB need a lot space of Random Access Memory (RAM)? No. MongoDB can be run on small free space of RAM. 21. What language you can use with MongoDB? MongoDB client drivers supports all the popular programming languages so there is no issue of language, you can use any language that you want. 22. Does MongoDB database have tables for storing records? No. Instead of tables, MongoDB uses "Collections" to store data. 23. Do the MongoDB databases have schema? Yes. MongoDB databases have dynamic schema. There is no need to define the structure to create collections. 24. What is the method to configure the cache size in MongoDB? MongoDB's cache is not configurable. Actually MongoDb uses all the free spaces on the system automatically by way of memory mapped files. 25. How to do Transaction/locking in MongoDB? MongoDB doesn't use traditional locking or complex transaction with Rollback. MongoDB is designed to be light weighted, fast and predictable to its performance. It keeps transaction support simple to enhance performance. 26. Why 32 bit version of MongoDB are not preferred ? Because MongoDB uses memory mapped files so when you run a 32-bit build of MongoDB, the total storage size of server is 2 GB. But when you run a 64-bit build of MongoDB, this provides virtually unlimited storage size. So 64-bit is preferred over 32-bit. 27. Is it possible to remove old files in the moveChunk directory? Yes, These files can be deleted once the operations are done because these files are made as backups during normal shard balancing operation. This is a manual cleanup process and necessary to free up space. 28. What will have to do if a shard is down or slow and you do a query? If a shard is down and you even do query then your query will be returned with an error unless you set a partial query option. But if a shard is slow them Mongos will wait for them till response. 29. Explain the covered query in MongoDB. A query is called covered query if satisfies the following two conditions: The fields used in the query are part of an index used in the query. The fields returned in the results are in the same index. 30. What is the importance of covered query? Covered query makes the execution of the query faster because indexes are stored in RAM or sequentially located on disk. It makes the execution of the query faster. Covered query makes the fields are covered in the index itself, MongoDB can match the query condition as well as return the result fields using the same index without looking inside the documents. 31. What is sharding in MongoDB? In MongoDB, Sharding is a procedure of storing data records across multiple machines. It is a MongoDB approach to meet the demands of data growth. It creates horizontal partition of data in a database or search engine. Each partition is referred as shard or database shard. 32. What is replica set in MongoDB? A replica can be specified as a group of mongo instances that host the same data set. In a replica set, one node is primary, and another is secondary. All data is replicated from primary to secondary nodes. 33. What is primary and secondary replica set in MongoDB? In MongoDB, primary nodes are the node that can accept write. These are also known as master nodes. The replication in MongoDB is single master so, only one node can accept write operations at a time. Secondary nodes are known as slave nodes. These are read only nodes that replicate from the primary. 34. By default, which replica sets are used to write data? By default, MongoDB writes data only to the primary replica set. 35. What is CRUD in MongoDB? MongoDB supports following CRUD operations: Create Read Update Delete 36. In which format MongoDB represents document structure? MongoDB uses BSON to represent document structures. 37. What will happen when you remove a document from database in MongoDB? Does MongoDB remove it from disk? Yes. If you remove a document from database, MongoDB will remove it from disk too. 38. Why are MongoDB data files large in size? MongoDB doesn't follow file system fragmentation and pre allocates data files to reserve space while setting up the server. That's why MongoDB data files are large in size. 39. What is a storage engine in MongoDB? A storage engine is the part of a database that is used to manage how data is stored on disk. For example: one storage engine might offer better performance for read-heavy workloads, and another might support a higher-throughput for write operations. 40. Which are the storage engines used by MongoDB? MMAPv1 and WiredTiger are two storage engine used by MongoDB. 41. What is the usage of profiler in MongoDB? A database profiler is used to collect data about MongoDB write operations, cursors, database commands on a running mongod instance. You can enable profiling on a per-database or per-instance basis. The database profiler writes all the data it collects to the system. profile collection, which is a capped collection. 42. Is it possible to configure the cache size for MMAPv1 in MongoDB? No. it is not possible to configure the cache size for MMAPv1 because MMAPv1 does not allow configuring the cache size. 43. How to configure the cache size for WiredTiger in MongoDB? For the WiredTiger storage engine, you can specify the maximum size of the cache that WiredTiger will use for all data. This can be done using storage.wiredTiger.engineConfig.cacheSizeGB option. 44. How does MongoDB provide concurrency? MongoDB uses reader-writer locks for concurrency. Reader-writer locks allow concurrent readers shared access to a resource, such as a database or collection, but give exclusive access to a single write operation. 45. What is the difference between MongoDB and Redis database? Difference between MongoDB and Redis: Redis is faster than MongoDB. Redis has a key-value storage whereas MongoDB has a document type storage. Redis is hard to code but MongoDB is easy. 46. What is the difference between MongoDB and CouchDB? Difference between MongoDB and CouchDB: MongoDB is faster than CouchDB while CouchDB is safer than MongoDB. Triggers are not available in MongoDB while triggers are available in CouchDB. MongoDB serializes JSON data to BSON while CouchDB doesn't store data in JSON format. 47. What is the difference between MongoDB and Cassandra? Difference between MongoDB and Cassandra: MongoDB is cross-platform document-oriented database system while Cassandra is high performance distributed database system. MongoDB is written in C++ while Cassandra is written in Java. MongoDB is easy to administer in the case of failure while Cassandra provides high availability with no single point of failure. 48. Is there any need to create database command in MongoDB? You don't need to create a database manually in MongoDB because it creates automaically when you save the value into the defined collection at first time. 49. What do you understand by NoSQL databases? Is MongoDB a NoSQL database? explain. At the present time, the internet is loaded with big data, big users, big complexity etc. and also becoming more complex day by day. NoSQL is answer of all these problems, It is not a traditional database management system, not even a relational database management system (RDBMS). NoSQL stands for "Not Only SQL". NoSQL is a type of database that can handle and sort all type of unstructured, messy and complicated data. It is just a new way to think about the database. Yes. MongoDB is a NoSQL database. MongoDB Questions and Answers Pdf Download Read the full article
0 notes
Text
Full Stack Roadmap 2019
Becoming a full stack web developer seems an intimidating task, especially if you are completely new to the field of coding. As a beginner, you might think that you have a whole lot to learn within a short span of time. The languages, frameworks, libraries and databases along with everything else required is a whole long list of tools of full stack web development. If you start attempting to learn everything at the same time is setting yourself up to FAIL spectacularly. The easiest way to begin any work is to strategize with a road map. A road map is the best way to kick start your attempt to become a full stack web developer.

Tackle each layer one by one. Your objective should be to learn the bare minimum skill set so that you can start experimenting and honing your learned skills. Once you have mastered the basics, you can go ahead and learn full stack technologies which will give you an edge over other people. Follow a structured path and equip yourself steadily rather than trying to learn all over the web development spectrum.
This road map has multiple sections and is the go-to guide for organizing and selecting technologies to learn. The article mainly benefits the noobs but is also useful to the professional coders looking to become a full stack web developer. If you already have knowledge of some of the technologies we are going to talk about here, skip to the sections that will be useful to you. Feel free to customize this road map to suit your needs.
Front end technologies roadmap for a full stack web developer

You can start by learning the technologies required for the presentation or the front end layer. Follow this roadmap strategy if you wish to master front end development requisites. There are again the must learn, should learn and the value additions.
Basic languages
HTML- the HyperText Markup Language is the most basic and must know for any website you are contriving. You define and structure the content of a website.
CSS- this is used for styling websites and adding layouts, fonts and colours.
SQL- Structured Query Language, this is a basic language that is used for database management.
Front-end frameworks
BootStrap- An open-source toolkit for developing responsive, mobile first projects. Uses HTML,CSS and JavaScript. It helps design the website faster and easier. It has design templates for forms, buttons, tables, navigation etc., It also supports JavaScript plugins.
AngularJS- This a structural framework for dynamic web apps. The JavaScript-based open source web framework is maintained by Google and a community of corporations and individuals. They address challenges in a single-page application. It allows usage of HTML as the template language. It data-binding and dependency reduce the amount of coding required substantially.
ReactJS- A JavaScript library maintained by Facebook and a group of companies as well as individual developers. React is optimal for fetching fast-changing data that needs to be recorded. It is used for building user interfaces for single page applications. It allows users to create reusable UI components.
VueJS-This is yet another open-source JavaScript framework for single page applications and UIs.It is very compact in size and high on performance. The best option for new coders, it offers hand-picked the choicest features of other frameworks like Angular and React. It is known as the most approachable framework today.
Other programming languages required by a full stack developer:
You need to be proficient in multiple programming languages as most of the core processes for any business have to be written in them. It is not possible to master all of them in a short time, so we have a list of languages for you to begin with.
JavaScript- It is a just-in-time compiled programming language. It helps in adding dynamic features to your website is the predominant usage of JavaScript. This is used for both front end and back end operations. The JavaScript basics are easy to learn. Many of the front-end as well as back-end frameworks, like NodeJS and AngularJS, use JavaScript. It is widely used for aplication like chatbots using full stack technology.
TypeScript- Developed and maintained by Microsoft for development of large applications. A prerequisite if you want to learn Angular, this has recently become very popular. This is an addition to JavaScript and is always used along with JavaScript for features like type checking.
Python- This is a high-level, general-purpose language. It can be used on a server to create web applications, mathematics and server scripting. It connects to databases to read and manipulate files. It was designed for readability and runs on an interpreter system. It can also be used in a procedural, object-oriented or functional way.
Ruby- A dynamic, open source language, it is easy to learn and code. It focuses on productivity and simplicity.it can be used for web applications, servers, system utilities, backups and database works.
PHP- The most popular scripting language, it can be embedded into HTML. PHP scripts can only be interpreted on a server where PHP is installed. It is used to collect form data, send or receive cookies amongst other functions.
Back end technologies roadmap for a full stack web developer.
Developers need a back end framework so that an application can be created. It is the script-side of a dynamic application. A lot of options are available for back end frameworks.
Express-Express.js is a framework and is used as a web application for Node.js. It is a module of the NodeJS. It can be used for apps that are based on servers that will listen for connection requests from clients. It can be used for single-page, multi-page, and hybrid web applications. It is fast, easy to use and assertive.
NodeJS-This is an open-source, cross-platform in nature, that is runs across various platforms. it is a JavaScript runtime environment that executes JavaScript outside a browser.
Django- This is a high-level Python web framework that follows model-template-view architecture. It is used to simplify the creation of complex, database-driven websites. It is fast and promotes a clean design.
Ruby on Rails- This is a server-side web application framework based on the Ruby language. It provides default structures for databases, web services and web pages. It uses model-view-controller architecture. This is comparatively hard to learn as you have to learn multiple and independent concepts.
Database systems roadmap.
In today's scenario, there are tons of databases. Each company develops its own databases according to their requirements.
The objective of this roadmap is to learn and become a database administrator.
MySQL, SQLite, Postgres- These are Relational Database management system, and the data is stored in table-like schemes. This is good to store business data. These use SQL
MongoDB, Cassandra, Apache storm, Sphinx- These are the NoSQL databases. Their only commonality is that they do not use a relational database scheme. This type of database covers a wide range of technologies and can be used to find key-value DB, graph DBs, streaming DBs etc.,
VoltDB, MemSQL- These are a new kind of database, the NewSQL. They follow the relational scheme but instead of disks, they use memory. the advantage is that they outperform the traditional RDBMS but the limited amount of memory available is definitely a downside to this type of database.
Recommended additional skills for a full stack web developer.
Git- The most popular distributed version control system. It is fast and efficient. It has the capacity to handle small to very large projects. It is used to coordinate between programmers as well as track any changes made to any code stored in its repository. Check out the git basics before getting started. GitHub is the most widely used code repository and thus a must learn for an aspiring coder.
Machine Learning- A subset of AI, it is a top trending topic in 2018, machine learning is now being incorporated into various industries. It has entered the web development field as well. This provides the ability to learn and improve without being explicitly programmed. This is a good-to-learn skill for a full stack web developer.
SSH- The secure shell protocol is used to operate network services securely over an unsecured network. The SSH provides a secured remote login from one computer to another. It ensures the privacy and integrity of the data.
HTTP/HTTPS-HyperText Transfer Protocol (HTTP) is the protocol used by the world wide web. it defines how messages are transmitted, the actions taken by the Web servers and browsers when responding to commands. HTTPS is the secured version of HTTP. Here, the communication protocol is encrypted using Transport Layer Security. It ensures protection against man-in-the-middle attacks and eavesdropping.
Linux command-line basic-Having this skill is not a must but one you should definitely have. It is not necessarily easy or hard to learn and saves a lot of time. The job that otherwise consumes a lot of time when done manually, like organizing items on the back-end will be over very fast.
Data structures and algorithms-Data structures are just ways to store the data while an algorithm is a generic approach methodology to solve a problem or requirement. Every programmer needs to be familiar with these concepts. By themselves, they are not a core skill, but the more intuitive you are about these, the easier it is to solve issues or add requirements. The impacts are felt in efficiency, scalability and performance of an application. As a full stack developer, this will help immensely.
Character encoding-This is a must learn if you are planning on developing global applications. If there is no proper character encoding, you might end up with unreadable text on display, the data will not be properly processed and your content may not be found by the search engines.
Use this road map and start by equipping yourself on these basic to intermediate skills required to become a successful full stack developer. Keep adding to your skills to give more value- addition to your role and by extension to your organization.
#web development#webdesign#full stack web development#ui development#uxdeveloper#html5#css#learn react#angular#php#python
0 notes
Text
Website Development courses
What is Web Development?
Web development is everything involved in the formation of a website. Typically it refers to the coding and programming side of web site production as opposed to the web design side. It encompasses all from a simple page of HTML text to complex. Working in website development not only means continuously learning new languages and knowing when to apply them, but, it also means learning more concerning marketing, requirements gathering and human-computer interaction. Website development has transitioned from simple HTML-driven sites to fully interactive informational and ecommerce portals.
Examples of feature-rich web development consist of ecommerce websites, content management systems (CMS) and social networks. Common web development programming languages and software include Hypertext Markup Language (HTML), Cascading Style Sheets (CSS), JavaScript, PHP, Drupal and MySQL.
Web Development Courses
Perhaps one of the most exciting prospects about entering a field like web development is the ability to basically get into it right away. Unlike many professions that put in months or even years of training, with web development you can easily get started today if you feel the fire of learning and discovery smoldering under your feet!
The best place to initiate getting a feel for how development works are the numerous free, live project web development courses that cover everything from basic programming introductions to development best practices. Below we’ll take appear at the web development courses and highlight what they can offer you and a selection of the best links or tools to check out.

1. Introduction (HTML, CSS, JavaScript)
2. PHP Basics
3. PHP Control Structures
4. Functions
5. PHP Arrays
6. Working with Forms
7. PHP RE & Math functions
8. PHP I/O and Mail
9. Cookies
10. Session
11. Introduction to Database
1. Introduction (HTML, CSS, JavaScript)
HTML -Students will learn the basic language of the Internet, including the theoretical principles of HTML and fluency in the HTML programming language.
Skills Gained:
· Syntax and principles of HTML coding.
· How to embed other web programming languages.
· The capability to create web pages with desired elements and requirements.
JavaScript- Building off basic web programming such as HTML, JavaScript is a more advance web programming language that allows for the creation of interactive web pages.
Skills Gained:
· Designing a web application.
· Implementation and testing client and server solutions.
· Learning user-interface principles.
2. PHP Basics
PHP is a server scripting language, and a controlling tool for creating dynamic and interactive Web pages.PHP is a widely-used, free, and capable to competitors such as Microsoft's ASP.
PHP scripts can be written everywhere in the document within PHP tags along with normal HTML.
3. PHP Control Structures
Control Structures are at the center of programming logic. They allow a script to respond differently depending on what has already occurred, or based on user input, and permit the graceful handling of repetitive tasks. In PHP, there are two main types of Control Structures: Conditional Statements and Control Loops.
4. Functions
Functions are one of the center aspects in JavaScript. A function is a set of statements that performs a task or calculates a value. Once you start to get your head about very basic JavaScript you will certainly need to spend some time into learning the in’s and out’s of functions. Basically, anytime you discover yourself repeating code, but modifying the small parts, you might probably use a function.
5. PHP Arrays
A PHP array is a variable that stores more than one piece of connected data in a single variable. Think of an array as a box of chocolates by slots inside. The box represents the array itself while the spaces containing chocolates stand for the values stored in the arrays. An array stores multiple values in one variable.
6. Working with Forms
A web form or HTML form on a web page allows a user to come into data that is sent to a server for processing. Forms can be like paper or database forms because web users fill out the forms using checkboxes, radio buttons, or text fields. For example, forms can be used to enter shipping or credit card data to order a product, or can be used to recover search results from a search engine.
7. PHP RE & Math functions
As you know PHP is a severe side script language and is used for creating dynamic web pages. PHP provides a number of built-in math functions which assist in performing several operations while dealing with mathematical data. It has good support for mathematical processing.
8. PHP I/O and Mail
PHP providing a number of assorted I/O streams that allow contact to PHP's own input and output streams, the standard input, output and error file descriptors, in-memory and disk-backed temporary file streams, and filters that can influence other file resources as they are read from and written to.
9. Cookies
A cookie is information that a Web site puts on your hard disk so that it can consider something about you at a later time. (More technically, it is information for future employ that is stored by the server on the client side of a client/server communication.) Typically, a cookie records your preferences by a particular site. Using the Web's Hypertext Transfer Protocol (HTTP), each request for a Web page is independent of all new requests. For this reason, the Web page server has no memory of what pages it has sent to a user before or anything about your previous visits. A cookie is a mechanism that allows the server to store up its own information about a user on the user's own computer.
10. Session
A session can be defined as server-side storage of information that is preferred to persist throughout the user's interaction with the web site or web application. This session id is approved to the web server every time the browser makes an HTTP request (i.e. a page link or AJAX request).
11. Introduction to Database
Most web database applications have small- to medium-size databases that store up thousands, or tens of thousands, of records. Database servers are complex software. However, the important part for web database application development is the applications interface that's used to access the database server.

Best Place to join the Web Development Course
With the enlargement of website designing industry, the demand of professional web designers is also increasing. Although many institute are there which offer training in web design but very few deliver the desire output. But there is one place where you can enhance your skills and attain the desiring results. That place is Web Development Institute in Nagpur, OSK which is one of the best website designing in Nagpur and website development training in Nagpur for courses.
Web Design & Web Development Courses Offered by Our Institute:
1. Introduction (HTML, CSS, JavaScript)
2. PHP Basics
3. PHP Control Structures
4. Functions
5. PHP Arrays
6. Working with Forms
7. PHP RE & Math functions
8. PHP I/O and Mail
9. Cookies
10. Session
11. Introduction to Database
0 notes
Text
What Makes PHP Rule the Software Market Till Now
If you want to develop dynamic, interactive and easy-to-use web applications, most developers recommend choosing PHP as your software development platform. PHP used to mean "Personal Homepage", indicating that its roots lie in creating a simple, personalized website. It is now a popular programming language that developers can use to place interactive elements on a page.
PHP is known for its scalability, huge community support, open source, and many other reasons. There is no doubt that this web development language is preferred over other languages for creating dynamic websites. If you want to build a small website or CMS that fits a specific customer need, using PHP is the best solution. However, when the time comes to focus more on security, architecture, speed, and robust functionality, it's a good time to choose a PHP framework for the project.
Why isn't PHP at war on the web platform?
It is true that there are various web development platforms available in the market and each of them has its own characteristics and functions. PHP shouldn't be included in the race, however, as it has become so popular that developers naturally choose the platform without thinking. So if a war breaks out, PHP wins, and here are a few reasons why.
Google knows it very simply: Google is known as a leading search engine company and thousands of robots crawl the web and index website content. PHP makes it easy for Google to crawl websites and determine the language in which they are built. Most websites that have used PHP respond with a header. So, if Google finds that more than 75% of websites are running PHP after crawling the entire network that is very good and accurate proof that PHP has a large online presence. With millions of websites developed on this platform, PHP remains the most attractive language for developers.
PHP provides maximum control: the language provides more control over the site than any other programming language, and it allows the developer to choose the language. Other languages require long and tedious scripts, but PHP helps developers perform the same function with just a few lines of code. Its open source nature also makes it easily accessible to everyone.
Works Well With Other Languages: PHP language works well with other languages and services such as CSS, HTML and various databases. Scripts have labels and this makes it easy to mix and match between HTML tags, which can make web content very dynamic. Therefore, functions and code can be written into the document in any order.
Excellent support access: Because PHP is an open source platform; There is a large community that offers support. There are lots of guides and references on the web that will make learning PHP easier and contribute to the community. Written codes, commands, and functions can be reused without having to reinvent the wheel.
For More Details, Visit Us: online php programs in community development
sharing problems and answers as community development
eol while scanning string literal
net runtime optimization service
mvn is not recognized as an internal or external command
android process acore has stopped
invalid literal for int with base 10
how to insert multiple array values into database php
How to display multiple selected value of dropdownlist in PHP
how to store multiple select values in database using php
#public static void main string args#android process acore has stopped#how to insert multiple array values into database php#How to display multiple selected value of dropdownlist in PHP
0 notes
Text
SMS Gateway - Use Your Phone as SMS Gateway
New Post has been published on https://intramate.com/php-scripts/sms-gateway-use-your-phone-as-sms-gateway/
SMS Gateway - Use Your Phone as SMS Gateway
LIVE PREVIEWGet it now for only $79
Turn your mobile phone into the SMS Gateway for your applications.
Features
Send SMS from your application developed using any programming language.
Send SMS with virtually no limit. You won’t be bound by SMS character limit (160 Characters).
Use CSV or Excel file containing numbers and messages in first two columns to send bulk messages.
Shows status of messages sent using SMS Gateway in Admin Panel.
Ability to receive messages in the Admin Panel and respond to them using a WebHook.
Ability to sign in using multiple Android devices to split messages between them when sending bulk messages.
Ability to create other users to let them use SMS Gateway from their mobile phones.
Send messages on schedule.
Send messages using any SIM programmatically or using Excel file.
Create contact lists and import contacts into them using Excel file.
Send message to contacts in a contacts list.
Ability to allow a contact to unsuscribe from the contacts list.
Add contacts or unsubcribe them from the list using the API.
If you want to try it out then register here. Follow the instruction you’ll receive in the email to get started.
To integrate into your application follow the guides on API page after logging in to the Admin Panel.
How it works!
1.) INSTALL ADMIN PANEL
You will receive Admin panel when you purchase SMS Gateway. Install it on your web hosting. It comes with installation script so it should be easy.
2.) INSTALL ANDROID APP
You need to download Android App from here. After installing it you can log in to it using your Admin panel URL and it’s credentials.
3.) READY TO SEND
Now when you send messages using API or excel file it will be first stored on your server with the ‘Pending’ status.
4.) READY TO PROCESS
After your server gets the messages it sends the notification to SMS Gateway app on your mobile. When the app gets the notification it downloads the messages for processing and set their status as ‘Queued’.
5.) SENT AND DONE
After each message is sent they get the status ‘Sent’ if it was sent successfully otherwise it will get ‘Failed’ status. SMS Gateway also checks for delivery of messages. If your mobile network is unable to deliver the message it will be marked as ‘Failed’ otherwise it will stay in ‘Sent’ status.
Server Requirements
Apache or Nginx
PHP 5.6 or above
MySQL
PHP Extensions
php_curl
php_zip
php_xml
php_mbstring
php_gd2 (if not compiled in)
It is recommended to use VPS Hosting for SMS Gateway but it should work perfectly fine on Shared Hosting too. If you decide to go with Shared Hosting make sure your host allows hosting of SMS Gateway application. Some hosts like HostGator and iPage don’t allow it so it is more likely that they will block the app.
Android Device Requirements
Android 5.0 or above.
Device with 3 GB or more RAM. It works on lower spec devices but you may experience degraded performance.
A device with Google Play Services. If your device has Google Play Store then it means it does have Google Play Services.
Note
There was a policy change from Google for all apps requiring SMS related permissions as you can see here. After March 9, 2019 this app won’t be available through Play Store. You will get all future updates notifications from CodeCanyon. You will need to install the APK file on your device to use the app. The app will function normally and its functionality won’t be affected from this move by Google.
Changelog
v5.1
New Features
Added ability to schedule messages.
v5.0.1
Fixes
Fixed an issue where normal users couldn’t remove the messages.
Fixed an issue that prevented the user from creating contacts list if other user had contacts list with same name.
Fixed an issue that caused duplicate unsubscribe text to be added when clicking on ‘Add Unsubscribe Link’ button.
Changes
Now using AJAX to submit the form that allows users to send message to contacts list.
v5.0
New Features
Create contact lists and import contacts into them using Excel file.
Send message to contacts in a contacts list.
Ability to allow a contact to unsuscribe from the contacts list.
Add contacts or unsubcribe them from the list using the API.
Changes
Now failed messages will show reason for failure. (Requires App Update)
Now message field on Send Message form will show how many messages will be used to send the message.
v4.0.3
Fixes
Fixed an issue that prevents assignment of next primary device after signing out from the Android app.
Fixed an issue that prevents assignment as primary device after login to the Android app even if there is no primary device exists.
Fixed an issue where a floating-point number was being considered as a valid mobile number.
Changes
Now exported excel will have a text formatting by default.
v4.0.2
Fixes
Fixed a critical issue in bulk sending functionality that caused some of the messages to be sent multiple times, sometimes neglecting others and sometimes from non-existence SIM on the device.
Changes
Now the application will set message status to “Delivered” if it is successful as per the Delivery Report.
Now non-Admin users are also allowed to remove their messages.
v4.0.1
Fixes
Fixed an issue where devices combo box on excel upload form doesn’t show all the available SIM cards.
New Features
Now received message will show receiver SIM.
v4.0
New Features
Added ability to send messages using any SIM via API or Excel file.
v3.1.1
Fixes
Fixed an issue where changing name and timezone from Device doesn’t affect the name and timezone on currently running PC session.
Fixed an issue where error wasn’t shown when login script was unable to remove the ‘install’ directory.
Fixed js and css path errors in installation script.
Fixed an issue where end date wasn’t showing the correct date on messages page if user’s timezone setting wasn’t same as database timezone.
Changes
Replaced Play Store URL from registration email with APK file URL.
Now the application uses locally hosted DataTables js file to improve performance.
Now localizing exported excel file column headers.
Now ignoring devices value in API if bad value is provided.
v3.1
New Features
Added option to turn off Delivery Reports.
v3.0.4
Fixes
Fixed an issue causing Excel export to ignore search parameters.
Fixed an issue where status wasn’t translated to primary language on messages page.
Changes
Now allows up to 60 seconds of delay between messages.
v3.0.3
Fixes
Added missing strings in the language file.
New Features
Added German language file.
v3.0.2
Changes
Now the API call will return date and time in ISO 8601 format.
Fixes
Fixed an issue where select all checkbox was still checked even after a successful operation.
v3.0.1
Fixes
Fixed an issue where The Unknown device wasn’t visible for non-admin users on messages page.
Fixed an issue where search didn’t work on messages page for non-admin users if there are no devices registered.
v3.0
Changes
Now API will return details of all the messages after sending them.
Now API supports GET requests.
Now messages page will show the total messages count for the search results.
Code and Performance Optimization.
New Features
Added ability to receive messages in Admin Panel and respond to it using a WebHook.
Added ability to change results per page in messages page.
Added new API page.
Added functionality to get messages using API.
v2.1
Changes
Now newline character in a message will be converted to br tag in messages page to show it properly.
Now users can resend messages with ‘Queued’ status. It is only recommended to do so if your message status stays in ‘Queued’ status for more than 24 hours even if message sending was finished on Android device.
New Features
Added ability to remove messages.
v2.0.1
Fixes
Fixed an issue causing single message form in Sender to show device doesn’t exist error even if it exists in the database. This only happened if your device ID is greater than or equal to 10.
Changes
Now users list in Manage Users page will show the infinite symbol in Max Devices when Maximum Devices allowed for the user is unlimited.
Now the application won’t rely on mbstring extension to send messages. Only Excel export and import requires mbstring extension enabled.
New Features
Added favicon.
v2.0
Fixes
Fixed an issue causing a fatal error in profile page when entering the wrong current password.
Fixed an issue that can prevent too many bulk messages from being sent.
Fixed an issue causing Failed messages to be marked as Pending.
New Features
Added support for multiple devices per user. The user can sign in to multiple devices and split messages between them.
Added support for paging to improve the performance of messages page.
Now user can change their name from profile settings.
Changes
Moved all the strings used in admin panel to a centralized location for easier localization.
Added new status named “Queued” and removed “Delivered” status to avoid confusion.
Now seconds data will be shown for sent time and delivered time on messages page.
Now delivery time will be reported from android app.
v1.0.6
New Features
Added missing phpdoc comments to make IDEs happy.
Added icon representing Delay field in the profile page.
Changes
Changed Firebase Cloud Message priority to high.
Now included php files will prevent access when opened directly.
Now Reset Password page will use the password reset link to reset the password.
Fixes
Fixed wrong use of constant in Manage Users page.
Fixed an issue in Manage users page causing 500 error for few users.
Fixed an issue causing a message to show outside browser window if a message is too big.
v1.0.5
New Features
Added ability to set the delay between messages.
Now messages will show delivery time near the status label.
Changes
Changed input field type to text in sender.php to allow + in the input.
Fixes
Fixed an issue causing wrong value to be saved in the database if there is $ in value.
Fixed an issue with search form layout in messages.php on lower resolution displays.
Fixed install script to use single quote in the config file to prevent issue when there is $ sign in database password.
Fixed an issue preventing checkbox from changing state when clicking select all if the user has interacted with a checkbox before.
1.0.4
Fixes
Fixed an issue where certain CSV files are not readable by excel uploader.
Fixed a critical issue preventing some of the messages from being sent when the user tries to send too many messages at once.
Fixed an issue preventing users from uploading multiple excel files.
1.0.3
Fixes
Fixed an issue where application can’t send messages in bulk if the total data size of bulk messages exceeds 4096 bytes.
Fixed an issue where application opens too many MySQL connections resulting in a crash.
Fixed an issue where installation script doesn’t work if installed MySQL version is below 5.6.
Fixed installation script to prevent it from saving changes to the database until every query executes successfully.
New Features
Added progress bar for ajax requests.
Added .htaccess file to prevent directory listing.
Changes
Now page won’t be reloaded after removing users instead only users table will be refreshed.
1.0.2
Fixes
Fixed DateTime input field line height issue in mobile application.
New Features
Added ability to remove users.
Changes
Moved Add New User form to Manage Users page.
Now if any message from multipart message fails then it will be considered as the failed message.
Now messages will be grouped according to users for Admin.
Now when a new user will be added it will use the date from defined timezone rather than server timezone.
1.0.1
Fixes
Fixed an issue where PHP Mailer class was declared twice using require a statement in reset-password.php causing a fatal error.
Fixed an error in API example in documentation causing it to not report error response correctly.
Fixed scrollbar in installation and login page.
New Features
Added jQuery Validation Plugin for better form validation.
Added server URL and android application URL to create user email.
Changes
Removed ’$’ from allowed characters in a random password generator to avoid problems.
LIVE PREVIEWGet it now for only $79
0 notes
Text
New Post has been published on Victor Font Consulting Group, LLC
New Post has been published on https://victorfont.com/formidable-forms-repeaters-complex-jquery-operations/
Formidable Forms Repeaters and Complex jQuery Operations
Snapshot
"To Infinity and Beyond"—Buzz Lightyear
Formidable Forms repeater fields are a great product feature. While the repeaters work fine with standard math calculations available through Formidable's shortcodes, more complex operations, such as we're addressing in this tutorial, require custom jQuery code. Getting the code to work correctly can be somewhat elusive though. This tutorial demonstrates how to get Formidable's repeater field to work with jQuery calculations as new rows are added to the form.
An example of why this is needful is posted by Howard Jennings through the Formidable Community Forum. Mr. Jennings asked how he could hide certain dropdown options based on the value selected in another dropdown.
This is something that needs to be done in jQuery because it requires manipulating CSS in the browser in real-time, which can't be done from the server in PHP. He provided some code that he had cobbled together to demonstrate his requirement. I refactored the code and reached out to him via email. Click here to access the pastebin with the refactored code.
After Mr. Jennings received the code and verified it worked well, he then asked how to apply it to each row in a repeater. This question has more challenges than solutions. After conducting some research, I couldn't find any clear examples online to share with him.
Mr. Jennings asked a good question though, and I didn't have an answer ready at hand. After thinking about it for awhile, I decided to learn how to do this myself and write this tutorial while I studied the problem
In this tutorial, you'll learn:
How repeaters work from both the Formidable and Document Object Model (DOM) perspectives
How to overcome repeater challenges in the DOM
Writing code that works
There's also an example repeater form for you to play with that does not save entries to the database.
How Repeaters Work
Formidable Perspective
First, let's understand what repeaters are from a Formidable perspective. Architecturally, repeaters are embedded forms. Whenever a user clicks on the add or remove button to add or remove a row on the form, the repeater is actually adding or removing a form entry for the embedded form.
In this article, we'll sometimes reference the repeater as the child form. The parent form is the form that displays the repeater's content.
Repeaters consist of a form section that functions as the container for the child form. The form section is a permanent part of the parent form. It has its own field id and key.
The data capture fields you add to the repeater section are actually being added to the child form. They aren't part of the parent form, other than in appearance. So in essence, when you add a repeater to your form, you are actually building two forms at once. Maybe more, if you have multiple repeaters.
When you view a form's source code in your browser, the id of the child form is stored in a hidden field beneath the section container and section title:
A Formidable Form's Source Code as Displayed in Firefox Inspector
Let's take a closer look at the source code below. The hidden field is on line 3. The child form's id is 6 (value="6"). You would use this form id if you search for data directly in the database with phpMyAdmin. Other than being found in this hidden field, the child form ID is not referenced again in the source code. It's only used with Formidable's back-end functions
<div id="frm_field_87_container" class="frm_form_field frm_section_heading form-field "> <h3 class="frm_pos_top frm_section_spacing">test field</h3> <input type="hidden" name="item_meta[87][form]" value="6" class="frm_dnc">
Further examination of the source code reveals that repeater data rows are appear as multidimensional arrays. A multidimensional array is an array containing one or more arrays. PHP understands multidimensional arrays that are two, three, four, five, or more levels deep. With our repeaters, each field in a repeater row is notated as a multidimensional array 3-levels deep.
As an example, let's say I have a repeatable section with an id of 87. There is a text field in this repeater with an id of 89. The source code for this input field as displayed in the browser is:
<input type="text" id="field_97w00-0" name="item_meta[87][0][89]" value="" data-invmsg="Text is invalid" data-sectionid="87">
Let's break this down so we can understand what we are seeing. The input type is standard for any text field. Next is the field's id as referenced by the DOM. The DOM id is different from the Formidable field id that you see when building a form. The id in the DOM is composed of the word "field" followed by an underscore "_" plus the Formidable field's key.
In the example above, the field key for field 89 is "97w00". Yet, you see there is also a "-0" appended to the end of the DOM id beginning with "field_97w00". What do you think this means?
DOM ids must be unique for all elements on a page. So, Formidable appends the repeater row id to the end of the DOM id to ensure its uniqueness.
Let's look at the input field name. This is the most critical attribute for us to understand. It lies at the heart of the jQuery function we're going to build. This is the reference to the multidimensional array that will be used on the back end. Each array element is wrapped in square brackets [].
The first dimension "[87]" is the link to the parent form. This is the field id of the repeatable section.
name="item_meta[87][0][89]"
The second dimension is the row id.
name="item_meta[87][0][89]"
The third dimension is the id of the field that stores the data.
name="item_meta[87][0][89]"
The first and third dimensions are static. They don't change as rows are added. The second dimension increments for every row that's added. Removing a row does not change row ids after they've been assigned in the DOM.
Arrays are always indexed from 0. The first row id is always 0 in an array. Now, if I add a row to the repeater, the text field on the new row is named:
name="item_meta[87][1][89]"
See how the row id increments?
The remaining properties for this input field are value, data-invmsg, and data-sectionid. Don't be concerned with these for now. They don't come into play with our jQuery function.
DOM Perspective
Repeaters are challenging to manipulate with jQuery because of how the DOM and jQuery work together. Normally, the first line in a jQuery function is:
jQuery(document).ready(function($) )
Translated into English, this means, "Don't apply the functions in this script until the DOM is ready, then execute this code and bind it to whatever elements it affects."
A page can't be manipulated safely until the document is "ready." jQuery detects this state of readiness for you. Code included inside $( document ).ready() will only run once the DOM is ready for JavaScript code to execute.
When the DOM is loaded and ready for a new form's entry, additional repeater rows don't exist yet, only the first row does. Therefore, the jQuery function is only bound to the first row. The jQuery only runs once when the DOM has reached its ready state. You can't bind code to elements that don't exist yet.
Adding rows to a repeater does not change the DOM's ready state. Once the DOM is loaded, it's always ready until the page is refreshed and reloaded. Because new repeater rows are added through jQuery Ajax calls and Ajax does not reload the page, the DOM doesn't get reloaded. It remains in its initial "ready" state and any jQuery associated with document ready will not refire. This means that code meant to manipulate a repeater row, will only continue to work on the first row.
If the entire page was refreshed and the DOM reloaded, the code would rebind to the new rows assuming the jQuery function references the HTML elements with wild cards or variables instead of direct field names.
It's not possible to know from the onset how many rows a user may add to a repeater. So, we have to figure out some way of counting how many repeater rows we have so we can make them work with our jQuery function.
Understanding how this all fits together reveals that the greatest challenge with repeater rows can be phrased as, "If the page doesn't get refreshed, how do we get our jQuery to refire as rows are added to a repeater?"
Writing code that works
Just as jQuery can detect the DOM's ready state, it can also detect other global states and events. The event we're going to rely upon for new repeater rows is ajaxComplete(). This function fires globally whenever an ajax call completes its duty. And since it's global, we can bind code to it in document ready. But what code do we bind to it?
We've already learned that code added to document ready fires when the DOM is loaded and ready to execute JavaScript. But that code only fires once. ajaxComplete() fires every time an Ajax call finishes its job.
We want the same code to run every time a form with a repeater is loaded and when a new row is added to a repeater. Following good coding practices, we would place this code into its own function so it can be executed upon document ready and ajaxComplete(). We'll call this function repeater_row_init(). As we begin to build our functions, the basic shell looks like this:
View the code on Gist.
Since it's possible that we could build a form with multiple repeater sections, it's a good idea to pass a repeater section id to the init function so we know which repeater to initialize. It's also a good idea to pass the section ids in an array so we can initialize all of the repeaters on our form at one time by looping through the array. Now our repeater_row_init function looks like this:
View the code on Gist.
If you'll notice when you read through the code, the repeater_row_init function is calling another function named repeater_section_87_init. This function is an element of the callbacks array. Here is how you create the callbacks array:
/* setup an array of repeater callback functions */ /* you'll want a different callback for each repeater section */ var callbacks = repeater_section_87_init : function() /* there's nothing in here yet */ ;
Let's build out the callback. This is where we have to traverse the DOM and find the right repeater rows to which to apply our code. A big challenge here occurs when you delete a row from a repeater. Normally, rows are added in numerical sequence. The first row is always 0. If we add a new row, it's 1, then 2, then 3, etc.
If all we were doing were adding rows it's not difficult to construct a loop and run through it by incremental counter. However, lets say we delete row 2. Row ids don't adjust for this. Our row ids will have a gap. The 0, 1, 2, 3 now becomes 0, 1, 3. You can't depend on an incremental counter loop when there is a gap in the numbers.
Moreover, when you delete a row from a repeater, Ajax is not invoked. So, there's no ajaxComplete() event to hook into. It doesn't matter, though. We can safely ignore delete events and there's no impact to our code if we do. Our only concern then is adding new rows.
This is the source code from a repeater field where I've deleted a row in the middle. There are 2 rows remaining: 0 and 2.
<div id="frm_field_87_container" class="frm_form_field frm_section_heading form-field "> <h3 class="frm_pos_top frm_section_spacing">test field</h3> <input type="hidden" name="item_meta[87][form]" value="6" class="frm_dnc"> <div id="frm_section_87-0" class="frm_repeat_sec frm_repeat_87 frm_first_repeat frm_grid_container"> <input type="hidden" name="item_meta[87][row_ids][]" value="0"> <input type="hidden" name="item_meta[87][0][0]" value=""> <div id="frm_field_89-87-0_container" class="frm_form_field form-field frm_top_container frm_field_89_container"> <label for="field_97w00-0" class="frm_primary_label">Text <span class="frm_required"></span> </label> <input type="text" id="field_97w00-0" name="item_meta[87][0][89]" value="" data-invmsg="Text is invalid" data-sectionid="87"> </div> <div class="frm_form_field frm_hidden_container frm_repeat_buttons frm "> <a href="#" class="frm_add_form_row frm_button" data-parent="87" aria-label="Add"><i class="frm_icon_font frm_plus_icon"> </i> Add</a> <a href="#" class="frm_remove_form_row frm_button frm_hidden" data-key="0" data-parent="87" aria-label="Remove"><i class="frm_icon_font frm_minus_icon"> </i> Remove</a> </div> </div> <div id="frm_section_87-2" class="frm_repeat_sec frm_repeat_87 frm_grid_container frm-fade-in"> <input type="hidden" name="item_meta[87][row_ids][]" value="2"> <input type="hidden" name="item_meta[87][2][0]" value=""> <div id="frm_field_89-87-2_container" class="frm_form_field form-field frm_top_container frm_field_89_container"> <label for="field_97w00-2" class="frm_primary_label">Text <span class="frm_required"></span> </label> <input type="text" id="field_97w00-2" name="item_meta[87][2][89]" value="" data-invmsg="Text is invalid" data-sectionid="87"> </div> <div class="frm_form_field frm_hidden_container frm_repeat_buttons frm "> <a href="#" class="frm_add_form_row frm_button" data-parent="87" aria-label="Add"><i class="frm_icon_font frm_plus_icon"> </i> Add</a> <a href="#" class="frm_remove_form_row frm_button" data-key="2" data-parent="87" aria-label="Remove"><i class="frm_icon_font frm_minus_icon"> </i> Remove</a> </div> </div> </div>
As we examine this source, we have to find an element that will clue us into the actual row id so we can determine that second dimension in the field name. There's only one element in this source code that contains the row id and it repeats for every row:
<input type="hidden" name="item_meta[87][row_ids][]" value="2">
This means we have to loop through these hidden fields, store their values, and pass those values back to the repeater section callback init function. To loop through the hidden fields and return the rowids, I've created a helper function called get_row_ids().
Good coding practice teaches that functions should only do one thing. To make sure get_row_ids() works correctly across any repeater field, we pass the section id as a parameter. Now our call back code looks like this:
/* setup an array of repeater callback functions */ /* you'll want a different callback for each repeater section */ var callbacks = repeater_section_87_init : function() var section_id = "87", rowids = get_row_ids( section_id ); /* now that we have the row ids for this section, we can apply the code to each of the correct elements */ ; function get_row_ids( section_id ) /* loop through the hidden fields that have the row_ids and push them into an array */ var row_ids = []; $('input[name^="item_meta[' + section_id + '][row_ids]"]').each(function(index, el) row_ids.push(el.value); ); /* return the rowi_ids array to the calling init function */ return row_ids;
The final initialization step is applying the code we want to each of the newly added repeater rows. For this example, we'll use a version of Mr. Jennings refactored code from the pastebin modified for our example form.
The last thing we have to wrap up is hooking the init into the ajax.Complete() function. For this, we have to know which repeater section invoked the Ajax call so we can execute the correct init callback.
Since ajaxComplete() fires globally for all Ajax calls, there has to be a way for us to determine which element on our page invoked the call. This part is very technical and requires a much deeper explanation than I want to provide in this article, but suffice it to say that you can find the repeater row id in the ajax.Complete() "event" object. It's nested 5-levels deep and not easy to find. Rather than explaining it all here, here's the code tied to ajax.Complete():
/* initialize the repeater for every added row */ $( document ).ajaxComplete( function( event, xhr, settings ) var complete_event = jQuery.makeArray(event); var active_elem = complete_event[0]['target']['activeElement']['dataset']['parent'], repeater_section = [active_elem]; if (active_elem == '87') repeater_row_init( repeater_section ); ); });
The completed code as written for the demo form below is:
View the code on Gist.
As with any other Formidable Forms custom jQuery scripts, insert your script into the After Fields section on your form's Customize HTML page.
Now, do you want to see it work?
Working Example
The Deductible dropdown as defined in the form has five values. When each row is initialized, you'll only see 3 options. If you select "Michigan" as the state, the Deductible dropdown will display 2 options. Choose any other state, and the options return to the original three. This will continue to work for all rows added to the repeater.
Demo for Repeaters and Complex jQuery Operations
If you are human, leave this field blank.
Repeater Section: id=511
State: id = 513 Alabama Alaska Arizona Arkansas California Colorado Connecticut Delaware District of Columbia Florida Georgia Hawaii Idaho Illinois Indiana Iowa Kansas Kentucky Louisiana Maine Maryland Massachusetts Michigan Minnesota Mississippi Missouri Montana Nebraska Nevada New Hampshire New Jersey New Mexico New York North Carolina North Dakota Ohio Oklahoma Oregon Pennsylvania Rhode Island South Carolina South Dakota Tennessee Texas Utah Vermont Virginia Washington West Virginia Wisconsin Wyoming
Deductible: id = 514 $7,500 / $10,000 $5,000 / $5,000 $2,500 / $15,000 $2,500 / $2,500 $5,000 / $5,000
Add Remove
jQuery(document).ready(function ($) "use strict"; /* setup our array of repeater section ids to pass to the repeater_row_init function */ var repeater_sections = ["511"]; /* setup an array of repeater callback functions */ /* you'll want a different callback for each repeater section */ var callbacks = repeater_section_511_init : function() var rowids = get_row_ids( '511' ), // get all of the row ids new_row_id = rowids[rowids.length-1]; // get the new row id, it will always be the last array index /* now that we have the row ids for this section, we can loop through the array and apply the code to each of the correct elements */ $.each(rowids, function( index, row_id ) /* the first time through, we have to make sure the CSS is set for newly added row */ /* nothing will have been selected yet and the drop down for field 513 will have no value */ if( row_id == new_row_id ) init_new_511_repeater_row( row_id ); $('select[name="item_meta[511][' + row_id + '][513]"]').on("change", function() var val1 = $(this).val(); /* clear the current val if another state had been selected previously */ $('select[name="item_meta[511][' + row_id + '][514]"]').val(""); if (val1 == 'Michigan') /* hide the values we don't want */ $('select[name="item_meta[511][' + row_id + '][514]"]').children('option[value="SWBC - 0.0"]').css('display','none'); $('select[name="item_meta[511][' + row_id + '][514]"]').children('option[value="FIC - 0.0"]').css('display','none'); $('select[name="item_meta[511][' + row_id + '][514]"]').children('option[value="Seattle - 0.002"]').css('display','none'); /* display the ones we do */ $('select[name="item_meta[511][' + row_id + '][514]"]').children('option[value="Seattle - 0.0"]').css('display',''); $('select[name="item_meta[511][' + row_id + '][514]"]').children('option[value="FIC - .003"]').css('display',''); else /* display the values we want to see */ $('select[name="item_meta[511][' + row_id + '][514]"]').children('option[value="SWBC - 0.0"]').css('display',''); $('select[name="item_meta[511][' + row_id + '][514]"]').children('option[value="FIC - 0.0"]').css('display',''); $('select[name="item_meta[511][' + row_id + '][514]"]').children('option[value="Seattle - 0.002"]').css('display',''); /* hide the values we don't want */ $('select[name="item_meta[511][' + row_id + '][514]"]').children('option[value="Seattle - 0.0"]').css('display','none'); $('select[name="item_meta[511][' + row_id + '][514]"]').children('option[value="FIC - .003"]').css('display','none'); ); ); ; function init_new_511_repeater_row( row_id ) /* display the values we want to see */ $('select[name="item_meta[511][' + row_id + '][514]"]').children('option[value="SWBC - 0.0"]').css('display',''); $('select[name="item_meta[511][' + row_id + '][514]"]').children('option[value="FIC - 0.0"]').css('display',''); $('select[name="item_meta[511][' + row_id + '][514]"]').children('option[value="Seattle - 0.002"]').css('display',''); /* hide the values we don't want */ $('select[name="item_meta[511][' + row_id + '][514]"]').children('option[value="Seattle - 0.0"]').css('display','none'); $('select[name="item_meta[511][' + row_id + '][514]"]').children('option[value="FIC - .003"]').css('display','none'); function get_row_ids( section_id ) /* loop through the hidden fields that have the row_ids and push them into an array */ var row_ids = []; $('input[name^="item_meta[' + section_id + '][row_ids]"]').each(function(index, el) row_ids.push(el.value); ); /* return the rowi_ids array to the calling init function */ return row_ids; /* This is our init function */ /* the repeater_section parameter is an array of repeater section ids */ function repeater_row_init( repeater_section ) /* loop through the repeater_section array and initialize each repeater row */ $.each(repeater_section, function( index, val ) /* construct the callback function name */ var fnName = "repeater_section_" + val + "_init"; /* invoke the appropriate callback function, don't use eval here */ callbacks[fnName](); ); /* initialize the repeater for the initial load */ repeater_row_init( repeater_sections ); /* initialize the repeater for every added row */ $( document ).ajaxComplete( function( event, xhr, settings ) var complete_event = jQuery.makeArray(event); var active_elem = complete_event[0]['target']['activeElement']['dataset']['parent'], repeater_section = [active_elem]; if (active_elem == '511') repeater_row_init( repeater_section ); ); );
Submit
0 notes
Text
Using MySQL Database Service for WordPress
Today we will see how to use MySQL Database Service aka MDS with WordPress. To achieve this easy task, we will use the architecture we already deployed in this article. We have then two Compute Instances on OCI, 1 running WordPress (Apache and PHP) and one running MySQL 8.0. The Plan This is how we will proceed to migrate to MDS with minimal maintenance time, we will: create a MDS instance verify if the database is ready to act as replication source dump the MySQL instance running on OCI for being migrated to MDS. load the dump in MDS create a user dedicated to the replication create a replication channel on MDS (from OCI to MDS) modify WordPress config to point to MDS Create a MDS instance The first step is of course to connect to OCI’s dashboard. We should see our two running compute instances: Let’s now create the MySQL Database Service instance, you will find the service in the left column; Now we just follow the creation wizard that is very simple: It’s very important to create an admin user (the name can be whatever you want) and don’t forget the password. We will put our service in the private subnet we created earlier (see also this post): The last screen of the wizard is related to the automatic backups: The MDS instance will be provisioned after a short time and you can see that in its detailed view: All good for step 1, we can now proceed with the second one. Verify our database to act as replication source We now connect to our current MySQL running on OCI and verify that all settings required to replication with GTID are in place. mysql> select @@gtid_mode; +-------------+ | @@gtid_mode | +-------------+ | OFF | +-------------+ 1 row in set (0.00 sec) By default GTID mode is disabled and we need to enable it. To be able to perform this operation without restarting the MySQL instance, this is how to proceed: mysql> SET PERSIST server_id=1; mysql> SET PERSIST enforce_gtid_consistency=true; mysql> SET PERSIST gtid_mode=off_permissive; mysql> SET PERSIST gtid_mode=on_permissive; mysql> SET PERSIST gtid_mode=on; mysql> select @@gtid_mode; +-------------+ | @@gtid_mode | +-------------+ | ON | +-------------+ All good now ! MySQL Shell Dump & Load Instead of using mysqldump or mysqlpump that are not efficient in case of large dataset and are certainly not optimized for Cloud, we will use the new amazing feature of MySQL Shell (since 8.0.21): Dump & Load. Please check those links for more details: https://docs.cloud.oracle.com/en-us/iaas/mysql-database/doc/importing-and-exporting-databases.html https://mysqlserverteam.com/mysql-shell-dump-load-part-1-demo/ https://mysqlserverteam.com/mysql-shell-dump-load-part-2-benchmarks/ https://mysqlserverteam.com/mysql-shell-dump-load-part-3-load-dump/ https://mysqlserverteam.com/mysql-shell-8-0-21-speeding-up-the-dump-process/ We connect in ssh to our MySQL instance in OCI and we can start the dump. There are multiple ways to perform such operation. As my WordPress dataset is not so large and already in the cloud, I use the filesystem. If it was on premise with a large dataset I would have used Object Store. I start MySQL Shell and connect to my MySQL instance on OCI (the one WordPress is using for the moment). As I’m connected via ssh on the server, I use localhost to connect using Shell: $ mysqlsh root@localhost And now I just dump my instance. As I know this dump will be used to be loaded in MDS, I will add some options: MySQL localhost:33060+ ssl JS > util.dumpInstance('file://dump', {ocimds: true, compatibility: ["strip_restricted_grants"]}) This is the full output of the command: Checking for compatibility with MySQL Database Service 8.0.21 NOTE: User root@localhost had restricted privileges (RELOAD, FILE, SUPER, BINLOG_ADMIN, SET_USER_ID) removed NOTE: Database wordpress had unsupported ENCRYPTION option commented out Compatibility issues with MySQL Database Service 8.0.21 were found and repaired. Please review the changes made before loading them. Acquiring global read lock All transactions have been started Locking instance for backup Global read lock has been released Writing global DDL files Writing users DDL Preparing data dump for table wordpress.wp_commentmeta Writing DDL for schema wordpress Writing DDL for table wordpress.wp_commentmeta Data dump for table wordpress.wp_commentmeta will be chunked using column meta_id Preparing data dump for table wordpress.wp_comments Data dump for table wordpress.wp_comments will be chunked using column comment_ID Preparing data dump for table wordpress.wp_links Data dump for table wordpress.wp_links will be chunked using column link_id Preparing data dump for table wordpress.wp_options Data dump for table wordpress.wp_options will be chunked using column option_id Preparing data dump for table wordpress.wp_postmeta Data dump for table wordpress.wp_postmeta will be chunked using column meta_id Preparing data dump for table wordpress.wp_posts Data dump for table wordpress.wp_posts will be chunked using column ID Preparing data dump for table wordpress.wp_term_relationships Data dump for table wordpress.wp_term_relationships will be chunked using column object_id Preparing data dump for table wordpress.wp_term_taxonomy Data dump for table wordpress.wp_term_taxonomy will be chunked using column term_taxonomy_id Preparing data dump for table wordpress.wp_termmeta Data dump for table wordpress.wp_termmeta will be chunked using column meta_id Preparing data dump for table wordpress.wp_terms Data dump for table wordpress.wp_terms will be chunked using column term_id Preparing data dump for table wordpress.wp_usermeta Writing DDL for table wordpress.wp_comments Writing DDL for table wordpress.wp_links Writing DDL for table wordpress.wp_options Data dump for table wordpress.wp_usermeta will be chunked using column umeta_id Preparing data dump for table wordpress.wp_users Data dump for table wordpress.wp_users will be chunked using column ID Running data dump using 4 threads. NOTE: Progress information uses estimated values and may not be accurate. Writing DDL for table wordpress.wp_postmeta Writing DDL for table wordpress.wp_posts Writing DDL for table wordpress.wp_term_relationships Writing DDL for table wordpress.wp_term_taxonomy Writing DDL for table wordpress.wp_termmeta Writing DDL for table wordpress.wp_terms Writing DDL for table wordpress.wp_usermeta Writing DDL for table wordpress.wp_users Data dump for table wordpress.wp_commentmeta will be written to 1 file Data dump for table wordpress.wp_comments will be written to 1 file Data dump for table wordpress.wp_links will be written to 1 file Data dump for table wordpress.wp_postmeta will be written to 1 file Data dump for table wordpress.wp_options will be written to 1 file Data dump for table wordpress.wp_term_taxonomy will be written to 1 file Data dump for table wordpress.wp_term_relationships will be written to 1 file Data dump for table wordpress.wp_terms will be written to 1 file Data dump for table wordpress.wp_posts will be written to 1 file Data dump for table wordpress.wp_termmeta will be written to 1 file Data dump for table wordpress.wp_users will be written to 1 file Data dump for table wordpress.wp_usermeta will be written to 1 file 1 thds dumping - 110% (2.22K rows / ~2.00K rows), 0.00 rows/s, 0.00 B/s uncompressed, 0.00 B/s compressed Duration: 00:00:00s Schemas dumped: 1 Tables dumped: 12 Uncompressed data size: 1.49 MB Compressed data size: 341.04 KB Compression ratio: 4.4 Rows written: 2216 Bytes written: 341.04 KB Average uncompressed throughput: 1.49 MB/s Average compressed throughput: 341.04 KB/s We can now load that dump to our MDS Instance easily. From MySQL Shell we connect to our instance using the IP we have in the detailed view or using the name we gave it during setup: MySQL localhost:33060+ ssl JS > c [email protected] Creating a session to '[email protected]' Please provide the password for '[email protected]': *** Save password for '[email protected]'? [Y]es/[N]o/Ne[v]er (default No): y Fetching schema names for autocompletion… Press ^C to stop. Closing old connection… Your MySQL connection id is 9 (X protocol) Server version: 8.0.21-u1-cloud MySQL Enterprise - Cloud No default schema selected; type use to set one. Perfect ! We can start the load: MySQL 10.0.1.9:33060+ ssl JS > util.loadDump('file://dump') Loading DDL and Data from 'file://dump' using 4 threads. Target is MySQL 8.0.21-u1-cloud. Dump was produced from MySQL 8.0.21 Checking for pre-existing objects… Executing common preamble SQL Executing DDL script for schema wordpress Executing DDL script for wordpress.wp_users Executing DDL script for wordpress.wp_usermeta Executing DDL script for wordpress.wp_links Executing DDL script for wordpress.wp_options Executing DDL script for wordpress.wp_termmeta Executing DDL script for wordpress.wp_comments Executing DDL script for wordpress.wp_commentmeta Executing DDL script for wordpress.wp_postmeta Executing DDL script for wordpress.wp_term_taxonomy Executing DDL script for wordpress.wp_term_relationships Executing DDL script for wordpress.wp_posts Executing DDL script for wordpress.wp_terms [Worker003] wordpress@wp_options@@0.tsv.zst: Records: 128 Deleted: 0 Skipped: 0 Warnings: 0 [Worker003] wordpress@wp_usermeta@@0.tsv.zst: Records: 18 Deleted: 0 Skipped: 0 Warnings: 0 [Worker003] wordpress@wp_term_relationships@@0.tsv.zst: Records: 177 Deleted: 0 Skipped: 0 Warnings: 0 [Worker003] wordpress@wp_users@@0.tsv.zst: Records: 1 Deleted: 0 Skipped: 0 Warnings: 0 [Worker003] wordpress@wp_terms@@0.tsv.zst: Records: 1 Deleted: 0 Skipped: 0 Warnings: 0 [Worker003] wordpress@wp_term_taxonomy@@0.tsv.zst: Records: 1 Deleted: 0 Skipped: 0 Warnings: 0 [Worker002] wordpress@wp_comments@@0.tsv.zst: Records: 201 Deleted: 0 Skipped: 0 Warnings: 0 [Worker001] wordpress@wp_postmeta@@0.tsv.zst: Records: 1266 Deleted: 0 Skipped: 0 Warnings: 0 [Worker000] wordpress@wp_posts@@0.tsv.zst: Records: 423 Deleted: 0 Skipped: 0 Warnings: 0 Executing common postamble SQL 9 chunks (2.22K rows, 1.49 MB) for 9 tables in 1 schemas were loaded in 1 sec (avg throughput 1.49 MB/s) 0 warnings were reported during the load. Et voilà ! All is imported. In MDS with MySQL Shell 8.0.21, loading users can be problematic. You can try with {loadUsers: true} but it will fails for the user root. In 8.0.22, you will have to possibility to exclude or include some users. Therefor, in our case the wp user needs to be created manually in MDS (you will find the statements in the dump @.users.sql file. If you are a specialist of MySQL Replication, you already noticed that we are missing on important thing to after have loaded the dump. We still need to set the GTID purged information from when the dump was taken. In MDS, this operation can be achieved calling a dedicated procedure called sys.set_gtid_purged() Now let’s find the value we need to add there. The value of GTID executed from the dump is written in the file @.json in the dump directory: $ cat dump/@.json | grep gtidEx "gtidExecuted": "7c9286c7-dd49-11ea-8564-020017013873:1-369", Now that we know the value, we can specify it in our MDS instance: MySQL 10.0.1.9:33060+ ssl JS > sql call sys.set_gtid_purged("7c9286c7-dd49-11ea-8564-020017013873:1-369") Replication user creation On the production MySQL (the one still running on the OCI compute instance), we need to create a user dedicated to replication: mysql> CREATE USER 'repl'@'10.0.1.%' IDENTIFIED BY 'C0mpl1c4t3d!Paddw0rd' REQUIRE SSL; mysql> GRANT REPLICATION SLAVE ON *.* TO 'repl'@'10.0.1.%'; Create the replication channel We go back on OCI’s dashboard and in our MDS instance’s details page, we click on Channels: We now create a channel and follow the wizard: We use the credentials we just created and as hostname we put or the IP or the fqdn of the compute instance. After a little while, the channel will be created and in MySQL Shell when connected to your MDS instance, you can see that replication is running: I invite you to use this query to have all the information you need (cut and paste it ): SELECT concat(conn_status.channel_name, ' (', worker_id,')') AS channel, conn_status.service_state AS io_state, applier_status.service_state AS sql_state, format_pico_time(if(GTID_SUBTRACT(LAST_QUEUED_TRANSACTION, LAST_APPLIED_TRANSACTION) = "","0", abs(time_to_sec(if(time_to_sec(APPLYING_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP)=0,0, timediff(APPLYING_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP,now()))))) * 1000000000000) latency, format_pico_time((LAST_QUEUED_TRANSACTION_START_QUEUE_TIMESTAMP - LAST_QUEUED_TRANSACTION_ORIGINAL_COMMIT_TIMESTAMP) * 100000000000) transport_time, format_pico_time((LAST_QUEUED_TRANSACTION_END_QUEUE_TIMESTAMP - LAST_QUEUED_TRANSACTION_START_QUEUE_TIMESTAMP) * 1000000000000) time_to_relay_log, format_pico_time((LAST_APPLIED_TRANSACTION_END_APPLY_TIMESTAMP - LAST_APPLIED_TRANSACTION_START_APPLY_TIMESTAMP) * 1000000000000) apply_time, conn_status.LAST_QUEUED_TRANSACTION AS last_queued_transaction, applier_status.LAST_APPLIED_TRANSACTION AS last_applied_transaction FROM performance_schema.replication_connection_status AS conn_status JOIN performance_schema.replication_applier_status_by_worker AS applier_status ON applier_status.channel_name = conn_status.channel_name ; This is an example of the output: Point WordPress to MDS Now you need to change the location of your MySQL Server in WordPress. If you prefer you can put WordPress in Maintenance Mode (there are few plugins to do that) or just change the wp-config.php file immediately. You can of course wait a but to see how MDS behave and to get familiar with it. Replication is setup and running. When you are ready, just make the change. In my case I need to replace /** MySQL hostname */ define( 'DB_HOST', '10.0.1.5' ); by /** MySQL hostname */ define( 'DB_HOST', '10.0.1.9' ); And that’s it ! Wooohoooo, it works o/ We are now running WordPress with MDS ! After, you can stop the replication channel and terminal the MySQL Compute Instance. https://lefred.be/content/using-mysql-database-service-for-wordpress/
0 notes