RE: [PHP] Endless 'while' loops?

2003-11-03 Thread Dave G
GoLive Gurus,

The problem has been resolved. I now understand much better how
while loops operate, and fixed the problem of the script not parsing.
I am now successfully making mailing lists using PHP.
While I was banging my head thinking there was something wrong
with how I was accessing the array variable, it turned out to be the
most simple thing. I had mistakenly placed a semi-colon at the end of my
while() command, and that was the root of my troubles. It never ceases
to amaze me how finding that one errant punctuation mark can be so
difficult and misleading!
In any case, I very appreciative of the many valuable tips
offered, and I believe tightening up the code as suggested by people on
this list helped me see my script better and isolate the problem.
Many thanks to David, Jay, Hanuska, Leif, and Teren for their
comments!

-- 
Cheers!
Dave G
[EMAIL PROTECTED]

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



Re: [PHP] Extracting random rows

2003-11-03 Thread Marek Kilimajer
Hello, works for me. As a workaround you can pass a random integer to te 
RAND() function to be used as seed value.

Scott wrote:
Hello,

Below is a boiled-down example of the problem I'm having.  I'm trying to
extract rows randomly from MySql, but I keep getting the same one. It
works if I query MySql directly from the command line, so it seems like
a php problem.
Thanks,
Scott
!DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0//EN
html
head
  title/title
  meta http-equiv=Content-Type content=text/html;
charset=iso-8859-1
  meta name=GENERATOR content=Quanta Plus
/head
body
?

include (connectlpi.php);

$sql = 
select id
from $table_name
order by rand()
limit 1
;
$result = @mysql_query($sql,$connection) or die(Couldn't execute
query.);
while ($row = mysql_fetch_array($result)) {

$id = $row['id'];

}

echo $id;

?



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


Re: [PHP] Sleep Function

2003-11-03 Thread Marek Kilimajer
It is exactly what you need. And you can lower the sleep time, I think 1 
or 2 seconds are just enough.

Glenn Gasner wrote:
The php.net documentation for the sleep and usleep functions has me
confused.  I'm using shared hosting and I need to email my whole mailing
list while not clogging the shared mail server.  What I'm trying to do is
put a pause between each email sent (like 10 seconds) so I can set it up to
send a thousand (or whatever) messages without manually putting time between
batches.  My guess is that I should put a line with sleep(10); inside the
mail sending loop so that it pauses between notes.  However, the Jan-17 note
on the usleep function mentions that these kinds of loops can consume 100%
of CPU while running.  The Jan-29 note on the time() function says that
sleep uses way less CPU than wait(). I don't know how to test CPU usage of
any PHP function.  Is sleep() really so CPU intensive that I should avoid
it, is there a better function to use, or is it exactly what I need and
it'll be no problem even on a shared server?
Thanks!
Glenn Gasner
glenn at perex dot com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Extracting random rows

2003-11-03 Thread Shivanischal
hi,

do try this - select * from my_table orer by rand() limit my_max_rows like
select * from questions order by rand() limit 5. works for me. i'm
surprised too. but if u still want to do it in PHP, do go ahead.

warm regards,
-shiva


Scott [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hello,

 Below is a boiled-down example of the problem I'm having.  I'm trying to
 extract rows randomly from MySql, but I keep getting the same one. It
 works if I query MySql directly from the command line, so it seems like
 a php problem.

 Thanks,
 Scott

 !DOCTYPE HTML PUBLIC -//W3C//DTD HTML 4.0//EN
 html
 head
   title/title
   meta http-equiv=Content-Type content=text/html;
 charset=iso-8859-1
   meta name=GENERATOR content=Quanta Plus
 /head
 body

 ?

 include (connectlpi.php);

 $sql = 
 select id
 from $table_name
 order by rand()
 limit 1
 ;

 $result = @mysql_query($sql,$connection) or die(Couldn't execute
 query.);

 while ($row = mysql_fetch_array($result)) {

 $id = $row['id'];

 }

 echo $id;

 ?



 /body
 /html

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



Re: [PHP] Japanese entry into MySQL and into emails

2003-11-03 Thread Marek Kilimajer
I have only one advise for you: send yourself an email with the kanji 
encoding and check the email headers with the headers you set.

Dave G wrote:

Thank you Edwin, Marek, and Eugene for your responses and
advice.
For storing the Japanese names in kanji in the database, I've
changed the column to blob. Storing and retrieving the fields seems to
work okay in all my tests, and this solution seemed to be the easiest
and without any potential impact on the rest of the database. Thank you
for this solution.
For sending the email in Japanese, I am still not quite getting
it. At first I attempted to attach character set information within the
mail() command like so:
$addheaders = 'From: ' .$email .'\r\nContent-Type: text/html;
charset=iso-2022-jp';
mail ($toaddress, $subject, $mailcontent, $addheaders);
This sends the mail correctly, but the content is still coming
out as ASCII gibberish.
I then attempted to use the mb_send_mail() command, like so
(this time a From:  address being the only additional header:
mb_language(Japanese);
mb_send_mail($toaddress, $subject, $mailcontent, $fromaddress);
But this had exactly the same result.
I see on the
http://jp2.php.net/manual/en/function.mb-send-mail.php web page there is
lots of additional comments on the use of mb-send-mail(), but the
technical vocabulary is beyond me.
Can someone help me tweak this code to successfully send a kanji
email?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


php-general Digest 3 Nov 2003 11:32:09 -0000 Issue 2393

2003-11-03 Thread php-general-digest-help

php-general Digest 3 Nov 2003 11:32:09 - Issue 2393

Topics (messages 168358 through 168381):

Re: passing variables to subsequent pages
168358 by: Chris Shiflett

Re: scalar value as array problem
168359 by: John W. Holmes

How to run PHP4 and PHP5 side-by-side
168360 by: Adam Plocher
168362 by: Comex

Re: recursive acronym - PHP
168361 by: Lee Doolan

Test.
168363 by: S. Cole

Re: How to remove a variable from an array
168364 by: David Otton
168367 by: David Otton

Image resize with background.
168365 by: Chris
168368 by: Martin Towell

applying one function to all array elements
168366 by: Justin French
168370 by: Mike Migurski
168373 by: Chris Shiflett

Extracting random rows
168369 by: Scott
168378 by: Marek Kilimajer
168380 by: Shivanischal

Re: Endless 'while' loops?
168371 by: Dave G
168372 by: David Otton
168377 by: Dave G

Mailing List
168374 by: PHPLover
168375 by: Warren Vail

Sleep Function
168376 by: Glenn Gasner
168379 by: Marek Kilimajer

Re: Japanese entry into MySQL and into emails
168381 by: Marek Kilimajer

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---
--- Justin French [EMAIL PROTECTED] wrote:
 form action='nextpage.php?manifacturer=?=$_GET['manufacturer']?'
 method='get'

Unless I'm mistaken (which is possible), this won't work. When the
form method is GET, the query string is constructed using the form
fields. Therefore, the manufacturer will be lost.

Hope that helps.

Chris

=
My Blog
 http://shiflett.org/
HTTP Developer's Handbook
 http://httphandbook.org/
RAMP Training Courses
 http://www.nyphp.org/ramp
---End Message---
---BeginMessage---
Steve Turner wrote:

I have a frustrating problem. I have a shopping cart class that creates
session variable arrays to store the product_id and quantity. My development
machine is running windows 2000 with PHP 4.3.3 and my script is working
perfectly on my machine. When I upload to the remote host running FreeBSD
and PHP 4.3.2 I am getting errors. I believe I am having problems with
assigning the array values, and this is causing other problems. I am using
this statment to assign $_SESSION['cart']['product_id'] with the quantity
using a class with the add_item property.
 $cart-add_item($_GET['product_id'], $_GET['quantity']);

I am getting this error.

Warning: Cannot use a scalar value as an array in
/home/designor/public_html/class.php on line 14
Warning: Cannot use a scalar value as an array in
/home/designor/public_html/class.php on line 16
I have no idea what a scalar value even is. I did verify that my form was
passing the values by using
echo $_GET['product_id'] . $_GET['quantity'];
A string or integer would be a scalar value.

What you have is something like this:

$a = 4;
$a[] = 5;
Where you initially make $a an integer, then you try to make it into an 
array and add an element to it. PHP is giving you a warning (not an 
error) about this. You may be using any of the array functions on 
something that's not an array to begin with.

You can either fix the problem, or just adjust your error_reporting() 
level to not see warnings.

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com
---End Message---
---BeginMessage---
Hello, I'm using Apache 2.0 on a Linux box and I'm trying to figure out how to run 
PHP5 (beta2) and PHP4 co-existantly.  I have compiled both of them with 
--enable-versioning, but I can't figure out what I need to put in my httpd.conf to 
make it differentiate the two versions.
 
Ideally I would like php5 to be enabled for certain virtualhosts, and php4 for others. 
 But using .php5 file extensions would be acceptable too.
 
I have compiled PHP4 and PHP5 with the following configure options:
'./configure' '--with-apxs2=/home/httpd/bin/apxs' '--with-mysql=/home/mysql' 
'--enable-track-vars'  '--enable-versioning'
 
Thanks in advance
 
-Adam
---End Message---
---BeginMessage---
[EMAIL PROTECTED]
Adam Plocher:
 Hello, I'm using Apache 2.0 on a Linux box and I'm trying to figure
 out how to run PHP5 (beta2) and PHP4 co-existantly.  I have compiled
 both of them with --enable-versioning, but I can't figure out what I
 need to put in my httpd.conf to make it differentiate the two
 versions.

 Ideally I would like php5 to be enabled for certain virtualhosts, and
 php4 for others.  But using .php5 file extensions would be acceptable
 too.

 I have compiled PHP4 and PHP5 with the following configure options:
 './configure' '--with-apxs2=/home/httpd/bin/apxs'
 

Re: [PHP] Mailing List

2003-11-03 Thread Lowell Allen
 I would like to setup a mailing list for my company.
 I have a database containing email address of my clients along with other
 details.
 How can I send them mails ?
 If i write a script containing the mail function and loop the address, I
 think that might generate a script timeout error. I feel increasing the
 script timeout is not a good solution. I would like to know how you manage
 such situations. I feel this is a common problem but i didnt find any
 solution on the net. Do I need to use any sw or are there any already
 available scripts.

I built a queuing system to email to a large list. The general approach is
to add a database table that stores the email message and tracks progress
through the list. A PHP script called by a crontab checks the database to
see if a mailing is in progress. If so, it selects a certain number of
addresses and sends the message. By controlling the number of addresses
selected and how often the crontab calls the script, the email rate is
controlled. And using a crontab makes it a background process. The email
message is created and list progress monitored through a content management
system.

--
Lowell Allen

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



RE: [PHP] Web Applications and C++?

2003-11-03 Thread Jay Blanchard
[snip]
Inappropirate but intruiging nonetheless.
[/snip]

Maybe not so inappropriate as you could use C++ dll's ...calling them
from PHP, passing variables, etc.

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



RE: [PHP] Japanese entry into MySQL and into emails

2003-11-03 Thread Dave G

The issue of entering Japanese into email from a PHP script has
been resolved. A key point was that when creating a header for an email,
not only should \r\n be used to separate lines, but immediately
preceding \r\n should be a space.
The end result was to create a variable that goes into the final
space in the mail() command where one puts additional headers which
looks like this:

$headers = $fromaddress .  \r\nContent-Type: text/plain;
charset=iso-2022-jp;

Thanks Marek, Eugene, and Edwin for their advice on this matter,
and of storing kanji in a MySQL database.

-- 
Cheers!
Dave G
[EMAIL PROTECTED]

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



RE: [PHP] Call to undefined function: xml_parser_create()... but CGI compiled --with-xml

2003-11-03 Thread Dave [Hawk-Systems]
a production box running 4.2.2 recently had a script added to it requiring use
of xml functionality.  The box was already compiled (a few versions earlier)
with the --with-xml option.  Since then, have upgraded this box twice
(though it
is due for another) using config.nice to ensure the same options are installed.

have configured this as an apache module and as the CGI...  the apache module
uses the XML functions just fine.  The CGI however gives the error in the
subject.

Have compared phpinfo() on each, and added extension_dir and include_dir to the
standalone php's php.ini so that it matches the apache module version, still no
joy.

Any thoughts, recommendations, or hints as to what I may be missing which would
cause the cgi version not to compile with the xml features even when
the --with-xml option is and has been specified since 4.0.x and through every
upgrade since then thanks to using the same config.nice.

any takers on this?

Dave

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



[PHP] XML DOM

2003-11-03 Thread Ian Williams
I have an XML document as a string $strXml, that looks a little like this:

recordset
row
userid1/userid
usernameBob/username
passwordRover/username
/row
row
userid2/userid
usernameFred/username
passwordFido/username
/row
/recordset

What's the best way to grab a single value from this document? In the past
(in
VB), I have loaded the XML into a DOM Document, and used an XPath query to
select the data I want, and then bung the output into a string.

Any suggestions?

Thanks
Ian

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



[PHP] How do i replace table names?

2003-11-03 Thread Bas
I want to replace something like this:

$sql = CREATE TABLE bas_table (
);

With this:

CREATE TABLE hugo_table (
);

And do the same for INSERT INTO... How do i do this?

Regards,

Bas

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



RE: [PHP] How do i replace table names?

2003-11-03 Thread Jay Blanchard
[snip]
I want to replace something like this:

$sql = CREATE TABLE bas_table (
);

With this:

CREATE TABLE hugo_table (
);

And do the same for INSERT INTO... How do i do this?
[/snip]

Top of the morning to you Bas!

I have a couple of questions for you.

1. Have you read emany/em of the manual?
2. Are you subscribed to the MySQL list?

All queries are run in the same way. If you have permissions in the
database you can do this (for example);

$sqlInsert = INSERT INTO tableBAS (php, mysql) :
$sqlInsert .= VALUES ('knowledge from having read PHP manual', ;
$sqlInsert .= 'knowledge from having read MySQL manual') ;

$dbInsert = mysql_query($sqlInsert, $connectionInformation);

HTH!

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



RE: [PHP] time() daylight savings

2003-11-03 Thread Jay Blanchard
[snip]
does anybody know how php handles daylight saving issues ? 
[/snip]

I am pretty sure that PHP does not 'handle' daylight savings issues at
all, but relies on the server settings for its time base.

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



Re: [PHP] Mailing List

2003-11-03 Thread David T-G
PHPLover --

...and then PHPLover said...
% 
% Dear All,
% 
% I would like to setup a mailing list for my company.

Then set up a mailing list.


% I have a database containing email address of my clients along with other
% details.

That's good.


% How can I send them mails ?

I would highly recommend ezmlm for mailing list software.  It does a
fantastic job.

Now if you actually mean to send customized letters you'll have to inject
each one singly, which really gets time-consuming.

In either case, I would avoid having php do your actual mailing; use the
web interface for selecting recipients, creating your message body, and
whatnot, but then hand off the actual mailing work to a separate process
(and don't expect to wait until it finishes).


% If i write a script containing the mail function and loop the address, I
% think that might generate a script timeout error. I feel increasing the
% script timeout is not a good solution. I would like to know how you manage

We run a fan / marketing site for various clients (bands, video game
companies, whatnot) which offer content for those interested, a vanity
email address, and regular newsletters offsite to the base addresses.
Through moderate but not insane tuning I've managed to get our mail
processing down to about 120ms per message; that gives me in excess of
25k messages queued per hour, which is near our target of 60k emails
within two hours (and of course some of those take longer because of
timeouts and retries and such).  Even so, there's obviously no way that a
web browser would wait around for that kind of delay.

We follow a model similar to that of another poster; our subscribers are
in a database along with the massmail info and a cron job checks for
queued jobs and processes them.  It would be a lot easier if we could
send out a general letter, but fans like it when you address them by name
and so on :-/


% such situations. I feel this is a common problem but i didnt find any
% solution on the net. Do I need to use any sw or are there any already
% available scripts.

I agree that it's a common problem.  The reason you didn't find your
answers was because you looked for the wrong ones :-)


% 
% Thanks a Lot !!
% Long Live PHP !!
% 
% Thanks  Regards, 
% ___ 
% PHPLover
% Göd döësn't pläy dícë. 
% - Älbërt Ëínstëín

Is there something wrong with your vowels?


HTH  HAND

:-D
-- 
David T-G  * There is too much animal courage in 
(play) [EMAIL PROTECTED] * society and not sufficient moral courage.
(work) [EMAIL PROTECTED]  -- Mary Baker Eddy, Science and Health
http://justpickone.org/davidtg/  Shpx gur Pbzzhavpngvbaf Qrprapl Npg!



pgp0.pgp
Description: PGP signature


Re: [PHP] How do i replace table names?

2003-11-03 Thread Bas
No, i mean to replace the names in the string... And then execute them...
Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
I want to replace something like this:

$sql = CREATE TABLE bas_table (
);

With this:

CREATE TABLE hugo_table (
);

And do the same for INSERT INTO... How do i do this?
[/snip]

Top of the morning to you Bas!

I have a couple of questions for you.

1. Have you read emany/em of the manual?
2. Are you subscribed to the MySQL list?

All queries are run in the same way. If you have permissions in the
database you can do this (for example);

$sqlInsert = INSERT INTO tableBAS (php, mysql) :
$sqlInsert .= VALUES ('knowledge from having read PHP manual', ;
$sqlInsert .= 'knowledge from having read MySQL manual') ;

$dbInsert = mysql_query($sqlInsert, $connectionInformation);

HTH!

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



Re: [PHP] Problems with remote include

2003-11-03 Thread Pablo Zorzoli
On Thu, 2003-10-30 at 17:00, Chris Shiflett wrote:
 So the server where you're running the PHP script can't connect to
 the server you specify in your include() call. So, you can now remove
 PHP from the problem and work on that.

 [...]

 Hope that helps.

 Chris

Thank you Chris..i solved the problem with an etry in /etc/hosts in the
webserver.

Pablo

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



RE: [PHP] How do i replace table names?

2003-11-03 Thread Jay Blanchard
[snip]
No, i mean to replace the names in the string... And then execute
them...
[snip]

*slaps forehead* Duh, just do it?

$sqlCreateTable = CREATE TABLE `dumBas` ( ;
$sqlCreateTable .= `ai` int(11) NOT NULL AUTO_INCREMENT, ;
$sqlCreateTable .= `thing` char(32) default NULL, ;
$sqlCreateTable .= `stuff` char(16) default NULL, ;
$sqlCreateTable .= PRIMARY KEY  (`ai`), ;
$sqlCreateTable .= KEY `thing` (`thing`) ;
$sqlCreateTable .= ) ;
$dbCreateTable = mysql_query($sqlCreateTable, $connectionStuff);

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



Re: [PHP] How do i replace table names?

2003-11-03 Thread Bas
OKAY, I WANT TO REPLACE IN THE TABLENAME THE TEXT BAS_ WITH DUMMY_

SUCH LIKE THAT CREATE TABLE BAS_DATA BECOMES CREATE TABLE DUMMY_DATA

I AM NOT THAT DUMB... I JUST WANT TO REPLACE 1 TABLE PREFIX BY ANOTHER!!!


Jay Blanchard [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
[snip]
No, i mean to replace the names in the string... And then execute
them...
[snip]

*slaps forehead* Duh, just do it?

$sqlCreateTable = CREATE TABLE `dumBas` ( ;
$sqlCreateTable .= `ai` int(11) NOT NULL AUTO_INCREMENT, ;
$sqlCreateTable .= `thing` char(32) default NULL, ;
$sqlCreateTable .= `stuff` char(16) default NULL, ;
$sqlCreateTable .= PRIMARY KEY  (`ai`), ;
$sqlCreateTable .= KEY `thing` (`thing`) ;
$sqlCreateTable .= ) ;
$dbCreateTable = mysql_query($sqlCreateTable, $connectionStuff);

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



RE: [PHP] How do i replace table names?

2003-11-03 Thread Jay Blanchard
[snip]
OKAY, I WANT TO REPLACE IN THE TABLENAME THE TEXT BAS_ WITH DUMMY_

SUCH LIKE THAT CREATE TABLE BAS_DATA BECOMES CREATE TABLE DUMMY_DATA

I AM NOT THAT DUMB... I JUST WANT TO REPLACE 1 TABLE PREFIX BY
ANOTHER!!!
[/snip]

Then do it! And quit top posting! And quit yelling! 

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



Re: [PHP] How do i replace table names?

2003-11-03 Thread zhuravlev alexander
On Mon, Nov 03, 2003 at 04:37:41PM +0100, Bas wrote:
 OKAY, I WANT TO REPLACE IN THE TABLENAME THE TEXT BAS_ WITH DUMMY_
 
 SUCH LIKE THAT CREATE TABLE BAS_DATA BECOMES CREATE TABLE DUMMY_DATA
 
 I AM NOT THAT DUMB... I JUST WANT TO REPLACE 1 TABLE PREFIX BY ANOTHER!!!

sed -i.bak -e s'/BAS_/DUMMY_/g' your_sql_file.sql 


 -- zhuravlev alexander
   u l s t u  n o c

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



RE: [PHP] How do i replace table names?

2003-11-03 Thread Jay Blanchard
[snip]
I AM NOT THAT DUMB... I JUST WANT TO REPLACE 1 TABLE PREFIX BY
ANOTHER!!!
[/snip]

http://www.php.net/str_replace

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



RE: [PHP] References and memory efficiency

2003-11-03 Thread Johnson, Kirk
 I've been working on a database wrapper class for a while 
 now, MySQL to 
 be specific. Until  now, I've simply had a fetch function 
 that returned 
 an array of all the rows that the database returned, only 
 because I have 
 gotten so tired of always writing the same while loop to 
 iterate through 
 all the rows.
 
 However, I have discovered that the method I'm using, passing around 
 large multidimensional arrays of text by copy, is extremely memory 
 inefficient, so I am working on a new method. Tell me if this 
 is any better:

[...snip...]

 Where fetch($query, $array) is the header. In the second case, the 
 fetch function would therefore write the rows directly to the array 
 which was passed as a reference rather than returning a copy. 
 Am I right 
 in thinking that this is a better method?

I hope your new method is the right one, because I do it the same way and
for the same reason :) I haven't done any benchmarks, though. I use
procedural code, but the idea is the same. The calling routine builds the
query string and passes it into a function that executes the query,
processes the results set, puts the results into a hash, and returns a
reference to the hash. The calling routine then gets what it needs out of
the hash. So, one simple scalar gets passed in both directions. I use that
one function for all queries.

Kirk

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



[PHP] Quickform Image validation

2003-11-03 Thread Ian P. Christian
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

I'm using the following class for a form with an image in, but I need to use a
function to validate that an image was uploaded with the correct type and
that it's not too large.

I don't seem to be able to access the information about the file from within
the class witrhout using the $_FILES array.  Does anyone have any ideas?


?php

  require_once 'HTML/QuickForm.php';

  class Form_addShop extends HTML_QuickForm
  {
function Form_addShop($formName='addShop', $method = 'post', $target =
'_self', $attributes = null)
{
  $this-HTML_QuickForm($formName, $method, '', $target, $attributes);
  $this-addElement('header', null, 'Add a Shop');
  $this-addElement('text', 'txtName', 'Name', array('size'=20,
'maxlength'=50));
  $this-addElement('textarea', 'txtDescription', 'Description');
  $this-addElement('file', 'fileImage', 'Image');
  $this-addElement('submit', null, 'Submit');

  $this-applyFilter('txtName', 'trim');
  $this-applyFilter('txtDescription', 'htmlspecialchars');
  $this-addRule('txtName', 'Name is required', 'required', null,
'server');
  $this-addRule('txtDescription', 'Description is required', 'required',
null, 'server');
  $this-addFormRule(array($this,'CheckUpload'));
}

function CheckUpload($stuff)
{
  // shows MAX_FILE_SIZE
  var_dump($stuff);

  // shows nothing (probably due to form not having completed validation
  var_dump($this-exportValue('fileImage'));

  // shows what Iwant
  var_dump($_FILES);

  return array('fileImage' = 'This is not an image');
}
  }
?

Kind Regards,

- -- 
Ian P. Christian
 - [EMAIL PROTECTED]
 - +44 (0) 7740 189415
 - http://www.pookey.co.uk/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/poCXEe6ncNCcEO0RAuoKAJ9KaX06C294btAyTiLI/XVWecrrqACglSiH
ls8Fnw/i89euWHWp5F/WQ20=
=NBo0
-END PGP SIGNATURE-

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



Re: [PHP] How do i replace table names?

2003-11-03 Thread John W. Holmes
Bas wrote:
I want to replace something like this:

$sql = CREATE TABLE bas_table (
);
With this:

CREATE TABLE hugo_table (
);
And do the same for INSERT INTO... How do i do this?
If you know that bas_ will not appear within your data, then a simple 
str_replace() will do.

$new_data = str_replace('bas_','dummy_',$old_data);

If you're not sure, then a regular expression or more inclusive 
str_replace() would be necessary.

$new_data = str_replace('CREATE TABLE bas','CREATE TABLE dummy',$old_data);

or

$new_data = preg_replace('^CREATE TABLE bas','CREATE TABLE 
dummy',$old_data);

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com

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


[PHP] Problem connecting to remote MySQL Server

2003-11-03 Thread Donald Tyler
Hi,

I am publishing a site I have developed and I am having problems with
the scripts being able to access the remote MySQL server. When I try to
connect using the PHP scripts I just get an error saying that access is
denied.

I can access it fine from my machine using PHPMyAdmin so I know that
remote access is being allowed.
I have also connected to the web hosting server via SSH and have
connected successfully to the MySQL server via the MySQL client at the
terminal from that machine. So I know the server that the scripts are
running on also has access to the MySQL server.

Here is my script. Please let me know if you have any ideas why this
would be happening:

-

?PHP

/***
**
*   Connects to a MySQL database using the Belvedere
account  *

*/
function DBMS_CONNECT()
{
global $Site_Settings;

// Connect To DBMS
$Connection = mysql_connect($Site_Settings['DB_Host'],
$Site_Settings['DB_UserName'], $Site_Settings['DB_Password'])
or SQL_KillScript(Connecting to DBMS,$Connection);

// Select DB
if (!mysql_select_db($Site_Settings['DB_Name'],$Connection))
SQL_KillScript(Selecting Database,$Connection);

// Return the connection variable
return $Connection;
}

?

---

Here is the error message:

MySQL Error 1044 : Access denied for user: '[EMAIL PROTECTED]' to database
'Belvedere'

---

My DB_Host is specified as a domain name. e.g. db1.myhost.com

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



[PHP] Re: Problem connecting to remote MySQL Server

2003-11-03 Thread Rob Adams
Donald Tyler [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Hi,

 I am publishing a site I have developed and I am having problems with
 the scripts being able to access the remote MySQL server. When I try to
 connect using the PHP scripts I just get an error saying that access is
 denied.

 I can access it fine from my machine using PHPMyAdmin so I know that
 remote access is being allowed.

PHPMyAdmin doesn't necessarily mean that remote access is allowed.  A user
in MySQL may be able to access the database from the localhost, but not from
anywhere else.  In your case it looks like you may have the same username
defined twice, but with different levels of access.

[EMAIL PROTECTED] access allowed to database Belvedere.
[EMAIL PROTECTED]  access not allowed to database Belvedere.

Just a guess.

 I have also connected to the web hosting server via SSH and have
 connected successfully to the MySQL server via the MySQL client at the
 terminal from that machine. So I know the server that the scripts are
 running on also has access to the MySQL server.

 Here is my script. Please let me know if you have any ideas why this
 would be happening:

 -

 ?PHP

 /***
 **
 * Connects to a MySQL database using the Belvedere
 account *
 
 */
 function DBMS_CONNECT()
 {
 global $Site_Settings;

 // Connect To DBMS
 $Connection = mysql_connect($Site_Settings['DB_Host'],
 $Site_Settings['DB_UserName'], $Site_Settings['DB_Password'])
 or SQL_KillScript(Connecting to DBMS,$Connection);

 // Select DB
 if (!mysql_select_db($Site_Settings['DB_Name'],$Connection))
 SQL_KillScript(Selecting Database,$Connection);

 // Return the connection variable
 return $Connection;
 }

 ?

 ---

 Here is the error message:

 MySQL Error 1044 : Access denied for user: '[EMAIL PROTECTED]' to database
 'Belvedere'

 ---

 My DB_Host is specified as a domain name. e.g. db1.myhost.com

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



[PHP] JavaScript Newsgroup

2003-11-03 Thread Robb Kerr
What's your favorite JavaScript newsgroup? This group has been invaluable
in helping me learn PHP and need the same for JS.

Thanx,
-- 
Robb Kerr
Digital IGUANA
Helping Digital Artists Achieve their Dreams
http://www.digitaliguana.com
http://www.cancerreallysucks.org

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



Re: [PHP] XML DOM

2003-11-03 Thread Burhan Khalid
Ian Williams wrote:
I have an XML document as a string $strXml, that looks a little like this:

recordset
row
userid1/userid
usernameBob/username
passwordRover/username
/row
row
userid2/userid
usernameFred/username
passwordFido/username
/row
/recordset
What's the best way to grab a single value from this document? In the past
(in
VB), I have loaded the XML into a DOM Document, and used an XPath query to
select the data I want, and then bung the output into a string.
Any suggestions?
You can do the same bunging in PHP if your php setup has domxml enabled. 
 Or you can use the (faster, but batch-like) SAX parser.

More information : http://www.php.net/xml

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Search and POST and keywords

2003-11-03 Thread Burhan Khalid
Robert Sossomon wrote:

[ snipped ]

What I would LIKE it to do is pass along the keywords back to itself so
that when it is called from within itself it can be on the same search
terms.
I have made the code do this:
input type=\hidden\ name=\url\ value=\$_SERVER[PHP_SELF]\ input
type=\hidden\ name=\keyword\ value=\keyword\
These are inputs to another form, which just passed this back
   header(Location:$_POST[url]);
I guess what I am missing is another way to pass the KEYWORD from the
first form to the next part to make it seen by the script.
Have you looked at sessions?  I don't see why you don't want to use 
hidden fields, but sessions would be the next thing to look at.

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] JavaScript Newsgroup

2003-11-03 Thread Burhan Khalid
Robb Kerr wrote:

What's your favorite JavaScript newsgroup? This group has been invaluable
in helping me learn PHP and need the same for JS.
I would highly recommend Evolt ( http://www.evolt.org ) -- I'm a member 
and a frequent lurker (and sometime poster) on their lists. A lot of 
expert minds on Evolt, and I see javascript questions on it all the time :)

You should try The List mailing list for web development questions.

--
Burhan Khalid
phplist[at]meidomus[dot]com
http://www.meidomus.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] String Array Creation and assigment

2003-11-03 Thread Dan
i found the problem myself, array has to be defined like this:

$b=array[0=0];

then $b can be any array of any type of index and values as you wish to
assign to it.

Dan [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 please help with the following:

 I tried this first :
 $b[] = 'Book Worzel, Richard (1989). From Employee to Entrepreneur:  how
to
 turn your experience into a fortune.  Toronto:  Key Porter books.';
 $b[] = 'Book Ries, Al and Jack Trout (1994). The 22 Immutable Laws of
 Marketing.  New York:  Harper Business';
 ...

 then tried this :
 $b[0] = 'Book Worzel, Richard (1989). From Employee to Entrepreneur:  how
to
 turn your experience into a fortune.  Toronto:  Key Porter books.';
 $b[1] = 'Book Ries, Al and Jack Trout (1994). The 22 Immutable Laws of
 Marketing.  New York:  Harper Business';
 ...

 none of the above work, what's right?

 help will be appreciated.

 Dan

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



[PHP] caveats for upgrade from 4.2.2 to 4.3

2003-11-03 Thread Dave [Hawk-Systems]
any warnings, problems, or other issues we should be aware of... production
server, already addressed the register_globals issue

Dave

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



RE: [PHP] How to remove new line character?

2003-11-03 Thread Don Read

On 02-Nov-2003 Koala Yeung wrote:
 Thanks a lot
 
 I'd like to remove newline only.
 Is there any simple way?
 

rtrim($str, \r\n);

Regards,
-- 
Don Read [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.

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



[PHP] mysql_field_type() ...

2003-11-03 Thread René Fournier
...will say if a field is of type ENUM, but not its possible values 
(including default). Does anyone know how I can fetch possible values 
of a field type of ENUM?

Thanks.

...Rene

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


RE: [PHP] mysql_field_type() ...

2003-11-03 Thread Jay Blanchard
[snip]
...will say if a field is of type ENUM, but not its possible values 
(including default). Does anyone know how I can fetch possible values 
of a field type of ENUM?
[/snip]

You would have to use DESCRIBE. So if

DESCRIBE db; //in the mysql table

returns --

+-+-+--+-+-+---+
| Field   | Type| Null | Key | Default | Extra |
+-+-+--+-+-+---+
| Host| char(60) binary |  | PRI | |   |
| Db  | char(64) binary |  | PRI | |   |
| User| char(16) binary |  | PRI | |   |
| Select_priv | enum('N','Y')   |  | | N   |   |
| Insert_priv | enum('N','Y')   |  | | N   |   |
| Update_priv | enum('N','Y')   |  | | N   |   |
| Delete_priv | enum('N','Y')   |  | | N   |   |
| Create_priv | enum('N','Y')   |  | | N   |   |
| Drop_priv   | enum('N','Y')   |  | | N   |   |
| Grant_priv  | enum('N','Y')   |  | | N   |   |
| References_priv | enum('N','Y')   |  | | N   |   |
| Index_priv  | enum('N','Y')   |  | | N   |   |
| Alter_priv  | enum('N','Y')   |  | | N   |   |
+-+-+--+-+-+---+

you can get the info from the `Type` column

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



[PHP] printer functions and pcl

2003-11-03 Thread Mark Newnham
I'm trying to output HP PCL commeands using the printer_write command. 
For example:

$str=sprintf(\033d0D); // Underline Text
$str.=Text to print;
$str.=sprintf(\033cE); // Reset printer
$handle = printer_open('DOMAIN\\PSERVER');
printer_write($handle,$str);
printer_close($handle);
The printer is configured for raw output.  The output appears to be 
correct (I've compared the spooled job against one that works, so it 
would seem to be a problem with the job configuration e.g. the 
printer_set_option. I've tried using the MODE,RAW functio, but when I 
set this, the printer_write function no-longer works.

can anyone help?

TIA

Mark

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


[PHP] Re: mysql_field_type() ...

2003-11-03 Thread Rob Adams
René fournier [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 ...will say if a field is of type ENUM, but not its possible values
 (including default). Does anyone know how I can fetch possible values
 of a field type of ENUM?

desc $tbl_name;

You'll have to parse it, but it will give you the list of available values.



 Thanks.

 ...Rene

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



[PHP] Dates then 1970

2003-11-03 Thread Mark McCulligh
What function(s) would you use if you want to take someone's birth day and
format it on display.

I have always used strtotime, then strftime but it doesn't work if someone
was born in 1939. strtotime returns -1.

What function would you use to take the input string 1939/11/23 and get
the timestamp so I can use functions like strftime or date.

Thanks,
Mark.

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



[PHP] Problems using gethostbyname() to resolve *.net.au

2003-11-03 Thread Dan Anderson
Some domain names on .net.au are not being resolved when I use
gethostbyname.  I can whois them on http://whois.ausregistry.net.au/and
fine them, but they can't be pinged.  

Anybody know why this might be?

Thanks in advance,

Dan

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



Re: [PHP] Problems using gethostbyname() to resolve *.net.au

2003-11-03 Thread Boyan Nedkov
the firewall is configured to block pings from outside - security reasons - so 
called stealth mode



Dan Anderson wrote:
Some domain names on .net.au are not being resolved when I use
gethostbyname.  I can whois them on http://whois.ausregistry.net.au/and
fine them, but they can't be pinged.  

Anybody know why this might be?

Thanks in advance,

Dan

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


[PHP] Mail Delivery Acknowledgement

2003-11-03 Thread imran
Thank you for contacting me

Your e-mail has been forwarded to the appropriate person Mr. Imran Asghar.
  
We welcome all comments and suggestions. 

Due to the high volume of e-mails received, not all e-mails are responded to directly.

All e-mails that are responded to are handled in the order in which they are received. 
 If you need more immediate information or assistance, call us on following telephone 
numbers

+92 3009467711




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



Re: [PHP] Quickform Image validation

2003-11-03 Thread Ian P. Christian
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

On Monday 03 November 2003 6:54 pm, Pablo Goose wrote:
 Hi Ian.  If you're trying to access an uploaded file then you have to
 use the $_FILES array.

 How is that you had hoped to access this information from outside the
 $_FILES array?

It seems to me that the class provides methods for accessing the uploaded 
file, the class should be providing abstraction from _GET and _POST 
variables, I'm assuming it shoudl do the same with uploaded files.

Or am I wrong?

- -- 
Ian P. Christian
 - [EMAIL PROTECTED]
 - +44 (0) 7740 189415
 - http://www.pookey.co.uk/
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (GNU/Linux)

iD8DBQE/ptYeEe6ncNCcEO0RAjkFAJ9NaiEbTQ4c/WdNjhqxHBbc4uo2rACeO8bT
dxDaC4cNOGp+wWrTa7hnILE=
=Ws1s
-END PGP SIGNATURE-

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



Re: [PHP] Problems using gethostbyname() to resolve *.net.au

2003-11-03 Thread Dan Anderson
 the firewall is configured to block pings from outside - security reasons - so 
 called stealth mode

No, you are wrong.  gethostbyname($hostname) correctly resolves my
servers, and I have disabled pings for security reasons. 
gethostbyname($hostname) has nothing to do with pings as a matter of
fact.  It performs a whois lookup and returns the ip address of
$hostname.  

-Dan

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



Re: [PHP] Problems using gethostbyname() to resolve *.net.au

2003-11-03 Thread Rob Adams

Dan Anderson [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
  the firewall is configured to block pings from outside - security
reasons - so
  called stealth mode

 No, you are wrong.

If you're going to ask for help, you should take it in whatever form it
comes.  Perhaps he wasn't answering your primary question, but just stating
how it is possible to not have a ping request returned by a valid address.
In which case he is quite right.

 gethostbyname($hostname) correctly resolves my
 servers, and I have disabled pings for security reasons.
 gethostbyname($hostname) has nothing to do with pings as a matter of
 fact.  It performs a whois lookup and returns the ip address of
 $hostname.

 -Dan

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



[PHP] Re: Mail Delivery Acknowledgement

2003-11-03 Thread Comex
[EMAIL PROTECTED]
[EMAIL PROTECTED]:
 Thank you for contacting me

 Your e-mail has been forwarded to the appropriate person Mr. Imran
 Asghar.

 We welcome all comments and suggestions.

 Due to the high volume of e-mails received, not all e-mails are
 responded to directly.

 All e-mails that are responded to are handled in the order in which
 they are received.  If you need more immediate information or
 assistance, call us on following telephone numbers

 +92 3009467711

???

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



Re: [PHP] Problems using gethostbyname() to resolve *.net.au

2003-11-03 Thread Dan Anderson
 If you're going to ask for help, you should take it in whatever form it
 comes.  Perhaps he wasn't answering your primary question, but just stating
 how it is possible to not have a ping request returned by a valid address.
 In which case he is quite right.

I am thankful he answered my question, I am just pointing out that his
answer cannot be correct.  No offense was meant and I hope none was
taken.

-Dan

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



Re: [PHP] Problems using gethostbyname() to resolve *.net.au

2003-11-03 Thread Boyan Nedkov
[snip]
... I can whois them on http://whois.ausregistry.net.au/and
fine them, but they can't be pinged.
Anybody know why this might be?
[snip]
I'm just answering your question why they can't be pinged.

You are perfectly right that 'gethostbyname($hostname) has nothing to do with 
pings as a matter of fact' and then I just wonder why do you try to resolve your 
gethostname() problem by pinging the hosts, if you know what the answer is.

Possible reason for the problem could be that your DNS provider doesn't have a 
record in its database for the domain name you try to resolve. Solution - try to 
find a script (I have such class but written in Delphi) with functionality 
similar to nslookup so to be able to define another DNS server for the resolving 
query. This script should also be able to send queries to more than one DNS 
server if you wish to minimize the amount of the domains unresolved.

Or change your DNS provider with another one more reliable.

HTH

Boyan
--


Dan Anderson wrote:
the firewall is configured to block pings from outside - security reasons - so 
called stealth mode


No, you are wrong.  gethostbyname($hostname) correctly resolves my
servers, and I have disabled pings for security reasons. 
gethostbyname($hostname) has nothing to do with pings as a matter of
fact.  It performs a whois lookup and returns the ip address of
$hostname.  

-Dan

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


[PHP] Mail Delivery Acknowledgement

2003-11-03 Thread imran
Thank you for contacting me

Your e-mail has been forwarded to the appropriate person Mr. Imran Asghar.
  
We welcome all comments and suggestions. 

Due to the high volume of e-mails received, not all e-mails are responded to directly.

All e-mails that are responded to are handled in the order in which they are received. 
 If you need more immediate information or assistance, call us on following telephone 
numbers

+92 3009467711




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



Re: [PHP] Dates then 1970

2003-11-03 Thread John W. Holmes
Mark McCulligh wrote:

What function(s) would you use if you want to take someone's birth day and
format it on display.
I have always used strtotime, then strftime but it doesn't work if someone
was born in 1939. strtotime returns -1.
What function would you use to take the input string 1939/11/23 and get
the timestamp so I can use functions like strftime or date.
You'll have to tear it apart and do the math youself. Current year minus 
the first four digits. If current month/day is less than month/day from 
string, then subtract one (hasn't reached birthday yet).

If you're storing these dates in a database, you can use your query to 
calculate the age (unless it used unix timestamps, also).

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com

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


php-general Digest 3 Nov 2003 23:46:16 -0000 Issue 2394

2003-11-03 Thread php-general-digest-help

php-general Digest 3 Nov 2003 23:46:16 - Issue 2394

Topics (messages 168382 through 168426):

Re: Mailing List
168382 by: Lowell Allen
168390 by: David T-G

Re: Web Applications and C++?
168383 by: Jay Blanchard

Re: Japanese entry into MySQL and into emails
168384 by: Dave G

Re: Call to undefined function:  xml_parser_create()... but CGI compiled --with-xml
168385 by: Dave [Hawk-Systems]

XML DOM
168386 by: Ian Williams
168405 by: Burhan Khalid

How do i replace table names?
168387 by: Bas
168388 by: Jay Blanchard
168391 by: Bas
168393 by: Jay Blanchard
168395 by: Bas
168396 by: Jay Blanchard
168397 by: zhuravlev alexander
168398 by: Jay Blanchard
168401 by: John W. Holmes

Re: time()  daylight savings
168389 by: Jay Blanchard

Re: Problems with remote include
168392 by: Pablo Zorzoli

Search and POST and keywords
168394 by: Robert Sossomon
168406 by: Burhan Khalid

Re: References and memory efficiency
168399 by: Johnson, Kirk

Quickform Image validation
168400 by: Ian P. Christian
168419 by: Ian P. Christian

Problem connecting to remote MySQL Server
168402 by: Donald Tyler
168403 by: Rob Adams

JavaScript Newsgroup
168404 by: Robb Kerr
168407 by: Burhan Khalid

Re: String Array Creation and assigment
168408 by: Dan

caveats for upgrade from 4.2.2 to 4.3
168409 by: Dave [Hawk-Systems]

Re: How to remove new line character?
168410 by: Don Read

mysql_field_type() ...
168411 by: René Fournier
168412 by: Jay Blanchard
168414 by: Rob Adams

printer functions and pcl
168413 by: Mark Newnham

Dates  then 1970
168415 by: Mark McCulligh
168426 by: John W. Holmes

Problems using gethostbyname() to resolve *.net.au
168416 by: Dan Anderson
168417 by: Boyan Nedkov
168420 by: Dan Anderson
168421 by: Rob Adams
168423 by: Dan Anderson
168424 by: Boyan Nedkov

Mail Delivery Acknowledgement
168418 by: imran.pak-vision.com
168422 by: Comex
168425 by: imran.pak-vision.com

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---
 I would like to setup a mailing list for my company.
 I have a database containing email address of my clients along with other
 details.
 How can I send them mails ?
 If i write a script containing the mail function and loop the address, I
 think that might generate a script timeout error. I feel increasing the
 script timeout is not a good solution. I would like to know how you manage
 such situations. I feel this is a common problem but i didnt find any
 solution on the net. Do I need to use any sw or are there any already
 available scripts.

I built a queuing system to email to a large list. The general approach is
to add a database table that stores the email message and tracks progress
through the list. A PHP script called by a crontab checks the database to
see if a mailing is in progress. If so, it selects a certain number of
addresses and sends the message. By controlling the number of addresses
selected and how often the crontab calls the script, the email rate is
controlled. And using a crontab makes it a background process. The email
message is created and list progress monitored through a content management
system.

--
Lowell Allen
---End Message---
---BeginMessage---
PHPLover --

...and then PHPLover said...
% 
% Dear All,
% 
% I would like to setup a mailing list for my company.

Then set up a mailing list.


% I have a database containing email address of my clients along with other
% details.

That's good.


% How can I send them mails ?

I would highly recommend ezmlm for mailing list software.  It does a
fantastic job.

Now if you actually mean to send customized letters you'll have to inject
each one singly, which really gets time-consuming.

In either case, I would avoid having php do your actual mailing; use the
web interface for selecting recipients, creating your message body, and
whatnot, but then hand off the actual mailing work to a separate process
(and don't expect to wait until it finishes).


% If i write a script containing the mail function and loop the address, I
% think that might generate a script timeout error. I feel increasing the
% script timeout is not a good solution. I would like to know how you manage

We run a fan / marketing site for various clients (bands, video game
companies, whatnot) which offer content for those interested, a vanity
email address, and regular newsletters offsite to the base addresses.
Through moderate but not insane tuning I've managed 

Re: [PHP] mysql_field_type() ...

2003-11-03 Thread John W. Holmes
Jay Blanchard wrote:

[snip]
...will say if a field is of type ENUM, but not its possible values 
(including default). Does anyone know how I can fetch possible values 
of a field type of ENUM?
[/snip]

You would have to use DESCRIBE. So if
Even better is

DESC table_name column_name;

so you only have to parse one row (if you're only after one row). :)

--
---John Holmes...
Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals  www.phparch.com

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


[PHP] Showing high and low flash clips

2003-11-03 Thread daniel
Hi there, i'm stumped on a problem, i am trying to create an admin tool,
which will database files which are ftp'd to the server first. A drop down
list of flash files are viewed, and they are seperated into high and low
clips with a language key joined to them. They are stored in the database
like:

mediaID filename languageID bandwidth

What i am having problems with is that when editing the record, i would
like to list each with both a high and low pulldown with a language list,
although there is an issue here as each clip has its own entry into the
database so its coming out sequentially and i would like it showing the 2
drop downs and the language joined to these. The issue is storing the
primary key of these files, so when i hit update it will update each file
record.

So when abstracting the data, i am trying to push both files into an array
with a language. I want it to look like

Array
(
[0] = Array
(
[0] = Array
(
[mediaID] = 3
[filename] = news_hi.swf
[languageID] = 1
)
[1] = Array
(
[mediaID] = 4
[filename] = news_lo.swf
[languageID] = 1
)
)

 [1] = Array
(
[0] = Array
(
[mediaID] = 3
[filename] = news_hi.swf
[languageID] = 1
)
[1] = Array
(
[mediaID] = 4
[filename] = news_lo.swf
[languageID] = 1
)
)
)

How is it possible ?

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



Re: [PHP] Showing high and low flash clips

2003-11-03 Thread Boyan Nedkov
Suppose we have a recordset $rs returned by query like that:

SELECT mediaID, filename, languageID
FROM yabady a
INNER JOIN yohoho b on a.ID = b.ID
ORDER BY mediaID
then to build the array you can write:

for ($i = 0; $i = $rs-getRowCount() - 1; $i++) {
$row = $rs-getRow();
$data = array('mediaID'= $row['mediaID'],
  'filename'   = $row['filename'],
  'languageID' = $row['languageID']);
}
Haven't tested it, but have a similar code in one of my scripts here that works fine.

Boyan
--


[EMAIL PROTECTED] wrote:

Hi there, i'm stumped on a problem, i am trying to create an admin tool,
which will database files which are ftp'd to the server first. A drop down
list of flash files are viewed, and they are seperated into high and low
clips with a language key joined to them. They are stored in the database
like:
mediaID filename languageID bandwidth

What i am having problems with is that when editing the record, i would
like to list each with both a high and low pulldown with a language list,
although there is an issue here as each clip has its own entry into the
database so its coming out sequentially and i would like it showing the 2
drop downs and the language joined to these. The issue is storing the
primary key of these files, so when i hit update it will update each file
record.
So when abstracting the data, i am trying to push both files into an array
with a language. I want it to look like
Array
(
[0] = Array
(
[0] = Array
(
[mediaID] = 3
[filename] = news_hi.swf
[languageID] = 1
)
[1] = Array
(
[mediaID] = 4
[filename] = news_lo.swf
[languageID] = 1
)
)
 [1] = Array
(
[0] = Array
(
[mediaID] = 3
[filename] = news_hi.swf
[languageID] = 1
)
[1] = Array
(
[mediaID] = 4
[filename] = news_lo.swf
[languageID] = 1
)
)
)
How is it possible ?

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


[PHP] Mail Delivery Acknowledgement

2003-11-03 Thread imran
Thank you for contacting me

Your e-mail has been forwarded to the appropriate person Mr. Imran Asghar.
  
We welcome all comments and suggestions. 

Due to the high volume of e-mails received, not all e-mails are responded to directly.

All e-mails that are responded to are handled in the order in which they are received. 
 If you need more immediate information or assistance, call us on following telephone 
numbers

+92 3009467711




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



[PHP] Apache1.3.28 vs PHP4.3.3

2003-11-03 Thread orlandopozo
hello, I tried to configure php as module SAPI of the apache web server, I
put this line:

LoadModule php4_module D:/PHP4.3.3/sapi/php4apache.dll
AddModule mod_php4.c
AddType application/x-httpd-php .php

When I tested the configuration, I got this error:

Cannot remove module mod_php4.c: not found module list

Thanks for any help, I will really aprecciate your support, bye.

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



[PHP] verify my ISP

2003-11-03 Thread John Taylor-Johnston
How can I verify if my ISP really does have PHP on a server I am using. They say if I 
want PHP, I must pay an extra $15 per month. Is there somehting I can put in my 
.htaccess to verify and maybe do this?

IfModule mod_php4.c
AddType application/x-httpd-php .php .php4 .php3 .phtml .htm .html
AddType application/x-httpd-php-source .phps
/IfModule

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



[PHP] [Newbie Guide] For the benefit of new members

2003-11-03 Thread tech
=
This message is for the benefit of new subscribers and those new to PHP.  
Please feel free to add more points and send to the list.
==
1. If you have any queries/problems about PHP try http://www.php.net/manual/en 
first. You can download a copy and use it offline also. 

You can also try http://www.php.net/manual/faq.php to get answers to 
frequently answered questions about PHP (added by Christophe Chisogne).

2. Try http://www.google.com next. Searching for php YOUR QUERY may fetch 
you relevant results within the first 10 results, if you are lucky.

3. There is a new searchable archive of the mailing list discussion at
http://phparch.com/mailinglists, which provides a comprehensive and
convenient search tool. Many of the common topics are discussed repeatedly, 
and you may get answer to your query from the earlier discussions. 

For example: One of the repeatedly discussed question in the list is Best PHP 
editor. Everyone has his/her favourite editor. You can get all the opinions 
by going through the list archives. If you want a chosen list try this link : 
http://phpeditors.linuxbackup.co.uk/ (contributed by Christophe Chisogne).

4. If you are stuck with a script and do not understand what is wrong, instead 
of posting the whole script, try doing some research yourself. One useful 
trick is to print the variable/sql query using print or echo command and 
check whether you get what you expected. 

After diagnosing the problem, send the details of your efforts (following 
steps 1, 2  3) and ask for help.

5. Provide a clear descriptive subject line. Avoid general subjects like 
Help!!, A Question etc.  Especially avoid blank subjects. 

6. When you want to start a new topic, open a new mail composer and enter the 
mailing list address [EMAIL PROTECTED] instead of replying to an 
existing thread and replacing the subject and body with your message.

7. PHP is a server side scripting language. Whatever processing PHP does takes 
place BEFORE the output reaches the client. Therefore, it is not possible to 
access the users'  computer related information (OS, screen size etc) using 
PHP. You need to go for JavaScript and ask the question in a JavaScript 
list.

(You can access information SENT by the user's browser while requesting pages
from your server. You can get the details about browser, OS etc as reported by 
this request. - contributed by Wouter van Vliet)

8. It's always a good idea to post back to the list once you've solved
your problem. People usually add [SOLVED] to the subject line of their
email when posting solutions. By posting your solution you're helping
the next person with the same question. [contribued by Chris W Parker]

9. Ask smart questions http://catb.org/~esr/faqs/smart-questions.html
[contributed by Jay Blanchard)

Hope you have a good time programming with PHP.

Best regards,
-- 
Integrated Management Tools for leather industry
--
http://www.leatherlink.net

Ma Siva Kumar,
BSG LeatherLink (P) Ltd,
Chennai - 600106

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



Re: [PHP] verify my ISP

2003-11-03 Thread Mykroft Holmes IV


John Taylor-Johnston wrote:
How can I verify if my ISP really does have PHP on a server I am using. They say if I want PHP, I must pay an extra $15 per month. Is there somehting I can put in my .htaccess to verify and maybe do this?

IfModule mod_php4.c
AddType application/x-httpd-php .php .php4 .php3 .phtml .htm .html
AddType application/x-httpd-php-source .phps
/IfModule
Put up a php test page? If you get the appropriate response, you have 
PHP enabled on the server.

Adam

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


[PHP] Uploading Files!

2003-11-03 Thread Dimitri Marshall
Hi there,
I'm new to this new PHP thing and man it's frusterating. Anyway, I'm not
gonna tell you my life story, but I just need to know how to allow users to
upload files to my server . I've already made a form with the input
name=whatever type=file and then a program that should get the varibles
[name] and [tmp_name] using $_POST. For some reason it's not working. Could
someone tell me how to do it, or what I'm doing wrong?

Thanks in advance,
Dimitri Marshall

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



Re: [PHP] verify my ISP

2003-11-03 Thread John Taylor-Johnston
Thanks Adam,
:=) First thing I tried.
Oh well.
John


  How can I verify if my ISP really does have PHP on a server I am using. They say 
  if I want PHP, I must pay an extra $15 per month. Is there somehting I can put in 
  my .htaccess to verify and maybe do this?
 
  IfModule mod_php4.c
  AddType application/x-httpd-php .php .php4 .php3 .phtml .htm .html
  AddType application/x-httpd-php-source .phps
  /IfModule
 

 Put up a php test page? If you get the appropriate response, you have
 PHP enabled on the server.

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



AW: [PHP] Uploading Files!

2003-11-03 Thread Daniel Diehl
Hi Dimitri,

 I'm new to this new PHP thing and man it's frusterating. Anyway, I'm not
 gonna tell you my life story, but I just need to know how to allow users
 to
 upload files to my server . I've already made a form with the input
 name=whatever type=file and then a program that should get the
 varibles
 [name] and [tmp_name] using $_POST. For some reason it's not working.
 Could
 someone tell me how to do it, or what I'm doing wrong?


[Daniel Diehl] 
Take a look at http://www.php.net/manual/en/features.file-upload.php . I
think this will solve your problem. You have to set the enctype
enctype=multipart/form-data in the form tag.


Greet,
Daniel

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



Re: [PHP] Uploading Files!

2003-11-03 Thread Rob Burris
Dimitri Marshall wrote:

Hi there,
I'm new to this new PHP thing and man it's frusterating. Anyway, I'm not
gonna tell you my life story, but I just need to know how to allow users to
upload files to my server . I've already made a form with the input
name=whatever type=file and then a program that should get the varibles
[name] and [tmp_name] using $_POST. For some reason it's not working. Could
someone tell me how to do it, or what I'm doing wrong?
Thanks in advance,
Dimitri Marshall
 

Try using $_FILES or $HTTP_POST_FILES and make sure you have 
|enctype=multipart/form-data in your form tag.|

- rob

--
[EMAIL PROTECTED]
http://www.phpexamples.net
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Moodle.Org

2003-11-03 Thread John Taylor-Johnston
Moodle.Org, an OpenSource project, needs help.

We need someone to help program a module to import WebCT quiz data into Moodle.

Any takers with a big heart for a worthwhile educational project?

John :=)

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



[PHP] Style.css

2003-11-03 Thread PHPLover
I am going throught the CVS of PHP and happened to see the Style.css
file.
I found that background-color of body,html is set to White instead of
#ff which i feel is not a valid CSS.
Am i right ?

Thanks  Regards, 
___ 
PHPLover

Göd döësn't pläy dícë. 
- Älbërt Ëínstëín




Re: [PHP] Style.css

2003-11-03 Thread Ashley M. Kirchner
PHPLover wrote:

I am going throught the CVS of PHP and happened to see the Style.css
file.
I found that background-color of body,html is set to White instead of
#ff which i feel is not a valid CSS.
Am i right ?
   Why is it not valid?  It's valid even in the proposed spec for CSS3 
(their online examples has colors defined that way in some cases.)  For 
that matter, all of these are valid:

   color: white;
   color: #ff;
   color: #fff;
   They all produce a white color.

--
H| I haven't lost my mind; it's backed up on tape somewhere.
 +
 Ashley M. Kirchner mailto:[EMAIL PROTECTED]   .   303.442.6410 x130
 IT Director / SysAdmin / WebSmith . 800.441.3873 x130
 Photo Craft Laboratories, Inc.. 3550 Arapahoe Ave. #6
 http://www.pcraft.com . .  ..   Boulder, CO 80303, U.S.A. 

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


[PHP] PHP 4.3.4 Released

2003-11-03 Thread Ilia Alshanetsky
PHP 4.3.4 has been released. The focus of this release was the resolution of
bugs and at the time of release some 70 bugs were resolved. All users are
encouraged to upgrade to 4.3.4.

PHP 4.3.4 contains, among others, following important fixes:

* Fixed disk_total_space() and disk_free_space() under FreeBSD.
* Fixed FastCGI being unable to bind to a specific IP.
* Fixed several bugs in mail() implementation on win32.
* Fixed crashes in a number of functions.
* Fixed compile failure on MacOSX 10.3 Panther.

Enjoy,

PHP Development Team.

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



[PHP] Search and POST and keywords

2003-11-03 Thread Robert Sossomon
I have been modifying the quote system I have been writing like mad and
have hit another brick wall of sorts.

I am trying to do a couple of things...
The search is now up and running on just a DESCRIPTION field.  Anything
else at this point is unwieldy.  It works perfectly however I am trying
to add a piece to the puzzle.

What I would LIKE it to do is pass along the keywords back to itself so
that when it is called from within itself it can be on the same search
terms.

I have made the code do this:
input type=\hidden\ name=\url\ value=\$_SERVER[PHP_SELF]\ input
type=\hidden\ name=\keyword\ value=\keyword\

These are inputs to another form, which just passed this back
   header(Location:$_POST[url]);

I guess what I am missing is another way to pass the KEYWORD from the
first form to the next part to make it seen by the script.

http://www.garlandcnorris.com/quotes

I have completely blown the numbers out of proportion, but you can still
play with it to see what I mean.

I can shoot source out if need be, but this is probably just a stupid
mistake on my part.

TIA!!

Robert

~~~
There are three kinds of economist. Those who can count, and those who
can't.

-Eddie George. 
~~~

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