Witajcie,
Otóż niedawno zaczełem pisaćtakie początkujące 'kodziki' w PHP. Mój kod polega na wyciągnieciu danych z bazy danych z tabelki 'SavePlayer'. Zrobiłem że po wpisaniu nicku użytkownika w pole input przekierowuje do podstrony z jego informacjami lecz działą to w ten sposób że po odswieżeniu już jakby 'sesja wygasła' i wyskakuje puste pole bez żadnego profilu. Chciałbym zeby działało to na podstawie
http://link.com/users.php?nick={NICK UŻytkownika} i tam wyświetlało dane wybranego użytkownika.
Tak wygląda mój kod:
display.php:
<form method="post" name="display" action="users.php" /> <input type="text" name="Nick" /> <input type="submit" name="Submit" value="display" />
users.php:
<?php
include('conf.php');
$Nick = $_POST['Nick'];
$query = "select * from SavePlayer where Nick = '$Nick'";
echo "<div style='float: left;margin-top: 15px;margin-left: 2px;'>"; echo '<img src="Skins/Skin_'.$line['Skin'].'.png" />';
<div style='float: left; margin-top: 15px; margin-left: 10px;'>
<span style='font-family: Oswald; font-size: 15px;'>Ogólne:</span><table>";
echo "<table style='float:left;'";
echo "<tbody><tr style='height: 27px'><td><b>Nick:</b>";
echo "<tr style='height: 27px'><td><b>Zabójstwa:</b>";
echo "<tr style='height: 27px'><td><b>Śmierći:</b>";
echo "<tr style='height: 27px'><td><b>Exp:</b>";
echo "<tr style='height: 27px'><td><b>Stan konta:</b>";
echo "<tr style='height: 27px'><td><b>Czas gry:</b>"; echo $line['PlayingTime'];
echo "<tr style='height: 27px'><td><b>Punkty driftu:</b>";
echo "<tr style='height: 27px'><td><b>Warny:</b>";
echo " <div style='float: left;margin-top: -26px;margin-left: 130px;'><span style='font-family: Oswald; font-size: 15px;'>Areny DM:</span><table>";
echo "<tr style='height: 27px'><td><b>Fragi DE:</b>";
echo "<tr style='height: 27px'><td><b>Fragi WA:</b>";
echo "<tr style='height: 27px'><td><b>Fragi MI:</b>";
echo "<tr style='height: 27px'><td><b>Fragi SN:</b>";
echo "<tr style='height: 27px'><td><b>Fragi SO:</b>";
echo "<tr style='height: 27px'><td><b>Fragi RPG:</b>";
echo "<tr style='height: 27px'><td><b>Fragi DM:</b>";
echo "<tr style='height: 27px'><td><b>Fragi SH:</b>";
echo "<tr style='height: 27px'><td><b>Fragi HE:</b>";
echo " </tbody></table></div><br /> <br/>";
echo '<iframe src="http://bepowerserver.tk/sygna/signature.php?player_name='.$line['Nick'].' " width="500px" height="150px" ></iframe>';
}
?>
Mógłby ktośpomóc zrobić te linki i zapowiedz tzw 'sql injection' (troche czytałem lecz żaden tutek nie pomógł)
Z góry bardzo dziękuje (IMG:
style_emoticons/default/smile.gif)
PS: Przykład o co mi chodzi znajduje się w tym iframe podanym w users.php
Ten post edytował masterbeat 28.09.2014, 16:00:42