SlideShare uma empresa Scribd logo
1 de 36
Baixar para ler offline
PHP ?
ก F Web Server
PHP ˈ C based language
F ก F PHP ก F ก
Web Browser F Internet Explorer, Fire Fox, Safari ˈWeb Browser F Internet Explorer, Fire Fox, Safari ˈ
F
Web Site ก F Yahoo Google ก F PHP
ก Web Server F F F PHP
ก Web Site ก ก
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
Call PHP Program By Web Browser
ก ก hello.php F 127.0.0.1 F
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
Run PHP on PC Windows OS
Appserv = PHP + Apache + MySQL
Apache ก ก Web Server ( F ก ˈ
Web Server)
PHP Compiler .php filePHP Compiler .php file
(Source Code)
MySQL ก ก F
F Notpad++ ก .php file
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
AppservInstallation
F F F ก
ʽ ก Web Browser ก
localhost F F ก Flocalhost F F ก F
Start > All Programs > Appserv > Control
Server By Service > Apache Restart
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
Hello World
1. F Folder C:AppServwww ก
Source Code Folder myPHP
2. F Notepad++ F .php file F index.phpF F F
3. Code
<?php echo ‘Hello World’; ?>
4. ʽ ก Web Browser F
http://localhost/myPHP
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
PHP Code Structure
F F tag <?php ?>
C based language F F ;
<?php<?php
……;
……;
……;
?>
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
PHP Output String
F echo “……”; Webbrowser
F F ก F F F <br /> F F
<?php<?php
echo “Hello <br />”;
echo “World”;
?>
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
PHPString Variable
PHP F F $
Case Sensitive F F F ก
F กF ก
<?php
$str=“A”
echo $str;
?>
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
PHP String Variable
ก F
<?php
$str1=“A”;$str1=“A”;
$str2=“B”;
$str3=$str1.$str2;
echo $str3;
?>
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
PHP String Variable
F string F F “…..”
F F F ก F “ string
F F ” F echo “””;
F F F ก F $ stringF F F ก F $ string
F F $ F echo $
F /*……*/ F ก
F F // F ก
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
PHP String Variable
<?php
$str="String";
echo "$str="String"";echo "$str="String"";
?>
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
PHP Numeric Variable
F F F F “…”
<?php
$num=1;
echo $num;echo $num;
?>
ก F F echo ก ˈ
F
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
PHP Numeric Variable
PHP ˈ C based language
ก F C F กF +,-
,*,/,(,),++,--,+=
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
PHP Automatic Type
Conversion
Numeric to String
<?php
$str1=“I am ”;
$str2=“ years old.”;$str2=“ years old.”;
$num=20*2;
echo $str1.$num.$str2;
?>
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
PHP Automatic Type
Conversion
String To Numeric
<?php
$str_num=“0.5”;
$num=0.5;
$sum=$str_num+$num;
echo “Sumation is ”.$sum;echo “Sumation is ”.$sum;
?>
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
PHP Automatic Type
Conversion
F F ก F F Numeric String F F
“ . ”
F F ก F ˈ ก F string
string ก, , , F
F F ก F ˈ ก F
string ก, , , F
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
PHP Array Variable
ก F ˈ Array F F
[] F index( F Array)
<?php
$arr[0]=1;$arr[0]=1;
$arr[1]="a";
echo $arr[0].$arr[1];
?> ก F Array ก ก F ก F ก
F
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
PHP Array Variable Count
F F Array F ก Fก F F F
count()
<?php
$arr[1]="First array";$arr[1]="First array";
$arr[2]="Second array";
echo "Variable arr has ".count($arr)."items.";
?> ก F F Array F 1 F
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
PHP Logical Operation
C based language
>, >=,<,<=,==, !=
&& ,||
<?php
$true=1;$true=1;
$false=0;
echo $true>=$false;
echo $true||$false;
echo $true!=$false;
echo $true&&$false;
?>
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
PHP Logical Operation
<?php
$n=1.5;
$n2="1.5";$n2="1.5";
echo $n==$n2;
?>
F ก F ก F
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
Control Statement
if( logical operation)
{ ……;}
else if(logical operation)
{ ……;}
else
{ ……;}
else
{ ……;}
F logical operation ˈ 1
{ }
F F logical operation F ˈ 1
else
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
Control Statement
<?php
$var="123";$var2=456;
if($var==123){echo "$var=123";}if($var==123){echo "$var=123";}
echo "<br />";
if($var==$var2){echo "$var=$var2";}
else{echo "$var not equal $var2";}
?>
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
Control Statement
while (logical operation){ …..;}
ก {} logical
operation F ˈ 1
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
Counter Program
ก
<?php
$n=1;
/* count 1 to 10*//* count 1 to 10*/
while($n<=10)
{
echo $n."<br />";
$n++;
}
?>
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
Example
ก F F F while loop
12345
12345
1234512345
12345
12345
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
Loop And Array Variable
ก F Array F Items F Loop while
<?php
$arr[1]="1";
$arr[2]="2";
$arr[3]="3";$arr[3]="3";
$n=1;
while($n<=count($arr))
{
echo $arr[$n]."<br />";
$n++;
}
?>
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
For Loop
for(ก F F ; F ก F loop; F F F loop)
{
…..;…..;
…..;
}
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
For Loop
<?php
for($n=1;$n<=10;$n++)
{
echo $n.”<br />”;echo $n.”<br />”;
}
?>
$n=1 ก ก F F
$n<=10 F ก F loop
$n++ F F F loop
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
For Loop And Array Variable
ก F Array F Items F Loop while
<?php
$arr[1]="1";
$arr[2]="2";
$arr[3]="3";$arr[3]="3";
for($n=1;$n<=count($arr);$n++)
{
echo $arr[$n]."<br />";
}
?>
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
SessionSession
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
Session
◦ Session F ก F F
F F F
◦ ก F F F a.php F ก F session F F
b.php ก F F session F a.php F ก F
F กF ก
◦ ก F F F ʽ F F web browser ก
◦ ก F F F a.php F F session
F F ʽ F F web browser session F ʽ
F F web browser ก F b.php ก F b.php ก
F F session ก F a.php F F ก
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
Session
◦ F ก session ก ก F F F ก
Fก ก ก server
◦ ก ก F session F F
ob_start();session_start(); F ก
◦ F F session F F◦ F F session F F
$_SESSION[" "] ก F F
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
Session
F a.php
<?php
ob_start();
session_start();
$_SESSION[“x”]=1;$_SESSION[“x”]=1;
echo $_SESSION[“x”];
$_SESSION[“x”]=“b”;
?>
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
Session
F b.php
<?php
ob_start();
session_start();
echo $_SESSION[“x”];echo $_SESSION[“x”];
$_SESSION[“x”]=999;
?>
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
Session
F c.php
<?php
echo $_SESSION[“x”];
?>
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)
ก F
• ก F browser PHPH F 2 F ก
• header(“Location: file_name url”);
• echo “<script>location=‘file_name url’</script>”;
• F
• header(“Location: index.php”);
• header(“Location: home.html”);
• header(“Location: http://www.google.co.th”);
• echo “<script>location=‘index.php’</script>”;
• echo “<script>location=‘home.html’</script>”;
• echo “<script>location=‘http://www.google.co.th’</script>”;
PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL
AJAX(JQUERY)

Mais conteúdo relacionado

Mais procurados

Refactoring using Codeception
Refactoring using CodeceptionRefactoring using Codeception
Refactoring using CodeceptionJeroen van Dijk
 
Melhorando sua API com DSLs
Melhorando sua API com DSLsMelhorando sua API com DSLs
Melhorando sua API com DSLsAugusto Pascutti
 
TDC 2016 (Florianópolis) - Vá para o próximo nível - Dicas e truques para a c...
TDC 2016 (Florianópolis) - Vá para o próximo nível - Dicas e truques para a c...TDC 2016 (Florianópolis) - Vá para o próximo nível - Dicas e truques para a c...
TDC 2016 (Florianópolis) - Vá para o próximo nível - Dicas e truques para a c...Matheus Marabesi
 
ZCPE - PHP Conference 2015
ZCPE   - PHP Conference 2015ZCPE   - PHP Conference 2015
ZCPE - PHP Conference 2015Matheus Marabesi
 
PHP「参照渡しできるよ」(君の考えている参照渡しと同じとは言ってない)
PHP「参照渡しできるよ」(君の考えている参照渡しと同じとは言ってない)PHP「参照渡しできるよ」(君の考えている参照渡しと同じとは言ってない)
PHP「参照渡しできるよ」(君の考えている参照渡しと同じとは言ってない)Kana Natsuno
 
Developing applications for performance
Developing applications for performanceDeveloping applications for performance
Developing applications for performanceLeon Fayer
 
Can WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.noCan WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.noMorten Rand-Hendriksen
 
DEV Čtvrtkon #76 - Fluent Interface
DEV Čtvrtkon #76 - Fluent InterfaceDEV Čtvrtkon #76 - Fluent Interface
DEV Čtvrtkon #76 - Fluent InterfaceCtvrtkoncz
 
Advanced modulinos trial
Advanced modulinos trialAdvanced modulinos trial
Advanced modulinos trialbrian d foy
 
Php Calling Operators
Php Calling OperatorsPhp Calling Operators
Php Calling Operatorsmussawir20
 
Semantic Web & TYPO3
Semantic Web & TYPO3Semantic Web & TYPO3
Semantic Web & TYPO3André Wuttig
 
Testing TYPO3 Applications
Testing TYPO3 ApplicationsTesting TYPO3 Applications
Testing TYPO3 ApplicationsAndré Wuttig
 
Advanced modulinos
Advanced modulinosAdvanced modulinos
Advanced modulinosbrian d foy
 
Laravel Poznań Meetup #2 - Wykorzystanie FormRequest w Laravelu
Laravel Poznań Meetup #2 - Wykorzystanie FormRequest w LaraveluLaravel Poznań Meetup #2 - Wykorzystanie FormRequest w Laravelu
Laravel Poznań Meetup #2 - Wykorzystanie FormRequest w LaraveluHighSolutions Sp. z o.o.
 
So cal0365productivitygroup feb2019
So cal0365productivitygroup feb2019So cal0365productivitygroup feb2019
So cal0365productivitygroup feb2019RonRohlfs1
 
PHP performance 101: so you need to use a database
PHP performance 101: so you need to use a databasePHP performance 101: so you need to use a database
PHP performance 101: so you need to use a databaseLeon Fayer
 
Build your own RESTful API with Laravel
Build your own RESTful API with LaravelBuild your own RESTful API with Laravel
Build your own RESTful API with LaravelFrancisco Carvalho
 

Mais procurados (20)

Refactoring using Codeception
Refactoring using CodeceptionRefactoring using Codeception
Refactoring using Codeception
 
Melhorando sua API com DSLs
Melhorando sua API com DSLsMelhorando sua API com DSLs
Melhorando sua API com DSLs
 
TDC 2016 (Florianópolis) - Vá para o próximo nível - Dicas e truques para a c...
TDC 2016 (Florianópolis) - Vá para o próximo nível - Dicas e truques para a c...TDC 2016 (Florianópolis) - Vá para o próximo nível - Dicas e truques para a c...
TDC 2016 (Florianópolis) - Vá para o próximo nível - Dicas e truques para a c...
 
ZCPE - PHP Conference 2015
ZCPE   - PHP Conference 2015ZCPE   - PHP Conference 2015
ZCPE - PHP Conference 2015
 
PHP「参照渡しできるよ」(君の考えている参照渡しと同じとは言ってない)
PHP「参照渡しできるよ」(君の考えている参照渡しと同じとは言ってない)PHP「参照渡しできるよ」(君の考えている参照渡しと同じとは言ってない)
PHP「参照渡しできるよ」(君の考えている参照渡しと同じとは言ってない)
 
Developing applications for performance
Developing applications for performanceDeveloping applications for performance
Developing applications for performance
 
symfony & jQuery (PUG)
symfony & jQuery (PUG)symfony & jQuery (PUG)
symfony & jQuery (PUG)
 
Can WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.noCan WordPress really do that? A case study of vierderduer.no
Can WordPress really do that? A case study of vierderduer.no
 
Php Rss
Php RssPhp Rss
Php Rss
 
DEV Čtvrtkon #76 - Fluent Interface
DEV Čtvrtkon #76 - Fluent InterfaceDEV Čtvrtkon #76 - Fluent Interface
DEV Čtvrtkon #76 - Fluent Interface
 
Advanced modulinos trial
Advanced modulinos trialAdvanced modulinos trial
Advanced modulinos trial
 
Php Calling Operators
Php Calling OperatorsPhp Calling Operators
Php Calling Operators
 
Semantic Web & TYPO3
Semantic Web & TYPO3Semantic Web & TYPO3
Semantic Web & TYPO3
 
Testing TYPO3 Applications
Testing TYPO3 ApplicationsTesting TYPO3 Applications
Testing TYPO3 Applications
 
Advanced modulinos
Advanced modulinosAdvanced modulinos
Advanced modulinos
 
Laravel Poznań Meetup #2 - Wykorzystanie FormRequest w Laravelu
Laravel Poznań Meetup #2 - Wykorzystanie FormRequest w LaraveluLaravel Poznań Meetup #2 - Wykorzystanie FormRequest w Laravelu
Laravel Poznań Meetup #2 - Wykorzystanie FormRequest w Laravelu
 
So cal0365productivitygroup feb2019
So cal0365productivitygroup feb2019So cal0365productivitygroup feb2019
So cal0365productivitygroup feb2019
 
PHP performance 101: so you need to use a database
PHP performance 101: so you need to use a databasePHP performance 101: so you need to use a database
PHP performance 101: so you need to use a database
 
Build your own RESTful API with Laravel
Build your own RESTful API with LaravelBuild your own RESTful API with Laravel
Build your own RESTful API with Laravel
 
Laravel - PHP For artisans
Laravel - PHP For artisansLaravel - PHP For artisans
Laravel - PHP For artisans
 

Semelhante a Session1+2

GettingStartedWithPHP
GettingStartedWithPHPGettingStartedWithPHP
GettingStartedWithPHPNat Weerawan
 
[PL] Jak nie zostać "programistą" PHP?
[PL] Jak nie zostać "programistą" PHP?[PL] Jak nie zostać "programistą" PHP?
[PL] Jak nie zostać "programistą" PHP?Radek Benkel
 
Make WordPress realtime.
Make WordPress realtime.Make WordPress realtime.
Make WordPress realtime.Josh Hillier
 
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016Codemotion
 
CodePolitan Webinar: The Rise of PHP
CodePolitan Webinar: The Rise of PHPCodePolitan Webinar: The Rise of PHP
CodePolitan Webinar: The Rise of PHPSteeven Salim
 
Php web backdoor obfuscation
Php web backdoor obfuscationPhp web backdoor obfuscation
Php web backdoor obfuscationSandro Zaccarini
 
Php mysql training-in-mumbai
Php mysql training-in-mumbaiPhp mysql training-in-mumbai
Php mysql training-in-mumbaivibrantuser
 
Introducation to php for beginners
Introducation to php for beginners Introducation to php for beginners
Introducation to php for beginners musrath mohammad
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHPBradley Holt
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐいHisateru Tanaka
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryTatsuhiko Miyagawa
 
Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Joseph Scott
 

Semelhante a Session1+2 (20)

GettingStartedWithPHP
GettingStartedWithPHPGettingStartedWithPHP
GettingStartedWithPHP
 
symfony & jQuery (phpDay)
symfony & jQuery (phpDay)symfony & jQuery (phpDay)
symfony & jQuery (phpDay)
 
[PL] Jak nie zostać "programistą" PHP?
[PL] Jak nie zostać "programistą" PHP?[PL] Jak nie zostać "programistą" PHP?
[PL] Jak nie zostać "programistą" PHP?
 
Make WordPress realtime.
Make WordPress realtime.Make WordPress realtime.
Make WordPress realtime.
 
第26回PHP勉強会
第26回PHP勉強会第26回PHP勉強会
第26回PHP勉強会
 
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
 
The new features of PHP 7
The new features of PHP 7The new features of PHP 7
The new features of PHP 7
 
Php with my sql
Php with my sqlPhp with my sql
Php with my sql
 
CodePolitan Webinar: The Rise of PHP
CodePolitan Webinar: The Rise of PHPCodePolitan Webinar: The Rise of PHP
CodePolitan Webinar: The Rise of PHP
 
Php web backdoor obfuscation
Php web backdoor obfuscationPhp web backdoor obfuscation
Php web backdoor obfuscation
 
Php mysql training-in-mumbai
Php mysql training-in-mumbaiPhp mysql training-in-mumbai
Php mysql training-in-mumbai
 
Introducation to php for beginners
Introducation to php for beginners Introducation to php for beginners
Introducation to php for beginners
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい関西PHP勉強会 php5.4つまみぐい
関西PHP勉強会 php5.4つまみぐい
 
Php mysql
Php mysqlPhp mysql
Php mysql
 
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQueryRemedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
Remedie: Building a desktop app with HTTP::Engine, SQLite and jQuery
 
Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )Anatomy of a PHP Request ( UTOSC 2010 )
Anatomy of a PHP Request ( UTOSC 2010 )
 

