PHP ( URL sakrivanje + problem )

Pozdrav,

Nedavno sam poceo se bavit sa php-om i naisao sam na par problema prilikom izrade sustava za korisnike/racunala kojeg radim. Koliko sam skuzio postoje dva nacina za slanje varijabli izmedu php datoteka. To se radi preko $_POST i $_GET. I taj dio mi sve radi kak spada medutim ono sto mene zanima je kako sakrit da ne pise koju datoteku poziva i koji atribut salje dok se misem dodje iznad tipke za recimo “uredivanje korisnika”. Ono sto zelim da mi uvijek u address baru browsera pise index.php i da ne prikazuje URL prilikom klikova na tipke. Je li tako nesto uopce moguce?

Trenutno mi pise dok dodje iznad tipke “http:/blabal/urediK.php?ID=1” medutim ja to zelim sakrit da ne pise uopce.

Ako postoji neki drugi i sigurniji nacin za prosljedivanje vrijednosti izmedu php datoteka neka me usmjeri na link , topic gdje mogu o tome citat.

Drugi problem koji imam i koje mi je velika enigma je to sto ja napisem mysql query u bazuu nekoj php datoteci i izvadim vrijednosti koje zelim i napravim while petlju da sve to ispise iz tablice i sad zelim da mi nakon toga ispod bude tipka recimo “Dodaj novog korisnika” i uvijek mi ta tipka bude ispred te tablice, a ne znam zasto… u kodu se nalazi ispod ispisa tablice i svega toga, al uporno to stavi uvijek ispred.

probao sam unutat php koda i pisat echo “

”; etc… misleci da ce razdvojit posto su div tagovi u pitanju , al opet uvijek stavio tu tipku ispred.

