Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] podstawianie zmiennej, pod link
-Gość_andi_*-
post
Post #1





Goście







witam (IMG:http://forum.php.pl/style_emoticons/default/dry.gif) mam male, glupie pytanie... jezeli otrzymuje z formularza dane tzn np. numer gg: 123456 i jest on przypisany pod zmienna $gadu to jak zrobic, aby podstawic ta zmienna do linka aby wyszedl link
echo '<A href="gg:'$gadu'">ble ble ble</A>'; (?) tzn "gg:123456" ( echo '<A href="gg:123456">ble ble ble</A>';
(IMG:http://forum.php.pl/style_emoticons/default/blinksmiley.gif) pomocy
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
-gosc-
post
Post #2





Goście







no wiec CALY kod pliku wyglada tak:

  1. <br>
  2. <?php
  3. /*********************************************
  4. * formularz
  5. *********************************************/
  6.  
  7. $pole1 = trim($_POST['pole1']);
  8. $pole2 = trim($_POST['pole2']);
  9. $pole3 = trim($_POST['pole3']);
  10. $pole4 = trim($_POST['pole4']);
  11. $data = date("H:i d.m.Y");
  12. $pole5 = trim($_POST['pole5']);
  13.  
  14. if(empty($pole1) and empty($pole2) and empty($pole5)) {
  15.  
  16. echo '<form action="" method="post">
  17. <input type="text" name="pole1" style="border: 0; width: 250px; height: 24px; background: url(page/50/graffika/ksiegaimie.gif)" />
  18. <input type="text" name="pole2" style="border: 0; width: 250px; height: 24px; background: url(page/50/graffika/ksiegaemail.gif)" /><br>
  19. <input type="text" name="pole3" style="border: 0; width: 250px; height: 24px; background: url(page/50/graffika/ksiegawww.gif)" />
  20. <input type="text" name="pole4" style="border: 0; width: 250px; height: 24px; background: url(page/50/graffika/ksiegagadu.gif)" /><br>
  21. <textarea name="pole5" style="border: 0; width: 500px; height: 48px; background: url(page/50/graffika/ksiegatresc.gif)">
  22. </textarea><br />
  23. <input type="submit" value="Dopisz sie!" /><br/>
  24. </form>';
  25.  
  26. }
  27. else {
  28.  
  29. $dane = $pole1."`".$pole2."`".$pole3."`".$pole4."`".$data."`".$pole5."n";
  30.  
  31. $file="baza.txt";
  32.  
  33. $fp=fopen("$file", "r+");
  34.  
  35. $dane=$dane.fread($fp, filesize($file));
  36.  
  37. rewind($fp);
  38.  
  39. flock($fp, 2);
  40.  
  41. fwrite($fp, $dane);
  42.  
  43. flock($fp, 3);
  44.  
  45. fclose($fp);
  46.  
  47. echo "Dziekuje za dodanie wpisu :)<br /><br><br>";
  48. }
  49.  
  50.  
  51. /*********************************************
  52. * podglad
  53. *********************************************/
  54.  
  55. $file = file("baza.txt");
  56. foreach($file as $value) {
  57. $exp = explode("`",$value);
  58. echo $exp[0]." ".$exp[1]." ".$exp[2]." ".$exp[3]." ".$exp[4]."<br />".$exp[5]."<hr />";
  59. } 
  60.  
  61. echo '<table border="1" width="490" cellspacing="0" cellpadding="0">
  62. <tr>
  63. <td colspan="2">'.$exp[0].'</td>
  64. <td width="199">
  65. <p align="right">'.$exp[4].'</td>
  66. </tr>
  67. <tr>
  68. <td width="124">
  69. <p align="center">
  70. <a href='gg:<?php echo $exp[3]; ?>'><img border="0" src="page/50/graffika/gadu.gif" width="32" height="32"></A>;
  71. </td>
  72. <td colspan="2">
  73. <p align="center">'.$exp[5].'</td>
  74. </tr>
  75. <tr>
  76. <td width="124">&nbsp;</td>
  77. <td width="167">&nbsp;</td>
  78. <td width="199">
  79. <p align="right">ip</td>
  80. </tr>
  81. </table>';
  82.  
  83. ?>


wywala caly czas:
"Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' ... no line 70"

nospor... punkt 2 i 3 odpada (IMG:http://forum.php.pl/style_emoticons/default/winksmiley.jpg)
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 29.12.2025 - 18:03