[PHP] What's wrong with this code please?

2004-02-24 Thread Donpro
$emails = array([EMAIL PROTECTED],[EMAIL PROTECTED],[EMAIL PROTECTED]);
$addresses = explode(,,$emails);
for ($i=0; $i  count($addresses); $i++) {
   echo $i . ': ' . $addresses[$i] . 'br';
   if ($i == count($addresses) - 1)
  $form['recipient'] .= $addresses[$i];
   else
  $form['recipient'] .= $addresses[$i] . ',';
   }
   echo 'Recipient = ' . $form['recipient'] . 'br';

 
The output I am receiving is:
0: Array
Recipient = Array
 
Obviously, I want to see the output of each array element as well as the
final contents of $form['recipient'].
 
Thanks in advance,
Don

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



[PHP] Why doesn't PHP see my MySQL upgrade?

2004-02-17 Thread Donpro
Hi,
 
Just installed a new RedHat 7.3 system.
 
1. I upgraded to PHP 4.3.4
2. I upgraded to MySQL 4.0.17
3. Restarted Apache; I even rebooted!
 
When I run phpinfo() in my web browser, it shows:
 
Client API version: 3.23.58
 
What's going on ???
 
Thanks,
Don

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



RE: [PHP] Why doesn't PHP see my MySQL upgrade?

2004-02-17 Thread Donpro
Disaster!

After uphrading to MySQL 4.0.17, I uninstalled all the old PHP-4.1.2 RPMs
and recompiled PHP-4.3.4.  Now I am getting compiling errors related to PHP.

/usr/local/php-4.3.4/ett/mysql/php_mysql.c:1158 undefined reference to
'mysql_create_db'

/usr/local/php-4.3.4/ett/mysql/php_mysql.c:1200 undefined reference to
'mysql_drop_db'

What next???

Shall I wipe out my PHP directory, install the Tarball and try compiling
from scratch?

 -Original Message-
 From: John W. Holmes [mailto:[EMAIL PROTECTED] 
 Sent: Tuesday, February 17, 2004 11:46 AM
 To: Donpro; php list
 Subject: Re: [PHP] Why doesn't PHP see my MySQL upgrade?
 
 
 From: Donpro [EMAIL PROTECTED]
 
  1. I upgraded to PHP 4.3.4
  2. I upgraded to MySQL 4.0.17
  3. Restarted Apache; I even rebooted!
 
  When I run phpinfo() in my web browser, it shows:
 
  Client API version: 3.23.58
 
  What's going on ???
 
 That's usual, as far as I can tell. That just means PHP is 
 using the 3.23 version of the client to connect to the 
 server. The server is still running 4.0.17, though. There 
 shouldn't be any issues with this. I don't think you need new 
 client versions until you get to MySQL 4.1 and higher.
 
 ---John Holmes...
 

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



[PHP] compile problem

2004-02-13 Thread Donpro
Hi,
 
trying to compile PHP 4.3.4. on RedHat Linux 7.3 and getting the following
error:
 
checking for CURL support... yes
checking for CURL in default path... found in /usr
checking for cURL 7.9.8 or greater... configure: error: cURL version 7.9.8
or later is required to compile php with cURL support
 
I am compiling with the --with-curl option AND I have curl 7.10.4 installed.
 
Any ideas?
 
Thanks,
Don

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



[PHP] uploaded files are corrupted

2004-02-11 Thread Donpro
Hi,
 
I have a script that allows the user to browse his/her local hard drive for
a file and email it as an attachment.  Text files come through OK but any
binary type file, e.g., JPEG or PDF arrive broken.  JPEG will show as a red
X in my browser and Adobe will complain about the PDF.  I don't know why???
 
A code sample of my form is:
 
form enctype=multipart/form-data action=formmail.php method=post 
Send this file: input name=userfile type=file 
input type=submit value=Send your file name=submit
/form
 
 
Thanks,
Don

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



[PHP] Sessions on Win2k

2004-02-11 Thread Donpro
Hi,
 
I've searched the archives and note that many have probelms using session on
a Win2K server.  I am getting a
 
Undefined index: sessions in
D:\inetpub\mydomain\www\forms\formmail\formmail.php on line 768
 
error.  Line 768 is: session_start();
 
It works Ok on Linux; is there any special Windows configuration?
 
Thanks,
Don
 

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



[PHP] Pausing in PHP

2003-11-10 Thread Donpro
Hi,
 
Is there a PHP function that would allow the script execution to pause 'N'
seconds?  This is analogous to the dBase inkey() function.
 
Thanks,
Don

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



[PHP] How do I call a function in a Class from another function in the same class

2003-08-14 Thread Donpro
Hi,
 
I have two functions in a class where one calls the other.  When creating my
object I get an error:
 
Call to undefined function
 
I dont understand why the function can't be seen?
 
 
Thanks,
Don

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.507 / Virus Database: 304 - Release Date: 8/4/2003
 


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



[PHP] How do I manipulate a date variable to a specific date array?

2003-08-14 Thread Donpro
Hi,
 
I use the getdate() function to return today's date in an array.  I do this
as I need to separate the day/month/year as to display them in a drop down
combo box in my form.  I would like to manipulate my array as such.
 
1) Find the next Monday (if not already Monday); set the array to this date
2) Add 4 weeks to the above Monday and set another array to this date
 