Primjer o cemu pricam…<span class="syntaxdefault"></span><span class="syntaxkeyword">echo&nbsp;</span><span class="syntaxstring">"<div>"</span><span class="syntaxkeyword">;<br />if&nbsp;(isset(</span><span class="syntaxdefault">$_SESSION</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'korisnik_logiran'</span><span class="syntaxkeyword">])&nbsp;==&nbsp;</span><span class="syntaxdefault">true</span><span class="syntaxkeyword">)&nbsp;<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxdefault">$imeK&nbsp;</span><span class="syntaxkeyword">=&nbsp;</span><span class="syntaxdefault">$_POST</span><span class="syntaxkeyword">[</span><span class="syntaxstring">'imeK'</span><span class="syntaxkeyword">];<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxdefault">initDB</span><span class="syntaxkeyword">();<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxdefault">$sql&nbsp;</span><span class="syntaxkeyword">=&nbsp;</span><span class="syntaxstring">"&nbsp;select&nbsp;racunalo.ID_R,&nbsp;racunalo.oznakar,korisnik.ime,vrstaracunala.tip,&nbsp;modelracunala.modelR,modelracunala.hdd,&nbsp;modelracunala.maticna,&nbsp;modelracunala.memorija&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;from&nbsp;korisnik,racunalo,vrstaracunala,&nbsp;modelracunala<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;where&nbsp;korisnik.ime&nbsp;LIKE&nbsp;'</span><span class="syntaxdefault">$imeK</span><span class="syntaxstring">%'&nbsp;AND&nbsp;vrstaracunala.vrstaR&nbsp;=&nbsp;racunalo.vrstaR&nbsp;AND&nbsp;modelracunala.PK_model&nbsp;=&nbsp;racunalo.PK_model&nbsp;AND&nbsp;racunalo.ID_K&nbsp;=&nbsp;korisnik.ID_K<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;order&nbsp;by&nbsp;racunalo.id_r"</span><span class="syntaxkeyword">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxdefault">$result&nbsp;</span><span class="syntaxkeyword">=&nbsp;</span><span class="syntaxdefault">mysql_query</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$sql</span><span class="syntaxkeyword">)&nbsp;or&nbsp;die(</span><span class="syntaxstring">"Dogodila&nbsp;se&nbsp;pogreška&nbsp;pri&nbsp;učitavanju&nbsp;računala!"</span><span class="syntaxkeyword">);&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="syntaxdefault">$num_rows&nbsp;</span><span class="syntaxkeyword">=&nbsp;</span><span class="syntaxdefault">mysql_num_rows</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$result</span><span class="syntaxkeyword">);<br />&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if&nbsp;(</span><span class="syntaxdefault">$num_rows&nbsp;</span><span class="syntaxkeyword">!=&nbsp;</span><span class="syntaxdefault">0</span><span class="syntaxkeyword">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span class="syntaxstring">"[align=center]"</span><span class="syntaxkeyword">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span class="syntaxstring">"<table&nbsp;class='tablica'&nbsp;border='1'&nbsp;cellspacing='3'><tr><th>Oznaka&nbsp;računala</th><th>Korisnik</th><th>Vrsta</th><th>Model</th><th>HDD</th><th>Maticna</th><th>Memorija</th></tr>"</span><span class="syntaxkeyword">;<br /><br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;while&nbsp;(</span><span class="syntaxdefault">$red&nbsp;</span><span class="syntaxkeyword">=&nbsp;</span><span class="syntaxdefault">mysql_fetch_array</span><span class="syntaxkeyword">(</span><span class="syntaxdefault">$result</span><span class="syntaxkeyword">))<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span class="syntaxstring">"<tr>"</span><span class="syntaxkeyword">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span class="syntaxstring">"<td>[align=center]</span><span class="syntaxdefault">$red</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">1</span><span class="syntaxkeyword">]</span><span class="syntaxstring">[/align]</td>"</span><span class="syntaxkeyword">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span class="syntaxstring">"<td>[align=center]</span><span class="syntaxdefault">$red</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">2</span><span class="syntaxkeyword">]</span><span class="syntaxstring">[/align]</td>"</span><span class="syntaxkeyword">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span class="syntaxstring">"<td>[align=center]</span><span class="syntaxdefault">$red</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">3</span><span class="syntaxkeyword">]</span><span class="syntaxstring">[/align]</td>"</span><span class="syntaxkeyword">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span class="syntaxstring">"<td>[align=center]</span><span class="syntaxdefault">$red</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">4</span><span class="syntaxkeyword">]</span><span class="syntaxstring">[/align]</td>"</span><span class="syntaxkeyword">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span class="syntaxstring">"<td>[align=center]</span><span class="syntaxdefault">$red</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">5</span><span class="syntaxkeyword">]</span><span class="syntaxstring">[/align]</td>"</span><span class="syntaxkeyword">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span class="syntaxstring">"<td>[align=center]</span><span class="syntaxdefault">$red</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">6</span><span class="syntaxkeyword">]</span><span class="syntaxstring">[/align]</td>"</span><span class="syntaxkeyword">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span class="syntaxstring">"<td>[align=center]</span><span class="syntaxdefault">$red</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">7</span><span class="syntaxkeyword">]</span><span class="syntaxstring">[/align]</td>"</span><span class="syntaxkeyword">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span class="syntaxstring">"<td>[align=center]<a&nbsp;href='urediR.php?ID=</span><span class="syntaxdefault">$red</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">0</span><span class="syntaxkeyword">]</span><span class="syntaxstring">'><img&nbsp;src='images/olovka.gif'&nbsp;alt='Uredi'&nbsp;title='Uredi'/></a>[/align]</td>"</span><span class="syntaxkeyword">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span class="syntaxstring">"<td>[align=center]<a&nbsp;href='brisiR.php?ID=</span><span class="syntaxdefault">$red</span><span class="syntaxkeyword">[</span><span class="syntaxdefault">0</span><span class="syntaxkeyword">]</span><span class="syntaxstring">'><img&nbsp;src='images/brisi.gif'&nbsp;alt='Brisi'&nbsp;title='Brisi'/></a></a>[/align]</td>"</span><span class="syntaxkeyword">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span class="syntaxstring">"</tr>"</span><span class="syntaxkeyword">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span class="syntaxstring">"[/align]"</span><span class="syntaxkeyword">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span class="syntaxstring">"[align=center]<h2>Trazeni&nbsp;korisnik&nbsp;ili&nbsp;nema&nbsp;niti&nbsp;jedno&nbsp;racunalo&nbsp;ili&nbsp;korisnik&nbsp;ne&nbsp;postoji.</h2>[/align]"</span><span class="syntaxkeyword">;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}<br />}<br />else&nbsp;<br />{<br /></span><span class="syntaxdefault">header</span><span class="syntaxkeyword">(</span><span class="syntaxstring">'Location:&nbsp;index.php'</span><span class="syntaxkeyword">);<br />}<br />echo&nbsp;</span><span class="syntaxstring">"</div>"</span><span class="syntaxkeyword">;<br />echo&nbsp;</span><span class="syntaxstring">"<div>[align=center]<a&nbsp;href='dodajR.php'>Dodaj&nbsp;novo&nbsp;racunalo</a>[/align]</div>"</span><span class="syntaxkeyword">;&nbsp;</span><span class="syntaxdefault"></span>

Slika kako to izgleda u browseru


http://img819.imageshack.us/img819/3114/slikabe.jpg

zgooglaj AJAX

ti fali za drugi problem

[quote=“Zvijer”]zgooglaj AJAX

ti fali za drugi problem[/quote]

a bokte :confused: nisam ni vidio da sam zaboravio zatvorit tag.

hvala

Neznam hoce li to u potpunosti rijesiti tvoj problem, ali mozes koristiti .htaccess rewrite, tako da tvoj link izgleda npr. “http://blabal.com/urediK/1/” umjesto “http://blabal.com/urediK.php?ID=1

Na što točno misliš? Tj kako će mu to pomoći u onome što želi?

Mislio sam totalno maknut tako da netko tko koristi stranicu ne vidi koji atributu se prosljeduju i koja php datoteka se poziva… ovako kak je svatko moze ukucat link i stavit npr. broj 3 ili koji vec i cackat po drugima.


Copyright © 2020 WM Forum - AboutContact - Sponsored by: Mydataknox & Webmaster.Ninja