Client Side Things
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsOther TechnologiesClient Side Things

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
AT&T devCentral & BlackBerry(r) Webcast Series: BlackBerry and GPS -Build Location Awareness into your BlackBerry Applications, July 10th-1:00PM EST. Register Today!
  #1  
Old October 12th, 2003, 03:20 AM
TongueTied TongueTied is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 4 TongueTied User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 52 sec
Reputation Power: 0
passing variable with href link?

This is really an html question

How can I set and pass a variable as part of an html reference? What I am trying to do is have a number of html hyperlinks all linking to the same php page. Depending on which hyperlink is selected, the target page will change depending on what the variable set to.

I thought the following would work but it doesn’t seem to:

From the referring page

<a href=”targetpage.php?selection=1”>Selection 1</a> |
<a href=”targetpage.php?selection=2”>Selection 2</a>

Now in the targetpage.php

php Code:
Original - php Code
  1.  
  2. <?php
  3. if ($_GET[‘selection’]=1){
  4.     //Do something
  5. } else {
  6.     //Do something different
  7. }
  8. ?>


With the above, I find the variable is always returning the value of 1 regardless of the selection.

Any suggestions on how I might get something like this to work?

Reply With Quote
  #2  
Old October 12th, 2003, 03:51 AM
TongueTied TongueTied is offline
Contributing User
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 4 TongueTied User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 10 m 52 sec
Reputation Power: 0
RE: passing variable with href link?

Found the problem. I forgot to put is two "=" signs in the logical expression it should have read
php Code:
Original - php Code
  1.  
  2. <?php
  3. if($_GET["selection"]==1){
  4.   //Do something
  5. }else{
  6.   //Do something else
  7. }
  8. ?>

Reply With Quote
Reply

Viewing: Codewalkers ForumsOther TechnologiesClient Side Things > passing variable with href link?


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway