php-general Digest 21 Aug 2007 20:20:28 -0000 Issue 4974

2007-08-21 Thread php-general-digest-help

php-general Digest 21 Aug 2007 20:20:28 - Issue 4974

Topics (messages 261069 through 261092):

Ïoëeçío äëÿ Áèçíåña
261069 by: php

Re: Pass $_GET to php cli.
261070 by: Per Jessen

Re: Declare variables in advance question
261071 by: Colin Guthrie
261074 by: Stut
261075 by: shiplu

Re: LDAP
261072 by: Colin Guthrie
261078 by: Alain Roger
261085 by: Dan Shirah
261086 by: Daniel Brown
261088 by: Dan Shirah

Re: php 4.4.7 make install with pear causes zend freeing errors
261073 by: M. Sokolewicz
261089 by: John Mendenhall

oracle instantclient 10 problem
261076 by: Rainhard

Server error
261077 by: Humani Power
261079 by: Borokov Smith

keeping fields moving forward
261080 by: Mike Ryan
261081 by: Chris Boget
261083 by: Jim Lucas
261084 by: Mike Ryan
261087 by: Jim Lucas
261092 by: brian

Re: About Session And Cookies
261082 by: Michelle Konzack

php to generate java-script
261090 by: Jas

LDAP ***RESOLVED***
261091 by: Dan Shirah

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]


--
---BeginMessage---
eehdga  otjcpm
 exqko  bbrgkf---End Message---
---BeginMessage---
N0K wrote:

 But if it run in the browser, i think it have to run in cli, dont you
 think ?

No, certainly not by default. They are very different environments, as
you have already found out.  


