A preserved archive of the Logical Gamers community forums, 2009-2025. The original threads and posts, served read-only. Registration, posting and private messages are gone for good.

Quick Question

1.2k views · started by K0rnfl4k3 ·
#1
Quick Question[PHP]
whats the best way to get the user id of any given user with PHP
#2
K0rnfl4k3 wrote:
whats the best way to get the user id of an account from the username?


go to there profile.
the profile id is the same as a user ID
it says it in the url of the profile page
#3
go to there profile.
the profile id is the same as a user ID
it says it in the url of the profile page


i rephrased my question
#4
There's probably a getstringbetween function out there somewhere.

Starting text: http://www.gaiaonline.com/profiles/
Ending text: /
#5
theres no sure way to get it from the html?
im using get_file_contents to get the profile page at "http://www.gaiaonline.com/p/username"
i know v2 profiles its always hooked to the username in the top right corner,
but how about v1 profiles?

also i do already have the getstringbetween function
#6
<div id="gaia_header">
<ul id="header_left">
<li class="spacer"></li>
<li><a href="/"><img src="http://s.cdn.gaiaonline.com/images/profile/mini_gaialogo.gif" width="47" height="23" alt="Gaia"/></a></li>
<li><a href="/market/">Shops</a></li>
<li>| <a href="/forum/">Forums</a></li>
<li>| <a href="/world/">World</a></li>

<li>| <a href="/games/">Games</a></li>
</ul>
<ul id="header_right">
<a href="http://www.gaiaonline.com/register/?_gaia_t_=3544" style="text-decoration:none;">
<img src="http://s.cdn.gaiaonline.com/images/fbconnect/buttons/btn_register_now.png" width="102" height="22" alt="Register Now"/>
<span style="color:#c67100;margin-right:20px;">Get your own profile/avatar or leave a comment</span>
</a>

<li><a href="/profiles/?u=[b][color=red]2011306[/color][/b]">Jasper Riddle</a></li>
<li>| <a href="/auth/">Sign In</a></li>
</ul>
</div>

This is a random person's page. They have a V2 profile. That bar at the top has their name and a link to their profile.