any ideas?
 
Thanks,
Don

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.507 / Virus Database: 304 - Release Date: 8/4/2003
 


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



[PHP] Adding days to a date

2003-08-14 Thread Donpro
I have a piece of code like so:
 
$today =- getdate();
 
I am looking for a function that will add a variable number of days and
return a valid date, i.e., the array elements for mday, mon and year
are reset as needed.  Is this possible?
 
Thanks,
Don
 

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.507 / Virus Database: 304 - Release Date: 8/4/2003
 


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



[PHP] Validating postal codes

2002-11-15 Thread DonPro
Hi,

I'm trying to validate a Canadian postal code.  I've already written a
function; code as follows:

if(!eregi('(^[a-z][0-9][a-z][0-9][a-z][0-9]$)',$form[authpstcode])) {
   $errors[] = 'You must input a valid Canadian postal code (A9A9A9) postal
code if he/she resides in Canada';
   $continue = false;
}

The above works OK if the user enters -- M2M6N6

But fails if the user enters --- M2M 6N6  (note the space between the two
triplets)

I want my function to validate either, i.e., allow a space between the two
triplets but not enforce it.

Any idea on how to modify my test?

Thanks,
Don



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




[PHP] How do I check if a checkbox has been checked?

2002-11-01 Thread DonPro
Hi,

I have a form with a checkbox like so:
input type=checkbox value=ON name=shipper_save

When I submit, the value is always shown as ON regardless of whether I've
checked the checkbox or not.  So this begets the question, How can I code my
PHP form processing script to determine whether the checkbox was checked?

Thanks,
Don



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




[PHP] Saving form input fields to MySQL br clicking on a button

2002-10-31 Thread DonPro
Hi,

I have a form where the user enters some information.  For a particular
section of the form, I'd like the user to be able to save what he/she
entered so that the next time they feel out the form, they can recall
without the need to retype.  This is not for the entire form but only for a
few input text fields.

I created a button called Memorize but how do I have the page save the
values to my MySQL database when the user clicks on the button.  I
understand that I can only use JavaScript to trap the OnClick() function
and not PHP but I cannot use JavaScript to write to a MySQL table.  I do not
want to submit as that would reload the form and the user would lose other
changes to other fields.

Any idea?

Don



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




[PHP] Re: Validating E-mail Accounts

2002-10-31 Thread DonPro
Most mail servers have the verify command disabled these days, so it makes
almost impossible to validate. Blame spammers for ruining everything.

But here's a class that will attempt to do what you wish:
http://www.phpclasses.org/browse.html/package/13.html

- Original Message -
From: Robert Miller [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Thursday, October 31, 2002 2:59 PM
Subject: [PHP] Validating E-mail Accounts


Is it possible, or (even better) do you have a sample script that can take a
user-submitted e-mail address, contact the host, and verify that the account
exists?

Thanks,

Rob



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




Re: [PHP] Saving form input fields to MySQL br clicking on a button

2002-10-31 Thread DonPro
These two ideas, I really like.  Saves me lots of coding

Thanks,
Don
  - Original Message - 
  From: PHP List 
  To: php ; DonPro 
  Sent: Thursday, October 31, 2002 4:09 PM
  Subject: Re: [PHP] Saving form input fields to MySQL br clicking on a button


  Why not use the Memorize button to set a hidden field? Or just use a check
  box.
  Since you are going to be submitting the data anyway, save the fields at
  that time depending on whether or not the check box/hidden filed is set?


   Hi,
  
   I have a form where the user enters some information.  For a particular
   section of the form, I'd like the user to be able to save what he/she
   entered so that the next time they feel out the form, they can recall
   without the need to retype.  This is not for the entire form but only for
  a
   few input text fields.
  
   I created a button called Memorize but how do I have the page save the
   values to my MySQL database when the user clicks on the button.  I
   understand that I can only use JavaScript to trap the OnClick() function
   and not PHP but I cannot use JavaScript to write to a MySQL table.  I do
  not
   want to submit as that would reload the form and the user would lose other
   changes to other fields.
  
   Any idea?
  
   Don
  
  
  
   --
   PHP General Mailing List (http://www.php.net/)
   To unsubscribe, visit: http://www.php.net/unsub.php
  




[PHP] How can I check for variances in spelling within form text input fields?

2002-10-02 Thread DonPro

Hi,

I would like some ideas on how to perform the following.  Any input from the
PHP gurus would be appreciated.

I have a form where my customer feels out certain information.  Part of this
information is the company name, address, city and state/province of their
customer.  I have to assign a unique number to their customer based on the
information they typed in.

Here is my problem:

1) They may enter the same customer twice but have a slightly different
spelling (maybe adding a LTD. to the company name)
2) Two of my customers may have the same customer. They will type it into my
form but again with variant spelling.

I would like to know if there is an algorithm which allows me to check for
small variances in spelling so that I would know if this customer has
already been assigned my unique number and therefore not assign a duplicate
number.

Thanks,
Don



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




[PHP] counting number of records in a MySQL table; how do I get the result?

2002-10-02 Thread DonPro

Hi,

I need to do either an insert or update into a MySQL table.  Insert if there
are 0 records or update if one record exist:

This is my code snippet:

if (mysql_query(SELECT COUNT(*) FROM AuthNum) == 0) {
   mysql_query(INSERT into AuthNum (FirstNum, LastNum, NextNum) VALUES
(1,2,3),$dblink);
} else {
   mysql_query(Update AuthNum Set FirstNum = 1, LastNum = 2, NextNum =
3,$dbLink);
}

My problem is, a record never gets inserted because the SELECT COUNT query
is returning a resource ID of 2.  How can I get the actual number of records
in the table?

Thanks,
Don



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




[PHP] Works from the command line but NOT from PHP

2002-10-01 Thread DonPro

Does anyone have any experience with FULLTEXT indexed MySQL tables?  I've
created such a key.  When I type the following from the MySQL command line,
I get the desired records returned, i.e., a subset of my entire table:

SELECT HSCode, UOM, EDescript FROM HSCodes WHERE MATCH(EDescript) AGAINST
('exercise');

However, the following PHP code returns the entire table, i.e., every single
column and I don't know why:

$queryID = mysql_query(SELECT HSCode, UOM, EDescript FROM HSCodes WHERE
MATCH(EDescript) AGAINST (' . $description . ') ORDER BY HSCode, UOM,
EDescript);
if ($queryID) {
   while ($queryRow = mysql_fetch_assoc($queryID)) {
  echo '$queryRow[HSCode] . ' | ' . $queryRow[UOM] . ' | ' .
$queryRow[EDescript];
   }
}




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




[PHP] checkbox objects returning false for isset() when submitted via a form.

