Re: PHP and ORACLE conection error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



"xxx xxxx" <xde7ori@flash.ro> wrote... :

> hy,
> i'm having a problem with my project....
> i have an oracle server on a computer named oracle and in apache htdocs files i have a directory special for my project...
> 
> 1 in that dir i have a html file named index.html
> here i get the username and the password and post it to the validate.php file
> 
> in the validate.php file:
> the first i have is 
> <?php session_start(); 
>  header("Cache-control:private"); ?>
> then
> 
> 1. i get the variables
>  $name=$_POST['username'];
>  $password=$_POST['pass'];
> 
> 2. i register the variables 
>   session_register("name") and session_register("password"),
> 
> 3. i verify if they can acces to the database 
> if( ociplogon($name,$password))
>  $ok='true';
> else $ok='false';

oops... You are assigning $ok to a *string* of a readable values 'true'
or 'false'.


> 4. in the body of the validate.php i have a script in order to load a new page
> 
> <script>
> var ok=<?php echo $ok; ?>
> if(ok==true) 
>  window.location.href="good_page.php";
> else
> window.location.href="error.php"
> window.reload();
> </script>

The string $ok is not empty, and thus will always evaluate as TRUE. You
need to assign it the boolean value a few lines above. Not a string.

> well
> that's it....
> it works but not fine....i know it isn't the best way but it worked ....
> till some days i have any problems but since today i don't know what is happening...
> 
> sometimes it works loading the good_page but sometimes it loads the error page....
> i think it is something with authentification and session but i need a solution quickly...i have no time to rethink all...
> 
> if you have a solution or another type of making all i have made send me a reply
> thanks a lot...
> cybercop78
> 
> http://www.idilis.ro - Stiri, e-mail gratuit, download,
> SMS, server de counter-strike, hosting gratuit, servicii internet...
> Fii cu un pas inaintea celorlati!




--
Maxim Maletsky
maxim@php.net



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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux