Δημοσιεύτηκε: 17 Νοέμ 2014, 17:47
Θεωριτηκα μιαζουν ενταξη δες αυτο :
php αρχειο :
Τωρα δες τα σφαλαματα του περιγητη :
τι κανω , γενικος εχω προβλημα με την συνδεση αρχειων php to html
- Κώδικας: Επιλογή όλων
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta charset="UTF-8">
<head>
<title> color sampler</title>
</head>
<body>
<h2> color sampler </h2>
<from method="get" action="/opt/lampp/htdocs/display.php">
R: <input type="text" name="r" size="3"/> <p/>
G:<input type="text" name="g" size="3" /> <p/>
B:<input type="text" name="b" size="3" /> <p/>
<input type="submit" value="show me" />
</from>
</body>
</html>
php αρχειο :
- Κώδικας: Επιλογή όλων
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta charset="UTF-8">
<head>
<title> color sampler</title>
</head>
<body>
<h2> color sampler </h2>
<?php
//
$r = $_GET['r'];
$g = $_GET['g'];
$b = $_GET['b'];
//
$rgb= "$r . ',' . $g . ',' . $b" ;
?>
R: <?php echo $r; ?>
G: <?php echo $g;?>
B: <?php echo $b;?>
<p/>
<div style="width:150px; heigh:150px; background-color:rgb(<?php echo $rgb; ?>)" />
</body>
</html>
Τωρα δες τα σφαλαματα του περιγητη :
- Κώδικας: Επιλογή όλων
color sampler
Notice: Undefined index: r in /opt/lampp/htdocs/display.php on line 11
Notice: Undefined index: g in /opt/lampp/htdocs/display.php on line 12
Notice: Undefined index: b in /opt/lampp/htdocs/display.php on line 13
R: G: B:
τι κανω , γενικος εχω προβλημα με την συνδεση αρχειων php to html