Se connecter avec
S'enregistrer | Connectez-vous

Mise en forme d'un texte "a la joce"

Dernière réponse : dans Programmation

salut, j'ai envie de faire un machin qui cree des msg comme sur le forum mais mon niveau de php est a peu pres celui la : http://cit.timone.univ-mrs.fr/ppc/ [:D awa']

qqun peut m'expliquer ou m'envoyer un link sur comment mettre en page correctement du texte en php paske des qu ej fous des balises genre
  1. <p><font face="Arial" size="4" color=#000066></font></p>
ca me fous des parses errors a la noix c saoulant :( 

mycy [:rougit]

Autres pages sur : mise forme texte joce

Lassé par la pub ? Créez un compte

Tu veux faire quoi ? Un livre d'or ?

Sache que les variables passées en formulaires s'acquierent de la manière suivante :

$_GET['nom_de_la_variable'] / $_POST['nom_de_la_variable']

(les puristes me diront : il existe $_REQUEST, oui je sais mais je préfère différencier ;)  )

Ensuite, (si c'est toujours le cas) il te faut une base de données ..

Dis en un peu plus sur ce que tu veux faire.

ben g une page html qui me recupere une variable "$prout" pis qui m'envoie sur zob.php pour afficher tout connement la phrase que je veux

la ca marche, mais je voudrais la mettre en forme genre les msg a la con du forum lors des TT etc ... mais ca merdouille ché pas pkoi :( 

le code de ouf :

  1. <html>
  2. <body>
  3. <form method="post" action="zob.php">Entrez votre phrase : <input type="text" name="prout" size="50">
  4. <input type="submit" value="Yeah !">
  5. </form>
  6. </body>
  7. </html>



  1. <?
  2. $prout = $_POST['prout'];
  3. print("<center>$prout</center>");
  4. ?>


et j'aimerais l'afficher comme ca :

  1. <?xml version="1.0" encoding="ISO-8859-1" ?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>">
  3. <html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>">
  4. <head>
  5. <title>Il est impossible de s'envoyer un message privé à soi même</title>
  6. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
  7. <style type="text/css">
  8. .borduresarace
  9. {
  10. border-style:solid;
  11. border-width:1px;
  12. border-color:#CDC9BF;
  13. }
  14. </style>
  15. </head>
  16. <body bgcolor="#FFFFFF">
  17. <br /><br /><br />
  18. <table width="100%" border="0">
  19. <tr>
  20. <td align="center">
  21. <table width="50%" cellspacing="0" cellpadding="0" class="borduresarace">
  22. <tr>
  23. <td bgcolor="#FFFFFF" align="center">
  24. <font face="Arial" size="4" color="#000066">Flo14 is gay !!!</font>
  25. </td>
  26. </tr>
  27. </table>
  28. </td>
  29. </tr>
  30. </table>
  31. </body>
  32. </html>


[:brainwasher]

Bitman1er a écritle code de ouf :

  1. <html>
  2. <body>
  3. <form method="post" action="zob.php">Entrez votre phrase : <input type="text" name="prout" size="50">
  4. <input type="submit" value="Yeah !">
  5. </form>
  6. </body>
  7. </html>



  1. <?
  2. $prout = $_POST['prout'];
  3. print("<center>$prout</center>");
  4. ?>



  1. if ( $_POST['submit'] ) {
  2.  
  3. $prout = stripslashes($_POST['prout']);
  4. echo '<?xml version="1.0" encoding="ISO-8859-1" ?>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>">
  6. <html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>">
  7. <head>
  8. <title>' . $prout . '</title>
  9. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
  10. <style type="text/css">
  11. .borduresarace
  12. {
  13. border-style:solid;
  14. border-width:1px;
  15. border-color:#CDC9BF;
  16. }
  17. </style>
  18. </head>
  19. <body bgcolor="#FFFFFF">
  20. <br /><br /><br />
  21. <table width="100%" border="0">
  22. <tr>
  23. <td align="center">
  24. <table width="50%" cellspacing="0" cellpadding="0" class="borduresarace">
  25. <tr>
  26. <td bgcolor="#FFFFFF" align="center">
  27. <font face="Arial" size="4" color="#000066">' . $prout . '</font>
  28. </td>
  29. </tr>
  30. </table>
  31. </td>
  32. </tr>
  33. </table>
  34. </body>
  35. </html>';
  36.  
  37. } else {
  38.  
  39. ?>
  40.  
  41. <html>
  42. <body>
  43. <form method="post" action="zob.php">Entrez votre phrase : <input type="text" name="prout" size="50">
  44. <input type="submit" value="Yeah !">
  45. </form>
  46. </body>
  47. </html>
  48.  
  49. <?
  50.  
  51. }
  52. ?>


brut de fonderie là :) 

Bitman1er a écritnan c pas le cas :o 

bon par contre ca foire ton truc, en fait ca affiche que le else donc la meme chose que les 2 lignes originales :sweat: 

[:edit] non en fait ca foire :D 

http://cit.timone.univ-mrs.fr/ppc/

ca ca marche :

  1. <?
  2.  
  3. echo '<?xml version="1.0" encoding="ISO-8859-1" ?>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>">
  5. <html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>">
  6. <head>';
  7.  
  8.  
  9.  
  10. if ( $_POST['submit'] ) {
  11.  
  12. $prout = stripslashes($_POST['prout']);
  13. echo '
  14. <title>' . $prout . '</title>
  15. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
  16. <style type="text/css">
  17. .borduresarace
  18. {
  19. border-style:solid;
  20. border-width:1px;
  21. border-color:#CDC9BF;
  22. }
  23. </style>
  24. </head>
  25. <body bgcolor="#FFFFFF">
  26. <br /><br /><br />
  27. <table width="100%" border="0">
  28. <tr>
  29. <td align="center">
  30. <table width="50%" cellspacing="0" cellpadding="0" class="borduresarace">
  31. <tr>
  32. <td bgcolor="#FFFFFF" align="center">
  33. <font face="Arial" size="4" color="#000066">' . $prout . '</font>
  34. </td>
  35. </tr>
  36. </table>
  37. </td>
  38. </tr>
  39. </table>
  40. </body>
  41. </html>';
  42.  
  43. } else {
  44.  
  45. ?>
  46.  
  47. <html>
  48. <body>
  49. <form method="post" action="zob.php">Entrez votre phrase : <input type="text" name="prout" size="50">
  50. <input type="submit" name="submit" value="Yeah !">
  51. </form>
  52. </body>
  53. </html>
  54.  
  55. <?
  56.  
  57. }
  58. ?>

  1. <?
  2.  
  3. echo '<?xml version="1.0" encoding="ISO-8859-1" ?>
  4. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "<a href="http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" target="_blank">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</a>">
  5. <html xmlns="<a href="http://www.w3.org/1999/xhtml" target="_blank">http://www.w3.org/1999/xhtml</a>">
  6. <head>';
  7.  
  8.  
  9. $prout = $_GET['prout'];
  10. echo '
  11. <title>' . $prout . '</title>
  12. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
  13. <style type="text/css">
  14. .borduresarace
  15. {
  16. border-style:solid;
  17. border-width:1px;
  18. border-color:#CDC9BF;
  19. }
  20. </style>
  21. </head>
  22. <body bgcolor="#FFFFFF">
  23. <br /><br /><br />
  24. <table width="100%" border="0">
  25. <tr>
  26. <td align="center">
  27. <table width="50%" cellspacing="0" cellpadding="0" class="borduresarace">
  28. <tr>
  29. <td bgcolor="#FFFFFF" align="center">
  30. <font face="Arial" size="4" color="#000066">' . $prout . '</font>
  31. </td>
  32. </tr>
  33. </table>
  34. </td>
  35. </tr>
  36. </table>
  37. </body>
  38. </html>';
  39.  
  40.  
  41. ?>
Lassé par la pub ? Créez un compte