Re: [PHP-DB] problem with login script

2002-06-14 Thread Stuart Dallas

On Friday, June 14, 2002, 2:51:51 PM, Jason Wong wrote:

> On Friday 14 June 2002 20:23, Hutchins, Richard wrote:

>> I've been working with includes recently and that's the standard syntax.
>> Furthermore, if you put the functions.php file in a different directory,
>> remember to use double slashes in the path (i.e.
>> path\\foo\\bar\\functions.php). 

> That's only relevant if using a Windows server.

If you want to avoid headaches then it's best to use forward-slashes on
Windows (unless you need to access another drive).

-- 
Stuart


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




Re: [PHP-DB] problem with login script

2002-06-14 Thread Jason Wong

On Friday 14 June 2002 20:23, Hutchins, Richard wrote:
> I haven't been following your whole thread on this issue, but I did notice
> that the syntax for your include statement is incorrect. Try this:
>
>include("functions.php");
> ?>

Doesn't really matter, it works with or without parentheses.

> I've been working with includes recently and that's the standard syntax.
> Furthermore, if you put the functions.php file in a different directory,
> remember to use double slashes in the path (i.e.
> path\\foo\\bar\\functions.php). 

That's only relevant if using a Windows server.

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
We had to turn off that service to comply with the CDA Bill.
*/


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




RE: [PHP-DB] problem with login script

2002-06-14 Thread Hutchins, Richard

I haven't been following your whole thread on this issue, but I did notice
that the syntax for your include statement is incorrect. Try this:



I've been working with includes recently and that's the standard syntax.
Furthermore, if you put the functions.php file in a different directory,
remember to use double slashes in the path (i.e.
path\\foo\\bar\\functions.php). Instead of the include(); statement, you
also have require(); at your disposal.

Hope this helps.
-Original Message-
From: Jason Wong [mailto:[EMAIL PROTECTED]]
Sent: Friday, June 14, 2002 2:15 AM
To: [EMAIL PROTECTED]
Subject: Re: [PHP-DB] problem with login script


On Friday 14 June 2002 03:23, suman wrote:
> hi
> adding the in func.php still returns this.
>
> my functions script is
> -

You need:




This

>  when i run these i get this error
> Parse error: parse error, unexpected ';' in
> /usr/local/apache/htdocs/sims/php/functions.php on line 12

In future please indicate which is line 12!

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
To thine own self be true.  (If not that, at least make some money.)
*/


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

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




Re: [PHP-DB] problem with login script

2002-06-13 Thread Jason Wong

On Friday 14 June 2002 03:23, suman wrote:
> hi
> adding the in func.php still returns this.
>
> my functions script is
> -

You need:




This

>  when i run these i get this error
> Parse error: parse error, unexpected ';' in
> /usr/local/apache/htdocs/sims/php/functions.php on line 12

In future please indicate which is line 12!

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
To thine own self be true.  (If not that, at least make some money.)
*/


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




Re: [PHP-DB] problem with login script

2002-06-13 Thread suman

hi
adding the in func.php still returns this.

my functions script is
-function 
auuser($login,$passwd)
{
global $db_server,$http_host,$db,$db_user,$db_pass,$doc_root;
   if(!( $connect=pg_pconnect("host=$db_server  dbname=$db user=$db_user 
password=$db_pass"))
   {
Displayerrmsg(sprintf("internal error 
%s\n",pg_ErrorMessage($connect));
return 0;
}

$query="select passwd from login where usr='$login'";
$result=pg_exec($connect,$query) or die("ERROR IN 
QUERY:$query".pg_last_error($connect) );
if (!$result)
{
Displayerrmsg(sprintf("internal error 
%s\n",pg_ErrorMessage($connect));
return 0;
}
if( ($arr=pg_fetch_array($result,0,PGSQL_BOTH)) && 
($passwd==$arr["passwd"] && $passwd!="") )
return 1;
else
return 0;
}
-
my login.php file is
http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP-DB] problem with login script

2002-06-12 Thread Jason Wong

On Thursday 13 June 2002 06:00, suman wrote:
> hi
> when i execute this script i an error
> ---func
>tion
>
> this func is in file functions.php and the func deletecookies();
>
> auuser($login,$passwd)
> {
> global $db_server,$http_host,$db,$db_user,$db_pass,$doc_root;
>


[snip]

> 
> this is the file login.php
>
>  require 'functions.php';
>
[snip]

> ---
> i get this error
>
>
> function auuser($login,$passwd) { global
> $db_server,$http_host,$db,$db_user,$db_pass,$doc_root;  return 0; } if(
> ($arr=pg_fetch_array($result,0,PGSQL_BOTH)) && ($passwd==$arr["passwd"] &&
> $passwd!="") ) return 1; else return 0; } function Dispalyerrmsg ( $message
> ) { printf("

[snip]

PHP code in functions.php must be enclosed within 

-- 
Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
Open Source Software Systems Integrators
* Web Design & Hosting * Internet & Intranet Applications Development *


/*
"Home life as we understand it is no more natural to us than a cage is to a 
cockatoo."
-- George Bernard Shaw
*/


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




[PHP-DB] problem with login script

2002-06-12 Thread suman

hi
when i execute this script i an error
---function 

this func is in file functions.php and the func deletecookies();

auuser($login,$passwd)
{
global $db_server,$http_host,$db,$db_user,$db_pass,$doc_root;

$connect=pg_pconnect("host=$db_server  dbname=$db user=$db_user 
password=$db_pass");
if(!$connect)
{
Displayerrmsg(sprintf("internal error 
%s\n",pg_ErrorMessage($connect));
return 0;
}

$query="select passwd from login where usr='$login'";
$result=pg_exec($connect,$query) or die("ERROR IN 
QUERY:$query".pg_last_error($connect) );
if (!$result)
{
Displayerrmsg(sprintf("internal error 
%s\n",pg_ErrorMessage($connect));
return 0;
}
if( ($arr=pg_fetch_array($result,0,PGSQL_BOTH)) && 
($passwd==$arr["passwd"] && $passwd!="") )
return 1;
else
return 0;
}

this is the file login.php

http://$http_host/$doc_root/stuinfo.html";);
exit();
}
else
{
header("Location:http://$http_host/$doc_root/login.html";);
exit();
}
   
 
---
i get this error


function auuser($login,$passwd) { global 
$db_server,$http_host,$db,$db_user,$db_pass,$doc_root;  return 0; } if( 
($arr=pg_fetch_array($result,0,PGSQL_BOTH)) && ($passwd==$arr["passwd"] && 
$passwd!="") ) return 1; else return 0; } function Dispalyerrmsg ( $message ) 
{ printf("
.
.
.
the same func
.
%s
\n",$message); } function deletecookies() { setcookie("cookie_user",""); }
Fatal error: Call to undefined function: auuser() in 
/usr/local/apache/htdocs/sims/php/login1.php on line 35

plz help me.soprry for ong mail

bye
suman


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