Skip to content

Instantly share code, notes, and snippets.

View angular_1_4.ts
import { Component, OnInit } from '@angular/core';
@Component({
selector: 'app-counter',
templateUrl: './counter.component.html',
styleUrls: ['./counter.component.scss']
})
export class CounterComponent implements OnInit {
View angular_1_3.html
<div class="counter__container">
<div class="counter__container-inner">
<h4>Counter</h4>
<div class="button-group">
<button (click)="decrement()">-</button>
<button (click)="clearCounter()">0</button>
<button (click)="increment()">+</button>
</div>
<h5>Counter: {{counter}}</h5>
</div>
View angular_1_2.scss
.counter__container {
background-color: #F0F0F0;
min-width: 100px;
margin-bottom: 20px;
.counter__container-inner {
padding: 20px;
text-align: center;
.button-group {
View angular_1_1.html
<div class="counter__container">
<div class="counter__container-inner">
<h4>Counter</h4>
<div class="button-group">
<button>-</button>
<button>0</button>
<button>+</button>
</div>
<h5>Counter: </h5>
</div>
View PHP_en_15_4_2.php
<?php
$sql ="SELECT c_title, c_description, c_headline, c_content FROM os_content WHERE c_id = 3;";
try
{
$dbh = new PDO ("mysql:dbname=onlineshopDB; host=localhost", "user1", "abc");
$return = $dbh->query($sql);
$result = $return->fetchAll(PDO::FETCH_ASSOC);
$meta_title = $result[0]['c_title'];
View PHP_en_15_4_1.php
<?php
$sql ="SELECT c_title, c_description, c_headline, c_content FROM os_content WHERE c_id = 2;";
try
{
$dbh = new PDO ("mysql:dbname=onlineshopDB; host=localhost", "user1", "abc");
$return = $dbh->query($sql);
$result = $return->fetchAll(PDO::FETCH_ASSOC);
$meta_title = $result[0]['c_title'];
View PHP_en_15_3.php
<?php
include ("class_customer.php");
$newCustomer = new Customer();
if (!empty($_REQUEST['first_name']))
{
if ($_REQUEST['first_name'] != "")
{
$newCustomer->setFirstName($_REQUEST['first_name']);
View PHP_en_15_2_3.php
try
{
$dbh = new PDO ("mysql:dbname=onlineshopDB; host=localhost", "user1", "abc");
$newcustomer->setCustomerNumber($dbh);
$dbh = null;
}
catch(PDOException $e)
{
View PHP_en_15_2_2.php
if (!empty($_REQUEST['first_name']))
{
if ($_REQUEST['first_name'] != "")
{
$newcustomer->setFirstName($_REQUEST['first_name']);
}
}
View PHP_en_15_1_3.php
<p>Register as new customer!</p>
<form method="post" action="output.php">
<table>
<tr>
<td>Last name:</td>
<td><input name="last_name" type="text" /></td>
</tr>
<tr>
<td>First name:</td>
You can’t perform that action at this time.