Full Trust European Hosting

BLOG about Full Trust Hosting and Its Technology - Dedicated to European Windows Hosting Customer

AngularJS Hosting Europe - HostForLIFE.eu :: Angular Data Binding

clock October 16, 2020 07:42 by author Peter

Binding is basically the process of connecting data between the view of your application and it's code behind.
In Angular, the view of the application is the HTML page and the code behind is the Component class written in typescript code.
 
There are different types of data binding in Angular,
 
Component to View using interpolation
This is one of the ways of bindings provided by the Angular framework. For this one, we need to have a class level property in our Component class which we use in our HTML using double curly braces.
 
For example, the below code snippet shows a piece of code in the component class. There are 3 properties: department, imgURL and
showspinner, out of which imgURL and showspinner are already initialized, whereas department is just declared.
    department: Any;  
    imgURL: string = "assets/photos/Department.jpg";  
    showSpinner: boolean = false;   


In our HTML file, these properties are used inside double curly braces to render these values directly on the browser. In our case, the imgURL represents the source of the image so that has to be used in the below manner, as shown in the below code snippet.
    <image src = {{imgURL}} >  

When the application gets rendered on the browser, {{imgURL}} gets replaced by assets/photos/Department.jpg.
 
In the real time application, this property is initialized dynamically at runtime.
 
Component to View using property binding
Just like interpolation, this is another type of one way binding. Just like the prior one, in property binding also, we need a class level property that has to be bound with an HTML control on the View. However, the syntax is a little different.
 
Let's use the same example to apply to property binding.
    department: Any;  
    imgURL: string = "assets/photos/Department.jpg";  
    showSpinner: boolean = false;  

To use the property binding we need to use the below syntax. We need to enclose the property of the HTML control inside the square braces and enclose the Component property inside the quotes.
    <image [src] = 'imgURL' >  

Note
While rendering the data on UI, interpolation converts the data into string, whereas property binding does not change the type and renders it as it is.
 
View to Component using event binding
 
This type of binding is used to bind data from View to Component i.e. from the HTML page to the Component class. This one is similar to the events of simple javascript. It can either be a simple click event, a keyup, or any other. The only difference is that the events in Angular have to be put inside circular braces, the rest all is same.
 
As shown in the below code snippet, there are 3 buttons with their respective click events. The methods handling those events are in the code behind file.
    <button (click) = 'addDepartment()' >Add </button>  
    <button (click) = 'editDepartment()' >Edit </button>  
    <button (click) = 'deleteDepartment()' >Delete </button>  

To Bind View and Component Simultaneously (two-way binding)
 
This type of binding is a little different from other frameworks. The two-way binding keeps the property in the Component class and the value of the HTML control in sync. Whenever we change the value of HTML control, the value of the property of the Component class also
changes.
 
To implement this type of binding in Angular, we use a special directive with a little bit different of a syntax.
    <input required [(ngModel)] = 'departmentName' name = 'departmentName' >  

As you can see in the above code snippet, a directive ngModel has been used inside 2 types of braces. The two braces signify two different bindings. The square brace is for property binding that we discussed as the second type and the circular is for event binding, the third one
that we discussed.
 
Lets talk a little about this textbox, whenever there is any change in the value of this textbox an event gets triggered, and by means of the event binding the value gets passed to the Component property and it gets updated and similarly whenever there is any change in the property value, the value of the textbox will also get updated by means of property binding.

The Component property associated with this textbox in the above code is departmentName.
 
Take an example, when we are fetching some data by making an API call, at the beginning the textbox won't have any value but as soon as the value of the property in the Component class gets updated, the value of textbox will also get updated simultaneously.
 
Note
In order to use [(ngModel)] for two-way binding, the name attribute is a must. The Angular framework internally uses the name attribute to map the value of HTML control with the Component property.

HostForLIFE.eu AngularJS Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.

 



European Visual Studio 2017 Hosting - HostForLIFE.eu :: Exporting Comments In Visual Studio

clock October 15, 2020 10:08 by author Peter

In this blog, we will be talking about how transactions take place in Entity Framework. DbContext.Database.BeginTransaction() method creates a new transaction for the underlying database and allows us to commit or roll back changes made to the database using multiple SaveChanges method calls.

The following example demonstrates creating a new transaction object using BeginTransaction(), which is, then, used with multiple SaveChanges() calls.

