![]() |
#1
|
|||
|
|||
![]()
Okay, I've created a new user profile page for the script, but I'm having some issues linking it up. How can I create a link, where half of it depends on the users ID? For example, www.yourdomain.com/viewprofile.php?id=1 will direct you to the users page who has the user ID of 1. But I have no idea how to set this up, so that if a user clicks a profile link, it will echo their ID from the database into the ?id=* bit.
I hope this makes sense, because it's a lot harder to explain than I thought it'd be. Heh. Cheers! |
#2
|
|||
|
|||
![]()
I am assuming you have another application that you are trying to integrate into my script somehow?
If you know the username of a user you can easily find the ID and vise versa, assuming both scripts are running on a shared database. So, say you know the username of a user and you want to get their ID number, which is what I assume you want to do. You would do: PHP Code:
Brandon |
#3
|
|||
|
|||
![]()
Not quite lol.
Here is the page that I have created: PHP Code:
I'm definitely donating to help support this project when I get paid a week tomorrow. Thanks Brandon! |
#4
|
|||
|
|||
![]()
Well, I'm a bit confused now since you seem to be saying you want to replace the My Account page with the page above. The My Account page is for editing user-specific settings whereas the page you have here appears to be used to add a user to the friends list of another user.
I think I know what you want to do though and I think I have a better idea of what you are saying. I think what you are saying is when you have an adoptable shown somewhere on the site, how can you have the owner of that adoptable linked in to this page to add another user as a friend? Right? Take this example: Say we have a page like this one where you have the adoptable and the owner's name. Now I am assuming that you want to link the owner's name or ID number to the page you have created, right? Well, in the file show.php we would find: PHP Code:
PHP Code:
PHP Code:
In your file, change: PHP Code:
PHP Code:
Really, how you link a user's username to your show profile page depends on the file you want to link from. I hope this has helped some and feel free to let me know if you have any questions. Brandon |
#5
|
|||
|
|||
![]()
Hmm, I'm not trying to change anything in my file. I want to change the <a href=account.php> My Account </a> link in the template file to <a href=viewprofile.php?id=[logged in user's ID]> My Account </a>. I tried using <a href=viewprofile.php?id=".$id."> My Account <a> but that just linked to viewprofile.php?id=".$id." instead of replacing the ".$id." with the logged in user's ID.
Does this make any more sense? |
#6
|
|||
|
|||
![]()
Ok, try this:
In the template file, just go ahead and remove the My Account link all together. Then, in each php file find: PHP Code:
PHP Code:
Try this edit on one file and see if it works and if so then apply it to all the PHP files. :) Brandon |
#7
|
|||
|
|||
![]()
Okay, that works to perfection. But how would I go about making it display the uid instead of the username? Replacing it username with id doesn't display the number. It just displays ?id=
|
#8
|
|||
|
|||
![]()
If you want to use the ID number, you have to use this code before your link to convert the username to its id number:
PHP Code:
|
#9
|
|||
|
|||
![]()
So, the complete code I need to add after the second link, is:
PHP Code:
|
#10
|
|||
|
|||
![]()
Missing a few things...
PHP Code:
|
![]() |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Link Dots | voni | Questions and Supports | 6 | 05-13-2014 10:20 AM |
Link | MaximumRide | Questions and Supports | 6 | 04-23-2012 04:52 PM |
Getting my forums to link as a sub? | Aasixx | Questions and Supports | 4 | 04-20-2012 04:20 AM |
how change this link ? :( | kratosvr | Questions and Supports | 5 | 08-24-2011 09:09 AM |
Forums Link | Ashje | Questions and Supports | 2 | 01-24-2009 12:28 AM |
What's New? |
What's Hot? |
What's Popular? |