Php => $_post
zdoobz
Messages postés
34
Statut
Membre
-
Bobby -
Bobby -
salut les gens !
j'ai un probleme trop CON en php plz help!
j'ai ca :
<?
if (($_GET["ok"]) && ($x=1) )
{
if ( (!empty($_GET["nama"])) && (!empty($_GET["pwd"])) )
{
echo "<font color=\"red\"> 2nd too: Welcome $nama </font>";
}
echo "1st works";
?>
et puis cha:
<form action="index.php?x=1" method="post" >
<table width="100%" cellpadding="0" cellspacing="0" bgcolor="#F1F8FF">
<tr>
<td background="titlebckg.png" height="25px"><center>
<b>:LoG:</b>
</center></td>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0" border="0" background="icones/fant.png" style="r">
<tr>
<td>
<center>
<input name="nama" type="text" size="10" value="Nick">
</center>
</td>
</tr>
<tr>
<td style="border-bottom: 1px solid #66CCFF;">
<center>
<input name="pwd" type="password" size="8" ">
<input type="submit" size="2" value="Ok" name="ok" >
</center>
</td>
</tr>
</table>
</form>
dsl pr tt le html ke j'ai inséré mais bon :s si vs pouvez m'aider.. s'il mank des guillements ou koa c pck j'ai viré le css ..
merci !
j'ai un probleme trop CON en php plz help!
j'ai ca :
<?
if (($_GET["ok"]) && ($x=1) )
{
if ( (!empty($_GET["nama"])) && (!empty($_GET["pwd"])) )
{
echo "<font color=\"red\"> 2nd too: Welcome $nama </font>";
}
echo "1st works";
?>
et puis cha:
<form action="index.php?x=1" method="post" >
<table width="100%" cellpadding="0" cellspacing="0" bgcolor="#F1F8FF">
<tr>
<td background="titlebckg.png" height="25px"><center>
<b>:LoG:</b>
</center></td>
</tr>
</table>
<table width="100%" cellpadding="0" cellspacing="0" border="0" background="icones/fant.png" style="r">
<tr>
<td>
<center>
<input name="nama" type="text" size="10" value="Nick">
</center>
</td>
</tr>
<tr>
<td style="border-bottom: 1px solid #66CCFF;">
<center>
<input name="pwd" type="password" size="8" ">
<input type="submit" size="2" value="Ok" name="ok" >
</center>
</td>
</tr>
</table>
</form>
dsl pr tt le html ke j'ai inséré mais bon :s si vs pouvez m'aider.. s'il mank des guillements ou koa c pck j'ai viré le css ..
merci !
A voir également:
- Php => $_post
- Easy php - Télécharger - Divers Web & Internet
- Expert php pinterest - Télécharger - Langages
- Retour a la ligne php - Forum Webmastering
- Alert php - Forum PHP
- Retour a la ligne php ✓ - Forum PHP
5 réponses
Il manque une accolade, le bon code php est le suivant :
<?
if (($_GET["ok"]) && ($x==1) )
{
if ( (!empty($_GET["nama"])) && (!empty($_GET["pwd"])) )
{
echo "<font color=\"red\"> 2nd too: Welcome $nama </font>";
}
}
echo "1st works";
?>
<?
if (($_GET["ok"]) && ($x==1) )
{
if ( (!empty($_GET["nama"])) && (!empty($_GET["pwd"])) )
{
echo "<font color=\"red\"> 2nd too: Welcome $nama </font>";
}
}
echo "1st works";
?>
ou plutôt (plus adapté au code, je crois) :
<?php
if (($_GET["ok"]) && ($x==1) )
{
if ( (!empty($_GET["nama"])) && (!empty($_GET["pwd"])) )
{
echo "<font color=\"red\"> 2nd too: Welcome $nama </font>";
}
echo "1st works";
}
?>
<?php
if (($_GET["ok"]) && ($x==1) )
{
if ( (!empty($_GET["nama"])) && (!empty($_GET["pwd"])) )
{
echo "<font color=\"red\"> 2nd too: Welcome $nama </font>";
}
echo "1st works";
}
?>
Petite remarque, pour que le code fonctionne, il faut utiliser l'array $_POST au lieu de $_GET pour tester les variables, puisque la méthode du form est post et non get ;-)
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question