/Per Jessen, Zürich
---End Message---
---BeginMessage---
nitrox . wrote:
 I want to declare these variables Game_id and Member_id in advance. Following 
 the suggestionfrom one of my books can I do something like this:
  
 $expected = array('Game_id', 'Member_id');foreach($expected AS $key) {if 
 ( !empty($_POST[$key])) {  ${$key} = $_POST[$key];}else { 
 ${$key} = NULL;}}  case addmember:  switch ($_GET['type']) {
 case membergame:  $sql = INSERT INTO xsm_membergames   
  (Game_id,Member_id)  VALUES  
   (' . mysql_real_escape_string((int)$_POST[Game_id])) . ',   
  ' . mysql_real_escape_string((int)$_POST[Member_id])) . 
 ');  break;  }  break; 
 My concern is did I achieve anything with the code I just added to declare 
 the variables? Is it actually being passed to this:  case addmember:
   switch ($_GET['type']) {case membergame:  $sql = INSERT 
 INTO xsm_membergames(Game_id,
 Member_id)  VALUES(' . 
 mysql_real_escape_string((int)$_POST[Game_id]) . ',' 
 . mysql_real_escape_string((int)$_POST[Member_id]) . ');  break;  
 }  break; 
 I did add this and tested it on my server and I didnt recieve any errors. So 
 how can I be sure its doing what I intended? 
 _
 See what you’re getting into…before you go there
 http://newlivehotmail.com/?ocid=TXT_TAGHM_migration_HM_viral_preview_0507


Your code is not formatted very nicly in your mail which makes it very
hard to read, but it's also invalid. There is a case statement in there
without a switch to control it twice.

Col
---End Message---
---BeginMessage---

Colin Guthrie wrote:

nitrox . wrote:

I want to declare these variables Game_id and Member_id in advance. Following 
the suggestionfrom one of my books can I do something like this:
 
$expected = array('Game_id', 'Member_id');foreach($expected AS $key) {if ( !empty($_POST[$key])) {  ${$key} = $_POST[$key];}else { ${$key} = NULL;}}  case addmember:  switch ($_GET['type']) {case membergame:  $sql = INSERT INTO xsm_membergames(Game_id,Member_id)  VALUES(' . mysql_real_escape_string((int)$_POST[Game_id])) . ',' . mysql_real_escape_string((int)$_POST[Member_id])) . ');  break;  }  break; 
My concern is did I achieve anything with the code I just added to declare the variables? Is it actually being passed to this:  case addmember:  switch ($_GET['type']) {case membergame:  $sql = INSERT INTO xsm_membergames(Game_id,Member_id)  VALUES(' . mysql_real_escape_string((int)$_POST[Game_id]) . ',' . mysql_real_escape_string((int)$_POST[Member_id]) . ');  break;  }  break; 
I did add this and tested it on my server and I didnt recieve any errors. So how can I be sure its doing what I intended? 

[PHP] LDAP

2007-08-21 Thread Alain Roger
Hi,

I have a stupid issue with ldap_connect.

i've reinstalled PHP, postgreSQL and restore my data (web files) after
reinstalling my PC.
now, when i try : $ds = ldap_connect($ldaphost, $ldapport) or die(Could not
connect to $ldaphost);

nothing works.
i wrote before error_reporting(E_ALL); in order to check which error message
i get, but nothing is return as error.

what could be the problem ?

thx.

-- 
Alain

Windows XP SP2
PostgreSQL 8.2.3
Apache 2.2.4
PHP 5.2.3


[PHP] Re: Declare variables in advance question

2007-08-21 Thread Colin Guthrie
nitrox . wrote:
 I want to declare these variables Game_id and Member_id in advance. Following 
 the suggestionfrom one of my books can I do something like this:
  
 $expected = array('Game_id', 'Member_id');foreach($expected AS $key) {if 
 ( !empty($_POST[$key])) {  ${$key} = $_POST[$key];}else { 
 ${$key} = NULL;}}  case addmember:  switch ($_GET['type']) {
 case membergame:  $sql = INSERT INTO xsm_membergames   
  (Game_id,Member_id)  VALUES  
   (' . mysql_real_escape_string((int)$_POST[Game_id])) . ',   
  ' . mysql_real_escape_string((int)$_POST[Member_id])) . 
 ');  break;  }  break; 
 My concern is did I achieve anything with the code I just added to declare 
 the variables? Is it actually being passed to this:  case addmember:
   switch ($_GET['type']) {case membergame:  $sql = INSERT 
 INTO xsm_membergames(Game_id,
 Member_id)  VALUES(' . 
 mysql_real_escape_string((int)$_POST[Game_id]) . ',' 
 . mysql_real_escape_string((int)$_POST[Member_id]) . ');  break;  
 }  break; 
 I did add this and tested it on my server and I didnt recieve any errors. So 
 how can I be sure its doing what I intended? 
 _
 See what you’re getting into…before you go there
 http://newlivehotmail.com/?ocid=TXT_TAGHM_migration_HM_viral_preview_0507


Your code is not formatted very nicly in your mail which makes it very
hard to read, but it's also invalid. There is a case statement in there
without a switch to control it twice.

Col

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



[PHP] Re: LDAP

2007-08-21 Thread Colin Guthrie
Alain Roger wrote:
 Hi,
 
 I have a stupid issue with ldap_connect.
 
 i've reinstalled PHP, postgreSQL and restore my data (web files) after
 reinstalling my PC.
 now, when i try : $ds = ldap_connect($ldaphost, $ldapport) or die(Could not
 connect to $ldaphost);
 
 nothing works.
 i wrote before error_reporting(E_ALL); in order to check which error message
 i get, but nothing is return as error.
 
 what could be the problem ?


Silly question but is the PHP you installed exactly the same as the
previous one or did you select a different package? Perhaps PHP is
compiled without ldap support or perhaps you've not installed the
subpackage needed to enable ldap support. For me I have to install
php-ldap subpackage.

I would expect to see a fatal error saying no such function etc. so this
is perhaps not the problem, but worth a look.

Col

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



Re: [PHP] Pass $_GET to php cli.

2007-08-21 Thread Per Jessen
N0K wrote:

 But if it run in the browser, i think it have to run in cli, dont you
 think ?

No, certainly not by default. They are very different environments, as
you have already found out.  


/Per Jessen, Zürich

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



Re: [PHP] Re: Declare variables in advance question

2007-08-21 Thread Stut

Colin Guthrie wrote:

nitrox . wrote:

I want to declare these variables Game_id and Member_id in advance. Following 
the suggestionfrom one of my books can I do something like this:
 
$expected = array('Game_id', 'Member_id');foreach($expected AS $key) {if ( !empty($_POST[$key])) {  ${$key} = $_POST[$key];}else { ${$key} = NULL;}}  case addmember:  switch ($_GET['type']) {case membergame:  $sql = INSERT INTO xsm_membergames(Game_id,Member_id)  VALUES(' . mysql_real_escape_string((int)$_POST[Game_id])) . ',' . mysql_real_escape_string((int)$_POST[Member_id])) . ');  break;  }  break; 
My concern is did I achieve anything with the code I just added to declare the variables? Is it actually being passed to this:  case addmember:  switch ($_GET['type']) {case membergame:  $sql = INSERT INTO xsm_membergames(Game_id,Member_id)  VALUES(' . mysql_real_escape_string((int)$_POST[Game_id]) . ',' . mysql_real_escape_string((int)$_POST[Member_id]) . ');  break;  }  break; 
I did add this and tested it on my server and I didnt recieve any errors. So how can I be sure its doing what I intended? 
_

See what you’re getting into…before you go there
http://newlivehotmail.com/?ocid=TXT_TAGHM_migration_HM_viral_preview_0507



Your code is not formatted very nicly in your mail which makes it very
hard to read, but it's also invalid. There is a case statement in there
without a switch to control it twice.


That being the case the fact that you didn't get any errors indicates 
that you have PHP configured to not show errors, warnings and notices. I 
strongly recommend you modify your php.ini and set display_errors to on 
and error_reporting to E_ALL. Then restart your web server and try your 
script again. You should then see lots of errors.


-Stut

--
http://stut.net/

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



Re: [PHP] php 4.4.7 make install with pear causes zend freeing errors

2007-08-21 Thread M. Sokolewicz

Chris wrote:

M. Sokolewicz wrote:

Chris wrote:

John Mendenhall wrote:

Is the only valid response to problems with php4 to
upgrade to php5?  Or, are there still some people
out there still using php4 and possibly have had
problems with install such as the following?

If php5 is the only answer, I guess we'll just have
to go with what we have and limp along until we can
get everything converted to work on php5.

I sent this to the php-install list.


Try the -internals list.



I don't think the php-internals folks would appreciate such emails. 
For problems with the install, first make sure it's not your fault 
(sounds stupid, but usually is), and if it's a bug, report it via the 
bugtracker. There is no need to bother the PHP developers with such 
things.


The compiler complaining about free'ing memory is something they 
should pay attention to as far as I'm concerned. *shrug*


Clearly I should've read the thread better, somehow I missed that 
entirely -.-

sorry bout that :)

anyway, first thing to do before posting is cutting down on your config 
options to the bare minimum to see if it's due to the core engine or 
some kind of extension, I'm sure they would appreciate it.


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



Re: [PHP] Re: Declare variables in advance question

2007-08-21 Thread shiplu
use
#php -s
command to indend your source file

On 8/21/07, Colin Guthrie [EMAIL PROTECTED] wrote:
 nitrox . wrote:
  I want to declare these variables Game_id and Member_id in advance. 
  Following the suggestionfrom one of my books can I do something like this:
 
  $expected = array('Game_id', 'Member_id');foreach($expected AS $key) {
  if ( !empty($_POST[$key])) {  ${$key} = $_POST[$key];}else {
   ${$key} = NULL;}}  case addmember:  switch ($_GET['type']) { 
 case membergame:  $sql = INSERT INTO xsm_membergames  
(Game_id,Member_id)  
  VALUES(' . 
  mysql_real_escape_string((int)$_POST[Game_id])) . ',
  ' . mysql_real_escape_string((int)$_POST[Member_id])) . ');  
  break;  }  break;
  My concern is did I achieve anything with the code I just added to declare 
  the variables? Is it actually being passed to this:  case addmember:  
  switch ($_GET['type']) {case membergame:  $sql = 
  INSERT INTO xsm_membergames(Game_id,   
   Member_id)  VALUES(' . 
  mysql_real_escape_string((int)$_POST[Game_id]) . ',
  ' . mysql_real_escape_string((int)$_POST[Member_id]) . ');  
  break;  }  break;
  I did add this and tested it on my server and I didnt recieve any errors. 
  So how can I be sure its doing what I intended?
  _
  See what you're getting into…before you go there
  http://newlivehotmail.com/?ocid=TXT_TAGHM_migration_HM_viral_preview_0507


 Your code is not formatted very nicly in your mail which makes it very
 hard to read, but it's also invalid. There is a case statement in there
 without a switch to control it twice.

 Col

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




-- 
shout at http://shiplu.awardspace.com/

Available for Hire/Contract/Full Time

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



[PHP] oracle instantclient 10 problem

2007-08-21 Thread Rainhard
Ehlo,

I compiled php-5.2.3 with the
--with-oci8=instantclient,/opt/instantclient_10_2/ switch and it
completed with no errors.
First it seems to work well, but now, sometimes i get the infamous -
OCIEnvNlsCreate() failed check LD_LIBRARY_PATH - error.
The funny thing is, those variables are all set.
I dont have really a clue why this appears now.

versions in use
apache 2.2.4
php 5.2.3
instantclient 10.2.0.3

These parameters are set before the apache is started
ORACLE_BASE=/opt/instantclient_10_2
ORACLE_HOME=$ORACLE_BASE
NLS_LANG=GERMAN_GERMANY.WE8ISO8859P9
PATH=$PATH:$ORACLE_BASE
LD_LIBRARY_PATH=$ORACLE_BASE
TNS_ADMIN=/etc
ORACLE_SID=SID

Any suggestions would be much appreciated.
TIA
Rainhard

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



[PHP] Server error

2007-08-21 Thread Humani Power
Hi everybody. I have a Fedora Core 7 with php 5, and I want to upload an
image.
The funniest thing is that my script works fine in other computer but not in
this one.
I look for the error in /var/log/httpd/error.log and I found this

[Tue Aug 21 15:52:46 2007] [notice] caught SIGTERM, shutting down
[Tue Aug 21 15:55:32 2007] [notice] suEXEC mechanism enabled (wrapper:
/usr/sbin/suexec)
[Tue Aug 21 15:55:32 2007] [notice] Digest: generating secret for digest
authentication ...
[Tue Aug 21 15:55:32 2007] [notice] Digest: done
[Tue Aug 21 15:55:33 2007] [notice] mod_python: Creating 4 session mutexes
based on 256 max processes and 0 max threads.
[Tue Aug 21 15:55:33 2007] [notice] mod_python: using mutex_directory /tmp
[Tue Aug 21 15:55:34 2007] [notice] Apache/2.2.4 (Unix) DAV/2 PHP/5.2.2
mod_python/3.3.1 Python/2.5 mod_ssl/2.2.4 OpenSSL/0.9.8b mod_perl/2.0.3
Perl/v5.8.8 configured -- resuming normal operations

I know that this is PHP forum, but dont know if it is related.
Thanks for your help


Re: [PHP] Re: LDAP

2007-08-21 Thread Alain Roger
I found what was the problem :-(

in PHP.ini the Temp directory was not setup the same.
i do not know what is the link with LDAP module, but since i updated php.ini,
it works correctly.

Alain

On 8/21/07, Colin Guthrie [EMAIL PROTECTED] wrote:

 Alain Roger wrote:
  Hi,
 
  I have a stupid issue with ldap_connect.
 
  i've reinstalled PHP, postgreSQL and restore my data (web files) after
  reinstalling my PC.
  now, when i try : $ds = ldap_connect($ldaphost, $ldapport) or die(Could
 not
  connect to $ldaphost);
 
  nothing works.
  i wrote before error_reporting(E_ALL); in order to check which error
 message
  i get, but nothing is return as error.
 
  what could be the problem ?


 Silly question but is the PHP you installed exactly the same as the
 previous one or did you select a different package? Perhaps PHP is
 compiled without ldap support or perhaps you've not installed the
 subpackage needed to enable ldap support. For me I have to install
 php-ldap subpackage.

 I would expect to see a fatal error saying no such function etc. so this
 is perhaps not the problem, but worth a look.

 Col

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




-- 
Alain

Windows XP SP2
PostgreSQL 8.2.3
Apache 2.2.4
PHP 5.2.3


Re: [PHP] Server error

2007-08-21 Thread Borokov Smith

Hi dr Nick,

The $_FILES autoglobal contains an error code if something went wrong.
What is the code set to ?

Regards,

boro

Humani Power schreef:

Hi everybody. I have a Fedora Core 7 with php 5, and I want to upload an
image.
The funniest thing is that my script works fine in other computer but not in
this one.
I look for the error in /var/log/httpd/error.log and I found this

[Tue Aug 21 15:52:46 2007] [notice] caught SIGTERM, shutting down
[Tue Aug 21 15:55:32 2007] [notice] suEXEC mechanism enabled (wrapper:
/usr/sbin/suexec)
[Tue Aug 21 15:55:32 2007] [notice] Digest: generating secret for digest
authentication ...
[Tue Aug 21 15:55:32 2007] [notice] Digest: done
[Tue Aug 21 15:55:33 2007] [notice] mod_python: Creating 4 session mutexes
based on 256 max processes and 0 max threads.
[Tue Aug 21 15:55:33 2007] [notice] mod_python: using mutex_directory /tmp
[Tue Aug 21 15:55:34 2007] [notice] Apache/2.2.4 (Unix) DAV/2 PHP/5.2.2
mod_python/3.3.1 Python/2.5 mod_ssl/2.2.4 OpenSSL/0.9.8b mod_perl/2.0.3
Perl/v5.8.8 configured -- resuming normal operations

I know that this is PHP forum, but dont know if it is related.
Thanks for your help

  


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



[PHP] keeping fields moving forward

2007-08-21 Thread Mike Ryan
I am creating a series of forms that collect information this covers 3
screens before I want to write it out to the database.  when I go from one
screen to the next I have tried hidden and readonly input boxes but the data
in the hidden and readonly fields from screen one do not make it to the
final page.

Is there a way to get the data from page one without letting the users
modify the information.  I guess I could write the data to the database but
how do I find the record number of the data I just wrote so that I can
update the information, will php tell me the record number? I am using php
5.2.1 and mysql 5.x

thanks for your help.


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



RE: [PHP] keeping fields moving forward

2007-08-21 Thread Chris Boget
 Is there a way to get the data from page one without 
 letting the users modify the information.  I guess I 
 could write the data to the database 

Or you could store the data in the session space...

thnx,
Chris

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



[PHP] Re: About Session And Cookies

2007-08-21 Thread Michelle Konzack
Am 2007-08-17 22:07:47, schrieb Bastien Koert:
 
 If cookies are not available, you can either
  
 hide the id in the hidden form field element
 or
 enable trans_sid to automatically pass the session id in the url

This will be a security risk since Session-Hijacker can grap the URL

Greetings
Michelle Konzack
Systemadministrator
Tamay Dogan Network
Debian GNU/Linux Consultant


-- 
Linux-User #280138 with the Linux Counter, http://counter.li.org/
# Debian GNU/Linux Consultant #
Michelle Konzack   Apt. 917  ICQ #328449886
   50, rue de Soultz MSN LinuxMichi
0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)


signature.pgp
Description: Digital signature


Re: [PHP] keeping fields moving forward

2007-08-21 Thread Jim Lucas

Mike Ryan wrote:

I am creating a series of forms that collect information this covers 3
screens before I want to write it out to the database.  when I go from one
screen to the next I have tried hidden and readonly input boxes but the data
in the hidden and readonly fields from screen one do not make it to the
final page.

Is there a way to get the data from page one without letting the users
modify the information.  I guess I could write the data to the database but
how do I find the record number of the data I just wrote so that I can
update the information, will php tell me the record number? I am using php
5.2.1 and mysql 5.x

thanks for your help.



Are working with the data from Form 1 before going to form 2 and so forth?

If you are not, then you could look into a three layered div with tabs and keep 
it all on one page.

--
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare

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



Re: [PHP] keeping fields moving forward

2007-08-21 Thread Mike Ryan

Jim Lucas [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Mike Ryan wrote:
  I am creating a series of forms that collect information this covers 3
  screens before I want to write it out to the database.  when I go from
one
  screen to the next I have tried hidden and readonly input boxes but the
data
  in the hidden and readonly fields from screen one do not make it to the
  final page.
 
  Is there a way to get the data from page one without letting the users
  modify the information.  I guess I could write the data to the database
but
  how do I find the record number of the data I just wrote so that I can
  update the information, will php tell me the record number? I am using
php
  5.2.1 and mysql 5.x
 
  thanks for your help.
 
 
 Are working with the data from Form 1 before going to form 2 and so forth?

 If you are not, then you could look into a three layered div with tabs and
keep it all on one page.

 -- 
 Jim Lucas

 Some men are born to greatness, some achieve greatness,
 and some have greatness thrust upon them.

 Twelfth Night, Act II, Scene V
  by William Shakespeare

yes I get information from form one transfers to form two ok but then does
not show up on form 3. form 1 and 2 do not then save to the database after
the last page of form 3.

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



[PHP] LDAP

2007-08-21 Thread Dan Shirah
Okay, hopefully someone can help me out here.  I've gone over ldap at
php.net and multiple other sites but can't get it to work. Everytime I run
the query my results are 0 entries returned.

My AD tree is: CN=Users,DC=domain,DC=us.  I have the AD Server set so that
anonymous access to retrieve information is enabled.

Below is my code.  Any ideas?


?php
$ldap_host = AD Server;
$ldap_port = 389;
$base_dn = DC=domain,DC=us;
$filter = (CN=users);
$connect = ldap_connect( $ldap_host, $ldap_port);
ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3);

$bind = ldap_bind($connect);
$read = ldap_search($connect, $base_dn, $filter);

$info = ldap_get_entries($connect, $read);
echo $info[count]. entries returnedBRBR;
for($row = 0; $row$info[count]; $row++)
{
for($column = 0; $column$info[$row][count]; $column++)
{
$data = $info[$row][$column];
echo $data.:.$info[$row][$data][0].BR;
}
echo BR;
}
ldap_close($connect);
?


Re: [PHP] LDAP

2007-08-21 Thread Daniel Brown
On 8/21/07, Dan Shirah [EMAIL PROTECTED] wrote:
 Okay, hopefully someone can help me out here.  I've gone over ldap at
 php.net and multiple other sites but can't get it to work. Everytime I run
 the query my results are 0 entries returned.

 My AD tree is: CN=Users,DC=domain,DC=us.  I have the AD Server set so that
 anonymous access to retrieve information is enabled.

 Below is my code.  Any ideas?


 ?php
 $ldap_host = AD Server;
 $ldap_port = 389;
 $base_dn = DC=domain,DC=us;
 $filter = (CN=users);
 $connect = ldap_connect( $ldap_host, $ldap_port);
 ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3);

 $bind = ldap_bind($connect);
 $read = ldap_search($connect, $base_dn, $filter);

 $info = ldap_get_entries($connect, $read);
 echo $info[count]. entries returnedBRBR;
 for($row = 0; $row$info[count]; $row++)
 {
 for($column = 0; $column$info[$row][count]; $column++)
 {
 $data = $info[$row][$column];
 echo $data.:.$info[$row][$data][0].BR;
 }
 echo BR;
 }
 ldap_close($connect);
 ?


This may be kind of a dumb question  but did you check your
firewall settings?

-- 
Daniel P. Brown
[office] (570-) 587-7080 Ext. 272
[mobile] (570-) 766-8107

Hey, PHP-General list
50% off for life on web hosting plans $10/mo. or more at
http://www.pilotpig.net/.
Use the coupon code phpgeneralaug07
Register domains for about $0.01 more than what it costs me at
http://domains.pilotpig.net/.

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



Re: [PHP] keeping fields moving forward

2007-08-21 Thread Jim Lucas

Mike Ryan wrote:

yes I get information from form one transfers to form two ok but then does
not show up on form 3. form 1 and 2 do not then save to the database after
the last page of form 3.


That wasn't my question.

Again, when you submit form 1, do you do any processing of the data that came in from form 1 and 
then place that data inside form 2, and then when form 2 is submitted do you process the data in any 
way before inserting it into form 3?


I understand what you are doing with form 3, but I am wondering about form 1 
and form 2.

Do you process any of the data from form 1  2 before submitting all the data 
with form 3?

--
Jim Lucas

   Some men are born to greatness, some achieve greatness,
   and some have greatness thrust upon them.

Twelfth Night, Act II, Scene V
by William Shakespeare

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



Re: [PHP] LDAP

2007-08-21 Thread Dan Shirah
Nothing is being blocked since both servers are inside the DMZ.

On 8/21/07, Daniel Brown [EMAIL PROTECTED] wrote:

 On 8/21/07, Dan Shirah [EMAIL PROTECTED] wrote:
  Okay, hopefully someone can help me out here.  I've gone over ldap at
  php.net and multiple other sites but can't get it to work. Everytime I
 run
  the query my results are 0 entries returned.
 
  My AD tree is: CN=Users,DC=domain,DC=us.  I have the AD Server set so
 that
  anonymous access to retrieve information is enabled.
 
  Below is my code.  Any ideas?
 
 
  ?php
  $ldap_host = AD Server;
  $ldap_port = 389;
  $base_dn = DC=domain,DC=us;
  $filter = (CN=users);
  $connect = ldap_connect( $ldap_host, $ldap_port);
  ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3);
 
  $bind = ldap_bind($connect);
  $read = ldap_search($connect, $base_dn, $filter);
 
  $info = ldap_get_entries($connect, $read);
  echo $info[count]. entries returnedBRBR;
  for($row = 0; $row$info[count]; $row++)
  {
  for($column = 0; $column$info[$row][count]; $column++)
  {
  $data = $info[$row][$column];
  echo $data.:.$info[$row][$data][0].BR;
  }
  echo BR;
  }
  ldap_close($connect);
  ?
 

This may be kind of a dumb question  but did you check your
 firewall settings?

 --
 Daniel P. Brown
 [office] (570-) 587-7080 Ext. 272
 [mobile] (570-) 766-8107

 Hey, PHP-General list
 50% off for life on web hosting plans $10/mo. or more at
 http://www.pilotpig.net/.
 Use the coupon code phpgeneralaug07
 Register domains for about $0.01 more than what it costs me at
 http://domains.pilotpig.net/.



Re: [PHP] php 4.4.7 make install with pear causes zend freeing errors

2007-08-21 Thread John Mendenhall
 The compiler complaining about free'ing memory is something they 
 should pay attention to as far as I'm concerned. *shrug*
 
 Clearly I should've read the thread better, somehow I missed that 
 entirely -.-
 sorry bout that :)
 
 anyway, first thing to do before posting is cutting down on your config 
 options to the bare minimum to see if it's due to the core engine or 
 some kind of extension, I'm sure they would appreciate it.

I was assisted by Johannes Schl?ter.
He told me the -enable-debug configure
option was causing these error messages
to be displayed.

I removed that option and the error
messages were no longer displayed.

I am working towards getting all of
our customers off of php4 now.

Thanks for your assistance and pointers.

JohnM

-- 
john mendenhall
[EMAIL PROTECTED]
surf utopia
internet services

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



[PHP] php to generate java-script

2007-08-21 Thread Jas
Anyone have a good method of grabbing the current page and reading data
from it?

For example:
?PHP
 // find all form fields for current page
 function FindFormFields( $page ) {
  if( empty( $page ) ) {
   $data = -1;
  } else {
   if( ( $fh = @fopen( $page, r ) ) === FALSE ) {
$data = -1;
   } else {
while( !feof( $fh ) ) {
 $line = fgets( $fh, 512 );
 if( eregi( input type=\, $line ) ) {
  $data[] = $line;
 }
}
fclose( $fh );
   }
  }
  return $data;
 }

 echo FindFormFields( http://php.net; );
?

The above code would output the following:
Array
(
[0] =input type=text name=pattern value= size=30
accesskey=s /

[1] =input type=image

)

Now for the problem I am having and a description of what I am trying to
accomplish:

I want to dynamically generate a form and in doing so I would like to
dynamically generate the following javascript features for said page
  - javascript form validation
  - javascript form field focus

The problem is if I call the current page that is being generated such as
?PHP
echo FindFormFields( http://; . $_SERVER['SERVER_NAME'] .
$_SERVER['REQUEST_URI'] );
?

Not only does it take a helluva long time to load the page but it also
creates a nested array with duplicate values.

My best guess is that the order in which the page is being generated has
something to do with the lag as well as the nested array with duplicate
values.

Could anyone help me or point me in a better direction for performing
these actions?

Thanks in advance,
Jas

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



[PHP] LDAP ***RESOLVED***

2007-08-21 Thread Dan Shirah
Apparently even though our Domain Administrator said anonymous access is
enabled for the server, it still did not like me trying to query AD
anonymously.  I created a username/password with limited priviledges to AD
and now it works like a charm.

Below you will find my finished code:

?php
 $base_dn=CN=users,DC=domain,DC=us;
 $ldap_host=AD server;
 $ldap_port=389;
 $ldap_user=CN=username, CN=Users, DC=domain, DC=us;
 $ldap_pass=password;
 $filter=((objectclass=user)(Description=My Organization)(cn=*));
$connect = ldap_connect( $ldap_host, $ldap_port)
 or exit(Could not connect to LDAP server);
ldap_set_option($connect, LDAP_OPT_PROTOCOL_VERSION, 3);
ldap_set_option($connect, LDAP_OPT_REFERRALS, 0);
$bind = ldap_bind($connect, $ldap_user, $ldap_pass)
  or exit(Could not bind to $ldap_host);
$read = ldap_search($connect, $base_dn, $filter)
  or exit(Unable to search ldap server);
$info = ldap_get_entries($connect, $read);
echo $info[count]. entries returnedp;
$ii=0;
for ($i=0; $ii$info[$i][count]; $ii++){
$data = $info[$i][$ii];
echo $data.:nbsp;nbsp;.$info[$i][$data][0].br;
}
ldap_close($connect);
?


Re: [PHP] keeping fields moving forward

2007-08-21 Thread brian

Mike Ryan wrote:

I am creating a series of forms that collect information this covers 3
screens before I want to write it out to the database.  when I go from one
screen to the next I have tried hidden and readonly input boxes but the data
in the hidden and readonly fields from screen one do not make it to the
final page.

Is there a way to get the data from page one without letting the users
modify the information.  I guess I could write the data to the database but
how do I find the record number of the data I just wrote so that I can
update the information, will php tell me the record number? I am using php
5.2.1 and mysql 5.x



I'd write a class to handle the submissions; I pretty much always do 
this with forms. Instantiate the object on the first submit, populate 
with whatever from form 1, do your validation, store the object in the 
session and display form 2. Repeat.


You could give the class methods to handle setting each field and 
validation methods for each form. When all is done, call persist() and 
you're done.


Just remember to include() your class file before calling session_start().

As an aside, whenever i'm displaying a form i instantiate the class 
first. This way, my form markup can have, eg:


input type=text name=foo value=?= my_class-getFoo() ? /

so that on the first pass the empty object returns NULL. When i want to 
re-display the form (because there was an error somewhere) the 
already-populated vars are written back to the form.


brian

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



Re: [PHP] php to generate java-script

2007-08-21 Thread brian

Jas wrote:

Anyone have a good method of grabbing the current page and reading data
from it?

For example:
?PHP
 // find all form fields for current page
 function FindFormFields( $page ) {
  if( empty( $page ) ) {
   $data = -1;
  } else {
   if( ( $fh = @fopen( $page, r ) ) === FALSE ) {
$data = -1;
   } else {
while( !feof( $fh ) ) {
 $line = fgets( $fh, 512 );
 if( eregi( input type=\, $line ) ) {
  $data[] = $line;
 }
}
fclose( $fh );
   }
  }
  return $data;
 }

 echo FindFormFields( http://php.net; );
?

The above code would output the following:
Array
(
[0] =input type=text name=pattern value= size=30
accesskey=s /

[1] =input type=image

)

Now for the problem I am having and a description of what I am trying to
accomplish:

I want to dynamically generate a form and in doing so I would like to
dynamically generate the following javascript features for said page
  - javascript form validation
  - javascript form field focus

The problem is if I call the current page that is being generated such as
?PHP
echo FindFormFields( http://; . $_SERVER['SERVER_NAME'] .
$_SERVER['REQUEST_URI'] );
?

Not only does it take a helluva long time to load the page but it also
creates a nested array with duplicate values.



I'm not surprised it's taking a while to load in your browser. I think 
you have a serious nested loop issue there. What you're doing is telling 
the PHP engine to load the same page again. When it does that it's going 
to call your function *again* on the same page. Rinse and repeat.


But i don't understand what putting those tags in an array is going to 
accomplish. Perhaps there's a lot more to this, but i'd be inclined to 
set up my validation in a more targetted manner.


brian

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



[PHP] php/mysql - getting ID of query

2007-08-21 Thread John Pillion
This is as much a mysql question as it is php.

 

What is the most reliable way to retrieve an auto_increment key/id for a
query you just inserted?

 

In other words, I compile all my data, insert it into a new row, and now I
want to retrieve the ID it created for it in the ID/key field.  Without
turning around and searching for the values I just inserted, is there a way
to get the ID?  The ID is the only field that is guaranteed to be unique in
each data set, which makes it questionable to search for the data you just
inserted, unless you searched for the *whole* data set.

 

Thanks

 

John



Re: [PHP] php/mysql - getting ID of query

2007-08-21 Thread mike
mysql_insert_id()
mysqli_insert_id()

http://us.php.net/mysql is your friend :)
http://us.php.net/mysqli too!



On 8/21/07, John Pillion [EMAIL PROTECTED] wrote:
 This is as much a mysql question as it is php.



 What is the most reliable way to retrieve an auto_increment key/id for a
 query you just inserted?



 In other words, I compile all my data, insert it into a new row, and now I
 want to retrieve the ID it created for it in the ID/key field.  Without
 turning around and searching for the values I just inserted, is there a way
 to get the ID?  The ID is the only field that is guaranteed to be unique in
 each data set, which makes it questionable to search for the data you just
 inserted, unless you searched for the *whole* data set.



 Thanks



 John



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



[PHP] Re: php/mysql - getting ID of query

2007-08-21 Thread M. Sokolewicz

John Pillion wrote:

This is as much a mysql question as it is php.

 


What is the most reliable way to retrieve an auto_increment key/id for a
query you just inserted?

 


In other words, I compile all my data, insert it into a new row, and now I
want to retrieve the ID it created for it in the ID/key field.  Without
turning around and searching for the values I just inserted, is there a way
to get the ID?  The ID is the only field that is guaranteed to be unique in
each data set, which makes it questionable to search for the data you just
inserted, unless you searched for the *whole* data set.

 


Thanks

 


John




mysql_insert_id()
mysqli::insert_id
PDO::lastInsertId()

depending on the way you access it.

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



[PHP] Re: keeping fields moving forward

2007-08-21 Thread Mike Ryan
I think I have it fixed  I had some code wrong in my input hidden variable
this worked and did the job for me

I am an old time type of programmer who is not very good with the object
oriented programming and have not taken the time to learn some new tricks.
one day I will.



Mike Ryan [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 I am creating a series of forms that collect information this covers 3
 screens before I want to write it out to the database.  when I go from one
 screen to the next I have tried hidden and readonly input boxes but the
data
 in the hidden and readonly fields from screen one do not make it to the
 final page.

 Is there a way to get the data from page one without letting the users
 modify the information.  I guess I could write the data to the database
but
 how do I find the record number of the data I just wrote so that I can
 update the information, will php tell me the record number? I am using php
 5.2.1 and mysql 5.x

 thanks for your help.


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



[PHP] RE: php/mysql - getting ID of query

2007-08-21 Thread John Pillion
Thanks guys, that's exactly what I was looking for

J

-Original Message-
From: M. Sokolewicz [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 21, 2007 4:51 PM
To: John Pillion
Cc: php-general@lists.php.net
Subject: Re: php/mysql - getting ID of query

John Pillion wrote:
 This is as much a mysql question as it is php.
 
  
 
 What is the most reliable way to retrieve an auto_increment key/id for a
 query you just inserted?
 
  
 
 In other words, I compile all my data, insert it into a new row, and now I
 want to retrieve the ID it created for it in the ID/key field.  Without
 turning around and searching for the values I just inserted, is there a
way
 to get the ID?  The ID is the only field that is guaranteed to be unique
in
 each data set, which makes it questionable to search for the data you just
 inserted, unless you searched for the *whole* data set.
 
  
 
 Thanks
 
  
 
 John
 
 

mysql_insert_id()
mysqli::insert_id
PDO::lastInsertId()

depending on the way you access it.

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



[PHP] Programmer in the US?

2007-08-21 Thread Jan Reiter
Hi there!

I spent the last 4 Years ('03-'07) as an Officer with the German Air Force
collecting massive experience with large university networks (programming,
maintenance) and on electronic warfare live training exercises (management,
IT Officer), but I studied Space and Aeronautics and did not finish. I have
programming experience in C/C++ since '99 and PHP/html/jscript since '01. I
do not have a diploma or degree or anything. Only a military record that
tells what I did, and that I did it good! ;-)

Sine I see from some of your signatures that some of you are working at US
based companies, do you have any tips or experiences how to start off as a
programmer or technical manager with such a bad starting position? 

Getting a greencard once I got a job shouldn't be a problem since I'm
cleared up to NATO-Secret. (if that helps)

Thank you very much for any help, tips, experiences ... 

Best Regards,
 Jan

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



Re: [PHP] php to generate java-script

2007-08-21 Thread Nathan Nobbe
i agree with brian.
i still need to enhance my skills w/ javascirpt, but i think in the case of
validation, a simple
solution is to write generic validation components in javascript.  then
simply dynamically
include the ones you need for a particular form.
as far as the javascript knowing how to locate the form fields i think its a
matter of defining
a naming convention w/in your system.

-nathan

On 8/21/07, brian [EMAIL PROTECTED] wrote:

 Jas wrote:
  Anyone have a good method of grabbing the current page and reading data
  from it?
 
  For example:
  ?PHP
   // find all form fields for current page
   function FindFormFields( $page ) {
if( empty( $page ) ) {
 $data = -1;
} else {
 if( ( $fh = @fopen( $page, r ) ) === FALSE ) {
  $data = -1;
 } else {
  while( !feof( $fh ) ) {
   $line = fgets( $fh, 512 );
   if( eregi( input type=\, $line ) ) {
$data[] = $line;
   }
  }
  fclose( $fh );
 }
}
return $data;
   }
 
   echo FindFormFields( http://php.net; );
  ?
 
  The above code would output the following:
  Array
  (
  [0] =input type=text name=pattern value= size=30
  accesskey=s /
 
  [1] =input type=image
 
  )
 
  Now for the problem I am having and a description of what I am trying to
  accomplish:
 
  I want to dynamically generate a form and in doing so I would like to
  dynamically generate the following javascript features for said page
- javascript form validation
- javascript form field focus
 
  The problem is if I call the current page that is being generated such
 as
  ?PHP
  echo FindFormFields( http://; . $_SERVER['SERVER_NAME'] .
  $_SERVER['REQUEST_URI'] );
  ?
 
  Not only does it take a helluva long time to load the page but it also
  creates a nested array with duplicate values.
 

 I'm not surprised it's taking a while to load in your browser. I think
 you have a serious nested loop issue there. What you're doing is telling
 the PHP engine to load the same page again. When it does that it's going
 to call your function *again* on the same page. Rinse and repeat.

 But i don't understand what putting those tags in an array is going to
 accomplish. Perhaps there's a lot more to this, but i'd be inclined to
 set up my validation in a more targetted manner.

 brian

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




Re: [PHP] Re: About Session And Cookies

2007-08-21 Thread Kelvin Park
Hello, thanks for all the replies.
However, since I'm not very familiar with trans_sid I'll do some research on
that.

Michelle Konzack, if hiding the id in hidden form field element or enabling
trans_sid could lead to security risks, what would you recommend as an
alternative method to safely transfer user information across different
pages in a website?

Thank you.

On 8/18/07, Michelle Konzack [EMAIL PROTECTED] wrote:

 Am 2007-08-17 22:07:47, schrieb Bastien Koert:
 
  If cookies are not available, you can either
 
  hide the id in the hidden form field element
  or
  enable trans_sid to automatically pass the session id in the url

 This will be a security risk since Session-Hijacker can grap the URL

 Greetings
 Michelle Konzack
 Systemadministrator
 Tamay Dogan Network
 Debian GNU/Linux Consultant


 --
 Linux-User #280138 with the Linux Counter, http://counter.li.org/
 # Debian GNU/Linux Consultant #
 Michelle Konzack   Apt. 917  ICQ #328449886
50, rue de Soultz MSN LinuxMichi
 0033/6/6192519367100 Strasbourg/France   IRC #Debian (irc.icq.com)