To jest tylko wersja do druku, aby zobaczyć pełną wersję tematu, kliknij TUTAJ
phpBB2 by Przemo
Support forów phpBB2 modified by Przemo

HTML/PHP/AJAX/JS - Generator

Aki - 08-05-2009, 14:10
Temat postu: Generator
Witam robie generator i mam kod
Kod:
<?php
if(isset($_POST['generuj']))
{
print "<textarea cols=\"40\" rows=\"3\" readonly=\"readonly\">";
print "#include <a_samp>
public OnPlayerConnect(playerid)
{
SendClientMessageToAll(".$_POST['kolor']." ,".$_POST['wiadomosc'].");
return 1;
}";
print "</textarea>";
}
else
{
print "<form method=\"post\">";

print "<table>";
print "<tr><td>Wiadomosc: </td><td><input type=\"text\" name=\"wiadomosc\" size=\"25\"/></td></tr>";
print "<tr><td>Kolor: </td><td><input type=\"text\" name=\"kolor\" size=\"25\"/></td></tr>";
print "</table>";
print "<input type=\"submit\" name=\"generuj\" value=\"generuj\"/>";
print "</form>";
}
?>


Ale wyswietla mi sie wiadomosc

Kod:
#include <a_samp>
public OnPlayerConnect(playerid)
{
SendClientMessageToAll(tekst ,tekst);
return 1;
}



A prawidlowo chce ustawic tak:

Kod:
#include <a_samp>
public OnPlayerConnect(playerid)
{
SendClientMessageToAll(tekst , "tekst");
return 1;
}


A jak ustawie
Kod:
SendClientMessageToAll( ".$_POST['kolor']." ," ".$_POST['wiadomosc']." ");


To jest blad

Radek - 08-05-2009, 14:56

Zamien ten kawalek kodu:
Kod:
print "<textarea cols=\"40\" rows=\"3\" readonly=\"readonly\">";
print "#include <a_samp>
public OnPlayerConnect(playerid)
{
SendClientMessageToAll(".$_POST['kolor']." ,".$_POST['wiadomosc'].");
return 1;
}";
print "</textarea>";

na:

Kod:
echo '<textarea cols="40" rows="3" readonly="readonly">
#include <a_samp>
public OnPlayerConnect(playerid)
{
SendClientMessageToAll('.$_POST['kolor'].' ,"'.$_POST['wiadomosc'].'");
return 1;
}
</textarea>';



Powered by phpBB modified by Przemo © 2003 phpBB Group