SirChick Posted October 31, 2007 Share Posted October 31, 2007 I need help here, i duno what kinda thing im looking for to do this but ill give an example, Say in my database i have "places" Now what i wanted to do is load up these places like: South North West etc But as these are loaded they need to be urls to that particular place, but i don't know how this would be done because the places may change like West may not be there any more and it could change to East.. so i cant hard code the url as west cos then if u wanted to go east it would still be taking you west =/ I been trying to do it for businesses so like it lists all businesses and itll take you the business you clicked on ... how would the page know the url name of that business :S? Quote Link to comment https://forums.phpfreaks.com/topic/75556-solved-unique-urls-to-pages-that-may-change/ Share on other sites More sharing options...
revraz Posted October 31, 2007 Share Posted October 31, 2007 What determines which one is active? Quote Link to comment https://forums.phpfreaks.com/topic/75556-solved-unique-urls-to-pages-that-may-change/#findComment-382239 Share on other sites More sharing options...
SirChick Posted October 31, 2007 Author Share Posted October 31, 2007 ok let me just explain slightly different ... an example: say you have list of users... user 1 user 2 user 3 now what i want is when the user clicks on one of them 3 it'll take them to that peron's profile. Now obviously each user can't have their .php script so it would be ludicrous to do localhost/user1.php or localhost/user2.php and so on and so on.. yet some how when the user selects on of them itll take them to their profile.. (obviously by sending some kinda value) but how does it send the value and what value would it send :S Quote Link to comment https://forums.phpfreaks.com/topic/75556-solved-unique-urls-to-pages-that-may-change/#findComment-382250 Share on other sites More sharing options...
revraz Posted October 31, 2007 Share Posted October 31, 2007 This is usually done via the ID and $_GET["ID'] of the row. Quote Link to comment https://forums.phpfreaks.com/topic/75556-solved-unique-urls-to-pages-that-may-change/#findComment-382263 Share on other sites More sharing options...
SirChick Posted October 31, 2007 Author Share Posted October 31, 2007 How would ya put the variable into the url to use get? would it be like test.php?id=<?=echo$id;?> Quote Link to comment https://forums.phpfreaks.com/topic/75556-solved-unique-urls-to-pages-that-may-change/#findComment-382309 Share on other sites More sharing options...
revraz Posted October 31, 2007 Share Posted October 31, 2007 <a href="editnews.php?id=<?php echo $row->id; ?>" I use an associate array here for my Edit News link. Quote Link to comment https://forums.phpfreaks.com/topic/75556-solved-unique-urls-to-pages-that-may-change/#findComment-382313 Share on other sites More sharing options...
SirChick Posted October 31, 2007 Author Share Posted October 31, 2007 Echo'<a href="business.php?biz=<?={$GetCommercialResult['BusinessID']};?>"><?={$GetCommercialResult['BusinessName']}?></a>'; That is what i put but it is not working, i get this as an error: Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in C:\xampp\htdocs\londoncommercial.php on line 12 Quote Link to comment https://forums.phpfreaks.com/topic/75556-solved-unique-urls-to-pages-that-may-change/#findComment-382383 Share on other sites More sharing options...
trq Posted October 31, 2007 Share Posted October 31, 2007 If your using echo then your already in php. No need for the php tags. echo "<a href='londonbusprocess.php?bus={$GetCommercialResult['BusinessID']}'>{$GetCommercialResult['BusinessName']}</a>"; Quote Link to comment https://forums.phpfreaks.com/topic/75556-solved-unique-urls-to-pages-that-may-change/#findComment-382386 Share on other sites More sharing options...
SirChick Posted October 31, 2007 Author Share Posted October 31, 2007 thankyou Quote Link to comment https://forums.phpfreaks.com/topic/75556-solved-unique-urls-to-pages-that-may-change/#findComment-382399 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.