Odak modu

PHP Temel

PHP ve JS

PHP ve JS

JS ve PHP

  • PHP'yi HTML içerisinde gömülü olarak kullandığımız gibi kolayca Javascript ile de kullanabiliriz.
  • PHP ile JS ve JS Frameworkleri(Vue, React) içi ServerSide çalışabiliriz.(restapi)
<!doctype html>
<html lang="tr">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Patika PHP Basics</title>

    <div id="content"></div>
</head>
<body>

<script src="https://unpkg.com/axios/dist/axios.min.js"></script>
<script>
    axios.get('https://stebilisim.com/test2.php', {
        params: {
            getPost: true
        }
    })
        .then(function (response) {
            console.log(response.data);

            let content = document.getElementById('content'), html;
            for (const responseElement of response.data) {
                console.log(responseElement.page_title, responseElement.page_description,responseElement.page_image);
                html += `<img src="https://stebilisim.com/catalog/uploads/${responseElement.page_image}">`;
                html += `<h1>${responseElement.page_title}</h1>`;
                html += `<div>${responseElement.page_description}</div>`;
            }

            content.innerHTML = html;
        })
        .catch(function (error) {
            console.log(error);
        })
        .then(function () {
            // always executed
        });
</script>
</body>
</html>
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

try {
    $db = new PDO('mysql:host=localhost;dbname=*;','*','*');
    $db->query("SET CHARACTER SET utf8mb4");
}catch (PDOException $e){
    echo $e->getMessage();
}


if (isset($_GET['getPost'])){
    $q = $db->query("SELECT ptc.page_title, ptc.page_description, page.page_image FROM page 
                                INNER JOIN page_to_content ptc ON page.page_id = ptc.page_id && ptc.language_id = 1
                                WHERE page_type = 'blog' ");
    $data = $q->fetchAll(PDO::FETCH_ASSOC);
    echo json_encode($data);

}

img.png

Background Pattern
Birlikte öğrenelim

Sektörde en çok aranan yazılım becerilerini kazan

Yapay zeka desteği, birebir mentörlük saatleri, canlı dersler ve senin için özel hazırlanmış içeriklerle eksiklerini tamamla, düzenli geri bildirimler al ve öğrenme sürecini en verimli hale getir.

Yunus Emre Kabakcı

Patika+ mezunu

Patika+ Fullstack Web Development Bootcamp mezunumuz Yunus Emre,

3 ay içinde Katar’dan aldığı teklif ile, global bir şirket olan Pavo Group’da işe başladı!


“İçerik zenginliği, mentor desteği, ileriye dönük bir network sağlaması ve dünyada en çok tercih edilen frameworkler üzerinden bir eğitim veriyor olması Patika+’ı tercih etmemin temel sebepleri oldu!“

Yorumlar

Yorum yapabilmek için derse kayıt olmalısın!

Bu dersi nasıl buldun?

This website uses cookies to ensure you get the best experience.

Disclaimer: The information /programs / events provided on https://patika.dev and https://risein.com are strictly for upskilling and networking purposes related to the technical infrastructure of blockchain platforms. We do not provide financial or investment advice and do not make any representations regarding the value, profitability, or future price of any blockchain or cryptocurrency. Users are encouraged to conduct their own research and consult with licensed financial professionals before engaging in any investment activities. https://patika.dev and https://risein.com disclaim any responsibility for financial decisions made by users based on information provided here.