Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP] problem z T_STRING
lolek18
post
Post #1





Grupa: Zarejestrowani
Postów: 18
Pomógł: 0
Dołączył: 3.03.2008

Ostrzeżenie: (0%)
-----


Witam! Mam problem. Na stronie index.php mam zapisane
<?include ("menu.php");?>

Niestety po wgraniu na serwer wyskakuje mi następujący błąd: Parse error: parse error, unexpected T_STRING in /home/g521/httpd/menu.php on line 12.

Oto kod menu.php:



Kod
<?
print ('

<head>
<meta http-equiv="Content-type" content="text/html;charset=ISO-8859-2">
</head>



<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="navoff" onmouseover="this.className='navon'" onmouseout="this.className='navoff'">Strona główna</td>
</tr>
<tr>
<td class="navoff" onmouseover="this.className='navon'" onmouseout="this.className='navoff'">Forum</td>
</tr>
<tr>
<td class="navoff" onmouseover="this.className='navon'" onmouseout="this.className='navoff'">newsy</td>
</tr>
<tr>
<td class="navoff" onmouseover="this.className='navon'" onmouseout="this.className='navoff'">Konkursy</td>
</tr>
<tr>
<td width="152" valign="top"><img src=\"images/typujemy.PNG\" alt=\"navigation\" width="152" height="26" /></tr>
<tr>
<td class="navoff" onmouseover="this.className='navon'" onmouseout="this.className='navoff'">Płatne pewniaki</td>
</tr>
<tr>
<td class="navoff" onmouseover="this.className='navon'" onmouseout="this.className='navoff'">Obstaw kupon</td>
</tr>
<tr>
<td class="navoff" onmouseover="this.className='navon'" onmouseout="this.className='navoff'">Archiwum typów</td>
</tr>
<tr>
<td class="navoff" onmouseover="this.className='navon'" onmouseout="this.className='navoff'">Sprawdzalno&para;ć</td>
</tr>

<tr>
<td class="navoff" onmouseover="this.className='navon'" onmouseout="this.className='navoff'">WYNIKI NA ŻYWO</td>
</tr>
<tr>
<td width="152" valign="top"><img src=\"images/onas.PNG\" alt=\"navigation\" width="152" height="26" /></tr>
<tr>
<td class="navoff" onmouseover="this.className='navon'" onmouseout="this.className='navoff'">Kontakt</td>
</tr>
<tr>
<td class="navoff" onmouseover="this.className='navon'" onmouseout="this.className='navoff'">Informacje</td>
</tr>
<tr>
<td class="navoff" onmouseover="this.className='navon'" onmouseout="this.className='navoff'">Nasze aukcje</td>
</tr>

</table>

');
?>


Z góry dzięki za pomoc!!!

Ten post edytował lolek18 15.04.2008, 17:43:34
Go to the top of the page
+Quote Post
Piniek
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 463
Pomógł: 49
Dołączył: 27.12.2007
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


robisz to troche bez sensu po co wyświetlasz przez print questionmark.gif jeżeli mozna zamknąć znacznik php i wyświetlić to menu jak zwykly html ;]


--------------------
Go to the top of the page
+Quote Post
nevt
post
Post #3





Grupa: Przyjaciele php.pl
Postów: 1 595
Pomógł: 282
Dołączył: 24.09.2007
Skąd: Reda, Pomorskie.

Ostrzeżenie: (0%)
-----


1. Wstaw kod do właściwych znaczników BBcode bo będę musiał zamknąć temat...
2. To nie jest kod PHP tylko czysty HTML - wywal tag php, funkcję print() i zapisz jako .html
3. posklejałeś sobie chyba 2 skrypty, w jednym miałeś znaki escape dla " a w drugim żadnych. całość ująłeś w apostrofy. czy je zostawisz, czy usuniesz - i tak nie zadziała - poczytaj w manualu o różnicach w stosowaniu apostrofów ' i cudzysłowów " oraz zasadach ich zagnieżdżania ...


--------------------

-
Oh no, my young coder. You will find that it is you who are mistaken, about a great many things... -
Go to the top of the page
+Quote Post
lolek18
post
Post #4





Grupa: Zarejestrowani
Postów: 18
Pomógł: 0
Dołączył: 3.03.2008

Ostrzeżenie: (0%)
-----


Tylko ja potrzebuję to, żeby nie zmieniać na okrągło menu jak dojdzie nowy odnośnik. więc robię sobie menu.php żeby mi wyświetlało i mam jeden plik i go edytuję i zmianę mam w 5 sekund. A tak musiałbym wszystkie strony przelecieć pokolei.

A jak wywalę php to menu.html jak mam zagnieździć w index.php?

Ten post edytował lolek18 15.04.2008, 17:48:09
Go to the top of the page
+Quote Post
Piniek
post
Post #5





Grupa: Przyjaciele php.pl
Postów: 463
Pomógł: 49
Dołączył: 27.12.2007
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


tak samo ;]


--------------------
Go to the top of the page
+Quote Post
bim2
post
Post #6





Grupa: Zarejestrowani
Postów: 1 873
Pomógł: 152
Dołączył: 9.04.2006
Skąd: Berlin

Ostrzeżenie: (0%)
-----


  1. <? include('menu.html'); ?>
lub
  1. <?php echo file_get_contents('menu.html'); ?>


--------------------
Go to the top of the page
+Quote Post
phpion
post
Post #7





Grupa: Moderatorzy
Postów: 6 072
Pomógł: 861
Dołączył: 10.12.2003
Skąd: Dąbrowa Górnicza




Cytat(bim2 @ 15.04.2008, 19:11:23 ) *
  1. <? include('menu.html'); ?>
lub
  1. <?php echo file_get_contents('menu.html'); ?>

I co to da?

@Piniek:
Robisz print ''; i w nim używasz apostrofów, np. tu:
  1. <td class="navoff" onmouseover="this.className='navon'" onmouseout="this.className='navoff'">Strona główna</td>

Musisz je poprzedzić znakiem backslasha czyli:
  1. <td class="navoff" onmouseover="this.className='navon'" onmouseout="this.className='navoff'">Strona główna</td>

i analogicznie w kolejnych liniach kodu.

Aczkolwiek również uważam, że print'owanie statycznego HTML to pomysł conajmniej głupi winksmiley.jpg
Go to the top of the page
+Quote Post
lolek18
post
Post #8





Grupa: Zarejestrowani
Postów: 18
Pomógł: 0
Dołączył: 3.03.2008

Ostrzeżenie: (0%)
-----


ok działa. dzięks
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 20.08.2025 - 04:37