17488 Posts in 4473 Topics by 1978 members
| Go to End | ||
| Author | Topic: | 5837 Views |
-
Re: Pass Variables in a Query String?

12 August 2008 at 1:34am
Actually, I just discovered that I have an even bigger issue beyond the Director:: thing. First off, my SQL needs to be a bit more involved. I don't HAVE an ID for the Client in the ProjectPage table. Just the ClientName. So I need first to pass the ClientID in to the Clients table, get the ClientName there, and then get the Projects from the ProjectPage table which have this ClientName. How to accomplish??
Thanks,
Garrett -
Re: Pass Variables in a Query String?

13 August 2008 at 5:51am
Hi--
Why do you think I am getting an error from "if (isset(Director::urlParam('ClientID'))) { "?
Thanks,
Garrett -
Re: Pass Variables in a Query String?

13 August 2008 at 11:28am
Director::urlParam() points to an array such that the url equals www.yoursite.com/URLSegment/Action/ID/OtherID so unless you tell SS which one is 'ClientID' it has no idea!
How are you trying to pass the client id? eg if you are doing www.yoursite.com/clients/show/12 you would need to use Director::urlParam('ID') (as URLSegment = clients/, action = show/) or if you are using PHP Query strings so like www.yoursite.com/clients/show?clientID=12 you can get the clientID via $_GET['clientID'];
-
Re: Pass Variables in a Query String?

20 August 2008 at 7:37am
Success! Thank you so much for your solution.
NOW: to do the same thing using an Ajax load call rather than a direct link? The Client variable will be in the request, but not in the url, obviously. Possible?
Thanks again,
Garrett -
Re: Pass Variables in a Query String?

29 August 2008 at 3:38am
Subscribed.
For an ajax call, I used this (had to modify it a bit):
http://doc.silverstripe.com/doku.php?id=recipes:ajax_basics
Is that what you meant?
| 5837 Views | ||
| Go to Top |



