Re: [PHP] pdo_informix

2005-12-29 Thread Aleksander

Thanks,

Don't know why I couln't find the install page myself. Got it working 
without any problems.


Alex

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



Re: [PHP] Location ....

2005-12-29 Thread Sameer N Ingole

Christian Ista wrote:


From: Jay Blanchard [mailto:[EMAIL PROTECTED]
Header is a good solution, and is the only one available in PHP for
redirects. It requires that you do not send anything else out to the
browsers before sending the redirect, which is what is causing your error.
You can always use the output buffer functions to assist with that.
   



Ok but there is something more strange.

I use header location in a switch/case. An header location by case. I
don't understand at the end of the case, the header location don't work and
I go through the others cases.
 

I would do a simple thing, use exit() after header. Though this 
should not happen..


Regards,

--
Sameer N. Ingole
/*/
Better to light one candle than to curse the darkness.
/*/

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



Re: [PHP] Variables and Strings

2005-12-29 Thread Jochem Maas

PHP Superman wrote:

Hey everyone, is there a way to return all the variables from a string into
an array, for example
$Var1=Yo;
$Var2=Man;
$SQL=SELECT * FROM tblname WHERE 4=$Var1 AND WHERE 3=$Var2;
$AllVars=MySpecialFunction($SQL);


your function MySpecialFunction() will recieve the following string:

SELECT * FROM tblname WHERE 4=Yo AND WHERE 3=Man

which apart from being (probably) incorrect SQL, is just a string -
how is your special function supposed to tell which chars are part of
the previously injected variables' values - and even more impossible:
how would the function find out what those variables we're called to
begin with (it can't).

what is it you would like to achieve?

rgds,
jochem

PS - learn to walk before you fly ;-)


print_r($AllVars);

would ideally print an array like:
{
array
$Var1=Yo
$Var2=Man

}
i think i should use an ereg or preg replace but I don't know much about
them or how to use them, thanks in advance



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



Re: [PHP] Earlier versions hurt PHP 5

2005-12-29 Thread Silvio Porcellana [tradeOver]
Anas Mughal wrote:
 Here is a PHP5 hosting company:
 http://www.a2hosting.com/
 

Aaargh! I wouldn't suggest that one, I've had a really really bad
experience with them (they shut down my site *w/o any notice* because
they said I was using too much of their resources - while this was not
true).

I am now using hub.org (http://www.hub.org) and I find they have a
really good service (and PHP5)

-- 
tradeOver | http://www.tradeover.net
...ready to become the King of the World?

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



Re: [PHP] XML Reader

2005-12-29 Thread Silvio Porcellana [tradeOver]
[EMAIL PROTECTED] wrote:
 Is there any easy php script to run to view an xml file such as new
 headlines like so:  http://news.google.com/?output=rss or can anyone point
 me in the right direction for good online tutorials or books.
 

You can start here:
http://magpierss.sourceforge.net/

Magpie RSS is a good RSS parser for PHP.

HTH, cheers
Silvio

-- 
tradeOver | http://www.tradeover.net
...ready to become the King of the World?

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



[PHP] how to call perl code from PHP

2005-12-29 Thread dev lamp
Hi

I am unable to call perl code from PHP, since the extension does not
get loaded !

Scenario 1:
use dl('perl.so'); in the php code and invoke the script from the command line
The script works fine and the perl code gets executed as well.

Scenario 2:
the perl extension does not get loaded and the PHP script crashes.

I have read the article
http://www.zend.com/php5/articles/php5-perl.php

If anybody has faced this issue, please share how you solved the problem ?

Thanks in advance.

Here are the environment Details:
RHEL 4.0
PHP 5.0.5 (self compiled)
PECL/PERL package checked out from CVS

PHP 5.0.5 compilation details
---
./configure  --with-apxs2=/usr/local/apache2/bin/apxs 
--with-mysql=/usr/bin/mysql_config 
--with-mysqli=/usr/bin/mysql_config --with-openssl-dir=/usr/local/ssl
--with-libxml-dir=/usr/lib --enable-soap --enable-sockets
--enable-sqlite-utf8  --enable-wddx --with-gnu-ld  --with-gd
--with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib
--with-zlib-dir=/usr/local/lib --with-gd=/usr/local 
--enable-gd-native-ttf --enable-maintainer-zts  --with-pear
make
make install


pecl/perl package compilation details
-
export PHP_PREFIX=/usr/local
export PERL_PREFIX=/usr
echo $PHP_PREFIX
echo $PERL_PREFIX
$PHP_PREFIX/bin/phpize
./configure --with-perl=$PERL_PREFIX
--with-php-config=$PHP_PREFIX/bin/php-config
make
make install

entries in php.ini file
--

extension_dir = /usr/local/lib/php/extensions/no-debug-zts-20041030/
extension=perl.so


sample test code is as follows -
?php
if (!extension_loaded('perl'))
{
print perl extension not loaded;
exit;
}
?

--
Dev.

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



[PHP] what is the problem with this query?

2005-12-29 Thread sunaram patir
hi there,
could you please tell me what is the problem with this query
mysql_query(SELECT * FROM mailbox WHERE read='');

  i always get this warning:
  Warning: mysql_num_rows(): supplied argument is not a valid MySQL
result resource in index.php on line 24

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



RE: [PHP] what is the problem with this query?

2005-12-29 Thread Jay Blanchard
[snip]
could you please tell me what is the problem with this query
mysql_query(SELECT * FROM mailbox WHERE read='');

  i always get this warning:
  Warning: mysql_num_rows(): supplied argument is not a valid MySQL
result resource in index.php on line 24
[/snip]

THere is no apparent problem with the query, but there is a problem with
mysql_num_rows(). Can you show us he code there?

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



[PHP] XML-RPC problem with long running times

2005-12-29 Thread Andreas Schlicker

Hi all,

I'm using Apache/1.3.33 (Unix), PHP/5.0.3, mod_ssl/2.8.22, OpenSSL/0.9.6a.

I wrote a dummy script that is called by a Java program via XML-RPC, 
waits for some time and replies the start and end times.


?php
set_time_limit(500);
$xmlServer = xmlrpc_server_create();

function process() {
$result = ini_get('max_execution_time') . \n;
$result = $result . date(H:i:s) . \n;
sleep(0);
$result = $result . date(H:i:s) . \n;
return $result;
}

xmlrpc_server_register_method($xmlServer, 'process', 'process');
$xmlRequest = $HTTP_RAW_POST_DATA;
$xmlResponse = xmlrpc_server_call_method($xmlServer, $xmlRequest, NULL);

#$log = fopen($filename, 'a');
#fwrite($log, $xmlResponse);
#fflusch($log);
#fclose($log);

echo $xmlResponse;
xmlrpc_server_destroy($xmlServer);
?

If the script sleeps for up to 5 minutes, it works perfectly fine. 
However, I my real application will run probably an hour or so. If the 
script takes more than 5 minutes to execute, the client receives an 
empty response, even the header is missing. If I try to write the 
$xmlResponse to a file, the client receives a null message.


I wrote a small script without XMLRPC that acted the same way when 
called by a browser. This worked perfectly (I tested it up to 20 minutes 
waiting time) even if I used set_time_limit(5) and sleep(500).


Does anybody have an idea how to solve this problem? Thanks in advance.

Andreas

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



Re: [PHP] Re: mysqli module in php 4

2005-12-29 Thread John Nichel

Curt Zirzow wrote:

On Wed, Dec 28, 2005 at 11:58:02AM -0500, John Nichel wrote:


M. Sokolewicz wrote:


John Nichel wrote:



M. Sokolewicz wrote:



Bagus Nugroho wrote:



Hi All,

Is mysqli module enable by default on php 4 as mysql module.




no


If not enable by default, where I can get this module(hopefully  a 
direct link to download)




you can't, it *requires* PHP 5




I've been running mysqli on 4.3.x and 4.4



according to CVS it has a dependency on PHP 5



Undocumented 'feature'.  ;)



Please do tell how you even got it working..

% cd php44/ext/mysqli
php44/ext/mysqli: No such file or directory.
% cd pecl/mysqli
pecl/mysqli: No such file or directory.

The only thing I can think that perhaps might be done is:

% cd php5x/ext/mysqli
% phpize  #php4 version of phpize
% ./configure --with-mysqli=/usr/local/mysql/
% make


Yes, you have to grab the source from php5.  You'll have to point it to 
the mysql config program that comes with MySQL = 4.1  Also, to get both 
mysql and mysqli working, I had to configure mysqli as shared 
(--with-mysqli=shared,/usr/local/mysql/mysql_config)  We have not used 
this in production yet (and I'm sure it's not recommended/supported), 
but so far so good in our test enviroment.


--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] XML-RPC problem with long running times

