PHP MySQL Question..

anuj_web

New Member
Messages
145
Reaction score
0
Points
0
Hi

In my website , I have a login page after logging in the user goes to his profile...where he can change his details and then he is redirected to the same page with the changed details....

I am thinking of using an html page to show the profile details at first then direct it to a php file to use the update code to update accordingly
then again after this updation, redirect back to the html file with the updated data...

I actually want two pages so that i dont have to use the whole php and html code in the same page and mess up the code...

I need some suggestions to do this in a better way(if possible) or any modifications in this
method...

The html page has embedded PHP code to only generate the page and fetch the records..
and the php page has code to update the records....
 
Last edited:

LHVWB

New Member
Messages
1,308
Reaction score
0
Points
0
Okay, my suggestion is that you do have a general profile view page which gets the information from the database, as well as another page to change any of those details. The edit profile page will need to use some php though, because you will want to load the current details into the forms that the users will use to edit them. The information should probably then be submitted back to the other page. But you could do that on either page as long as you redirected the user to the general profile details page afterwards.

There are many already built 3rd party software packages that have user systems which could archieve a similar outcome, by using their own system. Have a look in the "Scripts & 3rd Party Apps" forum if you need one.
 

anuj_web

New Member
Messages
145
Reaction score
0
Points
0
hmmm..
well actually i have 3 kinds of users so i cannot have a common profile page :( ,i'll have to make a separate profile page for each ...

thanks for the suggestion
 

lszanto

New Member
Messages
23
Reaction score
0
Points
0
Wouldn't it just be easier to have a MySQL database and have a field in the database for example type for the account type and then just have a page that they can edit there profile from, which would change according to account type?
 

anuj_web

New Member
Messages
145
Reaction score
0
Points
0
Hi,
@ iszanto,

brother that is not possible nehow...

I found out a way to do that....

Please i have another webpage to design in which I have to show some search results.(probably thru a list )...(dynamically generated html page using PHP)

When a user cliks on a link corresponding to one of the search results complete profile for that link(user in this case) is displayed....

please...this one ..i cant figure out how ??
 
Last edited:

vishnurg

New Member
Messages
25
Reaction score
0
Points
0
huy man ...
just an easy answer ..just pass the user id along with the link in the serach result and so the link on serach results will be like
profile.php?id='$row_seacrh[0]'

where $row_search is the arry used to store mysql result and id is in '0' th postion of that ..
and if you use 3 pages for the three user ,, just pass the link to a temp page where it find the type of user and redirect the browser to corresponding user page ...


i hope it will be ok now //but i wish to say one thing .....it will be more simple in structure if u put a field for 'user type' in the table ///
 

lszanto

New Member
Messages
23
Reaction score
0
Points
0
huy man ...
just an easy answer ..just pass the user id along with the link in the serach result and so the link on serach results will be like
profile.php?id='$row_seacrh[0]'

where $row_search is the arry used to store mysql result and id is in '0' th postion of that ..
and if you use 3 pages for the three user ,, just pass the link to a temp page where it find the type of user and redirect the browser to corresponding user page ...


i hope it will be ok now //but i wish to say one thing .....it will be more simple in structure if u put a field for 'user type' in the table ///

That should work but if he can't add a value into the table wouldn't it be easier to just md5 it for the url, for example.
Code:
profile.php?id={md5($row_search[0])}

That would at least give some kind of security and then they could just compare the md5 on the next page like.

PHP:
if($_GET['id'] == md5(1)) {
    //Do 1 actions here.
} else if($_GET['id'] == md5(2)) {
   //Do 2 actions here.
}

Then at least the users can't see it is in a simple numerical order, does that make sense?
 
Top