2002-10-01 Thread DonPro

Hi,

I have a form that submits to itself via:
form name=hsform method=POST action=?=$_SERVER['PHP_SELF'] ? 

Within my form, I have some checkbox objects.  If I check them and submit my
form, isset(variable) returns true.  However, if I do not check them and
submit my form, isset(variable) returns false.

I am confused as I though that isset() returns true if the variable exists
regardless if it is empty or not.  Is there a way to do what I want?

Using php 4.2.1 on RedHat Linux 6.2

Thanks,
Don



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




[PHP] Need help creating a mysql query in PHP

2002-09-30 Thread DonPro

Hi,

I have a form containing a text field where the user types in a sentence.  I
need to search a mysql table, specifically a text field and display a list
of found results.  My criteria selections are:

1) return a record if all the words are contained in a record
2) return a record if all any word entered are contained in a record
3) return a record if parts of all words (starting at the beginning) are
contained in a record (e.g.. 'ex is in 'exercise')
3) return a record if parts of any word (starting at the beginning) are
contained in a record (e.g.. 'ex is in 'exercise')

Any advice would be appreciated.

Thanks,
Don



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




[PHP] How long do sessions last

2002-09-23 Thread DonPro

Hi,

If I use sessions (not session cookies) by issuing a session_start() and
then log in to an area of my web site, I understand that the session will
last until either I close my browser or issue a session_unset() followed by
a session_destroy().

If I log in and walk away from my PC, will the session eventually expire or
will I have to do one of the above?




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




[PHP] How do I keep a page from caching in I.E

2002-09-04 Thread DonPro

Hi,

Using I.E. 5.5. I can't seem to keep a page from caching.  When I click on
the browser BACK button, I get the cached page so I have to click on Refresh
to get the actual page content.  I've placed the following at the top of the
HTML file but it doesn't seem to do anything. Any help would be appreciated.

?PHP
header(Expires: Mon, 26 Jul 1997 05:00:00 GMT);
header(Last-Modified:  . gmdate(D, d M Y H:i:s) .  GMT);
header(Cache-Control: no-store, no-cache, must-revalidate);
header(Cache-Control: post-check=0, pre-check=0, false);
header(Pragma: no-cache);
?



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




[PHP] How do I get milliseconds?

2002-09-04 Thread DonPro

Using the following code,

date(His)

I get the hours, minutes and seconds.  Is there a way to extend this so that
I get the milliseconds too?

Thanks,
Don



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




[PHP] Question about sessions: how to force expiry

2002-08-22 Thread DonPro

Hi,

I am using a session variable to create an area where customers can access
certain pages via login/password.  If they successfully login, I create a
session variable and initialize it with their logon username.

I also have a logout button which unregisters the session variables and
issues a session_unset() and session_destroy().  Then is takes them back to
the login page.

Now all my pages in this area first check if the session variable is set and
if not, displays a message that the user must first login.

I noticed that after logging out and clicking click on the Back button in
my browser, it takes me back to the previous page which is does NOT display
the warning that the user must login.  However, when I click on the Refresh,
it does.  Is this some sort of caching problem?  I note that other sites
with similar setups do not have this problem.  When I click on the Back
button, I saw an expiry message.

How can I emulate this please?

Thanks,
Don



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




[PHP] Forms and sessions

2002-08-15 Thread DonPro

Hi,

How can I keep values in a from when using session_start() and later, the
Back Button on my Browser after posting via POST?

Thanks,
Don



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




[PHP] Why don't my PHP variables get posted?

2002-08-15 Thread DonPro

Hi,

I have a small form with checkbox objects.  Below is the code:

form method=POST action=doc_complete.html
input type=checkbox name=b13 value=checked
font size=3Export Declaration (B13)/fontbr
input type=checkbox name=\cinvoice\ value=checked
font size=3Commercial Invoice/font
p align=left
input type=submit value=Continue gt;gt;gt;/p
/form

In the past, I could access the two fields in doc_complete.html by using
PHP as in: $b13 and $cinvoice

However, when I added the code:
?PHP
session_cache_limiter('private, must-revalidate');
session_start();
?

to the top of doc_complete.html, I can no longer access the variables
properly, i.e., they do not give the correct results.  For some reason, they
seem to retain the first posting set.

Help,
Don




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




[PHP] Can I perform a PHP script from a form but stay on the same page afterwards?

2002-08-09 Thread DonPro

Hi,

I have a form where the user can change a value ion a text box and then
click on a button which will update a table in a MySQL database.  I assume
that the only way to do this is to have the button POST the form value to my
script which updates the MySQL table.

However, once updated (whether the update is successfull or not), I need to
remain or return to the same page that the form is on.

Can this easily be done?



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




[PHP] Form asking to refresh when I hit the back button

2002-08-01 Thread DonPro

Not sure if this is a PHP question but I've traced the problem to a PHP
statement.

I have a form that when submitted, displays a PDF document in the browser
(using a PDF library).  When I click on the back button, it should redisplay
my form but instead, displays a warning that data has expired and I need to
refresh.  Now this never happened until recently so I look at recent changes
and traced the problem to one single PHP statement at the top of my file:

session_start();

I am using sessions to pass values between pages and so added the statement
to my page so that I could check the value of a variable.  When I comment
out the above statement, I am no longer prompted to refresh.

Question: How can I have my cake and eat it to?

Thanks,
Don



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




[PHP] Can several different sessions coexist?

2002-08-01 Thread DonPro

Hi,

I'd like to register a session and create several session variables.  In
another part of my site, I'd like to register another session again creating
session variables.  After a bit, I'd like to destroy this second registered
session keeping the first intact.  Thus far, whenever I issue:

session_unset();
session_destroy();

both sessions are obliterated.  Is there a method of managing different
sessions where I can create additional sessions and destroy them without
losing my initial session?

Thanks,
Don



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




[PHP] How can I get my session variable to pass to another page?

2002-07-26 Thread DonPro

Hi,

I have a form that calls a PHP script which sets a session variable and
redirects to anopther URL as such:

session_start();
$HTTP_SESSION_VARS['userid'] = someidnumber;
Header('Location: ' . 'http://www.mydomain.com/welcome.html');

On welcome.html, I have the following code:

script language=php
echo 'userid: ' . $HTTP_SESSION_VARS['userid'] . 'br/';
/script

When I run it in my browser, the value of 'userid' is empty.  Anyone know
why?



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




[PHP] Using PHP with MySQL - Can I supress MySQL errors?

2002-07-23 Thread DonPro

Hi,

I'm using PHP to connect and perform queries with a MySQL database.  I've noticed that 
it there is an error performing certain
commands like 'mysql_connect()', I'll get a warning message in the browser.

I'd like to suppress these messages as I am storing the error, mysql_error(), in an 
array.  So if there is an error, I would simply
display the contents of the array in a nice format.

Is this possible?

Thanks,
Don



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




[PHP] Can a form submit to two PHP form processers in succession?

2002-07-22 Thread DonPro

Hi,

I'm not sure how to do this but I have a form which I wish to do the following.

When the uses clicks the submit button, I wish to perform a check where I look for a 
value in a MySQL database.  If found, I need
to return an error page telling the user that the value already exists.  I assume that 
I can just POST to a PHP page that performs
the check.

If the value was not found, I would like to POST the results to a PHP form handling 
script I use.

The above tow are separate PHP documents that are not connected.  In essence, it is 
akin to one form processing page handing off the
information to another page.  Can this be done in PHP?

Thanks,
Don



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




[PHP] Confused about the list() function

2002-07-17 Thread DonPro

Hi,

I have the following situation.  I have an array of colors that I would like to print 
out.  My first course of action would be to convert the array to a string so that I 
can parse it.  My command would be:

$color_list = explode(,, $color);

Now that I have a string of colors delimited by commas, I would like to parse the 
string and print out all my colors.  I have read the documentation on using the list() 
function but I find it confusing.  Can someone clear the fog from my mind please?

Thanks,
Don