This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// $handle: nombre del estilo (requerido) | |
// $src: ruta del archivo a incluir (requerido) | |
// $deps: nombre del estilo dependiente, se carga el dependiente previamente | |
// $ver: versión del archivo que vamos a incluir | |
// $media: media del estilo a incluir (‘all’, ‘screen’, ‘print’, ‘handheld’) | |
wp_enqueue_style( $handle, $src, $deps, $ver, $media ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require 'Kodetop/UserProfile.php'; | |
use Kodetop\UserProfile; | |
$user = new UserProfile(); | |
echo 'Hello ' . $user->getName(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Kodetop; | |
class UserProfile | |
{ | |
const VERSION = '1.0'; | |
var $name = 'Guest'; | |
function getName() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class user_profile | |
{ | |
const version = '1.0'; | |
var $name = 'Guest'; | |
function GetName() | |
{ | |
return $this->name; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// include connection | |
require 'pdo.php'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<?php while (($result = $statement->fetch()) !== false): ?> | |
<li><a href="country.php?code=<?php echo $result->code; ?>"><?php echo $result->name; ?></a></li> | |
<?php endwhile; ?> | |
</ul> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// include connection | |
require 'pdo.php'; | |
// prepare query | |
$statement = $pdo->prepare("SELECT * FROM country"); | |
$statement->execute(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1>Country</h1> | |
<p> | |
<strong>Name</strong>: <?php echo $result->name; ?><br> | |
<strong>Continent</strong>: <?php echo $result->continent; ?><br> | |
<strong>Region</strong>: <?php echo $result->region; ?><br> | |
<strong>Population</strong>: <?php echo number_format($result->population); ?><br> | |
<strong>Area</strong>: <?php echo number_format($result->area); ?><br> | |
<strong>Head of State</strong>: <?php echo $result->headofstate; ?> | |
</p> | |
<p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// include connection | |
require 'pdo.php'; | |
// get and filter parameter | |
$code = filter_input(INPUT_GET, 'code', FILTER_SANITIZE_STRING); | |
// prepare query | |
$statement = $pdo->prepare("SELECT * FROM country WHERE Code = :code"); | |
$statement->bindValue(':code', $code, PDO::PARAM_STR); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// include connection | |
require 'pdo.php'; | |
// send query | |
$statement = $pdo->prepare("SELECT * FROM country"); | |
$statement->execute(); | |
// loop and print data | |
while (($result = $statement->fetch()) !== false) { |
NewerOlder