
-----------------------------------
Homer_simpson
Fri Aug 01, 2003 3:03 pm

making a link change the value of a variable...
-----------------------------------
http://user.deluxnetwork.com/~backstabbe/phptest/searchresult.php
as u can see i've got my sign up system working... now u see that when u move yer mouse over "Rune Name" or "Rank" the color changes that means that there's gonna be a link there... now what i want to know is how to relate a link into php meaning that when i click on one of those a specific variable changes value... How do u do that...?!!?!

"I know how to do that using forms..."

-----------------------------------
Amailer
Fri Aug 01, 2003 4:17 pm


-----------------------------------
you mean set a value to a variable froma  URL?

like  $PHP_SELF?runename=$value for run name&rank=$value for rank

so you can put that in the OnCLICK or ahref= or whe/

-----------------------------------
PaddyLong
Fri Aug 01, 2003 4:36 pm


-----------------------------------
just use "get" variables which are the ones that go into the url.. just put a ? after the file (or url or whatever) and then the variable=something and if there are more than one variables use & in between them

http://www.someurl.com/somepage.php?variable1=something&variable2=somethingelse

then in that somepage.php file you can access those variables using $_GET['variable1'] and $_GET['variable2']
or (for older versions of php...)
$HTTP_GET_VARS['variable1'] and $HTTP_GET_VARS['variable2']

-----------------------------------
Homer_simpson
Fri Aug 01, 2003 6:52 pm


-----------------------------------
aha....!!! that's what i wanted TY...

so let's say i got URL http://blah.com/blah.php?rank=leader&name=homer

then inside my blah.php i use this code like this ?? :

$A_name=_GET[name];
$A_rank=_GET[RANK];


is that right?

-----------------------------------
Amailer
Fri Aug 01, 2003 7:00 pm


-----------------------------------
yes, thats right but the _GET$_GET

You need the '' or you could use "" 
and there has to be a $ before the _GET :D

same with the rank :D

-----------------------------------
Homer_simpson
Fri Aug 01, 2003 7:10 pm


-----------------------------------
TY...
One More thing... :P  using OnCLICK what was the command to redirect?
OnCLICK=geturl"blah.com" ?

-----------------------------------
Amailer
Fri Aug 01, 2003 7:17 pm


-----------------------------------
No, since you have a table that uses 'OnMouseOver' or w/e,
You could use OnClick (same place you use the OnMouseover or w/e)...so whne the viewer clicks the table, it will go to thURL given in the onClick :?

Like...

onMouseOver="this.style.backgroundColor='#feeebe'; this.style.cursor='hand';" onMouseOut="this.style.backgroundColor='#f8e8b8';" onclick="window.location.href='http://yourdomain.com/'"



:?

BTW, thats hosted on your computer right?
Use dyndns.org, its much better :?!

-----------------------------------
Homer_simpson
Fri Aug 01, 2003 9:03 pm


-----------------------------------
no that is not hosted on my compuer...

-----------------------------------
Amailer
Fri Aug 01, 2003 9:04 pm


-----------------------------------
Oh ok :) thought it was nvm :?
