Beppis Posted August 9, 2010 Share Posted August 9, 2010 Hi! I want to add the users nickname to the urlcode. I don't have any clue how to And maybe add more text after the url www.url.comTEXTusername echo $row["url"];$row["username"]; Please help Quote Link to comment https://forums.phpfreaks.com/topic/210209-add-username-to-url/ Share on other sites More sharing options...
Beppis Posted August 9, 2010 Author Share Posted August 9, 2010 Anyone? :'( Quote Link to comment https://forums.phpfreaks.com/topic/210209-add-username-to-url/#findComment-1096965 Share on other sites More sharing options...
onlyican Posted August 9, 2010 Share Posted August 9, 2010 Confused what are you trying to do??? The bit After the URL is a page. Unless you use Mod Rewrites or Query String (QueryString is something like index.php?user=USERNAME) Please tell us what you are trying to do and WHY!!! Quote Link to comment https://forums.phpfreaks.com/topic/210209-add-username-to-url/#findComment-1096966 Share on other sites More sharing options...
Beppis Posted August 9, 2010 Author Share Posted August 9, 2010 I have an url in the database. I want to add an specific ending for each and single user. like: index.php?user=USERNAME. I need to get the url from a table in the database like Can anyone help me? $sql = "SELECT * FROM tb_ads2 WHERE id='$adse'"; $result = mysql_query($sql); $row = mysql_fetch_array($result); $urln = $row["url"]; I want to add an ending Quote Link to comment https://forums.phpfreaks.com/topic/210209-add-username-to-url/#findComment-1096968 Share on other sites More sharing options...
trq Posted August 9, 2010 Share Posted August 9, 2010 This thread should get you started. Quote Link to comment https://forums.phpfreaks.com/topic/210209-add-username-to-url/#findComment-1096971 Share on other sites More sharing options...
Beppis Posted August 9, 2010 Author Share Posted August 9, 2010 I'm not so good at this echo "{$row['url']}&epi={$rowe['username']}"; Please help! Quote Link to comment https://forums.phpfreaks.com/topic/210209-add-username-to-url/#findComment-1096976 Share on other sites More sharing options...
trq Posted August 9, 2010 Share Posted August 9, 2010 I'm not so good at this echo "{$row['url']}&epi={$rowe['username']}"; Please help! What exactly is the problem? Quote Link to comment https://forums.phpfreaks.com/topic/210209-add-username-to-url/#findComment-1096977 Share on other sites More sharing options...
onlyican Posted August 9, 2010 Share Posted August 9, 2010 //Make it easier echo $row['url'].'&epi='.$rowe['username'].'<br />'; but do you know you have $row and $rowe Quote Link to comment https://forums.phpfreaks.com/topic/210209-add-username-to-url/#findComment-1096978 Share on other sites More sharing options...
Beppis Posted August 9, 2010 Author Share Posted August 9, 2010 I know that I have $row and $rowe Got an error message now. Parse error: syntax error, unexpected ';' in line 97 $sql = "SELECT * FROM tb_ads2 WHERE id='$adse'"; $result = mysql_query($sql); $row = mysql_fetch_array($result); if(isset($_COOKIE["usNick"]) && isset($_COOKIE["usPass"])) { $user=uc2($_COOKIE["usNick"]); $sql2 = "SELECT * FROM tb_users WHERE username='$user'"; $result2 = mysql_query($sql2); $rowe = mysql_fetch_array($result2); echo $row['url'].'?epi='.$rowe['username'].; LINE 97 } Quote Link to comment https://forums.phpfreaks.com/topic/210209-add-username-to-url/#findComment-1096989 Share on other sites More sharing options...
trq Posted August 9, 2010 Share Posted August 9, 2010 You have a . on the end that shouldn't be there. Quote Link to comment https://forums.phpfreaks.com/topic/210209-add-username-to-url/#findComment-1096993 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.