using(var context = new SchoolContext()) { 
using(DbContextTransaction transaction = context.Database.BeginTransaction()) { 
    try { 
        var standard = context.Standards.Add(new Standard() { 
            StandardName = "1st Grade" 
        }); 
        context.Students.Add(new Student() { 
            FirstName = "Rama2", 
                StandardId = standard.StandardId 
        }); 
        context.SaveChanges(); 
        context.Courses.Add(new Course() { 
            CourseName = "Computer Science" 
        }); 
        context.SaveChanges(); 
        transaction.Commit(); //save the changes 
    } catch (Exception ex) { 
        transaction.Rollback(); //rollback the changes on exception 
        Console.WriteLine("Error occurred."); 
    } 

In the above example, we created new entities - Standard, Student, and Course and saved these to the database by calling two SaveChanges(), which execute INSERT commands within one transaction.

If an exception occurs, then the whole changes made to the database will be rolled back.

I hope it's helpful.



Windows Server 2016 SSD Hosting - - HostForLIFE.eu :: Dedicated Servers As The Secured Solutions

clock September 25, 2020 09:16 by author Peter

When it comes to the option of dedicated servers, you may find it costly in comparison to other web hosting options. But ultimately, the choice is worth making because plenty of commercial benefits are integrated into this web hosting plan. Let’s see how it is a better option than others web hosting plans.

Better uptime
In dedicated hosting arrangements, the service provider reserves the SLA,  including the solution of hardware failure. The service provider maintains a support team for 24x7. With expert skill sets and ITIL complaint methods you can be sure about a high uptime.

Cost efficiency
This is a cost efficient option. According to the plan, a dedicated hosting service provider is responsible for upgradates and maintenance of hardware for maintaining connectivity, and for offering a friendly physical environment. Under this plan, you as a user have no obligation to pay for the total server room or for employing a service administrator. Under this plan you have to pay for the services you will be using.

Reliable bandwidth
Under this web hosting plan you will get to enjoy higher internet speed. There is no chance to lose the speed as there is no risk of sharing the connection. This will help in faster communication, upload management, and uninterrupted business presence.

Complete control on applications
If you select dedicated web hosting, you will enjoy a complete monopoly of decisions about using site management tools and allied other applications to boost your hosting environment. However, about the tools, you need to get prior approval from your hosting service provider that they will be able to give you backend support to maintain them.

Better security arrangement
Dedicated hosting service offers uninterrupted access to physical server. The security arrangement includes supervision cameras, Biometric Access Control System, round-the-clock patrolling, etc. for improved security. Advanced service providers often provide additional supports like DDos guard, web application firewall, VAPT, and security event management.

These reasons can clearly  justify why Dedicated Server is a better option. It is clearly understood that although expensive, this category of web hosting service offers excellent ROI (Return over investment).



AngularJS Hosting Europe - HostForLIFE.eu :: How to Create Strong Password for AngularJS Pages?

clock September 18, 2020 08:28 by author Peter

In this post, let me explain you how to create strong password for AngularJS. For choosing a password we need combination of special characters, Capital letter , small letters, digits etc to make it strong. Write the following code:

    <!DOCTYPE html> 
    <html> 
    <head> 
        <title>Strong Password for Angular UI Pages</title>            
        <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.3.8/angular.min.js"></script>   
        <script> 
            var app = angular.module("myApp", []); 
            app.controller("myCtrl", function ($scope) {        
                var strongRegularExp = new RegExp("^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})");        
                var mediumRegularExp = new RegExp("^(((?=.*[a-z])(?=.*[A-Z]))|((?=.*[a-z])(?=.*[0-9]))|((?=.*[A-Z])(?=.*[0-9])))(?=.{6,})");        
                $scope.checkpwdStrength = { 
                    "width": "150px", 
                    "height": "25px", 
                    "float": "right" 
                };        
                $scope.validationInputPwdText = function (value) { 
                    if (strongRegularExp.test(value)) { 
                        $scope.checkpwdStrength["background-color"] = "green"; 
                        $scope.userPasswordstrength = 'You have a Very Strong Password now'; 
                    } else if (mediumRegularExp.test(value)) { 
                        $scope.checkpwdStrength["background-color"] = "orange"; 
                        $scope.userPasswordstrength = 'Strong password, Please give a very strong password';  
                    } else { 
                        $scope.checkpwdStrength["background-color"] = "red"; 
                        $scope.userPasswordstrength = 'Weak Password , Please give a strong password'; 
                    }                  
};        
           }); 
        </script> 
    </head> 
    <body ng-app="myApp"> 
        <div ng-controller="myCtrl" style="border:5px solid gray; width:800px;"> 
            <div> 
                <h3>Strong Password for Angular UI Pages </h3> 
            </div> 
            <div style="padding-left:25px;">                  
<div ng-style="checkpwdStrength"></div> 
                <input type="password" ng-model="userPassword" ng-change="validationInputPwdText(userPassword)" class="class1" /> 
                <b> {{userPasswordstrength}}</b> 
            </div> 
            <br /> 
            <br /> 
            <br /> 
        </div> 
    </body> 
    </html> 

HostForLIFE.eu AngularJS Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.



European Ajax Hosting UK - HostForLIFE.eu :: How to Make Custom Alert Message with Ajax?

clock September 4, 2020 07:56 by author Peter

In this article, we are going to learn how to make custom Alert Message with Ajax. Some time we needed to make clone of windows alert message, however that alert message isn't permitting to change the header text. Here using Ajax model popup extender i'll show you how to make custom message box:
Add the user control file and ajaxtoolkit reference in your project.

Write the following code in ascx file.
<style type="text/css">
.MessageBoxPopUp
{
background-color:White;
border:solid 2px #99B4D1;
}

.MessageBoxButton
{
background-color: #A0A0A0;
border: solid 2px #B4B4B4;
color: Black;
font-weight:bold;
font-family:Verdana;
font-size:9pt;
cursor:pointer;
height: 20px;
width:70px;
display:none;
}
.MessageBoxHeader
{
height:17px;
font-size:10pt;
color:White;
font-weight:bold;
font-family:Verdana;
text-align:Left;
vertical-align:middle;
padding:3px 3px 3px 3px;
background-color:#3399FF;
border-bottom:2px solid #B4B4B4;
}
.MessageBoxData
{
height:20px;
font-size:8pt;
font-family:Verdana;
color:#3A4349;
text-align:Left;
vertical-align:top;
}
</style>
<script type="text/javascript">
function closeModelPopup(btn) {
// var mpe = document.getElementById("<%= mpeMessageBox.ClientID %>");
$find('mpeFirmMessageBox').hide();
}
</script>

<cc1:ModalPopupExtender ID="mpeMessageBox" runat="server" DynamicServicePath="" Enabled="True"
TargetControlID="btnTemp" PopupControlID="pnlMessageBox" BackgroundCssClass="modal"
PopupDragHandleControlID="pnlMessageBox" CancelControlID="btnCancel" BehaviorID="mpeFirmMessageBox">
</cc1:ModalPopupExtender>

<asp:Panel ID="pnlMessageBox" runat="server" Style="display: none; width: 300px;
height: 140px;" class="MessageBoxPopUp">
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr class="MessageBoxHeader" style="height: 17px;">

<td colspan="2">
    <asp:Label ID="lblHeader" runat="server"></asp:Label>
</td>

<td align="right" style="padding: 2px 2px 0px 0px;">
    <%--<asp:UpdatePanel ID="upnCloseMessageBox" runat="server">
        <ContentTemplate>--%>
            <asp:ImageButton ID="imgBtnClose" runat="server" ImageUrl="~/Image/close_icon.png"
                 OnClientClick="closeModelPopup(this)" />
        <%--</ContentTemplate>
    </asp:UpdatePanel>--%>
</td>
</tr>

<tr>
<td colspan="2" style="height: 5px;">
</td>
</tr>
<tr style="height: 88px;">

<td style="vertical-align: top; padding-left: 5px;">
    <asp:Image ID="imgInfo" runat="server" ImageUrl="~/Image/information-balloon.png" Width="40px" />
</td>

<td class="MessageBoxData" colspan="2" style=" padding: 10px 5px 5px 5px;">
    <asp:Label ID="lblMessage" runat="server"></asp:Label>
</td>

</tr>
<tr style="vertical-align: bottom; height: 20px; padding: 0px 5px 5px 0px;">
<td style="width: 40px;">
</td>
<td align="right" style="width: 180px">
    <asp:Button ID="btnOk" runat="server" CssClass="MessageBoxButton" />
</td>

<td align="right">
    <asp:Button ID="btnCancel" runat="server" CssClass="MessageBoxButton" />
</td>
</tr>
</table>
</asp:Panel>

Now, add the following code in .cs file
public delegate void delegate_OkClick();
public event delegate_OkClick OnOkClick;
public string Header
{
set { lblHeader.Text = value; }
//set { lblHeader.InnerHtml = value; }
}

public string Message
{
set { lblMessage.Text = value; }
}

public Button CancelButton
{
get { return btnCancel; }
}

public Button OkButton
{
get { return btnOk; }
}

public AjaxControlToolkit.ModalPopupExtender MessageBox
{
get { return mpeMessageBox; }
}

protected void Page_Load(object sender, EventArgs e)
{
}

protected void btnOk_OnClick(object sender, EventArgs e)
{
//raise the event if not null
if (OnOkClick != null)
OnOkClick();
}
public void displayMessage(string message)
{
displayMessage(message, null);
}
public void displayMessage(string message, int? type)

{

lblHeader.Text = "Alert Message";
//lblHeader.InnerHtml = title;
lblMessage.Text = message;
btnCancel.Attributes["style"] = "display:block";
btnCancel.Text = "Ok";
mpeMessageBox.Show();
}


Your message box is ready, now you need to call from the aspx page where ever you need to show the message.
You need to add below line of code in
<%@ Register Src="~/Control/Alert.ascx" TagName="MessageBox" TagPrefix="mb" %>
<asp:ScriptManager runat="server" ID="s"></asp:ScriptManager>
<mb:MessageBox ID="ucMessageBox" runat="server"></mb:MessageBox>

And from the code behind cal the display message write the following code:
protected void btnClick_OnClik(object sender, EventArgs e)
{
ucMessageBox.displayMessage("Alert from Code");
}

HostForLIFE.eu AJAX Hosting
HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes. We have customers from around the globe, spread across every continent. We serve the hosting needs of the business and professional, government and nonprofit, entertainment and personal use market segments.



European WCF Hosting - HostForLIFE.eu :: Why Should We Use WCF?

clock August 28, 2020 07:58 by author Peter

What is WCF?
WCF stands for ‘Windows Communication Foundation’. It is a Microsoft platform for building distributed and interoperable applications.

What is a distributed application?
A distributed application is an application where part of it runs on two or more computer nodes. Distributed applications are called ‘Connected systems’ also.

Now, let us see the above diagram where a Windows application is stored on one computer and the web service that it is consuming is running on another computer (which can be situated anywhere in the world). Well, this is a connected system.

Why build distributed applications?
    Interdependency
    An enterprise application may need to use the service provide by other enterprise, For example, an ecommerce application using Paytm for payments.

    For better scalability
    Scalability of an application implies the number of visitors an application can handle without degrading the performance. We can break down the application into different layers that run on different computers. Each of these computers will have its own memory and processor, which helps with improving the scalability of the application.

What is an interoperable application?
An application that can communicate with any other application that is built on any platform is called an interoperable application. Web Services can communicate with any application built on any platform, whereas .NET remoting service can be consumed only by another .NET application.

Why should we use WCF?

Without WCF,

Consider a situation where we have 2 clients and we need to implement a service for them.

The first client is using a Java application to interact with our services. This client wants a message to be in XML format and the protocol to be in HTTP. Without WCF, to satisfy the first client requirement, we will have to create an ASMX web service.


The second Client is using .NET and for better performance, this client wants a message format in binary format and protocol to be in TCP. Without WCF, to satisfy the second client requirement, we will create a .NET Remoting service.

 

.NET remoting and ASMX are two different technologies, and have completely different programming models. Therefore, developers have to learn two different technologies, which is not only time and cost consuming but needs two people with expertise.

So to unite and bring all these communication technologies under one roof, Microsoft has come up with a single programming model that is called WCF. WCF is going to unify everything, such as .NET Remoting, IPC, MSMQ queue, TCP, Peer networking, and all other communication technologies we have.

With WCF
With WCF, for both the clients, we will implement only one service and to satisfy the requirement of different clients, we will configure different end points.

What Is WCF? Why Should We Use WCF?
Here, the first endpoint will transport a message in XML format over HTTP protocol and the second endpoint will transport the message in binary format over TCP protocol. Here, we don’t need to change the service code to configure these endpoints. Now, if we have a third client who needs a binary message over HTTP protocol, to satisfy that client requirement, all we need to do is to create a new endpoint.

So, we have a single service but then to satisfy the requirements of different clients, we are creating/configuring different endpoints.



European PHP Hosting - HostForLIFE.eu :: MySQL PHP MVC CRUD Without Framework

clock August 14, 2020 12:50 by author Peter

This tutorial is for beginners or students. I created a functionality to add, edit and delete a record in PHP with MVC logic without Framework. Also,  explained how to create an MVC pattern in PHP. I hope it will be helpful for you to add a data table in your program.

Building Our MVC Framework Pattern in PHP
You might be wondering why we would even need to create our own framework when there are already so many good choices out there. The reason for this is so that we can gain an understanding of the underlying principles of MVC.

As we learn more about these principles, we will grow in our understanding of why the excellent MVC frameworks do things the way they do. We are not learning how to create an application in Zend Framework, or in CakePHP. We are learning how MVC works, and by extension, how these frameworks have built upon (or deviated from) the way in which we would expect an MVC framework to be built.
Section 1

Config.php is used to connect the mysql database to create a connection parameter for mysql host,user,password and database name.
<?php 
class config   
{    
function __construct() { 
$this->host = "localhost"; 
$this->user  = "root"; 
$this->pass = "welcome"; 
$this->db = "mydb13"; 


?> 


A small part of the code in index.php is used to setup a controller object and call mvcHandler() to view the default page list.php.
<?php 
session_unset(); 
require_once  'controller/sportsController.php';         
$controller = new sportsController();    
$controller->mvcHandler(); 
?> 


In the model folder, create one class for table structure, its named sports and has field and message field to hold messages and data.
<?php 
class sports 

// table fields 
public $id; 
public $category; 
public $name; 
// message string 
public $id_msg; 
public $category_msg; 
public $name_msg; 
// constructor set default value 
function __construct() 

$id=0;$category=$name=""; 
$id_msg=$category_msg=$name_msg=""; 


?> 


Section 2
The second section is a sportsModel class structure. We are going to explain and show insertRecord(), updateRecord(),selectRecord() and insertRecord(). The sportsModel class is used to access the function sportsController. The sportsModel class constructor receives a mysql connection parameter to work with the database.
<?php 

class sportsModel 

// set database config for mysql 
function __construct($consetup) 

$this->host = $consetup->host; 
$this->user = $consetup->user; 
$this->pass =  $consetup->pass; 
$this->db = $consetup->db;                                 

// open mysql data base 
public function open_db() 

$this->condb=new mysqli($this->host,$this->user,$this->pass,$this->db); 
if ($this->condb->connect_error)  

die("Erron in connection: " . $this->condb->connect_error); 


// close database 
public function close_db() 

$this->condb->close(); 

// insert record 
public function insertRecord($obj){ } 
//update record 
public function updateRecord($obj){ } 
// delete record 
public function deleteRecord($id){ }    
// select record      
public function selectRecord($id){ } 


?> 


Section 3
Section 3 is the controller code part. The sportsController has mvcHandler() and the CRUD functions insert(), update(),delete() and list(). mvcHandler() receives request and execute. This request shows views according to call request by user.
// insert record 
public function insertRecord($obj) 

try 
{    
    $this->open_db(); 
    $query=$this->condb->prepare("INSERT INTO sports (category,name) VALUES (?, ?)"); 
    $query->bind_param("ss",$obj->category,$obj->name); 
    $query->execute(); 
    $res= $query->get_result(); 
    $last_id=$this->condb->insert_id; 
    $query->close(); 
    $this->close_db(); 
    return $last_id; 

catch (Exception $e)  

    $this->close_db();    
    throw $e; 


//update record 
public function updateRecord($obj) 

try 
{    
    $this->open_db(); 
    $query=$this->condb->prepare("UPDATE sports SET category=?,name=? WHERE id=?"); 
    $query->bind_param("ssi", $obj->category,$obj->name,$obj->id); 
    $query->execute(); 
    $res=$query->get_result();                        
    $query->close(); 
    $this->close_db(); 
    return true; 

catch (Exception $e)  

    $this->close_db(); 
    throw $e; 


// delete record 
public function deleteRecord($id) 
{    
try{ 
    $this->open_db(); 
    $query=$this->condb->prepare("DELETE FROM sports WHERE id=?"); 
    $query->bind_param("i",$id); 
    $query->execute(); 
    $res=$query->get_result(); 
    $query->close(); 
    $this->close_db(); 
    return true;     

catch (Exception $e)  

    $this->closeDb(); 
    throw $e; 
}        
}    
// select record      
public function selectRecord($id) 

try 

    $this->open_db(); 
    if($id>0) 
    {    
        $query=$this->condb->prepare("SELECT * FROM sports WHERE id=?"); 
        $query->bind_param("i",$id); 
    } 
    else 
    {$query=$this->condb->prepare("SELECT * FROM sports");    }        
     
    $query->execute(); 
    $res=$query->get_result();    
    $query->close();              
    $this->close_db();                 
    return $res; 

catch(Exception $e) 

    $this->close_db(); 
    throw $e;    

 


Section Four
Section four is the view part, when mvcHandler() receives a request and executes the request, it shows views for user. We have created three views in the view folder, which is insert, update and list, which all have HTML design. These views work with controller, and the controller works with model to get or set records in a database table.
<div class="wrapper">   
<div class="container-fluid">   
<div class="row">   
<div class="col-md-12">   
    <div class="page-header clearfix">   
        <a href="index.php" class="btn btn-success pull-left">Home</a>   
        <h2 class="pull-left">Sports Details</h2>   
        <a href="view/insert.php" class="btn btn-success pull-right">Add New Sports</a>   
    </div>   
    <?php   
        if($result->num_rows > 0){   
            echo "<table class='table table-bordered table-striped'>";   
                echo "<thead>";   
                    echo "<tr>";   
                        echo "<th>#</th>";                                           
                        echo "<th>Sports Category</th>";   
                        echo "<th>Sports Name</th>";   
                        echo "<th>Action</th>";   
                    echo "</tr>";   
                echo "</thead>";   
                echo "<tbody>";   
                while($row = mysqli_fetch_array($result)){   
                    echo "<tr>";   
                        echo "<td>" . $row['id'] . "</td>";                                           
                        echo "<td>" . $row['category'] . "</td>";   
                        echo "<td>" . $row['name'] . "</td>";   
                        echo "<td>";   
                        echo "<a href='index.php?act=update&id=". $row['id'] ."' title='Update Record' data-toggle='tooltip'><i class='fa fa-edit'></i></a>";   
                        echo "<a href='index.php?act=delete&id=". $row['id'] ."' title='Delete Record' data-toggle='tooltip'><i class='fa fa-trash'></i></a>";   
                        echo "</td>";   
                    echo "</tr>";   
                }   
                echo "</tbody>";                               
            echo "</table>";   
            // Free result set   
            mysqli_free_result($result);   
        } else{   
            echo "<p class='lead'><em>No records were found.</em></p>";   
        }   
    ?>   
</div>   
</div>           
</div>   
</div>   


Conclusion
This article showed and explained to beginners how to make an MVC framework pattern in PHP. You might be wondering why we would even need to create our own framework when there are already so many good choices out there. The reason for this is so we can gain an understanding of the underlying principles of MVC.



Europe SQL Hosting - HostForLIFE.eu :: Delete Duplicate Rows From a Table in MSSQL 2012

clock July 22, 2020 13:56 by author Peter

For every table, we tend to use a primary key or distinctive key for distinct values, however generally we'll encounter a problem with duplicate records. it's a significant issue with duplicate rows. thus we want to delete duplicate records to resolve it. So here i'll make an example to explain delete duplicate rows in MSSQL Hosting.

Example:
First we create a simple database with one table for membership that contains: a Member's ID, Membership type, Firstname,  Lastname and Birthday:
CREATE TABLE [dbo].[Membership](
[MemberID] [varchar](20) NOT NULL,
[MemberType] [int] NOT NULL,
[Firstname] [varchar](80) NOT NULL,
[Lastname] [varchar](80) NOT NULL,
[Birthday] [date] NOT NULL
) ON [PRIMARY]

Now, insert the following rows into this table:

INSERT INTO dbo.Membership (MemberID, Firstname, Lastname, MemberType, Birthday) VALUES
('001', 'Peter', 'Smith', 1, convert(datetime, '05/23/1988', 0))
INSERT INTO dbo.Membership (MemberID, Firstname, Lastname, MemberType, Birthday) VALUES
('002', 'Scott', 'Davidson', 1, convert(datetime, '07/10/1983', 0))
INSERT INTO dbo.Membership (MemberID, Firstname, Lastname, MemberType, Birthday) VALUES
('002', 'Scott', 'Davidson', 1, convert(datetime, '07/10/1983', 0))

INSERT INTO dbo.Membership (MemberID, Firstname, Lastname, MemberType, Birthday) VALUES
('003', 'Kevin', 'Richard', 1, convert(datetime, '04/24/1985', 0))

We currently have duplicated Scott Davidson’s entry (MemberID 2), with no clearly safe method of removing the duplicate, whereas leaving at least one entry intact. Now, imagine if you had a complete databse of information with a whole lot or thousands of duplicates. Fixing this by hand quickly becomes an impossible task!

To solve this, first we can add an column using the IDENTITY keyword so we currently have a unique method of addressing every row:
ALTER TABLE dbo.Membership ADD AUTOID INT IDENTITY(1,1)

We can then we can use:
SELECT * FROM dbo.Membership WHERE AUTOID NOT IN (SELECT MIN(AUTOID) _
FROM dbo.Membership GROUP BY MemberID)

Which will properly choose all duplicated records in our database (always worth checking before running the delete query!).  Once we are happy this is working for us, we can then run the delete query:

DELETE FROM dbo.Membership WHERE AUTOID NOT IN (SELECT MIN(AUTOID) _
FROM dbo.Membership GROUP BY MemberID)



Magento Hosting - HostForLIFE.eu :: How To Install Magento Security Patch?

clock July 1, 2020 13:18 by author Peter

Making money is serious business, and it does take time for every effort to nurture and mature. Online shopping is actually only a small part of the wilderness of e-commerce. Web shopping which includes online transactions stock, download the software directly from the web actually connecting businesses to consumers is only about 20% of the total e-commerce. In fact, more in the form of trade relations business to business that facilitates the process of purchasing between companies. Many people hope that the possible occurrence of micro-transactions that allow people to pay in the form of coins some thousand or hundred dollars to access content or games on the Internet. One CMS that is used to create an online shop is Magento.

Magento is a premium shopping platform that Provides a platform online store with reviews Reviews their hosting packages. Features on Magento especially reporting features. This online store also handles complex system of discounts and voucher systems that can be integrated with other systems. Magento is an online shop for professionals who need a shopping system with detailed reporting. Magento has two versions items, Community (Open Source) and Professional.

Magento released a new patch for the Community Edition 1.9 and Enterprise Edition 1.14 to address security issues, including remote code execution and information leak vulnerabilities.

Be sure to test the patch in a development environment first, as it can affect extensions and customizations :

You can download the patch for both Community Edition and Enterprise Edition from the following options:

  • Partners: Go to the Partner Portal, select Technical Resources and then select Download from the Enterprise Edition panel. Next, navigate to Magento Enterprise Edition > Patches & Support and look for the folder titled “Security Patches – July-October.”
  • Enterprise Edition Merchants: Go to My Account, select the Downloads tab, and then navigate to Magento Enterprise Edition > Support Patches. Look for the folder titled “Security Patches – October 2015” .Merchants can also upgrade to the latest version of the Enterprise Edition and receive the security fixes as part of the core code.
  • Community Edition Merchants: Patches for earlier versions of Community Edition can be found on the Community Edition download page (look for SUPEE-67.88) Merchants can also upgrade today to the latest version of the Community Edition and receive the security fixes as part of the core code.

Before installing the patch check whether old patches are installed correctly. Some patches depend on other patches to be installed already.

Simply unpack the archive and replace files on your store by uploading app/ and lib/ folders into your Magento root directory.
If you use PHP opcode caches (APC/XCache/eAccelerator) make sure to flush it after patching, otherwise code will continue to run from caches.

If you have SSH access, it would be simpler to install the patch. Before installing the patch make sure to disable Magento Compiler at System > Configuration > Tools > Magento Compiler and clear compiled cache (if compiler is used).

If you have no SSH access, then to apply to the patch, you can simply upgrade your installation to the latest Magento version.

After the patch is installed successfully, check whether all CMS , home page, category pages and landing pages are running correctly without any issues. Magento security patch Supee 6788 affects the page layout, transaction emails and order confirmation notifications.

The Magento security patch supee 6788 has introduced new permissions for  blocks, core variables on CMS pages, templates and extensions. You can add your blocks in the admin section under System -> Permissions -> Blocks, or via setup scripts adding to the permission_block table.
Also, check if any other pages or blocks or transactional emails have been affected.

HostForLIFE.eu Magento Hosting
HostForLIFE.eu revolutionized hosting with Plesk Control Panel, a Web-based interface that provides customers with 24x7 access to their server and site configuration tools. Plesk completes requests in seconds. It is included free with each hosting account. Renowned for its comprehensive functionality - beyond other hosting control panels - and ease of use, Plesk Control Panel is available only to HostForLIFE's customers. They 
offer a highly redundant, carrier-class architecture, designed around the needs of shared hosting customers.



European Visual Studio 2017 Hosting - HostForLIFE.eu :: Drawing rubber-band lines and shapes in VB.NET

clock June 19, 2020 12:57 by author Peter

 The lack of XOR Drawing feature in GDI+ was not certainly welcome in the programmer's community. I guess it will be hard to survive with this handicap. In spite of this, I would like to show how we can draw rubber-band lines and shapes in GDI+ with just a few lines of code.

     Private Sub Form1_Load(ByVal sender As Object, ByVal e As System.EventArgs) 
    Dim size As Size = SystemInformation.PrimaryMonitorMaximizedWindowSize 
    bitmap = New Bitmap(size.Width, size.Height) 
    gB = Graphics.FromImage(bitmap) 
    Dim bckColor As Color = Me.BackColor 
    gB.Clear(bckColor) 
    End Sub 
    Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e AsSystem.Windows.Forms.MouseEventArgs) 
    Dim p As Point = New Point(e.X, e.Y) 
    x0 = p.X 
    y0 = p.Y 
    drag = True 
    End Sub 
    Private Sub Form1_MouseMove(ByVal sender As Object, ByVal e AsSystem.Windows.Forms.MouseEventArgs) 
    Dim p As Point = New Point(e.X, e.Y) 
    x= p.X 
    y = p.Y 
    Dim cx As Integer = x - x0 
    Dim cy As Integer = y - y0 
    If drag Then 
    Dim gx As Graphics = CreateGraphics() 
    gx.DrawImage(bitmap, 0, 0) 
    gx.Dispose() 
    Dim g As Graphics = CreateGraphics() 
    Dim pen As Pen = New Pen(Color.Blue) 
    Select Case DrawMode 
    Case 1 
    g.DrawLine(pen, x0, y0, x, y) 
    Exit Select 
    Case 2 
    g.DrawEllipse(pen, x0, y0, cx, cy) 
    Exit Select 
    Case 3 
    g.DrawRectangle(pen, x0, y0, cx, cy) 
    Exit Select 
    End Select 
    g.Dispose() 
    pen.Dispose() 
    End If 
    End Sub 
    Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e AsSystem.Windows.Forms.MouseEventArgs) 
    Dim cx As Integer = x - x0 
    Dim cy As Integer = y - y0 
    Dim pen As Pen = New Pen(Color.Blue) 
    Select Case DrawMode 
    Case 1 
    gB.DrawLine(pen, x0, y0, x, y) 
    Exit Select 
    Case 2 
    gB.DrawEllipse(pen, x0, y0, cx, cy) 
    Exit Select 
    Case 3 
    gB.DrawRectangle(pen, x0, y0, cx, cy) 
    Exit Select 
    End Select 
    drag = False 
    pen.Dispose() 
    End Sub 
    Private Sub Form1_Paint(ByVal sender As Object, ByVal e AsSystem.Windows.Forms.PaintEventArgs) 
    Dim gx As Graphics = CreateGraphics() 
    gx.DrawImage(bitmap, 0, 0) 
    gx.Dispose() 
    End Sub 
    Private Sub button1_Click(ByVal sender As Object, ByVal e As System.EventArgs)button1.ForeColor = Color.Red 
    button2.ForeColor = Color.Black 
    button3.ForeColor = Color.Black 
    DrawMode = 1 
    End Sub 
    Private Sub button2_Click(ByVal sender As Object, ByVal e As System.EventArgs) 
    button2.ForeColor = Color.Red 
    button1.ForeColor = Color.Black 
    button3.ForeColor = Color.Black 
    DrawMode = 2 
    End Sub 
    Private Sub button3_Click(ByVal sender As Object, ByVal e As System.EventArgs) 
    button3.ForeColor = Color.Red 
    button1.ForeColor = Color.Black 
    button2.ForeColor = Color.Black 
    DrawMode = 3 
    End Sub 
    Private Sub panel1_Paint(ByVal sender As Object, ByVal e AsSystem.Windows.Forms.PaintEventArgs) 
    button1.ForeColor = Color.Red 
    button1.Focus() 
    End Sub



About HostForLIFE.eu

HostForLIFE.eu is European Windows Hosting Provider which focuses on Windows Platform only. We deliver on-demand hosting solutions including Shared hosting, Reseller Hosting, Cloud Hosting, Dedicated Servers, and IT as a Service for companies of all sizes.

We have offered the latest Windows 2016 Hosting, ASP.NET Core 2.2.1 Hosting, ASP.NET MVC 6 Hosting and SQL 2017 Hosting.


Tag cloud

Sign in