Register

If this is your first visit, please click the Sign Up now button to begin the process of creating your account so you can begin posting on our forums! The Sign Up process will only take up about a minute of two of your time.

Page 2 of 3 FirstFirst 1 2 3 LastLast
Results 11 to 20 of 21
  1. #11
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    Quote Originally Posted by justlivyalife
    Looks nice

    One thing I was wondering was if there was a way the edit button would be invisible to normal users in some fashion?
    You could add start a session at login. For certain users (as described in another post) you could set (and register) a certain variable.
    On the CMS.php page, you start out with a session_start(). Then at the point in the code where the HTML for the 'Edit' button is, you can just test if that variable is set(with an if() clause). If it is, then echo out the HTML that makes up the Edit button. If the variable is not set, then nothing happens, and the edit button stays invisible. (same procedure for that last row in the table that contains the button)

    Quote Originally Posted by justlivyalife
    Looks nice

    ...Otherwise I was wondering about having it on another page to edit a different page.
    Not quite sure what you mean here.
    S. Rosland

  2.  

  3. #12
    Senior Member justlivyalife's Avatar
    Join Date
    Jul 2003
    Location
    Birmingham, UK
    Posts
    2,871
    Member #
    2374
    What I meant was that I had an idea, but not sure if I could do it.

    The idea was to have the edit link for index.php on edit.php, instead of on index.php (make sense better?)
    justlivyalife - The future depends on what we do in the present. (Mahatma Gandhi)
    WDF Resources: WDF Rules
    Non-WDF: JavascriptSource | Dynamic Drive | phpBB | HTML-Kit | Winamp | Download Firefox | Morguefile

  4. #13
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    If you mean that clicking 'edit' would take you to a different page (where you could edit as in the example), that's just seperating the code (after the 'if', and placing it on another page. Then use a 'header(location..' after the 'if' clause on the index page.

    If you mean that only certain users should be able to access the 'edit' page, then just do a 'header(location'->edit.php during log in.

    If that was unclear, then try to describe the scenario you're considering with different users. What do you want to happen when they open the index.php or edit.php.
    S. Rosland

  5. #14
    Senior Member justlivyalife's Avatar
    Join Date
    Jul 2003
    Location
    Birmingham, UK
    Posts
    2,871
    Member #
    2374
    Thanks for that, rosland.

    What I wanted to do was to make the 'Edit' link on index.php only visible to certain users, though not sure that is possible.
    justlivyalife - The future depends on what we do in the present. (Mahatma Gandhi)
    WDF Resources: WDF Rules
    Non-WDF: JavascriptSource | Dynamic Drive | phpBB | HTML-Kit | Winamp | Download Firefox | Morguefile

  6. #15
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    I'll to rewrite the code for you, but I won't have a chance to post it until I get home (two days).
    S. Rosland

  7. #16
    Senior Member justlivyalife's Avatar
    Join Date
    Jul 2003
    Location
    Birmingham, UK
    Posts
    2,871
    Member #
    2374
    That would be great thanks
    justlivyalife - The future depends on what we do in the present. (Mahatma Gandhi)
    WDF Resources: WDF Rules
    Non-WDF: JavascriptSource | Dynamic Drive | phpBB | HTML-Kit | Winamp | Download Firefox | Morguefile

  8. #17
    Senior Member rosland's Avatar
    Join Date
    Jul 2003
    Location
    Norway
    Posts
    1,944
    Member #
    2096
    Ok, I've made some cosmetic changes to the basic script, and added a simple login page.
    The Login page utilizes the example database I posted in this script.

    ---------------

    BTW, forgot to mention, I wrote this on a local machine with 'register_globals' set to 'ON'.

    You might need to add $_POST[''] and $_SESSION[''] to retrieve the different "POST" and "SESSION" variables (if your test server is running with 'register_globals' set to 'OFF', which is default.)

    Also, this is hastly put together. Depending on your PHP config (php.ini) it might generate errors (like 'undefined variable' etc). If you're receiving errors like this, please let me know, and will iron them out.
    S. Rosland

  9. #18
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,672
    Member #
    1234
    Liked
    142 times
    Must remember to check this when I'm at home
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com

  10. #19
    Senior Member justlivyalife's Avatar
    Join Date
    Jul 2003
    Location
    Birmingham, UK
    Posts
    2,871
    Member #
    2374
    Thanks Rosland .
    justlivyalife - The future depends on what we do in the present. (Mahatma Gandhi)
    WDF Resources: WDF Rules
    Non-WDF: JavascriptSource | Dynamic Drive | phpBB | HTML-Kit | Winamp | Download Firefox | Morguefile

  11. #20
    WDF Staff Wired's Avatar
    Join Date
    Apr 2003
    Posts
    7,672
    Member #
    1234
    Liked
    142 times
    Rosland, might want to post a SQL create statement.
    The Rules
    Was another WDF member's post helpful? Click the like button below the post.

    Admin at houseofhelp.com


Page 2 of 3 FirstFirst 1 2 3 LastLast

Remove Ads

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
All times are GMT -6. The time now is 12:38 PM.
Powered by vBulletin® Version 4.2.3
Copyright © 2022 vBulletin Solutions, Inc. All rights reserved.
vBulletin Skin By: PurevB.com