+ Reply to Thread
Results 1 to 8 of 8

Thread: PHP MySQL Question..

  1. #1
    anuj_web's Avatar
    anuj_web is offline x10 Sophmore anuj_web is an unknown quantity at this point
    Join Date
    Dec 2007
    Posts
    145

    PHP MySQL Question..

    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 by anuj_web; 04-25-2008 at 11:44 PM.

  2. #2
    LHVWB's Avatar
    LHVWB is offline Lord Of The Keys LHVWB is an unknown quantity at this point
    Join Date
    Jan 2008
    Location
    Australia
    Posts
    1,308

    Re: PHP MySQL Question..

    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.

  3. #3
    anuj_web's Avatar
    anuj_web is offline x10 Sophmore anuj_web is an unknown quantity at this point
    Join Date
    Dec 2007
    Posts
    145

    Re: PHP MySQL Question..

    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

  4. #4
    lszanto is offline x10Hosting Member lszanto is an unknown quantity at this point
    Join Date
    Apr 2008
    Posts
    23

    Re: PHP MySQL Question..

    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?

  5. #5
    anuj_web's Avatar
    anuj_web is offline x10 Sophmore anuj_web is an unknown quantity at this point
    Join Date
    Dec 2007
    Posts
    145

    Re: PHP MySQL Question..

    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 by anuj_web; 04-26-2008 at 04:38 AM.

  6. #6
    vishnurg is offline x10Hosting Member vishnurg is an unknown quantity at this point
    Join Date
    Dec 2007
    Posts
    25

    Smile Re: PHP MySQL Question..

    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 ///

  7. #7
    lszanto is offline x10Hosting Member lszanto is an unknown quantity at this point
    Join Date
    Apr 2008
    Posts
    23

    Re: PHP MySQL Question..

    Quote Originally Posted by vishnurg View Post
    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 Code:

    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?

  8. #8
    anuj_web's Avatar
    anuj_web is offline x10 Sophmore anuj_web is an unknown quantity at this point
    Join Date
    Dec 2007
    Posts
    145

    Re: PHP MySQL Question..

    hmmm thanks..

+ Reply to Thread

Similar Threads

  1. [PHP] MySQL and PHP
    By Bryon in forum Tutorials
    Replies: 43
    Last Post: 03-24-2011, 07:27 AM
  2. Replies: 3
    Last Post: 03-10-2008, 12:22 PM
  3. PHP and MySQL
    By TopMer in forum Scripts & 3rd Party Apps
    Replies: 5
    Last Post: 02-19-2008, 12:50 AM
  4. linking PHP MySQL to Dreamweaver
    By samster5 in forum Free Hosting
    Replies: 2
    Last Post: 12-02-2007, 12:51 PM
  5. http access and php read/write permissions.... one question !!
    By careerbridge in forum Scripts & 3rd Party Apps
    Replies: 8
    Last Post: 06-18-2006, 07:35 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers