$_GET problem
Posted by: Gondrong (202.134.2.---)
Date: June 21, 2007 05:32AM

I got a problem with the $_GET. You see I make a website and make a logout to destroy the session but I got an error in the main page that say :

Notice: Undefined index: act in C:\wamp\www\dashboard\index.php on line 36

Any body can help me??

Options: ReplyQuote
Re: $_GET problem
Posted by: CyberSpatium (71.237.217.---)
Date: June 21, 2007 01:26PM

post your code pls.


CyberSpatium
----------------------
WAMP English Forum Admin

Need help? Check out my WAMP User Manual/Guide here!


Cellular Phone Deals - The Best on the Net! - FREE PHONES! Take your pick from our featured cellular phone deals by Cingular, Verizon, T-Mobile, Sprint PCS, Nextel, and more! Most of our cellular phone offers include a FREE cellular phone with FREE shipping!


Web Development for Newbie's Blog - Check out my new blog. It is for web developers, and especially tailored for the web development newbie. If you are not fluent in “geek speak”, then this incredible resource is just you. And even if you are a web development pro, this is a great resource to check out some of the latest web development tips, news, tutorials, codes and more.


Mortgage and Home Loan Advice:
Clarify Loans

Options: ReplyQuote
Re: $_GET problem
Posted by: Gondrong (202.134.2.---)
Date: June 22, 2007 05:40AM

This is the code :

<?php
/****************************************************************
* include configuration and other files *
****************************************************************/
session_start();
include_once("includes/conf.php"winking smiley;
include_once("includes/MyTemplate.php"winking smiley;
$tpl = new MyTemplate("templates/index(1024x768).html"winking smiley;

/********************************************************
* open connection to oracle *
*******************************************************/

$conn = oci_connect($db_user, $db_password, $db_name);

/********************************************************
* Insert data from database to site *
********************************************************/
//echo $nama;
//$act="";
if (!empty($_POST["nama"]) && !empty($_POST["password"]))
{
$query = "SELECT * FROM MEMBER WHERE ID_PEGAWAI='".$_POST["nama"]."' AND PASSWORD='".$_POST["password"]."'";
$parse = oci_parse($conn, $query);
$result = oci_execute($parse, OCI_DEFAULT);
$row = oci_fetch_array($parse, OCI_RETURN_NULLS);
//echo $row['ID_PEGAWAI'];
if ($row['ID_PEGAWAI']==$_POST['nama'] && $row['PASSWORD']==$_POST['password'])
{
session_register("nama"winking smiley;
session_register("password"winking smiley;
header("Location:index2.php"winking smiley;
}
}

/*if ($_GET["act"]=='logout')
{
session_destroy();
//header("Location:index.php"winking smiley;
}*/

$tpl->write();

?>

the error message appear when I erase the comment for the last if,

Options: ReplyQuote
Re: $_GET problem
Posted by: Hekko (---.net.upc.cz)
Date: June 22, 2007 06:51PM

Seems you don't have any $_GET called act. Check the template to see whether the name and the method are spelled correctly.

Options: ReplyQuote
Re: $_GET problem
Posted by: Gondrong (202.134.2.---)
Date: June 27, 2007 05:13AM

/*if ($_GET["act"]=='logout')
{
session_destroy();
//header("Location:index.php"winking smiley;
}*/

That is the code where I use $_GET act. If I make it a comment the error dont occur but if I didnt make it a comment the error message appear.

Options: ReplyQuote


Sorry, only registered users may post in this forum.