Follow us on Twitter!
Never in the field of human conflict was so much owed by so many to so few. - Winston Churchill
Friday, April 25, 2014
Navigation
Home
HellBoundHackers Main:
HellBoundHackers Find:
HellBoundHackers Information:
Learn
Communicate
Submit
Shop
Challenges
HellBoundHackers Exploit:
HellBoundHackers Programming:
HellBoundHackers Think:
HellBoundHackers Track:
HellBoundHackers Patch:
HellBoundHackers Other:
HellBoundHackers Need Help?
Other
Members Online
Total Online: 22
Guests Online: 20
Members Online: 2

Registered Members: 82909
Newest Member: awais
Latest Articles
View Thread

HellBound Hackers | Computer General | Programming

Author

Quick PHP Help


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 29-10-06 22:33
I'm trying to set up a link that will link to an users profile by their user id and the link will say their username, so heres what i got so far...

<a href=' http://www.example.com/profile.php?lookup= ". $userdata["user_id"] ." '> ". $userdata['user_name'] ."</a>;

And it links to this URL...
http://www.example.com/profile.php?lookup=". $userdata["user_id"] ." with this text...
". $userdata['user_id'] ."
It doesnt change the $userdata['user_id'] to the user id and doesnt change the $userdata['user_name'] to their username.

Could someone help me out please.


Author

RE: Quick PHP Help


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 29-10-06 22:41
I am not sure what would be causing that.
What I can tell you is I put $500 on your running PHP-Fusion :P
I would have to see more of your code, chances are its just malformed PHP
here is an example

Code
<?PHP

echo "<a href='http://www.example.com/profile.php?lookup={$userdata['user_id']}'>{$userdata['user_name']}</a>";

?>




and if you are using PHP-Fusion use this instead...

Code
<?PHP

echo "<a href='".BASEDIR."profile.php?lookup={$userdata['user_id']}'>{$userdata['user_name']}</a>";

?>







Edited by on 29-10-06 22:43
Author

RE: Quick PHP Help


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 29-10-06 22:42
You're using a database with this ?


Author

RE: Quick PHP Help


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 29-10-06 22:45
I dont think it would be any problem besides his code. Look at the example he showed us.
He is missing quotes...
You should just paste your script here.


Author

RE: Quick PHP Help


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 29-10-06 22:45
instead of
<a href=' http://www.example.com/profile.php?lookup= ". $userdata["user_id"] ." '> ". $userdata['user_name'] ."</a>;

try this..

<a href='http://example.com/profile.php?lookup='" . $userdata['user_name'] . "'>" . $userdata['user_name'] . "</a>;

notice that you must put ' before the " after lookup= and " before ' to end the href value. that should work.


Author

RE: Quick PHP Help


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 29-10-06 22:47
Are you kidding chislam, that will give a broken tag.
after PHP outputs that it would look like
<a href='profile.php?lookup='id'>name</a>


The way he explains it, it sounds like he doesnt know PHP and he doesnt have it in PHP tags, if it was in PHP tags he would be getting blank or errors. he isnt getting eaither. I can almost gurentee you he doesnt have it in php tags and is echoing it out properly just look at my example above




Edited by on 29-10-06 22:49
Author

RE: Quick PHP Help


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 29-10-06 22:49
K ill try all these out, thanks for your help guys


Author

RE: Quick PHP Help


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 29-10-06 22:56
Nope no luck.
All the quotations are messing it up. I copied both skarecrow and chislams examples and neither worked. Any other ideas??


Oh and btw, I am not using this for Black-Fire, for another site that im working on.




Edited by on 29-10-06 22:57
Author

RE: Quick PHP Help


Member

Your avatar

Posts:
Location:
Joined: 01.01.70
Rank:
Guest
Posted on 29-10-06 23:05
Did you not here my request?
You need to give me more code.
Paste the whole script if you cant, all you are doing is frustrating me cause I cannot see the problem. I need to see your code.