2005-12-29 Thread Andreas Schlicker

Of course, fflusch($log); should be fflush($log);

I just found out that $xmlResponse really is empty.
However, connection_status() returns 0, so I assume that the script is 
not interrupted by a timeout.


Why does xmlrpc_server_call_method($xmlServer, $xmlRequest, NULL) return 
nothing if the call takes longer than 5 minutes and there is no 
interrupt? Is there some special XMLRPC timeout?


Any idea?

Andreas


Andreas Schlicker schrieb:

Hi all,

I'm using Apache/1.3.33 (Unix), PHP/5.0.3, mod_ssl/2.8.22, OpenSSL/0.9.6a.

I wrote a dummy script that is called by a Java program via XML-RPC, 
waits for some time and replies the start and end times.


?php
set_time_limit(500);
$xmlServer = xmlrpc_server_create();

function process() {
$result = ini_get('max_execution_time') . \n;
$result = $result . date(H:i:s) . \n;
sleep(0);
$result = $result . date(H:i:s) . \n;
return $result;
}

xmlrpc_server_register_method($xmlServer, 'process', 'process');
$xmlRequest = $HTTP_RAW_POST_DATA;
$xmlResponse = xmlrpc_server_call_method($xmlServer, $xmlRequest, NULL);

#$log = fopen($filename, 'a');
#fwrite($log, $xmlResponse);
#fflusch($log);
#fclose($log);

