Buongiorno a tutti, sto scrivendo il mio primo codice PHP con HTML. Ho scritto un codice HTML che deve acquisire dei dati e che poi richiama un file php che deve prendere questi dati e stamparli a video. Purtroppo questa seconda parte non la fa. Premetto che ho installato xampp. Vi posto qui sotto codice e immagini.
Grazie a chi può darmi una mano.
CODICE HMTL:
<html>
<head>
<link href="../css/phpMM.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header"><h1>MY WEB SITE</h1></div>
<div id="content">
<p>Please enter your online connections below:</p>
<form action="scripts/showRequestInfo.php" method="POST">
<fieldset>
<label for="first_name">First Name:</label> <input type="text" name="first_name" size="20" /><br />
<label for="last_name">Last Name:</label> <input type="text" name="last_name" size="20" /><br />
<label for="email">E-Mail Address:</label> <input type="text" name="email" size="50" /><br />
<label for="facebook_url">Facebook URL:</label> <input type="text" name="facebook_url" size="50" /><br />
<label for="twitter_handle">Twitter Handle:</label> <input type="text" name="twitter_handle" size="20" /><br />
</fieldset>
<br />
<fieldset class="center">
<input type="submit" value="Join the Club" />
<input type="reset" value="Clear and Restart" />
</fieldset>
</form>
</div>
<div id="footer"></div>
</body>
</html>
CODICE HMTL/PHP:
<html>
<head>
<link href="../../css/phpMM.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="header"><h1>PHP & MySQL: The Missing Manual</h1></div>
<div id="example">Example 2-1</div>
<div id="content">
<p>Here's a record of what information you submitted:</p>
<p>
First Name: <?php echo $_REQUEST['first_name']; ?><br />
Last Name: <?php echo $_REQUEST['last_name']; ?><br />
E-Mail Address: <?php echo $_REQUEST['email']; ?><br />
Facebook URL: <?php echo $_REQUEST['facebook_url']; ?><br />
Twitter Handle: <?php echo $_REQUEST['twitter_handle']; ?><br />
</p>
</div>
<div id="footer"></div>
</body>
</html>
<html>
<head>
<link href="../../css/phpMM.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="content">
<p>Here's a record of everything in the $_REQUEST array:</p>
<?php
foreach($_REQUEST as $key => $value) {
echo "<p>For " . $key . ", the value is '" . $value . "'.</p>";
}
?>
</div>
<div id="footer"></div>
</body>
</html>
Allegati: