Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 making a link change the value of a variable...
Index -> Programming, PHP -> PHP Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Homer_simpson




PostPosted: Fri Aug 01, 2003 3:03 pm   Post subject: 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..."
Sponsor
Sponsor
Sponsor
sponsor
Amailer




PostPosted: Fri Aug 01, 2003 4:17 pm   Post subject: (No subject)

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




PostPosted: Fri Aug 01, 2003 4:36 pm   Post subject: (No subject)

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




PostPosted: Fri Aug 01, 2003 6:52 pm   Post subject: (No subject)

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 ?? :
code:

$A_name=_GET[name];
$A_rank=_GET[RANK];


is that right?
Amailer




PostPosted: Fri Aug 01, 2003 7:00 pm   Post subject: (No subject)

yes, thats right but the _GET[name]; has to be $_GET['name'];

You need the '' or you could use ""
and there has to be a $ before the _GET Very Happy

same with the rank Very Happy
Homer_simpson




PostPosted: Fri Aug 01, 2003 7:10 pm   Post subject: (No subject)

TY...
One More thing... Razz using OnCLICK what was the command to redirect?
OnCLICK=geturl"blah.com" ?
Amailer




PostPosted: Fri Aug 01, 2003 7:17 pm   Post subject: (No subject)

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 Confused

Like...
code:

onMouseOver="this.style.backgroundColor='#feeebe'; this.style.cursor='hand';" onMouseOut="this.style.backgroundColor='#f8e8b8';" onclick="window.location.href='http://yourdomain.com/'"



Confused

BTW, thats hosted on your computer right?
Use dyndns.org, its much better Confused!
Homer_simpson




PostPosted: Fri Aug 01, 2003 9:03 pm   Post subject: (No subject)

no that is not hosted on my compuer...
Sponsor
Sponsor
Sponsor
sponsor
Amailer




PostPosted: Fri Aug 01, 2003 9:04 pm   Post subject: (No subject)

Oh ok Smile thought it was nvm Confused
Display posts from previous:   
   Index -> Programming, PHP -> PHP Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 9 Posts ]
Jump to:   


Style:  
Search: