php-general Digest 29 May 2005 08:01:21 -0000 Issue 3481

2005-05-29 Thread php-general-digest-help

php-general Digest 29 May 2005 08:01:21 - Issue 3481

Topics (messages 215947 through 215957):

[EMAIL PROTECTED]
215947 by: Ryan A

Re: cybercash as a shared object
215948 by: Bill Shupp

Questionary Development
215949 by: ...helmut
215950 by: ...helmut
215951 by: ...helmut
215953 by: ...helmut

Re: browse childnodes but not recursively
215952 by: Jared Williams

Re: Sorting Objects in an array by object properties
215954 by: Jared Williams

Re: unable to exec shell commands
215955 by: Andy Pieters

Regex question: replacing incidences of character when not enclosed within HTML 
tags?
215956 by: Murray . PlanetThoughtful

Dummy question about knowing marked checkboes
215957 by: Mário Gamito

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:
php-general@lists.php.net


--
---BeginMessage---
Everytime I write to the list or reply to the list I get an email from this
#%#¤! saying:

---
 We are currently away on holiday, until 16th June.  I will respond with
 your email on my return.


 Thanks
 James Nunnerley
---

Can someone unsub him please? Its reay starting to tick me off.
The autoresponder seems to be firing from this addres:
[EMAIL PROTECTED]

Cheers,
Ryan



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.322 / Virus Database: 267.2.0 - Release Date: 5/27/2005
---End Message---
---BeginMessage---

Bill Shupp wrote:
I need to install the cybercash module on a Debian Sarge system.  I 
really want to keep Debian's PHP packages, and just build this as a 
shared module.  At least one post in the archives indicates that this is 
possible, as does one changelog entry.  However, no specifics were offered.


Here's what I've tried:

I can build the module fine statically.

I can build the shared module cybercash.so by modifying the 
ext/cybercash/config.m4 and Makefile files, modeling them after the 
mcrypt.so entries.  While modules/cybercash.so does get built, I get 
this error when trying to load it:


PHP Warning:  Unknown(): Invalid library (maybe not a PHP library) 
'cybercash.so'  in Unknown on line 0


I'm building with PHP 4.3.10, and the latest cybercash from PECL.  I've 
also tried the cybercash module from 4.2.3, as suggested in one of the 
online manual comments.


Any guidance would be greatly appreciated!

Regards,

Bill Shupp


I was able to get it compiled by re-writing the config.m4 file, modeling 
it after the pfpro config.m4 file.  Here's what I posted on the online 
manual comments, just so that it makes it to the mail archives as well:




##

Here's how to install cybercash dynamically into PHP


1. Make sure you have the php dev tools installed, like pear and phpize.

2. Download the cybercash module:

pear download cybercash

3. Untar the module:

tar -xzf cybercash-version.tgz

4. Download and install my updated config.m4 file, the current one (as 
of version 1.18p1) doesn't work:


wget http://shupp.org/patches/cybercash.config.m4
cd cybercash-version
mv ../cybercash.config.m4 config.m4

5. Setup/compile module

phpize
./configure --with-cybercash=/path/to/cybercash-mck-library-source/c-api
make

6. Install module.  For Debian Sarge, the modules directory is 
/usr/lib/php4/20020429/:


cp modules/cybercash.so /usr/lib/php4/20020429/
(make install may work also)

7. Enable the module in php.ini, restart apache.


##


Incidentally, when I tried to compile the pfpro module from within the 
PHP source using buildconf, I got setting mismatch errors when trying to 
load it into Debian's PHP binaries.  However, by moving the extension 
out of the PHP source, and using phpize to setup it up, it loaded perfectly.


Hope this helps someone else save some time!


Regards,

Bill Shupp
---End Message---
---BeginMessage---
I have a form that contains 100 questions. To make it easier on the user, I 
will divide it into 5 sections (20 questions per section), then all the 
information will be written to a db. What is the best way to carry along 
through the pages the information that has already been submitted? Cookies? 
Writing to a DB after each section? Session Variables?

I read that writing to a database as i go along could be too much of a 
hazzle for the db, specially if I have multiple people filling out the form 
at the same time.

TIA

-- 
helmut
helmutgranda.com
---End Message---
---BeginMessage---
I have a form that contains 100 questions. To make it easier on the user, I 
will divide it into 5 sections (20 questions per section), then all the 
information will be written to a db. What is the best way to 

php-general Digest 29 May 2005 21:01:23 -0000 Issue 3482

2005-05-29 Thread php-general-digest-help

php-general Digest 29 May 2005 21:01:23 - Issue 3482

Topics (messages 215958 through 215966):

Re: Dummy question about knowing marked checkboes
215958 by: Tom Rogers

PHP on XP SP2 IIS Security?
215959 by: Mario netMines

Re: [EMAIL PROTECTED]
215960 by: Rasmus Lerdorf

PHP 5.1 release
215961 by: kioto

php based open source document workflow
215962 by: bruce

Replacing 2 strings
215963 by: W Luke

Warning: filemtime() (errno=75 - Value too large for defined data type)
215964 by: Andrew Brampton

A small PHP project
215965 by: Rob Scovell

Re: novice: how to run .sql script from php?
215966 by: tony yau

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:
php-general@lists.php.net


--
---BeginMessage---
Hi,

Sunday, May 29, 2005, 5:50:13 PM, you wrote:
MG Hi,

MG First of all, my apologies to all list members for this dummy question.
MG I've made my home work before posting here, but the truth is that i
MG didn't found an answer for such a simple question.
MG Only examples of more sophisticated related things.

MG I have this piece of code that produces various checkboxes inside a form:
MG ---
MG // select interesses names and values to build the chekboxes
MG $recordSet = $conn-Execute('SELECT interesses FROM interesses ORDER BY
MG interesses ASC');

MG // build the checkboxe's list
MG if (!$recordSet)
MG  print $conn-ErrorMsg();
MG else {
MG  while (!$recordSet-EOF) {
MG   print($recordSet-fields[0] . 'input name=\'interesses\'
MG type=\'checkbox\' id=\'interesses\' value=' . $recordSet-fields[0] .
'\'');
MG echobr /;
$recordSet-MoveNext();
MG }
$recordSet-Close();
$conn-Close();
MG }
MG -


MG Here's the correspondent HTML output:
MG -
MG Alojamentoinput name='interesses' type='checkbox' id='interesses'
value=Alojamento'br /
MG Artesanatoinput name='interesses' type='checkbox' id='interesses'
value=Artesanato'br /
MG Eventosinput name='interesses' type='checkbox' id='interesses'
value=Eventos'

MG (etc.)

MG -

MG My dummy question, for which i apologise once more is: after submitting
MG the form, how can i know which chekboxes were checked ?

MG Thanking you in advance.

MG Warm Regards,
MG Mário Gamito

Make them an array by adding [] at the end of the name. Also you are
missing a quote at the start of the value=  (double quotes makes it
easier to print in my opinion)

It should be like this:

while (!$recordSet-EOF) {
  print($recordSet-fields[0] . 'input name=interesses[]
  type=checkbox id=interesses value=' . $recordSet-fields[0].''
);

Then any checkboxes checked  will be in an array called interesses

$interesses = (isset($_POST['interesses']))? $_POST['interesses'] :
array();
if(count($interesses)  0){
  //checkboxes have been ticked
}else{
  //none ticked
}

-- 
regards,
Tom
---End Message---
---BeginMessage---

Hi all

a while ago I bought a new computer and set it up to run PHP on IIS using 
MySQL db. I did all the usual setup step as I used to for the last 5 yrs.
The first problem was with image uploading. The move_uploaded_file() was not 
working but only if the path was in the Inetpub directory. If I wanted to 
upload an image on the c: drive it was fine.
I use Win XP Proffesional and I'm not on a network, so I don't get the 
security tab on the folder properties. I decided to make the user 
IUSR_computername an Administrator (stupid I know, but it worked).


So now I'm trying to do an fopen($filename, w+) but it fails. If the file 
is outside the Inetpub directory, it works!!!


Can anyone help PLEASE

Thanks in advance

Mario 
---End Message---
---BeginMessage---
Ryan A wrote:
 Everytime I write to the list or reply to the list I get an email from this
 #%#¤! saying:

I got rid of him.

-Rasmus
---End Message---
---BeginMessage---
Hi all, i have question about the PHP 5.1 version. The PHP-GTk2 it's 
proud to start and require  PHP5.1
version to work. When it's possible to use a stable version and what are 
the new features of this release.

Thanks so much to all.
---End Message---
---BeginMessage---
hi...

i'm dealing with a project where i'm going to have users deal/modify a
number of docs.. i'd like some sort of doc workflow process where i can
allow a given user/type of user access to the doc, and move the doc along
the process.

ie,
  eng - develops the doc
 test- tests the doc
 qa - reviews the doc
 doc signed off/complete...

this kind of process would have the eng/test/qa person touching the doc, and
only after all have signed off on the 

[PHP] Dummy question about knowing marked checkboes

2005-05-29 Thread Mário Gamito
Hi,

First of all, my apologies to all list members for this dummy question.
I've made my home work before posting here, but the truth is that i
didn't found an answer for such a simple question.
Only examples of more sophisticated related things.

I have this piece of code that produces various checkboxes inside a form:
---
// select interesses names and values to build the chekboxes
$recordSet = $conn-Execute('SELECT interesses FROM interesses ORDER BY
interesses ASC');

// build the checkboxe's list
if (!$recordSet)
 print $conn-ErrorMsg();
else {
 while (!$recordSet-EOF) {
  print($recordSet-fields[0] . 'input name=\'interesses\'
type=\'checkbox\' id=\'interesses\' value=' . $recordSet-fields[0] .
'\'');
echobr /;
$recordSet-MoveNext();
}
$recordSet-Close();
$conn-Close();
}
-


Here's the correspondent HTML output:
-
Alojamentoinput name='interesses' type='checkbox' id='interesses'
value=Alojamento'br /
Artesanatoinput name='interesses' type='checkbox' id='interesses'
value=Artesanato'br /
Eventosinput name='interesses' type='checkbox' id='interesses'
value=Eventos'

(etc.)

-

My dummy question, for which i apologise once more is: after submitting
the form, how can i know which chekboxes were checked ?

Thanking you in advance.

Warm Regards,
Mário Gamito

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



Re: [PHP] Dummy question about knowing marked checkboes

2005-05-29 Thread Tom Rogers
Hi,

Sunday, May 29, 2005, 5:50:13 PM, you wrote:
MG Hi,

MG First of all, my apologies to all list members for this dummy question.
MG I've made my home work before posting here, but the truth is that i
MG didn't found an answer for such a simple question.
MG Only examples of more sophisticated related things.

MG I have this piece of code that produces various checkboxes inside a form:
MG ---
MG // select interesses names and values to build the chekboxes
MG $recordSet = $conn-Execute('SELECT interesses FROM interesses ORDER BY
MG interesses ASC');

MG // build the checkboxe's list
MG if (!$recordSet)
MG  print $conn-ErrorMsg();
MG else {
MG  while (!$recordSet-EOF) {
MG   print($recordSet-fields[0] . 'input name=\'interesses\'
MG type=\'checkbox\' id=\'interesses\' value=' . $recordSet-fields[0] .
'\'');
MG echobr /;
$recordSet-MoveNext();
MG }
$recordSet-Close();
$conn-Close();
MG }
MG -


MG Here's the correspondent HTML output:
MG -
MG Alojamentoinput name='interesses' type='checkbox' id='interesses'
value=Alojamento'br /
MG Artesanatoinput name='interesses' type='checkbox' id='interesses'
value=Artesanato'br /
MG Eventosinput name='interesses' type='checkbox' id='interesses'
value=Eventos'

MG (etc.)

MG -

MG My dummy question, for which i apologise once more is: after submitting
MG the form, how can i know which chekboxes were checked ?

MG Thanking you in advance.

MG Warm Regards,
MG Mário Gamito

Make them an array by adding [] at the end of the name. Also you are
missing a quote at the start of the value=  (double quotes makes it
easier to print in my opinion)

It should be like this:

while (!$recordSet-EOF) {
  print($recordSet-fields[0] . 'input name=interesses[]
  type=checkbox id=interesses value=' . $recordSet-fields[0].''
);

Then any checkboxes checked  will be in an array called interesses

$interesses = (isset($_POST['interesses']))? $_POST['interesses'] :
array();
if(count($interesses)  0){
  //checkboxes have been ticked
}else{
  //none ticked
}

-- 
regards,
Tom

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



[PHP] PHP on XP SP2 IIS Security?

2005-05-29 Thread Mario netMines

Hi all

a while ago I bought a new computer and set it up to run PHP on IIS using 
MySQL db. I did all the usual setup step as I used to for the last 5 yrs.
The first problem was with image uploading. The move_uploaded_file() was not 
working but only if the path was in the Inetpub directory. If I wanted to 
upload an image on the c: drive it was fine.
I use Win XP Proffesional and I'm not on a network, so I don't get the 
security tab on the folder properties. I decided to make the user 
IUSR_computername an Administrator (stupid I know, but it worked).


So now I'm trying to do an fopen($filename, w+) but it fails. If the file 
is outside the Inetpub directory, it works!!!


Can anyone help PLEASE

Thanks in advance

Mario 


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



Re: [PHP] webmaster@jnsolutions.co.uk

2005-05-29 Thread Rasmus Lerdorf
Ryan A wrote:
 Everytime I write to the list or reply to the list I get an email from this
 #%#¤! saying:

I got rid of him.

-Rasmus

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



[PHP] PHP 5.1 release

2005-05-29 Thread kioto
Hi all, i have question about the PHP 5.1 version. The PHP-GTk2 it's 
proud to start and require  PHP5.1
version to work. When it's possible to use a stable version and what are 
the new features of this release.

Thanks so much to all.

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



[PHP] php based open source document workflow

2005-05-29 Thread bruce
hi...

i'm dealing with a project where i'm going to have users deal/modify a
number of docs.. i'd like some sort of doc workflow process where i can
allow a given user/type of user access to the doc, and move the doc along
the process.

ie,
  eng - develops the doc
 test- tests the doc
 qa - reviews the doc
 doc signed off/complete...

this kind of process would have the eng/test/qa person touching the doc, and
only after all have signed off on the doc, would it be complete.. i'm going
to be dealing with potentially ~2000 docs, so i''d like to have a system in
place that allows us to more or less track what's going on.

does anybody have any thoughts on an open source solution for this kind of
situation.

thanks

bruce
[EMAIL PROTECTED]

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



[PHP] Replacing 2 strings

2005-05-29 Thread W Luke
Hi,

I have some text in a file which, when it's dumped to a var, needs to
be replaced.  In its raw form, it looks like this: ^JIM_JONES and I
need to remove the ^_ and  characters and have it read Jim-Jones

It's nestled in amongst a load of other text - I'm fopen'ing a file
and reading it line by line - the text-to-replace is just in a var
named $text1

Any ideas would be great

Will

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



[PHP] Warning: filemtime() (errno=75 - Value too large for defined data type)

2005-05-29 Thread Andrew Brampton

Hi,
I'm receiving the following warning:

Warning: filemtime(): Stat failed for master.log (errno=75 - Value too large 
for defined data type) in test.php on line 5


when I do the following line of code:
filemtime ('master.log');

The file in question is over 2GB, but I'm not interested in its size, I just 
want to know the time it was last modified.
I presume filemtime is just doing a stat which is failing when it tries to 
read the size field. Whatever the cause filemtime is returning false and 
displaying that warning.


Does anyone know a work around for this warning (which does not involve 
shelling out a command line app)?


My code was working fine until the file reached 2GB.

Thanks
Andrew

P.S I'm running PHP 4.3.10-13 on a Debian distro.


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



[PHP] A small PHP project

2005-05-29 Thread Rob Scovell

Hi,

I do some voluntary work for Anglican Action, a Christian social 
services agency in Hamilton, New Zealand. We have installed a PHP 
package called Entiako on a web server 
(http://www.apexsoftware.ca/products/entiako/entiako.php) -- this is a 
room booking system. However, we have had some problems with it and we 
are looking for someone who could make a few small changes to it to suit 
our purposes. (This is in accordance with the licence agreement, which 
allows these changes.)


If any of you guys are interested in taking on this short (pro bono) 
project for an organisation that helps shattered families rebuild their 
lives, then please email me: robscovell [{at}] xtra.co.nz


I think this will probably take about 15-20 hrs work at most, if that.

Thanks,

Rob Scovell

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



Re: [PHP] novice: how to run .sql script from php?

2005-05-29 Thread tony yau

I realised that there is a fundamental problem with using mysql_query( ...)
to run a .sql script to setup a database, and that was the database needs to
be there in the first place for php to connect to! also there was a lot of
comment lines in the script that was causing problem. ... so I gave up
trying to parse the file.

instead I did this
1) create the database with phpmyadmin etc
2) remove (by hand) all comment lines from the .sql file
and then include the file

ob_start();
include 'installation.sql';
$contents = ob_get_contents();
ob_end_clean();
execQuery($contents);

not very good but does the job.
thanks for all the help

tony yau

Rory Browne [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I'm assuming that the .sql file consists of a list of MySQL queries,
that when performed sequentially will set up your system.

That being the case, the  perfered way ot install the thing is to do a
'mysql [host/username/password parameters]  file.sql'.

I believe you can also run file.sql scripts using phpMyAdmin.

If you were to define a mysql_run_script() function, it would look a
bit like the following:

?pseudo_code

function mysql_run_script($file){

$sql = file_get_contents($file);

$queries = split_sql_into_individual_sql_queries($sql);

foreach($queries as $query){
mysql_query($query);
}

}

?

Come to think of it, you could turn the above pseudo code into valid
php code, by defining the split_sql_into_individual_sql_queries()
function. This would involve splitting by ';', taking into account the
possibility that ';' may occur in the middle of a string.

Check out the code for phpmyadmin, or phpbb(db backup/recover
feature), for a better idea.

On 5/27/05, tony yau [EMAIL PROTECTED] wrote:
 Hi All,

 I got this .sql script that setup the whole db schema, I can run
 mysql.exe to run on my pc but when it goes to a hosting company's server I
 don't have that command!

 So I tried to include(setup.sql) into a string and send that as one
 long sql query. BUT I need to get rid of all the comment lines first in
the
 script!!

 can someone give me a better idea of doing this.
 (there must be an equivalent php function like
 mysql_run_script(setup.sql))


 thanks
 --
 Tony Yau

 --
 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] novice: how to run .sql script from php?

2005-05-29 Thread M. Sokolewicz

tony yau wrote:

I realised that there is a fundamental problem with using mysql_query( ...)
to run a .sql script to setup a database, and that was the database needs to
be there in the first place for php to connect to! also there was a lot of
comment lines in the script that was causing problem. ... so I gave up
trying to parse the file.

instead I did this
1) create the database with phpmyadmin etc
2) remove (by hand) all comment lines from the .sql file
and then include the file

ob_start();
include 'installation.sql';
$contents = ob_get_contents();
ob_end_clean();

this is *very* overTheTop; why not just do:
$contents = file_get_contents('installation.sql');
???

execQuery($contents);

not very good but does the job.
thanks for all the help

tony yau

Rory Browne [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
I'm assuming that the .sql file consists of a list of MySQL queries,
that when performed sequentially will set up your system.

That being the case, the  perfered way ot install the thing is to do a
'mysql [host/username/password parameters]  file.sql'.

I believe you can also run file.sql scripts using phpMyAdmin.

If you were to define a mysql_run_script() function, it would look a
bit like the following:

?pseudo_code

function mysql_run_script($file){

$sql = file_get_contents($file);

$queries = split_sql_into_individual_sql_queries($sql);

foreach($queries as $query){
mysql_query($query);
}

}

?

Come to think of it, you could turn the above pseudo code into valid
php code, by defining the split_sql_into_individual_sql_queries()
function. This would involve splitting by ';', taking into account the
possibility that ';' may occur in the middle of a string.

Check out the code for phpmyadmin, or phpbb(db backup/recover
feature), for a better idea.

On 5/27/05, tony yau [EMAIL PROTECTED] wrote:


Hi All,

   I got this .sql script that setup the whole db schema, I can run
mysql.exe to run on my pc but when it goes to a hosting company's server I
don't have that command!

   So I tried to include(setup.sql) into a string and send that as one
long sql query. BUT I need to get rid of all the comment lines first in


the


script!!

   can someone give me a better idea of doing this.
   (there must be an equivalent php function like
mysql_run_script(setup.sql))


thanks
--
Tony Yau

--
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] novice: how to run .sql script from php?

2005-05-29 Thread Rory Browne
On 5/29/05, tony yau [EMAIL PROTECTED] wrote:
 
 I realised that there is a fundamental problem with using mysql_query( ...)
 to run a .sql script to setup a database, and that was the database needs to
 be there in the first place for php to connect to! also there was a lot of
 comment lines in the script that was causing problem. ... so I gave up
 trying to parse the file.
Umm, I suggest you read an awful lot more on mysql. I could be wrong
on this, but I can't at face value see anything wrong with
mysql_query(create database database_name); mysql_query(use
database_name). Your problem seems to be your lack of knowledge
regarding mysql, and using mysql from PHP.

 
 instead I did this
 1) create the database with phpmyadmin etc
 2) remove (by hand) all comment lines from the .sql file
 and then include the file
 
 ob_start();
 include 'installation.sql';
 $contents = ob_get_contents();
 ob_end_clean();
 execQuery($contents);

 ob_start();
 include 'installation.sql';
 $contents = ob_get_contents();
 ob_end_clean(); 

is spagetti code. use $contents = file_get_contents(installation.sql) instead.


is a bad way of writing that: $contents =
file_get_contents(installation.sql). Where did you get the
execQuery() from? If you have an execQuery() function that allows you
to do multiple queries seperated by semicolons, then you're sorted. 1


 
 not very good but does the job.
 thanks for all the help
 
 tony yau
 
 Rory Browne [EMAIL PROTECTED] wrote in message
 news:[EMAIL PROTECTED]
 I'm assuming that the .sql file consists of a list of MySQL queries,
 that when performed sequentially will set up your system.
 
 That being the case, the  perfered way ot install the thing is to do a
 'mysql [host/username/password parameters]  file.sql'.
 
 I believe you can also run file.sql scripts using phpMyAdmin.
 
 If you were to define a mysql_run_script() function, it would look a
 bit like the following:
 
 ?pseudo_code
 
 function mysql_run_script($file){
 
 $sql = file_get_contents($file);
 
 $queries = split_sql_into_individual_sql_queries($sql);
 
 foreach($queries as $query){
 mysql_query($query);
 }
 
 }
 
 ?
 
 Come to think of it, you could turn the above pseudo code into valid
 php code, by defining the split_sql_into_individual_sql_queries()
 function. This would involve splitting by ';', taking into account the
 possibility that ';' may occur in the middle of a string.
 
 Check out the code for phpmyadmin, or phpbb(db backup/recover
 feature), for a better idea.
 
 On 5/27/05, tony yau [EMAIL PROTECTED] wrote:
  Hi All,
 
  I got this .sql script that setup the whole db schema, I can run
  mysql.exe to run on my pc but when it goes to a hosting company's server I
  don't have that command!
 
  So I tried to include(setup.sql) into a string and send that as one
  long sql query. BUT I need to get rid of all the comment lines first in
 the
  script!!
 
  can someone give me a better idea of doing this.
  (there must be an equivalent php function like
  mysql_run_script(setup.sql))
 
 
  thanks
  --
  Tony Yau
 
  --
  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



[PHP] Free penetration test: my 2

2005-05-29 Thread Andy Pieters
Hi all

I would like to thank everybody for helping me.

Quite honestly, I didn't even remark the referal id.  I guess that's because 
if your looking at links all day long, you kinda block certain things.  Like 
seeing only the hostname part of urls.

Secondly, as far as I am concerned, no harm's done since I specifically asked 
for free (as in price), I wasn't planning signing up for any paid service at 
all.  So like someone said 35% of nothing is still nothing right?  Except, 
some sites give a (small) buck on referals regardless of signing up.

Thirdly, despite what I said previously, which was said after a very long day, 
and where I was very tired and confusing heads for tails, I do find that 
anyone who gives a link, and adds a referal id to it, should add a 
disclaimer to the message stating their affiliation.  

Being shy for money myself, I can understand that someone will take any and 
all oportunity to make an extra buck, but doing it this way is not very 
honest.

Show your professionalism, add that disclaimer, people will respect you more 
for it.

Thank you all for your help and thank you PHP!


Keep up the good work


With kind regards



Andy Pieters
Straight-A-Software

-- 
Registered Linux User Number 379093
-- --BEGIN GEEK CODE BLOCK-
Version: 3.1
GAT/O/E$ d-(---)+ s:(+): a--(-)? C$(+++) UL$ P-(+)++
L+++$ E---(-)@ W++$ !N@ o? !K? W--(---) !O !M- V-- PS++(+++)
PE--(-) Y+ PGP++(+++) t+(++) 5-- X++ R*(+)@ !tv b-() DI(+) D+(+++) G(+)
e$@ h++(*) r--++ y--()
-- ---END GEEK CODE BLOCK--
--
Check out these few php utilities that I released
 under the GPL2 and that are meant for use with a 
 php cli binary:
 
 http://www.vlaamse-kern.com/sas/
--

--

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



[PHP] Dummy question about gettion select option choosen

2005-05-29 Thread Mário Gamito
Hi,

Thank you all who have helped me in the checkbox's question.

This is an area to which i'm very fresh in PHP.

I now have this code in a form:
---
select name=interesse[]
option1/option
option2/option
option3/option
(etc...)
/select
--

My question is, how can i, in the action code, retrieve the option
choosen by the user ?

My most apologies for yet another dummy question, but i google and
google, and i always end up seeing examples fulls of complexity, when i
want is such a simple thing.

Thanking you in advance.

Warm Regards,
Mário Gamito

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



Re: [PHP] novice: how to run .sql script from php?

2005-05-29 Thread Marek Kilimajer

tony yau wrote:

I realised that there is a fundamental problem with using mysql_query( ...)
to run a .sql script to setup a database, and that was the database needs to
be there in the first place for php to connect to! also there was a lot of
comment lines in the script that was causing problem. ... so I gave up
trying to parse the file.

instead I did this
1) create the database with phpmyadmin etc


so you have phpmyadmin installed. good. now while you have the database 
selected,


2) click the SQL (it's in the toolbar in the right frame)
3) click Browse... button, find the .sql file, click OK
4) click the bottom Go button, wait and relax

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



Re: [PHP] Replacing 2 strings

2005-05-29 Thread Brian V Bonini
On Sun, 2005-05-29 at 12:22, W Luke wrote:
 Hi,
 
 I have some text in a file which, when it's dumped to a var, needs to
 be replaced.  In its raw form, it looks like this: ^JIM_JONES and I
 need to remove the ^_ and  characters and have it read Jim-Jones
 
 It's nestled in amongst a load of other text - I'm fopen'ing a file
 and reading it line by line - the text-to-replace is just in a var
 named $text1
 
 Any ideas would be great
 
 Will

Someone much more clever that I can probably come up with something much
cleaner and efficient but This works...

?php

function replace($string)
{
$chars = array(, ^, );
$string = str_replace($chars, , $string);
$string = str_replace(_, -, $string);
$pieces = preg_split('/-/', $string);

foreach($pieces as $char) {
$first_letter[] = $char{0};
$remainder[] = strtolower(substr($char, 1));
}

$result = array_merge($first_letter, $remainder);
list($frstltr,$lstltr,$frstwrd,$lstwrd) = $result;
$string = $frstltr . $frstwrd . - . $lstltr . $lstwrd;

return $string;

}

$text1 = '^JIM_JONES';
echo replace($text1);

?





-- 

s/:-[(/]/:-)/g


BrianGnuPG - KeyID: 0x04A4F0DC | Key Server: pgp.mit.edu
==
gpg --keyserver pgp.mit.edu --recv-keys 04A4F0DC
Key Info: http://gfx-design.com/keys
Linux Registered User #339825 at http://counter.li.org

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