echo $xmlResponse;
xmlrpc_server_destroy($xmlServer);
?

If the script sleeps for up to 5 minutes, it works perfectly fine. 
However, I my real application will run probably an hour or so. If the 
script takes more than 5 minutes to execute, the client receives an 
empty response, even the header is missing. If I try to write the 
$xmlResponse to a file, the client receives a null message.


I wrote a small script without XMLRPC that acted the same way when 
called by a browser. This worked perfectly (I tested it up to 20 minutes 
waiting time) even if I used set_time_limit(5) and sleep(500).


Does anybody have an idea how to solve this problem? Thanks in advance.

Andreas



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



[PHP] unable to load perl extension

2005-12-29 Thread dev lamp
Hi

I am unable to call perl code from PHP, since the extension does not
get loaded !

Scenario 1:
use dl('perl.so'); in the php code and invoke the script from the command line
The script works fine and the perl code gets executed as well.

Scenario 2:
the perl extension does not get loaded and the PHP script crashes.

I have read the article
http://www.zend.com/php5/articles/php5-perl.php

If anybody has faced this issue, please share how you solved the problem ?

Thanks in advance.

Here are the environment Details:
RHEL 4.0
PHP 5.0.5 (self compiled)
PECL/PERL package checked out from CVS

PHP 5.0.5 compilation details
---
./configure  --with-apxs2=/usr/local/apache2/bin/apxs
--with-mysql=/usr/bin/mysql_config
--with-mysqli=/usr/bin/mysql_config --with-openssl-dir=/usr/local/ssl
--with-libxml-dir=/usr/lib --enable-soap --enable-sockets
--enable-sqlite-utf8  --enable-wddx --with-gnu-ld  --with-gd
--with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib
--with-zlib-dir=/usr/local/lib --with-gd=/usr/local
--enable-gd-native-ttf --enable-maintainer-zts  --with-pear
make
make install


pecl/perl package compilation details
-
export PHP_PREFIX=/usr/local
export PERL_PREFIX=/usr
echo $PHP_PREFIX
echo $PERL_PREFIX
$PHP_PREFIX/bin/phpize
./configure --with-perl=$PERL_PREFIX
--with-php-config=$PHP_PREFIX/bin/php-config
make
make install

entries in php.ini file
--

extension_dir = /usr/local/lib/php/extensions/no-debug-zts-20041030/
extension=perl.so


sample test code is as follows -
?php
if (!extension_loaded('perl'))
{
   print perl extension not loaded;
   exit;
}
?

--
Dev.

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



Re: [PHP] unable to load perl extension

2005-12-29 Thread Jochem Maas

dev lamp wrote:

Hi

I am unable to call perl code from PHP, since the extension does not
get loaded !

Scenario 1:
use dl('perl.so'); in the php code and invoke the script from the command line
The script works fine and the perl code gets executed as well.


so the extension is not being loaded automatically right?
but if you dl() it everything is fine, right?
then double check the 'right' ini file is being used!



Scenario 2:
the perl extension does not get loaded and the PHP script crashes.

I have read the article
http://www.zend.com/php5/articles/php5-perl.php

If anybody has faced this issue, please share how you solved the problem ?

Thanks in advance.

Here are the environment Details:
RHEL 4.0
PHP 5.0.5 (self compiled)


personally I avoided this version of php like the plague - I would
suggest a diff. version just to rule out the possibility that 5.0.5
is the problem...


PECL/PERL package checked out from CVS

