Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Need help in index.php?act=login

    I've used this simple system which is,

    the table in index.php is divided into

    -----------------------
    banner
    -----------------------
    home | login
    -----------------------
    navigation | content
    |
    |
    |

    therefore if i click on login which codes <a href="?act=login">login</a>

    on the content part in the table
    the coding for PHP is
    switch ($_GET['act'])
    {
    case "login": include("content/login.php");
    break;
    ......
    }

    and it does work, as in it loads login.php

    But however the PHP codings for login.php does not work, as such

    i made login.php into 1> for viewing and 2> it re-acts login.php again when submit "login" button is hit

    such i made the php codings at the top

    and for form it's <form action="<?=$_SERVER['PHP_SELF']?>" method="post">

    and basically i just wait both the index.php?act=login to work but however it does not work if u have another set of PHP coding in that include file.

    Is there another method of doing something like ?id= or ?act or whatever u want and it does perform the actions inside the included php codings?

    Sorry i'm a little drunk but yeah i hope you get my drive. and i really do need help as i'm a student and i'm doing my final year project in polytechnic >_> submission for my 1st part of project is to be seen on this coming monday >_<

  • #2
    Super Moderator JohnDubya's Avatar
    Join Date
    Nov 2006
    Location
    Missouri
    Posts
    634
    Thanks
    12
    Thanked 18 Times in 18 Posts
    One quick thought: you say your login form only shows up when the page has ?act=login , right? But on the action for the form, you have it simply going to <?=$_SERVER['PHP_SELF']?> , which does not have the ?act=login at the end. If the login code only gets activated if $_GET['act'] == 'login' , this would cause your script not to work. Hopefully that helps!

  • #3
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    holy crap? it's actually solved? omg i'm sorry for being such a newbie >_>

    i'd just like added <form action="...PHP_SELF'] . "?act=log" ...>
    and it actually worked! zomg.. really.. thanks >_< i'm so grateful to you ~_~ i've been like searching for many hours.. or rather been thinking for days too. sigh it's a big relief.. finally.

  • #4
    Super Moderator JohnDubya's Avatar
    Join Date
    Nov 2006
    Location
    Missouri
    Posts
    634
    Thanks
    12
    Thanked 18 Times in 18 Posts
    Quote Originally Posted by reflux View Post
    holy crap? it's actually solved? omg i'm sorry for being such a newbie >_>

    i'd just like added <form action="...PHP_SELF'] . "?act=log" ...>
    and it actually worked! zomg.. really.. thanks >_< i'm so grateful to you ~_~ i've been like searching for many hours.. or rather been thinking for days too. sigh it's a big relief.. finally.
    Awesome! I've done this at least twice...spent hours poring over the code and come to find out, I didn't set the GET variable on the form action. Glad you could be helped by my troubles! haha

  • #5
    New to the CF scene
    Join Date
    Jul 2008
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I was so worried i couldn't get any help yea.. so..because i'm really rushing for time

    and yea. i'm from Singapore and therefore it's already a Saturday morning here (3AM) and still was researching all about templates lol.

    i'm really grateful to you from the bottom of my heart


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •