| | |
Profile Based Website help
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
•
•
Join Date: Oct 2009
Posts: 18
Reputation:
Solved Threads: 0
Hi all, so I'm looking to make a social network style site, just to help me understand php so please don't say anything about reinventing the wheel.
I'm looking for a way that when a user clicks on a name in the member list that it sends them to profile.php?id= so that profile.php can use it to identify whose profile they are looking for and can load the data for the profile from a mysql table.
member list
profile
is it wise to keep the profile info and "about me" user input text in a mysql table?
someone needs to write a decent tutorial on profiles that are user editable, people want to try recreate facebook/myspace to see how it works, its not about reinventing anything.
thanks, enzo
I'm looking for a way that when a user clicks on a name in the member list that it sends them to profile.php?id= so that profile.php can use it to identify whose profile they are looking for and can load the data for the profile from a mysql table.
member list
PHP Syntax (Toggle Plain Text)
<?php mysql_connect("localhost", "root", "") or die (mysql_error()); mysql_select_db ("phplogin"); $result = mysql_query ("SELECT * FROM users WHERE username=enzo"); @$row = mysql_fetch_array($result); $id = $row['id']; echo '<a href="profile.php?id="$id">Enzo's Profile</a>'; ?>
profile
PHP Syntax (Toggle Plain Text)
$currentprofile = $_GET ['id']; mysql_connect("localhost", "root", "") or die (mysql_error()); mysql_select_db ("phplogin"); $result = mysql_query ("SELECT * FROM users WHERE id=$currentprofile"); @$row = mysql_fetch_array($result); echo $row['profileinfo'];
is it wise to keep the profile info and "about me" user input text in a mysql table?
someone needs to write a decent tutorial on profiles that are user editable, people want to try recreate facebook/myspace to see how it works, its not about reinventing anything.
thanks, enzo
•
•
Join Date: Oct 2009
Posts: 18
Reputation:
Solved Threads: 0
0
#2 Oct 19th, 2009
PHP Syntax (Toggle Plain Text)
echo '<a href="profile.php?id="$id">Enzo's Profile</a>'; ?>
ive spotted the " after the = sign, wasnt supposed to be there but $id doesnt seem to contain anything?
0
#3 Oct 19th, 2009
•
•
•
•
PHP Syntax (Toggle Plain Text)
echo '<a href="profile.php?id="$id">Enzo's Profile</a>'; ?>
ive spotted the " after the = sign, wasnt supposed to be there but $id doesnt seem to contain anything?
php Syntax (Toggle Plain Text)
echo '<a href="profile.php?id=' . $id . '">Enzo's Profile</a>';
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
•
•
Join Date: Oct 2009
Posts: 18
Reputation:
Solved Threads: 0
0
#4 Oct 19th, 2009
thanks for your reply shawn, i got it sorted,
PHP Syntax (Toggle Plain Text)
<div id="apDiv12"> <?php $connect = mysql_connect("localhost", "root", "") or die (mysql_error()); $connect; mysql_select_db ("phplogin"); $result = mysql_query ("SELECT * FROM users WHERE username='jackflash'"); $row = mysql_fetch_array($result); $id = $row['id']; echo ('<a href=profile.php?id='.$id.'>Jack Flash</a>'); ?> </div>
0
#5 Oct 19th, 2009
•
•
•
•
someone needs to write a decent tutorial on profiles that are user editable, people want to try recreate facebook/myspace to see how it works, its not about reinventing anything.
thanks, enzo
"Hmm, they have user profiles what is a user profile though. Let's see, a user has a name, and a phone number and an email address. But, oh, look a user has an ID too, that's probably the unique key."
"User's have friends but how do they do that? Ahh, I see, it's really just a list of user ids that they are friends with. But... I know that just storing a list of IDs breaks normalization so they probably have a many-to-many relationship of users. That makes more sense..."
Stuff like that.
(As an aside, echo doesn't need () it's not a function it's a language construct)
GCS d- s+ a-->? C++(++++) UL+++ P+>+++ L+++ E--- W+++
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
N+ o K w++(---) O? !M- V PS+>++ PE+ Y+ PGP !t- 5? X- R tv+
b+>++ DI+ D G++>+++ e+ h+>++ r y+
PMs asking for help will not be answered, post on the forums. That's what they're there for.
![]() |
Similar Threads
- Tables design for a product based website (ASP.NET)
- Urgent: Help with creating template for PHP based website (Site Layout and Usability)
- how to find the connection string of wordpress based website (PHP)
- Website NOT showing menu hover in Internet Explorer (Site Layout and Usability)
- Freelancer to complete flash-based website (Web Development Job Offers)
- Selling: High-Traffic Myspace Resource Website (Websites for Sale)
- Better to scrap a failing website / community (Social Media and Online Communities)
- Help needed for newbie trying to set up subscription-based website (PHP)
- Who is spamming? (Geeks' Lounge)
- Custom URL (Social Media and Online Communities)
Other Threads in the PHP Forum
- Previous Thread: PHP and Crystal Reports
- Next Thread: referer problem in IE
| Thread Tools | Search this Thread |
.htaccess action ajax apache api array auto beginner binary bounce broken cakephp checkbox class cms code cron curl database date display dynamic echo email error errorlog file files folder form format forms function functions google href htaccess html image include insert integration interactive ip java javascript joomla limit link login loop mail malfunctioning masterthesis menu mlm mod_rewrite multiple mysql nodes oop paypal pdf php popup problem query radio ram random recursion reference regex remote return script search server sessions sms soap source space sql syntax system table tutorial unset update upload url validation validator variable video web websitecontactform xml youtube






