Complete documentation in this place!
PHP
is usual for forms .
Methods
for transmitt/receive variables -post , send , get .
Get
-low security level.
An
very good open source programm is Winlamp.
I Example
In index.html in Apache/htdocs :
In index.html in Apache/htdocs :
<html>
<head><title
> Is this number >10 ?
</title></head>
<body>
<bgcolor=#AFFF>
<fieldset>
<center>
<legend>
<p>
<b>
<font size="+3"
color="green2">
Form
send number to foo.php </b>
</p>
</font>
</legend>
</div>
<form
action="foo.php" method="post">
Number1:
<input type="text" name="nr1" /><br />
Number2:
<input type="text" name="nr2" /><br />
<input type="submit" name="submit" value="Submit me!" />
<input type="submit" name="submit" value="Submit me!" />
</form>
</fieldset>
</body>
</html>
In same folder place :
foo.php
-extern file
<?php
//
Available since PHP 4.1.0
import_request_variables('p','p_');
import_request_variables('q','q_');
if( $p_nr1>=10) echo "nr1 >= 10<br>";
else echo "nr1< 10<br>";
echo "<br><hr>";
echo "extern php file is ". $_SERVER['PHP_SELF'] ;
echo "<br> client computer adress
is " . $_SERVER['REMOTE_ADDR']."<hr>";
echo $_SERVER['USER_AGENT'];
$w=@($p_nr1+$p_nr2);
echo "<br> numbers sum is ".$w;
?>
Booth file coexist in Apache local folder.
@-for expression
$ prefix variables name in any php distribution
Run -write localhost in browser adress bar or localhost:80 or localhost:8080 .
(Need -work apache,php,mysql )
Run -write localhost in browser adress bar or localhost:80 or localhost:8080 .
(Need -work apache,php,mysql )
II Example
For PAGE MENUS is very simple an Powerpoint presentation save as
html document .
III Example
For PAGE MENUS is very simple an Powerpoint presentation save as
html document .
III Example
In combinattion with MySql sugest this example:
index1.php
<?php
$i=1;
switch ($i) {
case 0:
echo "i equals 0";
break;
case 1:
echo "i equals 1";
break;
case 2:
echo "i equals 2";
break;
}
$link=mysql_connect("localhost", "root",
"baghera");
if (!$link) {
die('Not connected : ' .
mysql_error());
}
// make foo the current db
$db_selected = mysql_select_db('test', $link);
if (!$db_selected) {
die ('Can\'t use foo : ' .
mysql_error());
}
mysql_query("INSERT INTO t (c) values ('yyyyy')");
printf("Last inserted record has id %d\n", mysql_insert_id());
?>
index1.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test Page for Apache Installation</title>
</head>
<!-- Background white, links blue (unvisited), navy (visited), red
(active) -->
<body bgcolor="#FFFFFF" text="#000000"
link="#0000FF"
vlink="#000080" alink="#FF0000">
<a href="http://winlamp.sourceforge.net/"><img
border="0" src="winlamp.jpg" align="right"
alt="WinLAMP logo" vspace="20"
hspace="20"></a>
<h2>WinLAMP, she installed successfully.</h2>
<p>If you can see this, it means that the installation of the Apache
web server
software on this system was successful. </p>
<p>See <a href="http://localhost/index1.php">Hit for
run script </a> </p>
<br><br><br>
<h2>Configuration Tips</h2>
We consolidated various configuration tips into a
single location. <br>Take a look at the
<a href="winlamptips.html">configuration tips</a>.
<br><br>
<hr width="50%" size="8" />
<h2 align="center">Seeing this instead of the website you
expected?</h2>
<p>This page is here because the site administrator has changed the
configuration of this web server. Please <strong>contact the person
responsible
for maintaining this server with questions.</strong> The Apache
Software
Foundation, which wrote the web server software this site administrator is
using, has nothing to do with maintaining this site and cannot help resolve
configuration issues.</p>
<p>You are free to use the image below on an Apache-powered web
server. Thanks
for using Apache!</p>
<div align="center"><img src="apache_pb.gif"
alt="" /></div>
<p>This is going to be ignored.</p>
<?php echo 'While this is going to be parsed.'; ?>
<p>This will also be ignored.</p>
</body>
</html>
AND proove in SQLYog
Management of databases , tables and querry's is very simple .
Run:localhost/index1.html
.
Run:localhost/index1.html
Comentarii
Trimiteți un comentariu