PHP 5.0.5 compilation details
---
./configure  --with-apxs2=/usr/local/apache2/bin/apxs
--with-mysql=/usr/bin/mysql_config
--with-mysqli=/usr/bin/mysql_config --with-openssl-dir=/usr/local/ssl
--with-libxml-dir=/usr/lib --enable-soap --enable-sockets
--enable-sqlite-utf8  --enable-wddx --with-gnu-ld  --with-gd
--with-jpeg-dir=/usr/local/lib --with-png-dir=/usr/local/lib
--with-zlib-dir=/usr/local/lib --with-gd=/usr/local
--enable-gd-native-ttf --enable-maintainer-zts  --with-pear



what is: --enable-maintainer-zts ?

have you tried stripping you configure line further to see if
that helps? i.e. remove everything apart from what you need to
run the specific code that relies on the perl extension. just to
see if removing something causes the perl extension to work


make
make install


pecl/perl package compilation details
-
export PHP_PREFIX=/usr/local
export PERL_PREFIX=/usr
echo $PHP_PREFIX
echo $PERL_PREFIX
$PHP_PREFIX/bin/phpize
./configure --with-perl=$PERL_PREFIX
--with-php-config=$PHP_PREFIX/bin/php-config
make
make install

entries in php.ini file
--


is the apache module using the php.ini that you think it is ?? -
that kind of thing has caught me out more than once!



extension_dir = /usr/local/lib/php/extensions/no-debug-zts-20041030/
extension=perl.so


sample test code is as follows -
?php
if (!extension_loaded('perl'))
{
   print perl extension not loaded;
   exit;
}
?

--
Dev.



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



[PHP] interfaces - your opinion

2005-12-29 Thread Jochem Maas

anyone here work with Interfaces? I do and I like them alot;

I recently ran into a situation where it would be nice to be able to specify
that a given interface is only allowed to be implemented by a certain
class (and all subclasses thereof) - Anyone have an idea as to how
to implement such a restraint in a clean way? does anyone think that this
is generally useful?

maybe it's something that should not be done at all.
maybe the implementation belongs in the engine (with some new syntax) e.g:

class MyClass {}
class MySubClass extends MyClass {}
class MyOtherClass {}
class SomebodyElsesClass {}

interface MyIface validfor MyClass, MyOtherClass
{
abstract function blabla();
}

// SomebodyElsesClass would not be able to implement MyIface


interested to know if anyone has an opinion on this.

rgds,
Jochem

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



Re: [PHP] php / mysql / js search result question

2005-12-29 Thread Greg Schnippel
Hi -

It sounds like you're trying to implement something similar to google
suggest which uses ajax to allow a user to navigate through a large
list of entries. The google suggest method does use a lot of calls
to the database but its asynchronous which eliminates cumbersome page
loads.

http://www.google.com/webhp?complete=1hl=en

I found this article which gives advice on how to implement google
suggest using php:

http://www.phpriot.com/d/articles/php/application-design/google-suggest-ajaxac/

A quick google search on +php +google suggest +ajax came up with
others as well.

If you're just interested in the javascript (i.e. you're not
navigating that large of a list) these articles should be able to help
with that as well.

- schnippy

On 12/27/05, Dave Carrera [EMAIL PROTECTED] wrote:
 Hi List,

 I have a very long list of customer names which i know is easy to get
 from a mysql result using php, no prob there.

 But what i would like to do is offer input box and when the user enters
 a letter, i think this will require client side onchange(), the full
 list, i think might be in an iframe, will move to the first instance of
 user input.

 Example:

 1 Alpha Customer
 2 Apple Customer
 3 Beta Customer
 4 Crazy customer
 5 Doppy customer

 User input is a so the list moves to first instance of a.  User
 continues to input ap so the list moves to 2 Apple Customer and so on.

 If the user had input d then the list would move to 5 Doppy customer
 and i suppose this could  become selected ready for the user to hit the
 return key to select this customer.

 I would prefer to not do multiple POSTS and return result, which i can
 do already, so i think some natty client side JS might do the trick but
 i have very little knowledge of this.

 Any urls or direct help / advise is gratefully received.

 Thank you in advance

 Dave c

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



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



Re: [PHP] unable to load perl extension

2005-12-29 Thread dev lamp
On 12/29/05, Jochem Maas [EMAIL PROTECTED] wrote:
 dev lamp wrote:
  Hi
 
  I am unable to call perl code from PHP, since the extension does not
  get loaded !
 
  Scenario 1:
  use dl('perl.so'); in the php code and invoke the script from the command 
  line
  The script works fine and the perl code gets executed as well.

 so the extension is not being loaded automatically right?
 but if you dl() it everything is fine, right?
 then double check the 'right' ini file is being used!


