...

View Full Version : Need help in index.php?act=login



reflux
07-25-2008, 06:45 PM
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 >_<

JohnDubya
07-25-2008, 07:00 PM
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!

reflux
07-25-2008, 07:36 PM
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.

JohnDubya
07-25-2008, 07:37 PM
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 :thumbsup:

reflux
07-25-2008, 07:50 PM
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 ;)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum