Jump to content

Should I make these two PHP pages become one?


alwaysinit

Recommended Posts

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

Example(Johnny)
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
Link to comment
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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.