Jump to content


This topic is now archived and is closed to further replies.


Should I make these two PHP pages become one?

Recommended Posts

Let me apologize first if this seems ignorant, I'm very new to coding.

I have two pages that display Johnny's MySQL data for his profile.(I don't know how to merge them, or even if it's possible)

1. Johnny logs in from home page, then clicks the "My Profile" button and is then directed to his profile that he manipulated to look unique. Data updates in MySQL when he changes anything   [u][b](memberarea.php)[/b][/u]

2. Visitor comes to site for the first time. They use my site search and find Johnny in the results. When they click his thumb they are directed to "profile.php" that I use to display Johnny's data from MySQL   [u][b](profile.php)[/b][/u]

I'm trying to get visitor to see exactly what Johnny sees as his profile, but I'm just not getting it.
Do I need two pages that update when Johnny changes something?, [b]or[/b]
Do I need one page that serves both purposes(Johnny view and visitor view)?

I know I could make the two look identical, then just echo Mysql data in the same places on both. But I'm trying to learn how to let Johnny manipulate the html on his profile. So both pages would need to be updated when Johnny makes changes, or both pages would have to merge to become one that is used for both situations(Johnny view & visitor view)

So I guess my question is this: [b]What is the setup for letting a user manipulate their html? Am I close?[/b]

Would'nt let me put code in this post, so if you wanna see code for both pages, just ask

Share this post

Link to post
Share on other sites
On the page that displays "Johnny's" profile, you can have a line that checks to see if Johnny this is Johnny or a visitor.

If it IS Johnny, echo a link to the browser that takes him to "editProfile".  Of course, "editProfile" would also check to see if it actually IS Johnny as well.

Share this post

Link to post
Share on other sites
Ok, I get it. Thanks

Won't let me post code for some reason, hmmm?
I wanna post code to see if you'll help me recognize Johnny in the script
I'll keep trying, thanks

Share this post

Link to post
Share on other sites


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.