Wildthrust Posted February 10, 2008 Share Posted February 10, 2008 How do I access a URL variable. All I can seem to find is info on accessing form variables with $_post etc, but can't find like a $_url. do I have to parse the url to get the variable? sorry, confused and just starting to learn php Quote Link to comment Share on other sites More sharing options...
AndyB Posted February 10, 2008 Share Posted February 10, 2008 somescript.php?this=6&that=7 ... retrieve the passed variable values from the GET array. Is that what you wanted? Quote Link to comment Share on other sites More sharing options...
Wildthrust Posted February 10, 2008 Author Share Posted February 10, 2008 I think so, basicly I have a directory full of icon files with filenames formated as icon##_##.png. I already have made it so the page will put the list into img tags so I get a page with every icon showing. However the ##_## part is also in a MySql database and I want to click on the icon and send it's ##_## to another page that can then look that up, so I would have a link on each icon like <a href="detail.php?icon=<?php echo substr($filename,4,5); ?>"><img ..... so I would want to be able to build a query on the next page like $sql = "SELECT * FROM TABLE WHERE ICON LIKE \'' . $icon . '\''; where $icon is the the ?icon= Quote Link to comment Share on other sites More sharing options...
Wildthrust Posted February 10, 2008 Author Share Posted February 10, 2008 browsing through the php manual would I do something like $_get['icon'] ? Quote Link to comment Share on other sites More sharing options...
AndyB Posted February 10, 2008 Share Posted February 10, 2008 $_GET['icon'] is what you want Quote Link to comment Share on other sites More sharing options...
Wildthrust Posted February 10, 2008 Author Share Posted February 10, 2008 cool, thanks Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.