Yorumu yapan: |
Yorumu: |
september
Yönetici Giriş tarihi: 21-06-2002 Yorumlar: 439 |
Rasmus Lerdorf tarafından öncelikle kendi kişisel web sayfalarını yazmak için geliştirilmesi nedeniyle 'P'ersonal 'H'ome 'P'ages adının kısaltması olarak karşımıza çıkan PHP, HTML gömülü (HTML-embedded) bir script dilidir. özellikle web uygulamaları geliştirenlerin dinamik ve havada (on the fly) üretilen web sayfalarını hızlı bir şekilde yazmaları için düşünülmüştür. Dilin sentaksı gelştirilirken C, Java ve en çok da Perl'den esinlenilmiştir. Bu nedenle bu dillerden her hangi birisini bilen bir kullanıcı için PHP'ye geçmek hiç de zor olmamaktadır.
PHP şu şekilde tanımlanabilir:
* Sunucu tabanlı (server sided),
* HTML ile bir arada kullanılabilen (HTML embedded),
* Script dili.
PHP'nin gelişim süreci:
* PHP-FI (Dinamik HTML üretimi, satır satır kod işletimi, CGI modeli çalışma)
* PHP-3.x (Apache'ye modül olarak gömülebilme, yerleşik veri tabanı arabirimleri)
* PHP-4.x (Ön derleme ve optimizer ile ara kod iyileştirme, eklentiler)
* PHP-5.x () |
20-11-2004CET15:59
|
september
http://www.php.net">
Yönetici Giriş tarihi: 21-06-2002 Yorumlar: 439 |
[code]<?php
/* Buralar yorum satırı*/
# Burası da tek satırlık yorum aralığı
$değer = "Bu değişkenin değeri";
echo $değer;
?>[/code]
php web sitesi: http://www.php.net |
20-11-2004CET16:05
|
|
Bence yasasin guvenlik php ye devam :)
Tek rakibi html |
20-11-2004CET20:49
|
september
Yönetici Giriş tarihi: 21-06-2002 Yorumlar: 439 |
PHP Nedir?
--------------------------------------------------------------------------------
PHP Web sunucu tarafında işlenip HTML içine gömülen bir betik dilidir!.
PHP
HTML kodu içerisine gömülebilir,
Web Sunucu tarafından yorumlanır,
Taşınabilir,
JavaScript, C, Perl dillerinden ilham alınarak yapılmıştır,
<html>
<head>
<title>Example</title>
</head>
<body>
<? echo "Merhaba ben bir PHP betigiyim"; ?>
</body>
</html>
Burada PHP, HTML kodu içerisinde "<?" ve "?>" etiketleri arasına gömülmüş; "<?" işaretleri ile PHP betiğine atlanacaği, "?>"; işaretleri ile de PHP betiğinin sonlandığı belirtilmiştir. |
24-12-2004CET20:58
|
Adventureman
Yönetici Giriş tarihi: 03-06-2004 Yorumlar: 128 |
hıımmmm |
11-01-2005CET09:58
|
september
http://tr.php.net/downloads.php adresine gidiniz.">
Yönetici Giriş tarihi: 21-06-2002 Yorumlar: 439 |
php 4.3.10 ve php PHP 5.0.3 kaynak kodları ve ve diğerlerinin downloadları için ;
http://tr.php.net/downloads.php adresine gidiniz. |
27-01-2005CET08:51
|
|
bende yakın da geçicem |
24-02-2005CET13:27
|
september
Yönetici Giriş tarihi: 21-06-2002 Yorumlar: 439 |
[B]Introduction to PHP[/B]
PHP, or PHP Hypertext Preprocessor, is a HTML embedded scripting language. It has the versatility of PERL, the syntax of C, and, most important of all, the database access features to all popular types of databases. (Including MySQL, PostgreSQL, MS SQL and Oracle) Writing scripts with PHP is comparatively easier than using PERL, while still maintaining the same, or even better functions.
[B]Examples of PHP[/B]
Okay, now, some very basic code examples of PHP:
[code]<?php print "Hello world"; ?>[/code]
Recognise anything? Most of the PHP code structures are from PERL, which might look like this to make the same function :
[code]#!/usr/bin/perl
print "Content-type:text/html\n\n";
print "Hello world";[/code]
which is a lot of fuss compared to the PHP code above. You can, actually, create a very complicated script with PHP doing most of your work, such as automation of registration of users, visitor tracking, server configuration, plus all others you can think of!
[B]Basic PHP syntax[/B]
If you already know PERL or C, you should be familiar with the syntax of PHP.
To start specifying PHP code:
[code]<?php
<script language="PHP">
<? *1
<% *2[/code]
To stop specifying PHP code:
[code]?>
</script>
?> *1
%> *2[/code]
[B]Example: [/B]
[code]<?php print "Hello world"; ?>
<script language="PHP">print "Hello world";</script>
<? print "Hello world"; ?> *1
<% print "Hello world"; %> *2[/code]
Note : *1 requires short_open_tag to be set on, which is default on most servers and *2 requires asp_tags to be set on, which is NOT default on most servers.
[B]PHP Data Types[/B]
- Strings
Strings are plain text enclosed in quotes (")
[B]Example:[/B] This is a "string"
- Integers
Integers are whole numbers
[B]Example[/B]
1234
- Doubles
Doubles are floating point numbers
[B]Example:[/B]
1234.567
[B]PHP Variables[/B]
A variable is a piece of data that is represented by a name. Variables are defined by the syntax $varname = value;
For example:
[code]$myname = "Jeremy"; # $myname is a string
$yourname = "Whoever"; # $yourname is a string too
$anynumber = 2; # $anynumber is an integer[/code]
The has (#) signs in the above text are called comments. They are notes by the programmer that is ignored by the script parser. Also, variables in strings are automatically expanded.
[B]Basic PHP functions[/B]
[code]print (string);[/code]
Outputs (string) into the screen.
[B]Example:[/B]
print "Hi! I am PHP";
[code]echo (string); [/code]
Outputs (string) into the screen, identical to print.
[B]Example:[/B]
echo "Hi! I am PHP";
[code]phpinfo(); [/code]
Outputs a large amount of information about the current state of PHP.
[B]Basic PHP control structures[/B]
Control structures are the logics of the program, for example, what will you do if you see a red traffic light when you are driving? A yellow one? What about a green one? Now, if you see a red one, you stop, when you see a yellow one, you prepare to stop or go, and, lastly, you go straight when you see a green one, right? I think your kindergarten teacher taught you that, but PHP hasn't even gone into kindergarten! You have to teach PHP what to do.
For example:
[code]<?php
$trafficlight = "red";
if ($trafficlight == "red") {
echo "I stop when I see a red light";
}
else if ($trafficlight == "yellow") {
echo "I prepare to go or stop when I see a yellow light";
}
else if ($trafficlight == "green") {
echo "I go when I see a green light";
}
else {
echo "You have not taught me what to do if I see a $trafficlight light!";
}
?>[/code]
Congratulations! You have taught PHP what to do when it encountered red, yellow and green traffic lights. Try to run the script and see what PHP will do when it encounters a red traffic light.
Now, try changing the first line from
[code]$trafficlight = "red";[/code]
to
[code]$trafficlight = "yellow";[/code]
and see what PHP will do when it encounters a yellow traffic light.
After that, try changing it to
[code]$trafficlight = "green";[/code]
and
[code]$trafficlight = "blue";[/code]
Whoops! We have forgotten to tell PHP what to do when it encounters a blue traffic light! Change the code to:
[code]<?php
$trafficlight = "blue";
if ($trafficlight == "red") {
echo "I stop when I see a red light";
}
else if ($trafficlight == "yellow") {
echo "I prepare to go or stop when I see a yellow light";
}
else if ($trafficlight == "green") {
echo "I go when I see a green light";
}
else if ($trafficlight == "blue") {
echo "I will ring up the traffic light repair crew if I see a blue light";
}
else {
echo "You have not taught me what to do if I see a $trafficlight light!";
}
?>[/code]
and see what PHP will do when it encounters a blue traffic light! |
07-03-2005CET13:58
|
|
my third lang :) |
16-12-2006CET03:55
|
|