Re: [PHP] Problem Directing the Page with header

2007-02-16 Thread Martin Marques

On Thu, 15 Feb 2007, Ashish Rizal wrote:




You need to put a session_commit(); here, so session gets writen.


header("Location: $adminAddress");
exit();
}



--
 21:50:04 up 2 days,  9:07,  0 users,  load average: 0.92, 0.37, 0.18
-
Lic. Martín Marqués |   SELECT 'mmarques' ||
Centro de Telemática|   '@' || 'unl.edu.ar';
Universidad Nacional|   DBA, Programador,
del Litoral |   Administrador
-
-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Problem Directing the Page with header

2007-02-16 Thread Németh Zoltán
2007. 02. 15, csütörtök keltezéssel 18.41-kor Ashish Rizal ezt írta:
> Hey Jim,
> Thanks for the quick response. I have actually made the whole
> code on same page (login.php) and the functions that i used in
> this code are in functions.php. Now this time it is showing the
> warning :
> Warning: Cannot modify header information - headers already sent
> by (output started at C:\Program
> Files\xampp\htdocs\fselection\login.php:1) in C:\Program
> Files\xampp\htdocs\fselection\login.php on line 19 
> The line 19 is header("Location: http://$host$uri/$extra";);

it says you sent out some output on line 1
what is on line 1? maybe you have a blank line in the beginning of your
php file?

greets
Zoltán Németh

> 
>  Below is the list of code for login.php.
> The Server i am using is SunOS 5.10. 
> 
>  session_start();
> require_once 'functions.php';
> $UserName = $_POST['UserName'];
> $Password = $_POST['Password'];
> $host = $_SERVER['HTTP_HOST'];
> $uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
> $extra = 'adminlogin.php';
> $loc = "\"http://$host$uri/$extra\"";;
> if ($_POST){
> $error = login_check($_POST);
> if (trim ($error)=="")
> {
> $accesslevel = accessLevel($UserName);
> ?>
>  if ($accesslevel == "admin"){
> $_SESSION["userid"] = login($_POST);
> header("Location: http://$host$uri/$extra";);
> exit();
> }
> else if ($accesslevel == "user") {
> //echo "this is user"; 
> $_SESSION["userid"] = login($_POST);
> header('Location: userlogin.php');
> exit();
> }
> }
> else {
> print "Error :$error";
> }
> }
> ?>
> 
> 
>   
> ***Login Form Goes Here **
> nothing php Stuffs on this part
> 
> 
> Thank you again for your time and consideration. 
> 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] Problem Directing the Page with header

2007-02-15 Thread Jim Lucas

Ashish Rizal wrote:

Hi, I am having problem with redirecting the page in user
authenication page . I am working on my windows machine as a
localhost with PHP Version 5.2.0. Everything is working good in
local machine (in Windows) but now when i tried to upload the
same code to the server which is using PHP Version 5.1.6, it does
not seem to redirect my page. I have a main loginpage which on
post goes to the logincheck.php and in Login.php i have all the
stuffs to authenticate and redirect the user. I am pasting the
logincheck.php code below. 
one thing to watch for is case-sensitivity.  you have a logincheck.php 
and then a Login.php  are you sure that the file has a 'L' in the name?


This is actually all mute if you are running on a windows server also. 
Do you know what OS is on the server? Linux, BSD, Windows, Mac...


when you say "it does not seem to rediret my page"...  What does it do 
instead???  Error...






Any Help would be highly aprriciated.
Thanks a lot 




--
Enjoy,

Jim Lucas

Different eyes see different things. Different hearts beat on different 
strings. But there are times for you and me when all such things agree.


- Rush

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] Problem Directing the Page with header

2007-02-15 Thread Ashish Rizal
Hi, I am having problem with redirecting the page in user
authenication page . I am working on my windows machine as a
localhost with PHP Version 5.2.0. Everything is working good in
local machine (in Windows) but now when i tried to upload the
same code to the server which is using PHP Version 5.1.6, it does
not seem to redirect my page. I have a main loginpage which on
post goes to the logincheck.php and in Login.php i have all the
stuffs to authenticate and redirect the user. I am pasting the
logincheck.php code below. 



Any Help would be highly aprriciated.
Thanks a lot 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php