Eigus
16.11.2013, 22:24:59
Cześć. Mam pytanie. Jak zrobić, że po wpisaniu informacji dowolnej i kliknięciu w button do tabelki pod nim zostanie dodana informacja z buttona. Jak to zrobić prosze o pomoc! Coś takiego jak na stronie:
http://pl-hb.net/playnow/index.php
boro11
16.11.2013, 23:19:46
if(isset($_POST['submit'])) {
$text = $_POST['text'];
}
<form action="" method="POST"> <input type="text" name="text"> <input type="submit" name="submit" value="Dodaj">
tabelke sobie dorób - daj to w tagach <? ?> w jakiejś komórce:
Eigus
16.11.2013, 23:40:31
A jak zrobić, żeby tworzyły się nowe tabele przy dodaniu?
kujol
16.11.2013, 23:50:05
Zamiast tego
Kod
echo $text;
Daj to, oczywiście z dorobioną tabelką
Kod
if(isset($_POST['submit'])){
$text = $_POST['text'];
echo $text;
}
else {}
Eigus
16.11.2013, 23:52:29
A gdzie dokładnie w tabelce to dodać?
kujol
16.11.2013, 23:55:13
Pod formularzem pomiędzy <? ?> (tam gdzie wysyłasz dane)
Eigus
16.11.2013, 23:56:47
Wyskakuje mi błąd jak dodaje Twój kod.
kujol
17.11.2013, 00:01:23
To tez usuń
Kod
if (isset ( $_POST [ 'submit' ]))
{
$text = $_POST [ 'text' ];
}
Twój kod powinien wyglądać tak :
Kod
<html>
Tutaj formularz
<?
Skrypt php
?>
</html>
Eigus
17.11.2013, 00:04:43
Równiez nie działa. Wkleisz mi wszystko po kolei?
kujol
17.11.2013, 00:08:05
Kod
<html>
< form action= ""
method= "POST" >
< input type = "text"
name = "text" >
< input type = "submit"
name = "submit"
value = "Dodaj" >
< / form >
<?
if(isset($_POST['submit'])){
$text = $_POST['text'];
echo '$text';
}
else { }
?>
</html>
Eigus
17.11.2013, 00:09:06
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/pplhax/public_html/wyszukiwarka.php(7) : eval()'d code on line 31
Taki błąd mam.
kujol
17.11.2013, 00:13:46
Czyli błąd jest w okolicach 31linii. Jak nadal nie dziala to pokaż wszystko co masz.
Eigus
17.11.2013, 00:15:20
<html>
<head>
{$headerinclude}
<title>Wyszukiwarka sparingów</title>
</head>
<body>
{$header}
<table border="0" cellspacing="{$theme['borderwidth']}" cellpadding="{$theme['tablespace']}" class="tborder" style="clear: both; border-bottom-width: 0;">
<tr>
<td class="thead" colspan="2">
Wyszukaj sparing:
</td>
</tr>
<tr>
<td class="trow2 post_content ">
<html>
< form action= ""
method= "POST" >
< input type = "text"
name = "text" >
< input type = "submit"
name = "submit"
value = "Dodaj" >
< / form >
<?
if(isset($_POST['submit'])){ $text = $_POST['text'];
}
else { }
?>
</html>
<header class="thead">Sparingi:</header>
<div class="panel_01" style="padding: 0 10px 10px 10px; background: #3c312b;">
<div class="trow1" style="text-align:center;"><br/><br></br>
</body>
</html>
kujol
17.11.2013, 00:25:23
<html>
<head>
{$headerinclude}
<title>Wyszukiwarka
sparingów</title>
</head>
<body>
{$header}
<table border="0"
cellspacing="{$theme
['borderwidth']}"
cellpadding="{$theme
['tablespace']}"
class="tborder"
style="clear: both; border-
bottom-width: 0;">
<tr>
<td class="thead"
colspan="2">
Wyszukaj sparing:
</td>
</tr>
<tr>
<td class="trow2
post_content ">
< form action= ""
method= "POST" >
< input type = "text"
name = "text" >
< input type = "submit"
name = "submit"
value = "Dodaj" >
< / form >
<?
if (isset ( $_POST [ 'submit' ])) {
$text = $_POST [ 'text' ] ;
}
else { }
?>
<header
class="thead">Sparingi:</
header>
<div class="panel_01"
style="padding: 0 10px
10px 10px; background:
#3c312b;">
<div class="trow1"
style="text-
align:center;"><br/><br></
br>
</body>
</html>
Eigus
17.11.2013, 00:26:50
W tym szablonie została wykryta potencjalna luka bezpieczeństwa - Taka wiadomość od MyBB
kujol
17.11.2013, 00:40:20

nigdy nie miałem styczności z MyBB, może wujek google pomoże.
1 wynik wyszukiwania:
https://forum.mybboard.pl/watek-mybb-blad-w...eczenstwa_45705
Eigus
17.11.2013, 00:42:15
A co z kodem, może samo html da rade?
kujol
17.11.2013, 08:32:26
Kod jest dobry, ale jeśli chcesz pozbyć się php, użyj ajax.
programowanie.opole.pl/archives/2115
Eigus
17.11.2013, 12:03:45
A mógłbyś mi zrobić to o oparcie z tym linkiem co wysłaleś? Bo mam z tym problem.
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę
kliknij tutaj.