Affichage PHP
Résolu
Super_carotte
Messages postés
1420
Date d'inscription
Statut
Membre
Dernière intervention
-
Super_carotte Messages postés 1420 Date d'inscription Statut Membre Dernière intervention -
Super_carotte Messages postés 1420 Date d'inscription Statut Membre Dernière intervention -
Bonjour,
Je ne comprend pas pourquoi mon echo '$var' n'affiche pas ce que l'utilisateur a saisi, pouvez vous m'aider?
Je cherche cela pour qu'ensuite la ligne juste dessous qui est en commentaire fonctionne avec le $var.
Merci a vous!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="STYLESHEET" type="text/css" href="styles.css">
<title>Scanning</title>
</head>
<body>
<div align="center">
<h2>Scanning</h2>
<a>Vous souhaitez scanner un document,</a><br>
<a>Renseigner:</a><br>
<form name="scan_doc" method="post">
<table>
<tr>
<td>Document à scanner:</td>
<td>
<input type="text" name="docscan">
</tr>
</table>
<input type="submit" name="Validerscan" value="Valider">
<input type="reset" name="Annuler" value="Annuler">
<?php
$var = $_POST["scan_doc"]
echo '$var'
// $foo = system('wget -O fichier.html $var',$output);
?>
</form>
</div>
</body>
</html>
Je ne comprend pas pourquoi mon echo '$var' n'affiche pas ce que l'utilisateur a saisi, pouvez vous m'aider?
Je cherche cela pour qu'ensuite la ligne juste dessous qui est en commentaire fonctionne avec le $var.
Merci a vous!
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="STYLESHEET" type="text/css" href="styles.css">
<title>Scanning</title>
</head>
<body>
<div align="center">
<h2>Scanning</h2>
<a>Vous souhaitez scanner un document,</a><br>
<a>Renseigner:</a><br>
<form name="scan_doc" method="post">
<table>
<tr>
<td>Document à scanner:</td>
<td>
<input type="text" name="docscan">
</tr>
</table>
<input type="submit" name="Validerscan" value="Valider">
<input type="reset" name="Annuler" value="Annuler">
<?php
$var = $_POST["scan_doc"]
echo '$var'
// $foo = system('wget -O fichier.html $var',$output);
?>
</form>
</div>
</body>
</html>
A voir également:
- Affichage PHP
- Affichage double ecran - Guide
- Easy php - Télécharger - Divers Web & Internet
- Windows 11 affichage classique - Guide
- Problème affichage fenêtre windows 10 - Guide
- Expert php pinterest - Télécharger - Langages
4 réponses
Salut,
Ben déjà la ligne c'est :
$var = $_POST["docscan"]
et pas
$var = $_POST["scan_doc"]
vu le nom de tes champs input
Et ensuite enlève les ' autour de ton $var dans ton echo, ça devrait aller mieux ;)
echo $var;
Ben déjà la ligne c'est :
$var = $_POST["docscan"]
et pas
$var = $_POST["scan_doc"]
vu le nom de tes champs input
Et ensuite enlève les ' autour de ton $var dans ton echo, ça devrait aller mieux ;)
echo $var;
Slt,
je remarque que tu oublies les ";" en fin de ligne dans ton code php
$var = $_POST["scan_doc"] ;
echo '$var' ;
je remarque que tu oublies les ";" en fin de ligne dans ton code php
$var = $_POST["scan_doc"] ;
echo '$var' ;
J'ai fait les corrections que tu proposes mais l'affichage reste vide.
J'ai repris ton code et j'ai séparé le code html et php en deux pages distinctes et ça fonctionne.
Voilà les codes:
Pour ta page html:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="STYLESHEET" type="text/css" href="styles.css">
<title>Scanning</title>
</head>
<body>
<div align="center">
<h2>Scanning</h2>
<a>Vous souhaitez scanner un document,</a><br>
<a>Renseigner:</a><br>
<form name="scan_doc" method="post" action="ta_page.php">
<table>
<tr>
<td>Document à scanner:</td>
<td>
<input type="text" name="docscan">
</tr>
</table>
<input type="submit" name="Validerscan" value="Valider">
<input type="reset" name="Annuler" value="Annuler">
</form>
</div>
</body>
</html>
Et ta page php:
<?php
$var = $_POST["docscan"];
echo $var;
// $foo = system('wget -O fichier.html $var',$output);
?>
voilà.... ^^
Je vais essayer de faire en sorte que ça tienne sur une page car (ça va vous faire rire vu mon niveau) je dois faire des trucs plutot compliqué.
W get, ce genre de chose... j'y comprend pas grand chose mais bon, je vais essayer =)
Aller zou, je pars sur un petit controle de validation d'abord,
Merci a vous tous!