[PHP] Can't Get PHP to work

2005-05-29 Thread Subscriber

Hi,

I sure hope someone here can help me.  I spent the entire day yesterday 
and most of the evening setting up a webserver on my Windows 2000 Pro 
system.  

I've got PHP 5.04, MySQL 4.1.12, ActivePerl 5.8.6, Java Runtime 
Environment, Tomcat 5.5.9, ZendOptimizer 2.5.10, MyODBC 3.5.11 and 
phpMyAdmin 2.6.2 all installed.


From what I can tell, all is working well except PHP and phpMyAdmin.

I added PHP to my path like this:

C:\Perl\bin\;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\php;C:\Apache2\bin;C:\mysql\bin;C:\php\dlls;C:\Program 
Files\Common Files\Ulead Systems\MPEG;C:\Program Files\Zone 
Labs\ZoneAlarm\MailFrontier


I've got a copy of php.ini in both my c:/php directory and in 
c://winnt.  I've listed my user directory as c:/apache/apache2/htdocs 
and I've placed phpmyadmin in htdocs.


But when I try to view a php page I get an error or page cannot be 
displayed.  On a couple of occassions I viewed the raw php data in my 
browser.


Also, when I try to add a php extension using LoadModule in my 
httd.conf file I get an error loading Apache telling me that the file 
cannot be found (but I've verified it exists - like php5apache.dll and 
php5ts.dll).


Can someone please help me figure out where I'm screwing up at?

Thanks in advance!

Edited to say I'm getting Closer!!!

Now when I go to 
[url=http://localhost/phpmyadmin]http://localhost/phpmyadmin[/url] I get 
the following info:


cannot load mysqli extension;
please check PHP configuration
[u]Documentation[/u]

And the documentation says:
[b][1.20] I receive the error cannot load MySQL extension, please check 
PHP Configuration. [/b]To connect to a MySQL server, PHP needs a set of 
MySQL functions called MySQL extension. This extension may be part of 
the PHP distribution (compiled-in), otherwise it needs to be loaded 
dynamically. Its name is probably mysql.so or php_mysql.dll. phpMyAdmin 
tried to load the extension but failed.


Usually, the problem is solved by installing a software package called 
PHP-MySQL or something similar.


I have tried using both mysql and mysqli in config.inc.php (phpmyadmin 
config file) and either way I get the same error message.  And in 
php.ini I have enabled the following extensions:


extension=php_mysql.dll
extension=php_mysqli.dll


Re: [PHP] Questionary Development

2005-05-29 Thread Rory Browne
If you insist on doing this serverside, then personally I'd probably
use hidden form fields. If you're open to doing it client side, then
I'd probably out the information into five div sections, only one of
which would be visible at any one time. using dhtml. What you want is
the CSS visibility attribute. Only one div would be visible at any
one time.

On 5/28/05, ...helmut [EMAIL PROTECTED] wrote:
 I have a form that contains 100 questions. To make it easier on the user, I
 will divide it into 5 sections (20 questions per section), then all the
 information will be written to a db. What is the best way to carry along
 through the pages the information that has already been submitted? Cookies?
 Writing to a DB after each section? Session Variables?
 
 I read that writing to a database as i go along could be too much of a
 hazzle for the db, specially if I have multiple people filling out the form
 at the same time.
 
 TIA
 
 --
 helmut
 helmutgranda.com
 
 --
 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 based open source document workflow

2005-05-29 Thread Rob Scovell
Well ... it's not PHP but Mason, and it's called Bricolage. (It's an 
Open Source content management system). And it's not straightforward ... 
but it can cover the sort of thing you are talking about with some 
tweaks. You will need to set it up so that you can use it to pass Word 
(or whatever) docs between work desks.


http://www.bricolage.cc/

Rob

bruce wrote:

hi...

i'm dealing with a project where i'm going to have users deal/modify a
number of docs.. i'd like some sort of doc workflow process where i can
allow a given user/type of user access to the doc, and move the doc along
the process.

ie,
  eng - develops the doc
 test- tests the doc
 qa - reviews the doc
 doc signed off/complete...

this kind of process would have the eng/test/qa person touching the doc, and
only after all have signed off on the doc, would it be complete.. i'm going
to be dealing with potentially ~2000 docs, so i''d like to have a system in
place that allows us to more or less track what's going on.

does anybody have any thoughts on an open source solution for this kind of
situation.

thanks

bruce
[EMAIL PROTECTED]


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



RE: [PHP] Regex question: replacing incidences of character when not enclosed within HTML tags? (somewhat solved)

2005-05-29 Thread Murray @ PlanetThoughtful
 So, thinking about it a little more, I decided what I was looking for was
 a
 regular expression that would allow me to replace any incidences of
 hyphens
 when not contained within tags (i.e., when not contained between  and
 ).
 
 And this is where things have ground to a halt.

Hi All,

After toying with this for several hours I decided to give up on trying to
work out a way to achieve this via a single regular expression replacement.

My simpler 'solution' now is to pull out all text not contained within tags
using preg_match_all(), and run a str_replace() across these values to
replace any incidences of hyphens, and then another str_replace() to replace
the content with the substring where hyphens were found.

So, something like:

?
preg_match_all(/(^|)(.+?)(|$)/m, $text,$hypharr);
for ($i=0; $i  count($hypharr[0]); $i++){

$rephyph = str_replace(-,-span style='font-size: 0px;'
/span, $hypharr[0][$i]);
if ($rephyph  $hypharr[0][$i]){
$text= str_replace($hypharr[0][$i],$rephyph,$text);
}
}

?

This seems to achieve what I'm looking for, ie replacing hyphens when not
contained in HTML tags.

Regards,

Murray

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



[PHP] Re: Warning: filemtime() (errno=75 - Value too large for defined data type)

2005-05-29 Thread Christopher Curtis
On 5/29/05, Andrew Brampton [EMAIL PROTECTED] wrote:

 Warning: filemtime(): Stat failed for master.log (errno=75 - Value too large
 for defined data type) in test.php on line 5
 
 when I do the following line of code:
 filemtime ('master.log');

 My code was working fine until the file reached 2GB.

 P.S I'm running PHP 4.3.10-13 on a Debian distro.

I'm afraid you have two options: either shell out to the 'stat'
command line tool, or recompile the PHP package.  You can 'apt-get
source php' and manually edit debian/rules to add the
-D_LARGE_FILE_OFFSET=64 looking argument to configure, then just
'dpkg-buildpackage -uc -us' it (or debian/rules binary).

There is a bug report against PHP pertaining to this, but it breaks
something in one of the other modules that I can't recall off the top
of my head.  I'm thinking it's related to Apache PAM, but that may be
something different ...

regards,
Chris

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