qwicfingers Posted April 12, 2008 Share Posted April 12, 2008 I would like to click a button and modify the url from www.example.com/index.php?id=1 to www.example.com/index.php?id=2 to 3, etc with out reloading the page is there away to do this? I can't seem to find a method to update the url. Thanks. Link to comment https://forums.phpfreaks.com/topic/100837-modify-the-url/ Share on other sites More sharing options...
amites Posted April 12, 2008 Share Posted April 12, 2008 if your talking about the URL in the address bar then the page has to reload, if you're talking about updating the content of the page to match id=1, id=2, id=3 then you want AJAX Link to comment https://forums.phpfreaks.com/topic/100837-modify-the-url/#findComment-515634 Share on other sites More sharing options...
qwicfingers Posted April 12, 2008 Author Share Posted April 12, 2008 I have a flash gallery in which all the images can be reached by adding a ?id=theID to the end of the url. I was hoping to be able to update the address bar with each pictures ID as you navigate the gallery, but if the page reload then the flash has to reload. =/ Link to comment https://forums.phpfreaks.com/topic/100837-modify-the-url/#findComment-515640 Share on other sites More sharing options...
BlueSkyIS Posted April 12, 2008 Share Posted April 12, 2008 i suggest that you change the images in Flash, not via HTML/PHP. if you have to update the URL for a new image, your page must be refreshed unless you use Ajax. then, you might as well tie Flash to PHP instead of Javascript to PHP (Ajax), imo. Link to comment https://forums.phpfreaks.com/topic/100837-modify-the-url/#findComment-515657 Share on other sites More sharing options...
qwicfingers Posted April 12, 2008 Author Share Posted April 12, 2008 The images are manged by the actionscript, so basically the gallery runs as normal unless you pass an ID var and the php get method then it jumps to that image. I was hoping to be able to also do the reverse and keep the url updated for usability as you browse. The php is only a few lines at this point. <?php foreach($_GET as $variable => $value) { echo "fo.addVariable('firstImageIndex', '$value');"; } ?> So back to the drawing board I guess, unless someone has another suggestion. Link to comment https://forums.phpfreaks.com/topic/100837-modify-the-url/#findComment-515668 Share on other sites More sharing options...
qwicfingers Posted April 12, 2008 Author Share Posted April 12, 2008 Ok I got an js suggestion from someone thanks for pointing me in that direction. Link to comment https://forums.phpfreaks.com/topic/100837-modify-the-url/#findComment-515675 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.