Jump to content


Photo

Should I make these two PHP pages become one?


  • Please log in to reply
2 replies to this topic

#1 alwaysinit

alwaysinit
  • Members
  • PipPipPip
  • Advanced Member
  • 60 posts

Posted 25 October 2006 - 12:49 AM

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   (memberarea.php)

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   (profile.php)

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?, or
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: What is the setup for letting a user manipulate their html? Am I close?

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

#2 doni49

doni49
  • Members
  • PipPipPip
  • Advanced Member
  • 515 posts
  • LocationCentral MO

Posted 25 October 2006 - 01:15 AM

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.
Don

#3 alwaysinit

alwaysinit
  • Members
  • PipPipPip
  • Advanced Member
  • 60 posts

Posted 25 October 2006 - 01:40 AM

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





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users