php-windows Digest 12 Sep 2008 02:48:47 -0000 Issue 3520

Topics (messages 29027 through 29031):

Why is the $todaydatestring data type displayed as Boolean?
        29027 by: Varuna Seneviratna
        29028 by: James Crow

PHP, LDAP and Windows Integrated Authentication
        29029 by: Break

I don't know what I'm doing wrong
        29030 by: Daniel Wagner
        29031 by: John Harris

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
Why is the $todaydatestring data type displayed as Boolean?

<?php
            $todaydate=11092008;
            echo "The data type of todaydate is
".gettype($todaydate)."</br>";
            $mydatestring=settype($todaydate,"String");
            echo "The data type of mydatestring is ".gettype($mydatestring);




        ?>

Varuna

-- 
Varuna Seneviratna
No 514 Udumulla Road
Battaramulla
Sri Lanka
Tel : 011-2888620
Mobile:0715617141

--- End Message ---
--- Begin Message ---
On Thu, 2008-09-11 at 18:53 +0530, Varuna Seneviratna wrote:
> Why is the $todaydatestring data type displayed as Boolean?
> 
> <?php
>             $todaydate=11092008;
>             echo "The data type of todaydate is
> ".gettype($todaydate)."</br>";
>             $mydatestring=settype($todaydate,"String");
>             echo "The data type of mydatestring is ".gettype($mydatestring);
> 
> 
> 
> 
>         ?>
> 
> Varuna

Varuna,

  The settype() function returns a boolean response for success/failure.
The variable $mydatestring is the response from setype() and not the
type of the function. If you add this:

echo "The data type of todaydate is ".gettype($todaydate);

It will respond as you expect.

Thanks,
James



--- End Message ---
--- Begin Message ---
Good morning all,

System platform:
Server with W2K3, IIS6 and PHP 5
Workstation with XP SP3.

I make a search into my LDAP.
It works but I need to make the bind with a username/password couple

Code below:
<?php
 $ldap_user = substr($_SERVER['AUTH_USER'],7)."@domaine.com"; 
 $ldap_pass); //here putting the password for ^$ldap_user;
 $ldap_host = 'ldap.domaine.com';
 $ldap_domain= 'ldap-domain';
 $base_dn='ou=USER,OU=OrgUnit,dc=domain,dc=com';
 $filter='(cn=*)';
 $connect=ldap_connect($ldap_host,389) or exit('>>Could not connect to LDAP 
server<<');
 $bind=ldap_bind($connect,$ldap_user,$ldap_pass) or exit('<<Could not bind to 
$ldap_host<<');
 $read=ldap_search($connect,$base_dn,$filter);
 $info=ldap_get_entries($connect,$read);
 echo $info['count'].' entries returned<p>';
 echo "<br>";

 for ($i=0;$i<$info['count']; $i++)
 {
  $info_cn = $info[$i]['initials'][0];
  echo 'cn = '.$info_cn.'<BR>';
 }
?>

I want use the Windows Integrated Authentication to send to my ldap_bind 
command the current user/password instead of hardcoded it into the php script.

Regards,

C.B

--- End Message ---
--- Begin Message ---
I am currently going through 'davidj's php tutorials @
http://www.dreamweaverclub.com/vtm/php-mysql-apache.php and am in the process 
of learning.  I am encountering an issue though that I can't seem to find an 
answer to.  Maybe someone can help me.  
I downloaded the WAMP server, (which I found out I could do after painstakingly 
manually setting up my own set of wamp programs) and made it up to the part of 
the tutorials when I am required to check out my work. 
(This is my connections.php)

<?php
//////////////////////////////////////
$database    =   "practice";
$username    =   "daniel";
$password    =   "buggytaz";
///////////////////////////////////////
$link        =   @mysql_connect('localhost', $username, $password);
$db          =   mysql_select_db($database, $link);
?>

(And this is my practice.php)

<?php
require_once("Connections/connection.php");  //database connection

/////////////////////////////////////////////////////
$query   =sprintf("SELECT * FROM table1");
$result  [EMAIL PROTECTED]($query);
$row     =mysql_fetch_array($result);
/////////////////////////////////////////////////////
echo $row['field2'];
?>

The database IS in place through the SQL managment program.
I am able to view my php.info document.
Now... this is the issue that I am having.
When I try to view the page I get this back:

Warning: require_once(Connections/connection.php) [function.require-once]: 
failed to open stream: No such file or directory in 
C:\wamp\www\WebRoot\Test\Images\practice.php on line 2
Fatal error: require_once() [function.require]: Failed opening required 
'Connections/connection.php' (include_path='.;C:\php5\pear') in 
C:\wamp\www\WebRoot\Test\Images\practice.php on line 2

I have a feeling that my issue is contained within:   
(include_path='.;C:\php5\pear')
But I honestly have no idea.
Please give me a hand if you can.
[EMAIL PROTECTED]


      

--- End Message ---
--- Begin Message ---
On 11 Sep 2008 14:45, Daniel Wagner wrote

> (This is my connections.php)
>
> <?php
[snip]
> $db          =   mysql_select_db($database, $link);
> ?>
>
> (And this is my practice.php)
>
> <?php
> require_once("Connections/connection.php");  //database connection
>
[snip]
> When I try to view the page I get this back:
>
> Warning: require_once(Connections/connection.php) [function.require-once]:
> failed to open stream: No such file

I can't see a problem if your connection.php file is located off the
practice.php folder.

C:\wamp\www\WebRoot\Test\Images\Connections\connection.php

In which folder is the connection.php file located?

-John


--- End Message ---

Reply via email to