Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem ze skryptem
kacpero1094
post
Post #1





Grupa: Zarejestrowani
Postów: 87
Pomógł: 0
Dołączył: 22.12.2008

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


Mam taki skrypt:
<?
session_start();
$ses=$_GET['session'];
if ($ses=="destroy") {
session_destroy();
header("Location: /logowanie.php?logowanie=wylogowano");
}
if ($_SESSION['zalogowany']!="tak") {
header("Location: /logowanie.php?logowanie=no");
}
elseif ($_SESSION['ranga']!="admin") {
echo 'Dla Ciebie jest przeznaczony inny panel!';
} else {
include('../top.php');
?>
<h1>Panel administracyjny</h1>
<h2>Edytuj artykuł</h2>
<?
if (isset($_GET['id'])) {
include('../config.php');
$mysql=mysql_connect($serwer,$user,$haslo);
$mysql=mysql_select_db($baza);
$query=mysql_query("SELECT * FROM artykuly WHERE id LIKE '" . $_GET['id'] . "'");
$row=mysql_fetch_array($query);
$row[7]=str_replace('&lt','<;', $row[7]);
$row[7]=str_replace('&gt','>', $row[7]);
$row[7]=str_replace('<code>','
Kod
', $row[7]);
$row[7]=str_replace('</code>','
', $row[7]);
$row[7]=str_replace('<i>','', '$row[7]');
$row[7]=str_replace('</i>','
', $row[7]);
$row[7]=str_replace('<b>','', $row[7]);
$row[7]=str_replace('</b>','
', $row[7]);
$row[7]=str_replace('<u>','', $row[7]);
$row[7]=str_replace('</u>','
', $row[7]);
$row[7]=str_replace('<h3>','[h2]', $row[7]);
$row[7]=str_replace('</h3>','[/h2]', $row[7]);
$row[7]=str_replace('<h2>','[h1]', $row[7]);
$row[7]=str_replace('</h2>','[/h1]', $row[7]);
$row[7]=str_replace('<a href="','[a][href]', $row[7]);
$row[7]=str_replace('">','[/href]', $row[7]);
$row[7]=str_replace('</a>','[a]', $row[7]);
$row[7]=str_replace('<br />','
', $row[7]);
$row[7]=str_replace('<br>','
', $row[7]);
$row[7]=str_replace('<br><br>','

', $row[7]);
$row[7]=str_replace('<img src="','[img]', $row[7]);
$row[7]=str_replace('" alt="mojpecet.eu" />','[/img]', $row[7]);
echo '<form action=edytuj.php method=post>';
echo 'Tytuł: <br>';
echo '<input type=text class=pole name=tytul value="' . $row[1] . '"><br>';
echo '<textarea rows=15 cols=60 name=tresc class=pole>' , $row[7] , '</textarea><br>'; //tu jest jakiś błąd
echo '<input type=submit class=submit value=Zmień>';
echo '<//form>';
} else {
echo 'Nie wybrano artykułu!';
}
?>
<?
include('../dol.php');
}
?>
W linii o znaczonej komentarzem //tu jest jakiś błąd jest polecenie wyświetlające w polu tekstowym kolumnę $row[7] z tabeli. Zamiast tego w polu typu <textarea> wyświetla się tekst: $row[7]
Co zrobić?

Ten post edytował kacpero1094 30.12.2008, 14:35:17
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: 23.08.2025 - 22:26