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 1035 korisnika na forumu :: 46 registrovanih, 10 sakrivenih i 979 gosta   ::   [ Administrator ] [ Supermoderator ] [ Moderator ] :: Detaljnije

Najviše korisnika na forumu ikad bilo je 3466 - dana 01 Jun 2021 17:07

Korisnici koji su trenutno na forumu:
Korisnici trenutno na forumu: 357magnum, _Rade, A.R.Chafee.Jr., Asparagus, babaroga, bojank, Brana01, cemix, Centauro, DENIRO, Dimitrije Paunovic, Duh sa sekirom, dzoni19, FileFinder, Futog 74, hyla, ILGromovnik, Istman, JOntra, Još malo pa deda, kobaja77, Kubovac, kybonacci, laganini123, Lieutenant, maiden6657, mgolub, MiG-29M2, MiroslavD, mnn2, muaddib, pein, Ripanjac, RJ, S2M, sap, Seeker, stegonosa, tubular, VJ, wolf431, wolverined4, Zimbabwe, Žrnov, šumar bk2, Čivi