Link => query

Link => query

offline
  • Pridružio: 30 Sep 2006
  • Poruke: 137

i need a script that when i click on a link to execute mysql query but to do in the same page.

I make it but in another way.I've created 10 links in the index page and 10 pages.And when i click on one of the links it relocate me to the page and execute the query that i wroted in that page.

Now i dont know how to do that to be in the index page and not need to create 20 if it's needed for every link .

Any suggestion?



Registruj se da bi učestvovao u diskusiji. Registrovanim korisnicima se NE prikazuju reklame unutar poruka.
offline
  • Blood  Male
  • Ugledni građanin
  • Pridružio: 26 Jul 2003
  • Poruke: 384
  • Gde živiš: Beograd

Try like this:
$act = $_GET['act']; if($act == 'link1') {  // query for link one } elseif($act == 'link2') {  // query for link 2 } ...
and you need to have links like this:
<a href="yourpage.php?act=link1">Link1</a> <a href="yourpage.php?act=link2">Link2</a>
got it?

This is very basic stuff, have you tryed to think a little before you asked here?



offline
  • Pridružio: 30 Sep 2006
  • Poruke: 137

tnx man, i will think more next time

Ko je trenutno na forumu
 

Ukupno su 4719 korisnika na forumu :: 15 registrovanih, 2 sakrivenih i 4702 gosta   ::   [ Administrator ] [ Supermoderator ] [ Moderator ] :: Detaljnije

Najviše korisnika na forumu ikad bilo je 20624 - dana 04 Apr 2026 04:18

Korisnici koji su trenutno na forumu:
Korisnici trenutno na forumu: avijacija, bigfoot, Boskovic, Cvijo_ue, Dave191173, Komanca, KonstantinR, Koridor, Misirac, Miškić, nixos, Rogan33, Shilok, UAV operator, Zastava