There is only one php.ini
I have checked the extensions path information using phpinfo().

Is there something else that I need to checkout ?

 

 is the apache module using the php.ini that you think it is ?? -
 that kind of thing has caught me out more than once!

 

How do I check that ?
I downloaded apache sources and compiled it.
Why do I need to specify the path of the php.ini file to the apache web server ?


Dev.

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



Re: [PHP] mysqli class not found

2005-12-29 Thread Erik Saline

Thanks I deleted the new.
I was following an example in the  book for that.

Now I get the error:

Call to undefined function mysqli_connect() in 
/var/www/cgi-bin/db_connect.php on line 4,


I added extenstion=mysqli.so to my php.ini

Erik

- Original Message - 
From: PHP Superman [EMAIL PROTECTED]

To: Erik Saline [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Wednesday, December 28, 2005 6:56 PM
Subject: Re: [PHP] mysqli class not found


you are not missing anything, you are actually adding to much. Using new
is for making objects, if you take away the new in the $result variable
declaration it should work fine.
On 12/28/05, Erik Saline [EMAIL PROTECTED] wrote:



- Original Message -
From: Erik Saline
To: php-general@lists.php.net
Sent: Wednesday, December 28, 2005 1:08 PM


I installed Apache, PHP, and Mysql during the Fedora Core 4 installation.

PHP 5.0.4
MYSQL 4.1.14

I used php -i to show that mysql and mysqli were installed.
Configure Command = './configure' '--build=i386-redhat-linux'
'--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config' '

Here is the code.

$result = new mysqli_connect('localhost', 'nobody', 'test', 'godisdead');

Here is the error.

PHP Fatal error: Class 'mysqli' not found in
/var/www/cgi-bin/db_connect.php on line 4,



What am I missing?



Erik





--
Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!

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



Re: [PHP] Earlier versions hurt PHP 5

2005-12-29 Thread Rory Browne
On 12/29/05, Rory Browne [EMAIL PROTECTED] wrote:
  Please don't make comments like removing older versions of PHP from the
  download page. We have delivered solutions to clients that run on PHP4.
  Those clients need the ability to conveniently download PHP4 in order to run
  our code.

 Why can't you make  your code PHP5 compatable? It seems to be to be a
 fairly small price to make your code future proof, which will have to
 be done eventually anyway.

 Personally I think that anyone who still writes new code that is
 incompatable with php5 should be shot, - in the leg before being
 buried alive.

  Happy New Year!!!


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



[PHP] PHPMailer inserting unwanted spaces

2005-12-29 Thread René Fournier
Has anyone encountered this? I am composing an HTML email with  
PHPMailer, and for some reason PHPMailer is inserted spaces  
periodically, which breaks the formatting. I've looked through the  
docs, but can only find a setting for Word Wrap (which is set to 0).


...Rene

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



Re: [PHP] mysqli class not found

2005-12-29 Thread PHP Superman
What OS are you using? I think that you entered the wrong filename. for
windows i use php_mysqli.dll . Somewhere in php.ini there is a list of
extensions you can use, uncomment the php_mysqli.dll , copy php_mysqli.dll
to the php install directory and change the php.ini extension setting to
your php install directory, that should fix the problem .
On 12/29/05, Erik Saline [EMAIL PROTECTED] wrote:

 Thanks I deleted the new.
 I was following an example in the  book for that.

 Now I get the error:

 Call to undefined function mysqli_connect() in
 /var/www/cgi-bin/db_connect.php on line 4,

 I added extenstion=mysqli.so to my php.ini

 Erik

 - Original Message -
 From: PHP Superman [EMAIL PROTECTED]
 To: Erik Saline [EMAIL PROTECTED]
 Cc: php-general@lists.php.net
 Sent: Wednesday, December 28, 2005 6:56 PM
 Subject: Re: [PHP] mysqli class not found


 you are not missing anything, you are actually adding to much. Using new
 is for making objects, if you take away the new in the $result variable
 declaration it should work fine.
 On 12/28/05, Erik Saline [EMAIL PROTECTED] wrote:
 
 
  - Original Message -
  From: Erik Saline
  To: php-general@lists.php.net
  Sent: Wednesday, December 28, 2005 1:08 PM
 
 
  I installed Apache, PHP, and Mysql during the Fedora Core 4
 installation.
 
  PHP 5.0.4
  MYSQL 4.1.14
 
  I used php -i to show that mysql and mysqli were installed.
  Configure Command = './configure' '--build=i386-redhat-linux'
  '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config'
 '
 
  Here is the code.
 
  $result = new mysqli_connect('localhost', 'nobody', 'test',
 'godisdead');
 
  Here is the error.
 
  PHP Fatal error: Class 'mysqli' not found in
  /var/www/cgi-bin/db_connect.php on line 4,
 
 
 
  What am I missing?
 
 
 
  Erik
 
 


 --
 Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!




--
Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!


Re: [PHP] mysqli class not found

2005-12-29 Thread John Nichel

PHP Superman wrote:*

What OS are you using? I think that you entered the wrong filename. for
windows i use php_mysqli.dll . Somewhere in php.ini there is a list of
extensions you can use, uncomment the php_mysqli.dll , copy php_mysqli.dll
to the php install directory and change the php.ini extension setting to
your php install directory, that should fix the problem .


Follow the thread.


I installed Apache, PHP, and Mysql during the Fedora Core 4


casting the first stone
*Example of why top-posting is bad
/casting the first stone

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



Re: [PHP] Variables and Strings

2005-12-29 Thread PHP Superman
Thanks for the responses guys, but what i'm saying is i would like to return
all the variable names i have in a string,
$String=Blah Blah Blah $VarName Blah Blah Blah;
$Vars=myspecialfunction($Varname);
echo ($Vars);

that code would produce $Varname, if there were more variables it would also
return the Variable Names in an array
On 12/29/05, Jochem Maas [EMAIL PROTECTED] wrote:

 PHP Superman wrote:
  Hey everyone, is there a way to return all the variables from a string
 into
  an array, for example
  $Var1=Yo;
  $Var2=Man;
  $SQL=SELECT * FROM tblname WHERE 4=$Var1 AND WHERE 3=$Var2;
  $AllVars=MySpecialFunction($SQL);

 your function MySpecialFunction() will recieve the following string:

 SELECT * FROM tblname WHERE 4=Yo AND WHERE 3=Man

 which apart from being (probably) incorrect SQL, is just a string -
 how is your special function supposed to tell which chars are part of
 the previously injected variables' values - and even more impossible:
 how would the function find out what those variables we're called to
 begin with (it can't).

 what is it you would like to achieve?

 rgds,
 jochem

 PS - learn to walk before you fly ;-)

  print_r($AllVars);
 
  would ideally print an array like:
  {
  array
  $Var1=Yo
  $Var2=Man
 
  }
  i think i should use an ereg or preg replace but I don't know much about
  them or how to use them, thanks in advance
 




--
Hi Everyone, I am running PHP 5 on Windosws XP SP2 with MySQL5, Bye Now!


[PHP] php / JS / DOM question

2005-12-29 Thread jonathan
I know that this is more of a Javascript / DOM question but I cannot  
for the life of me figure this out:


I have this form:

form name=query_form
input type=text name=q/input
input type=button onclick=drawImg('A',document.forms 
['query_form'].elements['q']); value=Search/input

/form

When the user clicks on the button, I want the text that is in input  
elment 'q' to be sent to the Javascript function drawImg but when I  
debug it via alerts, it appears to be NULL. Looking at the examples  
online, I feel like this should work. Does anybody know why this  
might not be working correctly?


-jonathan

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



Re: [PHP] mysqli class not found

2005-12-29 Thread John Nichel

PHP Superman wrote:
Hold on, I heard that you can't run the mysql and mysqli php 
extensions , try removing  the mysql extension if my other advice 
doesen't work

snip

Please reply to the list.

You can compile php with both.

From the manual :
http://us2.php.net/mysqli


If you would like to install the mysql extension along with the mysqli 
extension you have to use the same client library to avoid any conflicts.


--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

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



RE: [PHP] php / JS / DOM question

2005-12-29 Thread Dan Uyemura
Try:
input type=text name=q id=q/input
input type=button
onclick=drawImg('A',document.getElementById('q').value);
value=Search/input

I didn't test this, but I think it'll work...

-Original Message-
From: jonathan [mailto:[EMAIL PROTECTED] 
Sent: Thursday, December 29, 2005 1:45 PM
To: php-general@lists.php.net
Subject: [PHP] php / JS / DOM question

I know that this is more of a Javascript / DOM question but I cannot  
for the life of me figure this out:

I have this form:

form name=query_form
input type=text name=q/input
input type=button onclick=drawImg('A',document.forms 
['query_form'].elements['q']); value=Search/input
/form

When the user clicks on the button, I want the text that is in input  
elment 'q' to be sent to the Javascript function drawImg but when I  
debug it via alerts, it appears to be NULL. Looking at the examples  
online, I feel like this should work. Does anybody know why this  
might not be working correctly?

-jonathan

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

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



[PHP] Re: php / JS / DOM question

2005-12-29 Thread Al

jonathan wrote:
I know that this is more of a Javascript / DOM question but I cannot  
for the life of me figure this out:


I have this form:

form name=query_form
input type=text name=q/input
input type=button onclick=drawImg('A',document.forms 
['query_form'].elements['q']); value=Search/input

/form

When the user clicks on the button, I want the text that is in input  
elment 'q' to be sent to the Javascript function drawImg but when I  
debug it via alerts, it appears to be NULL. Looking at the examples  
online, I feel like this should work. Does anybody know why this  might 
not be working correctly?


-jonathan


You need to ask in the JAVASCRIPT newsgroup.  This is not a php question.

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



Re: [PHP] php / JS / DOM question

2005-12-29 Thread Kirk . Johnson
Add the value property: document.forms['query_form'].elements['q']
.value.

Kirk

jonathan [EMAIL PROTECTED] wrote on 12/29/2005 02:45:23 PM:

 form name=query_form
 input type=text name=q/input
 input type=button onclick=drawImg('A',document.forms 
 ['query_form'].elements['q']); value=Search/input
 /form
 
 When the user clicks on the button, I want the text that is in input 
 elment 'q' to be sent to the Javascript function drawImg but when I 
 debug it via alerts, it appears to be NULL.

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



RE: [PHP] Variables and Strings

2005-12-29 Thread Jay Blanchard
[snip]
Thanks for the responses guys, but what i'm saying is i would like to return
all the variable names i have in a string,
$String=Blah Blah Blah $VarName Blah Blah Blah;
$Vars=myspecialfunction($Varname);
echo ($Vars);

that code would produce $Varname, if there were more variables it would also
return the Variable Names in an array
[/snip]

And you call yourself Superman?!? 

Keep in mind that the variable name in a double quoted string is
interpreted, you would have to use an outside process to read each line of
the file, locate the lines where the variables are, and then process to your
liking.

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



Re: [PHP] php / JS / DOM question

2005-12-29 Thread jonathan

thanks so much.

i didn't realize but I did strip out all the php. My bad.

-jonathan
On Dec 29, 2005, at 1:48 PM, Dan Uyemura wrote:


Try:
input type=text name=q id=q/input
input type=button
onclick=drawImg('A',document.getElementById('q').value);
value=Search/input

I didn't test this, but I think it'll work...

-Original Message-
From: jonathan [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 29, 2005 1:45 PM
To: php-general@lists.php.net
Subject: [PHP] php / JS / DOM question

I know that this is more of a Javascript / DOM question but I cannot
for the life of me figure this out:

I have this form:

form name=query_form
input type=text name=q/input
input type=button onclick=drawImg('A',document.forms
['query_form'].elements['q']); value=Search/input
/form

When the user clicks on the button, I want the text that is in input
elment 'q' to be sent to the Javascript function drawImg but when I
debug it via alerts, it appears to be NULL. Looking at the examples
online, I feel like this should work. Does anybody know why this
might not be working correctly?

-jonathan

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

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





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



RE: [PHP] Variables and Strings

2005-12-29 Thread Jim Moseby
 
 Thanks for the responses guys, but what i'm saying is i would 
 like to return
 all the variable names i have in a string,
 $String=Blah Blah Blah $VarName Blah Blah Blah;
 $Vars=myspecialfunction($Varname);
 echo ($Vars);
 
 that code would produce $Varname, if there were more 
 variables it would also
 return the Variable Names in an array

I believe what Jochem is trying to tell you is that when you assign the
string variable, the variable names are expanded to their values, so the
names are no longer available.

Consider this:

$partname='widget';
$amount=100;

$string=This $partname costs $amount dollars;

/*
$string now equals This widget costs 100 dollars, so when you pass it to
your function, it has no way to know for sure what the variables were, or
that there even were ANY variables involved in the generation of the string.

The variable NAMES are not passed because PHP expands them to their values
and sets $string accordingly.
*/

$string='This $partname costs $amount dollars';

$string now equals This $partname costs $amount dollars.  In this case, I
used single quotes.  The values are not expanded and the variable NAMES are
passed.  The VALUE of the variables are not.  So you could then have a
function look for any word that starts with a $ and return an array of
names.

That all being said, what in the world are you trying to do with this?  I
bet you $1.78 (the change in my desk drawer) there is a much better way to
solve whatever problem it is than the way you are trying here.

JM

Because it ruins the flow of the conversation.
Why is top posting a bad thing?

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



[PHP] web app in my portflio

2005-12-29 Thread Scott DeMers

Hey, Folks:

I have a web application I've just completed, and I want to present  
it as part of my online portfolio, most of which hi-lights my work as  
a front end developer. My question is this: How do I go about showing  
off all of the hard-work I've done on the back-end? Do I simply  
describe the structure of the program, or should I present the ERD,  
code samples, screen-shots, etc? Is there such a thing as a code  
portfolio ? Does anyone have examples of their own work to share?  
Thanks.



Scott DeMers
Web Coordinator
International Studies and Programs
[EMAIL PROTECTED]

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



Re: [PHP] web app in my portflio

2005-12-29 Thread Philip Hallstrom
I have a web application I've just completed, and I want to present it as 
part of my online portfolio, most of which hi-lights my work as a front end 
developer. My question is this: How do I go about showing off all of the 
hard-work I've done on the back-end? Do I simply describe the structure of 
the program, or should I present the ERD, code samples, screen-shots, etc? Is 
there such a thing as a code portfolio ? Does anyone have examples of their 
own work to share? Thanks.


First... be careful if it's your employers application.  They might not 
want their database schema posted for the world to see.  If that's not an 
issue then...


I'd write up an overview document.  Include some screenshots.  Basically a 
resume for your app.  Make it long enough so it's clear that it's complex 
and clear what you did, but short enough so that the person can understand 
what it is the app does and what you did.


If you can, host a private copy of the application for demoing purposes 
that you can show on a case by case basis.


And if you're releasing the code, by all means post it (tgz or zip) so 
those curious can glance through it...


-philip

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



[PHP] Strange Right-Shift Problem

2005-12-29 Thread Michael Gross

Hello
I have to migrate a PHP-application to a new Linux-Box. Both the old and 
the new system are Linux and PHP 5.1.1. (the old one has a Pentium 4, 
the new one two Xeon CPUs). I have a problem using the 
Crypt_Xtea-Extension. I narrowed it down to the following right-shift 
operation:


(-3281063054  11) produces different results:
Old System: 495070
New System: -1048576

I understand that both results are wrong, but everything worked with 
the old behavior and I need that behavior back very urgent.


Maybe someone can explain me in which way the bits are shifted so that 
the result is 495070? If I understand it, I implement my own shift 
function.



thanks a lot
  Michael Gross

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



Re: [PHP] php / JS / DOM question

2005-12-29 Thread M. Sokolewicz
which is not part of the standards. It's accepted by most browsers 
because a lot of sites use it (due to the fact that IE is so popular), 
but it's *NOT* standard. So, don't do it! Dan showed the correct way.


- tul

[EMAIL PROTECTED] wrote:

Add the value property: document.forms['query_form'].elements['q']
.value.

Kirk

jonathan [EMAIL PROTECTED] wrote on 12/29/2005 02:45:23 PM:



form name=query_form
input type=text name=q/input
input type=button onclick=drawImg('A',document.forms 
['query_form'].elements['q']); value=Search/input

/form

When the user clicks on the button, I want the text that is in input 
elment 'q' to be sent to the Javascript function drawImg but when I 
debug it via alerts, it appears to be NULL.


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



Re: [PHP] what is the problem with this query?

2005-12-29 Thread Graham Cossey
On 12/29/05, Jay Blanchard [EMAIL PROTECTED] wrote:
 [snip]
 could you please tell me what is the problem with this query
 mysql_query(SELECT * FROM mailbox WHERE read='');

   i always get this warning:
   Warning: mysql_num_rows(): supplied argument is not a valid MySQL
 result resource in index.php on line 24
 [/snip]

 THere is no apparent problem with the query, but there is a problem with
 mysql_num_rows(). Can you show us he code there?

I would hazard a guess that mysql_num_rows() is not being passed the
correct query result handle as a parameter.

ie: $result = mysql_query(...);
$rows = mysql_num_rows($result);

--
Graham

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



Re: [PHP] what is the problem with this query?

2005-12-29 Thread Michael Gross
read is a reserved word in mysql 
(http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html). You have 
to double-quote reserved words:


mysql_query(SELECT * FROM mailbox WHERE \read\='');

Graham Cossey wrote:

On 12/29/05, Jay Blanchard [EMAIL PROTECTED] wrote:

[snip]
could you please tell me what is the problem with this query
mysql_query(SELECT * FROM mailbox WHERE read='');

  i always get this warning:
  Warning: mysql_num_rows(): supplied argument is not a valid MySQL
result resource in index.php on line 24
[/snip]

THere is no apparent problem with the query, but there is a problem with
mysql_num_rows(). Can you show us he code there?


I would hazard a guess that mysql_num_rows() is not being passed the
correct query result handle as a parameter.

ie: $result = mysql_query(...);
$rows = mysql_num_rows($result);

--
Graham



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