» »

Kaj je tukaj narobe [PHP]

Bojevnik ::

<html>
<body>

<?php

echo $_POST["ime"];
echo $_POST["priimek"];
echo $_POST["naslov"];
echo $_POST["id"];
echo $_POST["id_st"];
echo $_POST["emso"];
echo $_POST["email"];
echo $_POST["dovoljenje"];

mysql_connect("localhost", "root", "");
mysql_select_db("lizika");
mysql_query("insert into imenik (ime, priimek, id) values ('$ime', '$priimek','$id');");
?>
<a href="test.php">Dodaj nov vnos</a>
</body>
</html>



problemi so v vrstici mysql_query
napake mi ni izpiše nobene, toda spremeniljivk vseeno ne doda v bazo

PHP je verzija 5.0.4
Fear is the mindkiller. Fear is the little-death that brings total obliteration
I will not fear. I will permit it to pass over me and through me.
And when its has gone past I will turn the inner eye to see it's path.

MUC ::

mysql_query("insert into imenik (ime, priimek, id) values ($_POST['ime'], $_POST['priimek'],$_POST['id']);");

Bojevnik ::

v tem primeru mi to napako ven vrže
Parse error: syntax error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in D:\Program Files\Apache Group\Apache2\htdocs\index.php on line 17
Fear is the mindkiller. Fear is the little-death that brings total obliteration
I will not fear. I will permit it to pass over me and through me.
And when its has gone past I will turn the inner eye to see it's path.

MUC ::

pol pa vrž narekovaje (') vn iz $_POST spremenljivk pri queriju

Bojevnik ::

Thnx, dela.
Fear is the mindkiller. Fear is the little-death that brings total obliteration
I will not fear. I will permit it to pass over me and through me.
And when its has gone past I will turn the inner eye to see it's path.

Bojevnik ::

Pa da ne bom nove teme odpiru, kako se prebere stvari iz tabele. npr. če imam tabelo ime priimek id z vrednostmi
test, test, test. Kako bi to izpisal na strani.
Fear is the mindkiller. Fear is the little-death that brings total obliteration
I will not fear. I will permit it to pass over me and through me.
And when its has gone past I will turn the inner eye to see it's path.

Red_Mamba ::

select * from tabela (where id=1)

sicer pa w3Scools :D
Bad things happen to good people all the time for no reason!
Linkedin >> http://goo.gl/839Aua
@DavidLednik >> http://goo.gl/zQv4xA @redzmijo >> http://goo.gl/tl7VAu

Brilko ::

Dobro bi bilo tudi kaj zavarovati vhodne pdoatke pred nezaželenem storitvam prijaznih uporabnikov. ;)

Bojevnik ::

@Red mamba: sql znam zanima me kako php prepričaš da ti na strani izpiše probal sem
mysql_query("select ime, priimek, id from imenik;");

@Brilko : sem še čisti začetnik v PHP, tako, da tega še ne znam
Fear is the mindkiller. Fear is the little-death that brings total obliteration
I will not fear. I will permit it to pass over me and through me.
And when its has gone past I will turn the inner eye to see it's path.

no_use4 ::

$query = mysql_query("select ime, priimek, id from imenik");

$result = array();
$data = array();

while($result = mysql_fetch_array($query)) {
$data[] = $result;
}

v $data so podatki iz baze. pol gres pa sam cez array...

foreach($data as $item) {
echo "ime: ".$item['ime'];
echo "priimek: ".$item['priimek'];
}

Bojevnik ::

ql dela, tnx
Pa tisto kar je kami rekel, glede zaščite. Prosil bi za link ali pa za razložitev.
Fear is the mindkiller. Fear is the little-death that brings total obliteration
I will not fear. I will permit it to pass over me and through me.
And when its has gone past I will turn the inner eye to see it's path.

Taras_Bulba ::

tole je mislu verjetno
http://www.securiteam.com/securityrevie...
http://www.imperva.com/application_defe...

gre se v grobem zato, da zli uporabnik v vnosna polja vstavi posebne znake, za njimi pa SQL poizvedbo in če ti vhodnih podatkov ne pregleduješ za temi posebnimi znaki se zna zgoditi kaj neprijetnega, npr. brisanje baze, pregledovanje česa kar ne bi smel videti...

Bojevnik ::

tnx
Fear is the mindkiller. Fear is the little-death that brings total obliteration
I will not fear. I will permit it to pass over me and through me.
And when its has gone past I will turn the inner eye to see it's path.


Vredno ogleda ...

TemaSporočilaOglediZadnje sporočilo
TemaSporočilaOglediZadnje sporočilo
»

download hitrost

Oddelek: Pomoč in nasveti
131041 (642) QRII
»

joomla in mywebhoster

Oddelek: Izdelava spletišč
6565 (301) luksorzi
»

[JavaScript] Splošna shema programa

Oddelek: Programiranje
5603 (480) CWIZO
»

Na Cod mi ne dela grafika!:S

Oddelek: Igre
7463 (371) cupaslo
»

eno vprašanje o glTranslate

Oddelek: Programiranje
5415 (330) Senitel

Več podobnih tem