
PHP, Mesajı txt dosyaya yazıp tekrar okumak
<?php
if (isset($_GET[‘message’]))
{
$fp = fopen(‘./messages.txt’, ‘a’);
fwrite($fp, “{$_GET[‘message’]}<br />”);
fclose($fp);
}
readfile(‘./messages.txt’);
?>
//—————————————————–
//style sheet import
<link rel=”stylesheet” type=”text/css” href=”linktypes.css”/>
//——————————————————————-
//Tabs
<ul id=”tabnav”>
<li class=”recipes”><a href=”#”>Recipes</a></li>
<li class=”contact”><a href=”#”>Contact Us</a></li>
<li class=”articles”><a href=”#”>Articles</a></li>
<li class=”buy”><a href=”#”>Buy Online</a></li>
</ul>
//—————————————————-
//Uzantısı html olan bir sayfanın içinde php script çalıştırma———————————-
<script type=”text/javascript” src=”myscript.php?id=3&name=george”></script>
//————————————————–
urldecode()
quotemeta() . \ + * ? [ ^ ] ( $ ) karakterlerinin önüne \ (backslash) karakteri koyar.
addslashes()
htmlentities()
//————————————————————————————
<style type=”text/css” >
<!–
.style1 {
font-size: 24px;
font-weight: bold;
color: #FF0000;
}
.style5 {font-size: 36px; font-weight: bold; color: #000066;}
body {
background-color: #999999;
}
–>
</style>
//————————————————————
<?php
// Connect
$link = mysql_connect(‘mysql_host’, ‘mysql_user’, ‘mysql_password’)
OR die(mysql_error());
// Query
$query = sprintf(“SELECT * FROM users WHERE user=’%s’ AND password=’%s'”,
mysql_real_escape_string($user),
mysql_real_escape_string($password));
?>
//————————————————————————————[:en]PHP, write the message back to txt file and read it again
<?php
if (isset($_GET[‘message’]))
{
$fp = fopen(‘./messages.txt’, ‘a’);
fwrite($fp, “{$_GET[‘message’]}<br />”);
fclose($fp);
}
readfile(‘./messages.txt’);
?>
//—————————————————–
//style sheet import
<link rel=”stylesheet” type=”text/css” href=”linktypes.css”/>
//——————————————————————-
//Tabs
<ul id=”tabnav”>
<li class=”recipes”><a href=”#”>Recipes</a></li>
<li class=”contact”><a href=”#”>Contact Us</a></li>
<li class=”articles”><a href=”#”>Articles</a></li>
<li class=”buy”><a href=”#”>Buy Online</a></li>
</ul>
If you have a php script in a page with an extension of html:
<script type=”text/javascript” src=”myscript.php?id=3&name=george”></script>
urldecode()
quotemeta() . \ + * ? [ ^ ] ( $ ) \ (backslash) character before the characters.
addslashes()
htmlentities()
//————————————————————————————
<style type=”text/css” >
<!–
.style1 {
font-size: 24px;
font-weight: bold;
color: #FF0000;
}
.style5 {font-size: 36px; font-weight: bold; color: #000066;}
body {
background-color: #999999;
}
–>
</style>
//————————————————————
<?php
// Connect
$link = mysql_connect(‘mysql_host’, ‘mysql_user’, ‘mysql_password’)
OR die(mysql_error());
// Query
$query = sprintf(“SELECT * FROM users WHERE user=’%s’ AND password=’%s'”,
mysql_real_escape_string($user),
mysql_real_escape_string($password));
?>
//————————————————————————–