Problème PHP
Fermé
lapin0506
Messages postés
16
Date d'inscription
mardi 30 décembre 2008
Statut
Membre
Dernière intervention
10 mai 2009
-
9 mai 2009 à 19:47
Alain_42 Messages postés 5361 Date d'inscription dimanche 3 février 2008 Statut Membre Dernière intervention 13 février 2017 - 9 mai 2009 à 20:16
Alain_42 Messages postés 5361 Date d'inscription dimanche 3 février 2008 Statut Membre Dernière intervention 13 février 2017 - 9 mai 2009 à 20:16
Bonjour, quand je marque un texte sur le Bloc Note en PHP, et bien je marque bien ''nom de fichier".php, cela pas de problème mais quand je vais dans ''mes documents", et que j'ouvre mon fichier, il y a RIEN dessus ou il y a un texte qui ne veut ABSOLUMENT rien dire (je fais très attention a mettre les bonnes balises et a les refermer correctement). Voîlà, alors si vous pouvez m'aider tout de suite, sa serait génial!!!
Merci
Merci
A voir également:
- Problème PHP
- Easy php - Télécharger - Divers Web & Internet
- Expert php pinterest - Télécharger - Langages
- Php alert ✓ - Forum PHP
- Bouton php - Forum PHP
- Retour à la ligne php ✓ - Forum PHP
7 réponses
ben85350
Messages postés
610
Date d'inscription
vendredi 30 mai 2008
Statut
Membre
Dernière intervention
2 avril 2013
27
9 mai 2009 à 19:50
9 mai 2009 à 19:50
Ça doit venir d'un problème d'encodage.
Je te conseille Notepad++ pour développer : simple et efficace.
Je te conseille Notepad++ pour développer : simple et efficace.
Utilisateur anonyme
9 mai 2009 à 19:53
9 mai 2009 à 19:53
Bonsoir,
Tu ouvres le fichier dans ton navigateur ? Si oui, il faut utiliser par exemple Wamp ou EasyPHP.
Tu ouvres le fichier dans le bloc-notes ? Si oui, solution donnée au message du dessus.
Tu ouvres le fichier dans ton navigateur ? Si oui, il faut utiliser par exemple Wamp ou EasyPHP.
Tu ouvres le fichier dans le bloc-notes ? Si oui, solution donnée au message du dessus.
lapin0506
Messages postés
16
Date d'inscription
mardi 30 décembre 2008
Statut
Membre
Dernière intervention
10 mai 2009
9 mai 2009 à 19:54
9 mai 2009 à 19:54
ok, et d'ou vient le probleme dans ce code??
MERCI
<?php
$host="localhost"; // Host name
$username=""; // Mysql username
$password=""; // Mysql password
$db_name="test"; // Database name
$tbl_name="forum_question"; // Table name
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$sql="SELECT * FROM $tbl_name ORDER BY id DESC";
// OREDER BY id DESC is order result by descending
$result=mysql_query($sql);
?>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="6%" align="center" bgcolor="#E6E6E6"><strong>#</strong></td>
<td width="53%" align="center" bgcolor="#E6E6E6"><strong>Topic</strong></td>
<td width="15%" align="center" bgcolor="#E6E6E6"><strong>Views</strong></td>
<td width="13%" align="center" bgcolor="#E6E6E6"><strong>Replies</strong></td>
<td width="13%" align="center" bgcolor="#E6E6E6"><strong>Date/Time</strong></td>
</tr>
<?php
while($rows=mysql_fetch_array($result)){ // Start looping table row
?>
<tr>
<td bgcolor="#FFFFFF"><? echo $rows['id']; ?></td>
<td bgcolor="#FFFFFF"><a href="view_topic.php?id=<? echo $rows['id']; ?>"><? echo $rows['topic']; ?></a><BR></td>
<td align="center" bgcolor="#FFFFFF"><? echo $rows['view']; ?></td>
<td align="center" bgcolor="#FFFFFF"><? echo $rows['reply']; ?></td>
<td align="center" bgcolor="#FFFFFF"><? echo $rows['datetime']; ?></td>
</tr>
<?php
// Exit looping and close connection
}
mysql_close();
?>
<tr>
<td colspan="5" align="right" bgcolor="#E6E6E6"><a href="create_topic.php"><strong>Create New Topic</strong> </a></td>
</tr>
</table>
MERCI
<?php
$host="localhost"; // Host name
$username=""; // Mysql username
$password=""; // Mysql password
$db_name="test"; // Database name
$tbl_name="forum_question"; // Table name
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$sql="SELECT * FROM $tbl_name ORDER BY id DESC";
// OREDER BY id DESC is order result by descending
$result=mysql_query($sql);
?>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="6%" align="center" bgcolor="#E6E6E6"><strong>#</strong></td>
<td width="53%" align="center" bgcolor="#E6E6E6"><strong>Topic</strong></td>
<td width="15%" align="center" bgcolor="#E6E6E6"><strong>Views</strong></td>
<td width="13%" align="center" bgcolor="#E6E6E6"><strong>Replies</strong></td>
<td width="13%" align="center" bgcolor="#E6E6E6"><strong>Date/Time</strong></td>
</tr>
<?php
while($rows=mysql_fetch_array($result)){ // Start looping table row
?>
<tr>
<td bgcolor="#FFFFFF"><? echo $rows['id']; ?></td>
<td bgcolor="#FFFFFF"><a href="view_topic.php?id=<? echo $rows['id']; ?>"><? echo $rows['topic']; ?></a><BR></td>
<td align="center" bgcolor="#FFFFFF"><? echo $rows['view']; ?></td>
<td align="center" bgcolor="#FFFFFF"><? echo $rows['reply']; ?></td>
<td align="center" bgcolor="#FFFFFF"><? echo $rows['datetime']; ?></td>
</tr>
<?php
// Exit looping and close connection
}
mysql_close();
?>
<tr>
<td colspan="5" align="right" bgcolor="#E6E6E6"><a href="create_topic.php"><strong>Create New Topic</strong> </a></td>
</tr>
</table>
Utilisateur anonyme
9 mai 2009 à 19:59
9 mai 2009 à 19:59
Ce code t'affiche une erreur ?
Si tu utilises ce code en local (avec wamp), il faut mettre $username="root".
Si tu utilises ce code en local (avec wamp), il faut mettre $username="root".
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question
lapin0506
Messages postés
16
Date d'inscription
mardi 30 décembre 2008
Statut
Membre
Dernière intervention
10 mai 2009
9 mai 2009 à 20:08
9 mai 2009 à 20:08
non, c'est bon, je n'arrive pas trop a utiliser notepad car, j'ouvre ''notepad'', je vais dans ''language'', je selectionne ''PHP'', je fais ''copier/coller '' j'enregistre, et rien ne s'ouvre. Puis je vais dans ''enregistrer sous'', et le fichier s'enregistre sous forme ''****.log''. Aidez moi svp
Utilisateur anonyme
9 mai 2009 à 20:12
9 mai 2009 à 20:12
Quand tu fais enregistrer/sous, tu écris bien : nom_de_fichier.php ?
Alain_42
Messages postés
5361
Date d'inscription
dimanche 3 février 2008
Statut
Membre
Dernière intervention
13 février 2017
894
9 mai 2009 à 20:16
9 mai 2009 à 20:16
un conseil si tu veux coder en php, télécharges et installes Notepad++ (gratos)
pour editer le php c'est beaucoup mieux que bloc note
ensuite quand tu dis je l'ouvre ensuite, tu l'ouvres avec quoi ? Bloc notes ou tu cliques 2 fois dessus ?
pour editer le php c'est beaucoup mieux que bloc note
ensuite quand tu dis je l'ouvre ensuite, tu l'ouvres avec quoi ? Bloc notes ou tu cliques 2 fois dessus ?