Último

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 

Último (20)

04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 

Session1+2

  • 1. PHP ? ก F Web Server PHP ˈ C based language F ก F PHP ก F ก Web Browser F Internet Explorer, Fire Fox, Safari ˈWeb Browser F Internet Explorer, Fire Fox, Safari ˈ F Web Site ก F Yahoo Google ก F PHP ก Web Server F F F PHP ก Web Site ก ก PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 2. Call PHP Program By Web Browser ก ก hello.php F 127.0.0.1 F PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 3. Run PHP on PC Windows OS Appserv = PHP + Apache + MySQL Apache ก ก Web Server ( F ก ˈ Web Server) PHP Compiler .php filePHP Compiler .php file (Source Code) MySQL ก ก F F Notpad++ ก .php file PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 4. AppservInstallation F F F ก ʽ ก Web Browser ก localhost F F ก Flocalhost F F ก F Start > All Programs > Appserv > Control Server By Service > Apache Restart PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 5. Hello World 1. F Folder C:AppServwww ก Source Code Folder myPHP 2. F Notepad++ F .php file F index.phpF F F 3. Code <?php echo ‘Hello World’; ?> 4. ʽ ก Web Browser F http://localhost/myPHP PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 6. PHP Code Structure F F tag <?php ?> C based language F F ; <?php<?php ……; ……; ……; ?> PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 7. PHP Output String F echo “……”; Webbrowser F F ก F F F <br /> F F <?php<?php echo “Hello <br />”; echo “World”; ?> PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 8. PHPString Variable PHP F F $ Case Sensitive F F F ก F กF ก <?php $str=“A” echo $str; ?> PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 9. PHP String Variable ก F <?php $str1=“A”;$str1=“A”; $str2=“B”; $str3=$str1.$str2; echo $str3; ?> PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 10. PHP String Variable F string F F “…..” F F F ก F “ string F F ” F echo “””; F F F ก F $ stringF F F ก F $ string F F $ F echo $ F /*……*/ F ก F F // F ก PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 11. PHP String Variable <?php $str="String"; echo "$str="String"";echo "$str="String""; ?> PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 12. PHP Numeric Variable F F F F “…” <?php $num=1; echo $num;echo $num; ?> ก F F echo ก ˈ F PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 13. PHP Numeric Variable PHP ˈ C based language ก F C F กF +,- ,*,/,(,),++,--,+= PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 14. PHP Automatic Type Conversion Numeric to String <?php $str1=“I am ”; $str2=“ years old.”;$str2=“ years old.”; $num=20*2; echo $str1.$num.$str2; ?> PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 15. PHP Automatic Type Conversion String To Numeric <?php $str_num=“0.5”; $num=0.5; $sum=$str_num+$num; echo “Sumation is ”.$sum;echo “Sumation is ”.$sum; ?> PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 16. PHP Automatic Type Conversion F F ก F F Numeric String F F “ . ” F F ก F ˈ ก F string string ก, , , F F F ก F ˈ ก F string ก, , , F PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 17. PHP Array Variable ก F ˈ Array F F [] F index( F Array) <?php $arr[0]=1;$arr[0]=1; $arr[1]="a"; echo $arr[0].$arr[1]; ?> ก F Array ก ก F ก F ก F PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 18. PHP Array Variable Count F F Array F ก Fก F F F count() <?php $arr[1]="First array";$arr[1]="First array"; $arr[2]="Second array"; echo "Variable arr has ".count($arr)."items."; ?> ก F F Array F 1 F PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 19. PHP Logical Operation C based language >, >=,<,<=,==, != && ,|| <?php $true=1;$true=1; $false=0; echo $true>=$false; echo $true||$false; echo $true!=$false; echo $true&&$false; ?> PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 20. PHP Logical Operation <?php $n=1.5; $n2="1.5";$n2="1.5"; echo $n==$n2; ?> F ก F ก F PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 21. Control Statement if( logical operation) { ……;} else if(logical operation) { ……;} else { ……;} else { ……;} F logical operation ˈ 1 { } F F logical operation F ˈ 1 else PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 22. Control Statement <?php $var="123";$var2=456; if($var==123){echo "$var=123";}if($var==123){echo "$var=123";} echo "<br />"; if($var==$var2){echo "$var=$var2";} else{echo "$var not equal $var2";} ?> PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 23. Control Statement while (logical operation){ …..;} ก {} logical operation F ˈ 1 PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 24. Counter Program ก <?php $n=1; /* count 1 to 10*//* count 1 to 10*/ while($n<=10) { echo $n."<br />"; $n++; } ?> PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 25. Example ก F F F while loop 12345 12345 1234512345 12345 12345 PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 26. Loop And Array Variable ก F Array F Items F Loop while <?php $arr[1]="1"; $arr[2]="2"; $arr[3]="3";$arr[3]="3"; $n=1; while($n<=count($arr)) { echo $arr[$n]."<br />"; $n++; } ?> PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 27. For Loop for(ก F F ; F ก F loop; F F F loop) { …..;…..; …..; } PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 28. For Loop <?php for($n=1;$n<=10;$n++) { echo $n.”<br />”;echo $n.”<br />”; } ?> $n=1 ก ก F F $n<=10 F ก F loop $n++ F F F loop PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 29. For Loop And Array Variable ก F Array F Items F Loop while <?php $arr[1]="1"; $arr[2]="2"; $arr[3]="3";$arr[3]="3"; for($n=1;$n<=count($arr);$n++) { echo $arr[$n]."<br />"; } ?> PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 30. SessionSession PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 31. Session ◦ Session F ก F F F F F ◦ ก F F F a.php F ก F session F F b.php ก F F session F a.php F ก F F กF ก ◦ ก F F F ʽ F F web browser ก ◦ ก F F F a.php F F session F F ʽ F F web browser session F ʽ F F web browser ก F b.php ก F b.php ก F F session ก F a.php F F ก PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 32. Session ◦ F ก session ก ก F F F ก Fก ก ก server ◦ ก ก F session F F ob_start();session_start(); F ก ◦ F F session F F◦ F F session F F $_SESSION[" "] ก F F PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 34. Session F b.php <?php ob_start(); session_start(); echo $_SESSION[“x”];echo $_SESSION[“x”]; $_SESSION[“x”]=999; ?> PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 35. Session F c.php <?php echo $_SESSION[“x”]; ?> PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)
  • 36. ก F • ก F browser PHPH F 2 F ก • header(“Location: file_name url”); • echo “<script>location=‘file_name url’</script>”; • F • header(“Location: index.php”); • header(“Location: home.html”); • header(“Location: http://www.google.co.th”); • echo “<script>location=‘index.php’</script>”; • echo “<script>location=‘home.html’</script>”; • echo “<script>location=‘http://www.google.co.th’</script>”; PROJECTSOFT.BIZ ก WEB APPLICATION F PHP MYSQL AJAX(JQUERY)