RE: [PHP] Recursive Interpolation

2004-10-05 Thread Chuck Wolber
On Mon, 4 Oct 2004, Michael Sims wrote:

> Chuck Wolber wrote:
> > The method I've come up with in the meantime, I believe is much more
> > effective than heredocs, but still an ugly hack:
> >
> > function interpolate ($text, $msg_variable) {
> > $msg_key = '_FP_VAR_';
> >
> > foreach (array_keys($msg_variable) as $key) {
> > $token = $msg_key.$key;
> > $text = preg_replace("/$token/", "$msg_variable[$key]",
> > $text); }
> >
> > return ($text);
> > }
> 
> What's ugly about it?  I saw your earlier post I was actually planning 
> on responding and suggesting something exactly like you just came up 
> with.

The main problem (aside from performance, which you addressed) is that it 
does not handle corner cases such as when you want to use one of your 
variables within the text of the dispatch (escaping). It is also not 
truly recursive. 

>From a hacker standpoint, it extends the base PHP tool set, rather than 
making use of existing tools (not necessarily a bad thing). IMHO a 
non-ugly version of this would allow you to use standard PHP variables in 
your dispatch and force PHP itself to re-interpret the variables. This is 
why I think an interpolate() function would have to be built in to the 
base PHP interpreter rather than be done with the language itself. 


> I think it's fairly clean and logical.

Thank you :)



> The only problem I can see with this approach is that it's inefficient 
> as $msg_variable gets larger or the $text gets larger, since you're 
> iterating through every key of the former, even if the token isn't in 
> $text, and you run preg_replace() once for each token, but that 
> shouldn't hurt you unless you really have a heavy traffic site, IMHO.

Right, which is another reason my hack shouldn't be considered a 
generalized solution to the recursive interpolation problem. Any 
developers on the list want to comment on a possible interpolate() 
function?



> I toyed around with using preg_replace_callback() for this eariler, but 
> the only problem with it is that you can't create a callback that 
> accepts more than just one variable (the array of matches).  This means 
> I couldn't get the equivalent of your $msg_variable passed to the 
> callback, so I had to make it global in the callback function (yuk).  
> If it weren't for that it'd be a perfect solution, because 
> preg_replace_callback would only be called once and the function 
> wouldn't need to iterate through all of $msg_variable. It's times like 
> that that I miss Perl's more powerful variable scoping rules.  Ah 
> well...

Definitely cleaner and even appears (at first glance) that it lends itself 
to being recursive a lot easier than mine. Could you solve the global 
problem by doing a $this.msg_variable sort of thing within the callback?

-Chuck



-- 
http://www.quantumlinux.com 
 Quantum Linux Laboratories, LLC.
 ACCELERATING Business with Open Technology

 "The measure of the restoration lies in the extent to which we apply 
  social values more noble than mere monetary profit." - FDR

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



RE: [PHP] Help needed Postgresql and PHP

2004-10-05 Thread Warren Vail
Extracting name and addresses from postgres as a comma separated values
"CSV" file should be doable with postgress utilities or scripts.  Assuming
you have access to a word processor like Microsoft Word, that has a "Mail
Merge" capability, where your letter can be merged and printed with names
and addresses from your CSV file.

Factors affecting the wisdom of this approach are;
* The volume of letters you expect to print and the printers you expect to
use (bubble jet ink cartridges are expensive).
* If name and address are the only substitutions in the letter.  Greetings,
additional content may require more that a CSV solution.
* Special bulk mail requirements like zip code sort and selections should be
doable in postgres.
* For really large volumes you will need to break down the workload for
multiple printers in a fashion that makes sense.

If you want to reinvent the wheel by developing your own mail merge process,
I would recommend against it, unless there is some significant gain by doing
that.  I'm guessing that your have already considered this, but are looking
for some other solution for some reason that is not apparent to me.

Good Luck,

Warren Vail


-Original Message-
From: suma parakala [mailto:[EMAIL PROTECTED]
Sent: Monday, October 04, 2004 11:23 PM
To: [EMAIL PROTECTED]
Subject: [PHP] Help needed Postgresql and PHP

Hi
I am developing an application using php and postgresql . My problem is I
need to retrieve name and addresses from table(postgres sql table)  and
print letter (body of letter will be same). Kindly help /Suggest how i can
do this
Thanks
Suma

_
Looking for a soulmate?  http://www.shaadi.com/ptnr.php?ptnr=hmltag Log onto
Shaadi.com.

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

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



[PHP] validate a tag

2004-10-05 Thread Pahlevanzadeh Mohsen
Dear,I have a input text tag that it named question.
Also i have a 2 radio bottum.
When i receive their value,I want to test that
question tag is empty or not.If empty,I again send to
client until client fill out this tag.
Can u solve my problem?


";
   echo "Your question";
   echo "radio type ";
   echo "check box type ";
   echo "";
/*   if (empty($HTTP_POST_VARS['question']))
{
 echo "please fill out question field.";
 display_form();
}//end of if*/

  }//end of display_form func
 function test_var()
  {
   if (empty($HTTP_POST_VARS['question']))
{
 echo "please fill out question field.";
 display_form();
}//end of if

  }//end of func
 function insert_to_question()
  {
   display_form();
   while(empty($HTTP_POST_VARS['question']))
test_var();
  }//end of insert_to_question func
 insert_to_question();
?>


=
-DIGITAL  SIGNATURE---
///Mohsen Pahlevanzadeh
 Network administrator  & programmer 
  My home phone is: +98213810146  
My email address is  
  m_pahlevanzadeh at yahoo dot com   
My website is: http://webnegar.net





__
Do you Yahoo!?
New and Improved Yahoo! Mail - 100MB free storage!
http://promotions.yahoo.com/new_mail 

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



[PHP] Math problem with modulus

2004-10-05 Thread Christoph Schwadorf
Hello.

I have some problems with basic math in the function below. 

function Custom_Round($Digit, $Divisor) {
return (($Digit / $Divisor) - (($Digit % $Divisor) / $Divisor));
}

Custom_Round(23, 10) returns float(2) as expected.
Same for Custom_Round(22, 10).

BUT when you compare the both results like below
Custom_Round(23, 10)!=Custom_Round(22, 10)
I always get bool(true) whereas the result should be bool(false)

When I have debuged this small piece of code I found out that 
intval(Custom_Round(23, 10)) = 1
whats definitly not expected.
But intval(Custom_Round(22, 10)) = 2 as expected. 
Replacing Custom_Round() by Floor() works fine, but why does the custom
function doing the same not work? Is this a bug in PHP?

This problem occurse in PHP 4.3.3 and PHP 5.0.1.

Thanks for help,
Christoph

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



[PHP] checkbox arrays and validation

2004-10-05 Thread Angelo Zanetti
Hi all, 

this might be slightly off-topic in a way but Im looking for help not
flaming.

Ok I have a checkbox array that I populate from a DB using php:

while ($row = mysql_fetch_array($result))
  echo("" . $row['models_type'] . "");

So when I want to see each variable in the array I use:

foreach ($_POST['chkmodels'] as $c)
{
echo(" value: " . $c);
}

this is fine. 

but what I want to clarify is that if I change my PHP echo statement
to:

echo("" . $row['models_type'] . "");

basically without the [] then it is still recognised as an array. But
when the array is passed back it is returned as a string separated by
commas. Then I should use the split() function to create an array.
IE:

$modelsArray = split('[,]', $chkmodels);

however when I try the second way (without the [])

like this:

if(isset($_POST['chkmodels']))
$selModels=$_POST['chkmodels']; 
else
header("Location: ../freesample.php");



if(isset($selModels))
{

echo("selmodels: " .$selModels);
$selModelsInd = split('[,]',$selModels);
echo("Ind modesl" . $selModelsInd);
foreach ($selModelsInd as $c)
{
echo(" value: " . $c);
}
}


I get the following results, when I select 2 checkboxes:

selmodels: 2
Ind modeslArray
value: 2

this is wrong and should output the following:

selmodels: 2
Ind modeslArray
value: 1
value: 2

as the values of the selected checkboxes are 1 and 2 and also there are
two that are selected.

Here is the OT part. how do I reference the checkboxes in javascript if
the chkmodels[] is used?

I have tried many things like:

myCheckboxArray = document.forms[0].elements["chkmodels[]"];

and 

myCheckboxArray = document.frmft[0].elements["chkmodels[]"]; //where
frmft is the name of my form.

If someone could please advise me as to what I'm doing wrong or why the
information is not being outputted as expected, that would be really
helpful.

thanks in advance
Angelo


Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Technikon or the sender 
of this e-mail be liable to any party for any direct, indirect, 
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

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



RE: [PHP] checkbox arrays and validation

2004-10-05 Thread Ford, Mike
On 05 October 2004 11:10, Angelo Zanetti wrote:

> Hi all,
> 
> this might be slightly off-topic in a way but Im looking for help not
> flaming. 
> 
> Ok I have a checkbox array that I populate from a DB using php:
> 
> while ($row = mysql_fetch_array($result))
>   echo("" . $row['models_type'] . "");
> 
> So when I want to see each variable in the array I use:
> 
>   foreach ($_POST['chkmodels'] as $c)
>   {
>   echo(" value: " . $c);
>   }
> 
> this is fine.
> 
> but what I want to clarify is that if I change my PHP echo statement
> to: 
> 
> echo("" . $row['models_type'] . "");
> 
> basically without the [] then it is still recognised as an array. But
> when the array is passed back it is returned as a string separated by
> commas.

No, this is incorrect.  You will see only the last value selected, returned
as a simple scalar.  PHP doesn't do automatic array-ification of multiple
values -- that's why you need the [] in the name attribute.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



Re: [PHP] checkbox arrays and validation

2004-10-05 Thread John Holmes
Angelo Zanetti wrote:
but what I want to clarify is that if I change my PHP echo statement
to:
echo("" . $row['models_type'] . "");
basically without the [] then it is still recognised as an array. But
when the array is passed back it is returned as a string separated by
commas. Then I should use the split() function to create an array.
If you leave off the [], then only the last checkbox value remains in 
$_POST['chkmodels']. It is not passed as a comma separated string.

If you look at the query string, you'll see something like this:
?chkmodels=1&chkmodels=2
which means PHP makes $_POST['chkmodels'] equal to 1 for the first 
variable, then sets the same $_POST['chkmodels'] equal to 2 for the 
second variable in the query string. End result is one value (not an 
array) remaining in $_POST['chkmodels'].

--
---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


Re: [PHP] checkbox arrays and validation

2004-10-05 Thread Marek Kilimajer
Angelo Zanetti wrote:
Here is the OT part. how do I reference the checkboxes in javascript if
the chkmodels[] is used?
I have tried many things like:
myCheckboxArray = document.forms[0].elements["chkmodels[]"];
The above should work. Is it really the first form on the page?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: Math problem with modulus

2004-10-05 Thread M. Sokolewicz
Christoph Schwadorf wrote:
Hello.
I have some problems with basic math in the function below. 

function Custom_Round($Digit, $Divisor) {
return (($Digit / $Divisor) - (($Digit % $Divisor) / $Divisor));
}
Custom_Round(23, 10) returns float(2) as expected.
Same for Custom_Round(22, 10).
BUT when you compare the both results like below
Custom_Round(23, 10)!=Custom_Round(22, 10)
I always get bool(true) whereas the result should be bool(false)
When I have debuged this small piece of code I found out that 
intval(Custom_Round(23, 10)) = 1
whats definitly not expected.
But intval(Custom_Round(22, 10)) = 2 as expected. 
Replacing Custom_Round() by Floor() works fine, but why does the custom
function doing the same not work? Is this a bug in PHP?

This problem occurse in PHP 4.3.3 and PHP 5.0.1.
Thanks for help,
Christoph
intval converts other types to integers. Integers can only be whole 
numbers, eg 1, 2, 15, -789, etc. No matter what decimals, intval 
converts it to the lower (closer to 0) integer value. Eg 2.5 => 2, 
19.9=>19, -25.3 => -25 etc.

What happens now is that you're converting a float to an integer, 
float=>integer conversion has a lot of "problems", floating point 
numbers have a lot more precision. Numbers given as being float(2) can 
actually be something of the like 
1.99, and when converted to intgers, 
they drop down to 1 instead of 2.

This is explained here:
http://www.php.net/manual/en/language.types.integer.php#language.types.integer.casting.from-float
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] checkbox arrays and validation

2004-10-05 Thread Angelo Zanetti
its the only form on the page...

Based on the other responses I will have to use chkmodels[] and need to
get the javascript working. Is it not possible to use the forms name
when referencing the array?

thank again.
Angelo

>>> Marek Kilimajer <[EMAIL PROTECTED]> 10/5/2004 1:52:02 PM >>>
Angelo Zanetti wrote:
> Here is the OT part. how do I reference the checkboxes in javascript
if
> the chkmodels[] is used?
> 
> I have tried many things like:
> 
> myCheckboxArray = document.forms[0].elements["chkmodels[]"];

The above should work. Is it really the first form on the page?


Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Technikon or the sender 
of this e-mail be liable to any party for any direct, indirect, 
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

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



Re: [PHP] checkbox arrays and validation

2004-10-05 Thread Marek Kilimajer
Angelo Zanetti wrote:
its the only form on the page...
Based on the other responses I will have to use chkmodels[] and need to
get the javascript working. Is it not possible to use the forms name
when referencing the array?
You should be able to use:
document.formName
document.forms[0]
document.forms['formName']
thank again.
Angelo

Marek Kilimajer <[EMAIL PROTECTED]> 10/5/2004 1:52:02 PM >>>
Angelo Zanetti wrote:
Here is the OT part. how do I reference the checkboxes in javascript
if
the chkmodels[] is used?
I have tried many things like:
myCheckboxArray = document.forms[0].elements["chkmodels[]"];

The above should work. Is it really the first form on the page?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] checkbox arrays and validation

2004-10-05 Thread Angelo Zanetti
Hi Marek, 

I try to access the array like this:

 document.frmft.elements["chkmodels[]"];

but doesnt work. I also tried this:

models = document.forms['frmft'].elements["chkmodels[]"];

is there not a problem with the elements part?

thanks


>>> Marek Kilimajer <[EMAIL PROTECTED]> 10/5/2004 2:19:26 PM >>>
Angelo Zanetti wrote:
> its the only form on the page...
> 
> Based on the other responses I will have to use chkmodels[] and need
to
> get the javascript working. Is it not possible to use the forms name
> when referencing the array?

You should be able to use:

document.formName
document.forms[0]
document.forms['formName']

> 
> thank again.
> Angelo
> 
> 
Marek Kilimajer <[EMAIL PROTECTED]> 10/5/2004 1:52:02 PM >>>
> 
> Angelo Zanetti wrote:
> 
>>Here is the OT part. how do I reference the checkboxes in javascript
> 
> if
> 
>>the chkmodels[] is used?
>>
>>I have tried many things like:
>>
>>myCheckboxArray = document.forms[0].elements["chkmodels[]"];
> 
> 
> The above should work. Is it really the first form on the page?

Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Technikon or the sender 
of this e-mail be liable to any party for any direct, indirect, 
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

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



RE: [PHP] checkbox arrays and validation

2004-10-05 Thread Ford, Mike
On 05 October 2004 13:55, Angelo Zanetti wrote:

> Hi Marek,
> 
> I try to access the array like this:
> 
>  document.frmft.elements["chkmodels[]"];
> 
> but doesnt work. I also tried this:
> 
> models = document.forms['frmft'].elements["chkmodels[]"];
> 
> is there not a problem with the elements part?

So long as your form goes something like:

  
Value 1
Value 2
Value 3
...
  

you can refer to the checkboxes simply as

   document.frmft["chkmodels[]"]

This is the way I've always done it, and it's always worked a treat.

Of course, in this situation this will give you an array of checkbox objects which you 
then have to index into, but that's a whole other story.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED]
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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



[PHP] Re: email templating system

2004-10-05 Thread Manuel Lemos
Hello,
On 10/04/2004 10:35 PM, Adwinwijaya wrote:
Currently I use Smarty for page templating system, and I am happy with
this. But is there any way to produce a file with smarty instead of
displaying it as a page.
I want to use this as email templating, I want to create an email and
I have a template like smarty and I want to assign it just like
smarty. Is there any templating system that suitable for me ?
You can use Smarty also for e-mail, either sending text or HTML.
You may want to take a look at this e-mail message composing and sending 
class that even comes with an example of how to send personalized 
messages in HTML and/or text that use Smarty to compose their content:

http://www.phpclasses.org/mimemessage
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Session Problem

2004-10-05 Thread Kevin Javia
Hi there,

I have got PHP 5 installed on IIS6 with 'register_globals = on'.

When run my page with session variable at top of the page



I got notice like "Notice: Undefined index: _user in E:\Projects\."

What can be the reason and what is the solution? _user variable is not
registered before.

Thanks a ton for reading this far.

Kevin.

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



Re: [PHP] Session Problem

2004-10-05 Thread raditha dissanayake
Kevin Javia wrote:
Hi there,
I have got PHP 5 installed on IIS6 with 'register_globals = on'.
 

consider switching it off. your application will be impossible to 
install on any other server if you keep working on it with register 
global s on.

When run my page with session variable at top of the page

$_SESSION['_user'] == ""
..
?>
 

Is your syntax correct if you want to set a value for this you need to 
use '=' and not '=='

I got notice like "Notice: Undefined index: _user in E:\Projects\."
 

this is just a warning, you can disable it or write it to the log file 
instead of the browser by editing your php.ini

What can be the reason and what is the solution? _user variable is not
registered before.
 

The fact that it's not registered and that you are using it in a 
comparision operation is what's caused the engine to give you a warning.

Thanks a ton for reading this far.
Kevin.
 


--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] checkbox arrays and validation

2004-10-05 Thread Angelo Zanetti
thanks Mike, 

worked like a charm!! 

and thanks to the others who replied!



>>> "Ford, Mike" <[EMAIL PROTECTED]> 10/5/2004 3:09:32 PM >>>
On 05 October 2004 13:55, Angelo Zanetti wrote:

> Hi Marek,
> 
> I try to access the array like this:
> 
>  document.frmft.elements["chkmodels[]"];
> 
> but doesnt work. I also tried this:
> 
> models = document.forms['frmft'].elements["chkmodels[]"];
> 
> is there not a problem with the elements part?

So long as your form goes something like:

  
Value 1
Value 2
Value 3
...
  

you can refer to the checkboxes simply as

   document.frmft["chkmodels[]"]

This is the way I've always done it, and it's always worked a treat.

Of course, in this situation this will give you an array of checkbox
objects which you then have to index into, but that's a whole other
story.

Cheers!

Mike

-
Mike Ford,  Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Headingley Campus, LEEDS,  LS6 3QS,  United Kingdom
Email: [EMAIL PROTECTED] 
Tel: +44 113 283 2600 extn 4730  Fax:  +44 113 283 3211 

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


Disclaimer 
This e-mail transmission contains confidential information,
which is the property of the sender.
The information in this e-mail or attachments thereto is 
intended for the attention and use only of the addressee. 
Should you have received this e-mail in error, please delete 
and destroy it and any attachments thereto immediately. 
Under no circumstances will the Cape Technikon or the sender 
of this e-mail be liable to any party for any direct, indirect, 
special or other consequential damages for any use of this e-mail.
For the detailed e-mail disclaimer please refer to 
http://www.ctech.ac.za/polic or call +27 (0)21 460 3911

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



Re: [PHP] Recursive Interpolation

2004-10-05 Thread l0t3k
if you check the internals archive, i think Sara said she had an
interpolator on her plate...


"Chuck Wolber" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On Mon, 4 Oct 2004, Michael Sims wrote:
>

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



[PHP] Procmail + PHP Problem

2004-10-05 Thread Hidayet Dogan
Hi,

I wrote a small PHP script that reads input from php://stdin. And, i'm
using it in .procmailrc (with using pipe) to get e-mail content and parse.
The problem is PHP script does not read "body" part of e-mails.
Reading process stops before the "body" part of e-mail (i can get
all other header parts).

I've tested it with sending e-mail via firefox, pine, outlook. But i got
same result.

Here is the reading part of the script:
...
...
$fp = fopen("php://stdin", "r");
while (!feof($fp))
  $email .= fgets($fp, 8192);
fclose($fp);
...
...

I also tried it with using "fread" function instead of "fgets", got same
result, used "STDIN" constant and "/dev/stdin" instead of "php://stdin",
got same result.

.procmailrc part is:
...
...
| /home/hdogan/test.php
...
...

My server is running with Postfix 2.x and PHP 4.3.0 (CLI).

I think there is a EOF character before starting body part of e-mail
content. But it was running well when i tried months ago on different
server (MTA server was same - postfix).

Do you have any idea or solition for this issue?

Thanks,

 Hidayet Dogan
  [EMAIL PROTECTED]

Pleksus Bilisim Teknolojileri D.T.O. A.S.
--
caldiran sok. 14/6 06420 kolej ankara * www.pleksus.com.tr
tel : +90 312 4355343 * faks: +90 312 4354006

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



[PHP] PEAR & Auth

2004-10-05 Thread Pahlevanzadeh Mohsen
I was working with Auth class.That was working good.
But i receive following errror:
Fatal error: Undefined class name 'db' in
/var/www/html/votting/Auth/Container/DB.php on line
130
Please guide me.

=
-DIGITAL  SIGNATURE---
///Mohsen Pahlevanzadeh
 Network administrator  & programmer 
  My home phone is: +98213810146  
My email address is  
  m_pahlevanzadeh at yahoo dot com   
My website is: http://webnegar.net




___
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com

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



Re: [PHP] validate a tag

2004-10-05 Thread Greg Donald
On Tue, 5 Oct 2004 01:59:12 -0700 (PDT), Pahlevanzadeh Mohsen
<[EMAIL PROTECTED]> wrote:
> Dear,I have a input text tag that it named question.
> Also i have a 2 radio bottum.
> When i receive their value,I want to test that
> question tag is empty or not.If empty,I again send to
> client until client fill out this tag.
> Can u solve my problem?

Do you know about isset() or empty() ?  


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



[PHP] Re: PEAR & Auth

2004-10-05 Thread M. Sokolewicz
Pahlevanzadeh Mohsen wrote:
I was working with Auth class.That was working good.
But i receive following errror:
Fatal error: Undefined class name 'db' in
/var/www/html/votting/Auth/Container/DB.php on line
130
Please guide me.
=
-DIGITAL  SIGNATURE---
///Mohsen Pahlevanzadeh
 Network administrator  & programmer 
  My home phone is: +98213810146  
My email address is  
  m_pahlevanzadeh at yahoo dot com   
My website is: http://webnegar.net



___
Do you Yahoo!?
Declare Yourself - Register online to vote today!
http://vote.yahoo.com
install Pear::DB
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PHP "make install" writes to httpd.conf

2004-10-05 Thread Greg Donald
On Mon, 04 Oct 2004 18:32:01 -0400, Robert Cummings
<[EMAIL PROTECTED]> wrote:
> Anyway to choke PHP's behaviour of adding the following to httpd.conf
> when you make install:
> 
> LoadModule php4_module /some_dumb_location/libphp4.so

Before make install do:
cp httpd.conf httpd.conf.bak

Then after do:
cp httpd.conf.bak httpd.conf

I usually just tar up my whole /etc before I ever install anything
new.  Backups are good.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



[PHP] Read word documents on a Linux server

2004-10-05 Thread Jacob Larsen
Can I via Php read word documents on a Linux server?
I see COM, but that's only available for the Windows version of PHP.
Thanks,
Jacob
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] PEAR & Auth

2004-10-05 Thread Greg Donald
On Tue, 5 Oct 2004 07:06:53 -0700 (PDT), Pahlevanzadeh Mohsen
<[EMAIL PROTECTED]> wrote:
> I was working with Auth class.That was working good.
> But i receive following errror:
> Fatal error: Undefined class name 'db' in
> /var/www/html/votting/Auth/Container/DB.php on line
> 130
> Please guide me.

Where's your code?


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



RE: [PHP] Recursive Interpolation

2004-10-05 Thread Michael Sims
Chuck Wolber wrote:
> On Mon, 4 Oct 2004, Michael Sims wrote:
>> What's ugly about it?  I saw your earlier post I was actually
>> planning on responding and suggesting something exactly like you
>> just came up with.
>
> The main problem (aside from performance, which you addressed) is
> that it does not handle corner cases such as when you want to use one
> of your variables within the text of the dispatch (escaping).

I think the answer to that is to use a token delimiter that is unlikely to ever
appear literally.  In my implementation I look for tokens that appear between ?: and
:?.  The token is only replaced if it appears in my data array.  The likelihood that
I'll need a literal word surrounded by my delimiters that is also an existing token
in my array is low enough to be negligible, IMHO.

> It is
> also not truly recursive.

Maybe I'm not fully understanding the problem, but I don't see where recursion
enters into it.  Do you want the interpolate() function to call itself again when it
comes across uninterpolated tokens within a token?  Even PHP's own double-quote
interpolation doesn't work like that.  In the string "this is a $variable" the
$variable has to have already been defined at the time the string is evaluated...IOW
you cannot delay interpolation even in pure PHP code without using eval().  Can you
explain what you mean by "truly recursive" and give an example where it might be
useful?

> From a hacker standpoint, it extends the base PHP tool set, rather
> than making use of existing tools (not necessarily a bad thing). IMHO
> a non-ugly version of this would allow you to use standard PHP
> variables in your dispatch and force PHP itself to re-interpret the
> variables. This is why I think an interpolate() function would have
> to be built in to the base PHP interpreter rather than be done with
> the language itself.

I can see a value in having such a function, even if I personally wouldn't use it to
solve the problem you have described.  At least with my current, possibly incorrect
understanding of it. :)

> Any
> developers on the list want to comment on a possible interpolate()
> function?

Most of the PHP devs don't read this list.  You could post to the internals list,
although as another poster has already pointed out, this has been discussed there
already:

http://marc.theaimsgroup.com/?l=php-dev&m=109397509903069&w=2

The poster in that thread used eval() for this, which is another option if you
haven't already considered it.

>> I toyed around with using preg_replace_callback() for this eariler,
>> but the only problem with it is that you can't create a callback that
>> accepts more than just one variable (the array of matches).  This
>> means I couldn't get the equivalent of your $msg_variable passed to
>> the callback, so I had to make it global in the callback function
>> (yuk). If it weren't for that it'd be a perfect solution, because
>> preg_replace_callback would only be called once and the function
>> wouldn't need to iterate through all of $msg_variable. It's times
>> like that that I miss Perl's more powerful variable scoping rules.
>> Ah well...
>
> Definitely cleaner and even appears (at first glance) that it lends
> itself to being recursive a lot easier than mine. Could you solve the
> global problem by doing a $this.msg_variable sort of thing within the
> callback?

No.  You can use a method for the callback, but it has to be static, which means no
instance methods therefore you're still stuck with globals.  Here was my version,
FWIW (watch for wrapping):

function processTemplate($text) {
  return preg_replace_callback(
'/\?:(.*?):\?/',
  create_function(
'$matches',
'global $values; return isset($values[$matches[1]]) ? $values[$matches[1]] :
$matches[0];'
  ),
$text
  );
}

Having to use a global bothers me far more than calling preg_replace() multiple
times. YMMV.

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



[PHP] Re: validate a tag

2004-10-05 Thread Ben Ramsey
I just glanced at your code, and your usage of empty() looks correct and 
should work just fine. However, you're calling the function recursively 
(from within itself), so you'll probably wind up in a loop. Pull that 
test out and do it at the top of your script instead of within the function.

I've also found that empty() sometimes doesn't work well with form 
values, so you may want to test with 
(strlen(trim($HTTP_POST_VARS['question'])) > 0) instead.


Pahlevanzadeh Mohsen wrote:
Dear,I have a input text tag that it named question.
Also i have a 2 radio bottum.
When i receive their value,I want to test that
question tag is empty or not.If empty,I again send to
client until client fill out this tag.
Can u solve my problem?
";
   echo "Your question";
   echo "radio type ";
   echo "check box type ";
   echo "";
/*   if (empty($HTTP_POST_VARS['question']))
{
 echo "please fill out question field.";
 display_form();
}//end of if*/
  }//end of display_form func
 function test_var()
  {
   if (empty($HTTP_POST_VARS['question']))
{
 echo "please fill out question field.";
 display_form();
}//end of if
  }//end of func
 function insert_to_question()
  {
   display_form();
   while(empty($HTTP_POST_VARS['question']))
test_var();
  }//end of insert_to_question func
 insert_to_question();
?>
--
Regards,
Ben Ramsey
http://benramsey.com
---
http://www.phpcommunity.org/
Open Source, Open Community
Visit for more information or to join the movement.
---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: validate a tag

2004-10-05 Thread Ben Ramsey
Pahlevanzadeh Mohsen wrote:
Dear,I have a input text tag that it named question.
Also i have a 2 radio bottum.
When i receive their value,I want to test that
question tag is empty or not.If empty,I again send to
client until client fill out this tag.
Can u solve my problem?
I also forgot to mention that you may want to consider using 
PEAR::HTML_QuickForm as a way to rapidly develop forms that also 
provides form validation.

http://pear.php.net/package/HTML_QuickForm
--
Regards,
Ben Ramsey
http://benramsey.com
---
http://www.phpcommunity.org/
Open Source, Open Community
Visit for more information or to join the movement.
---
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


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

2004-10-05 Thread Greg Donald
On Tue, 5 Oct 2004 09:55:20 +0530, Gnanavel <[EMAIL PROTECTED]> wrote:
> 8. 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.

I think it would be good to recommend the use of a "threaded" email
client when participating in the PHP mailing lists.  Most every mail
client I've ever used has this threaded message viewing capability,
people just don't seem to make use of it.  It's fairly annoying to see
someone come along days after a post is answered and provide the exact
same answer again.

Mailing list threads are best viewed as threads, not single messages.

If you need a threaded email client, I can invite you to a good one,
GMail.  Contact me off-list.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



[PHP] mapping a directory to a script like a servlet

2004-10-05 Thread Roger Hyam

Hi,

I hope some one out there can help me. I have been looking around for a solution to 
this and just getting confused.

I want to run a php script like it was a servlet. At the moment I have a little 
application where the urls look like this:

http://www.mysite.com/index.php?current_page=contact

but I would like them to look like this:

http://www.mysite.com/contact

so I have mapped / to the index.php script and then pick up the remaining path some 
how.

I have done this kind of thing before with servlets and asp.net but can't figure how 
to do it with Apache + PHP. I was looking at mod_rewrite but then got scared!

Any help most welcome.

Thanks,

Roger

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



Re: [PHP] mapping a directory to a script like a servlet

2004-10-05 Thread Petar Nedyalkov
On Tuesday 05 October 2004 18:03, Roger Hyam wrote:
> Hi,
>
> I hope some one out there can help me. I have been looking around for a
> solution to this and just getting confused.
>
> I want to run a php script like it was a servlet. At the moment I have a
> little application where the urls look like this:
>
> http://www.mysite.com/index.php?current_page=contact
>
> but I would like them to look like this:
>
> http://www.mysite.com/contact
>
> so I have mapped / to the index.php script and then pick up the remaining
> path some how.
>
> I have done this kind of thing before with servlets and asp.net but can't
> figure how to do it with Apache + PHP. I was looking at mod_rewrite but
> then got scared!

mod_rewrite is the easiest solution ;-) just don't get scared but read the 
man.

>
> Any help most welcome.
>
> Thanks,
>
> Roger

-- 
Cyberly yours,
Petar Nedyalkov
Devoted Orbitel Fan :-)
-
Orbitel - the New Generation Telecom! See www.orbitel.bg.


pgpQQNaU2XUAf.pgp
Description: signature


Re: [PHP] mapping a directory to a script like a servlet

2004-10-05 Thread Greg Donald
On Tue, 5 Oct 2004 08:03:55 -0700 (PDT), Roger Hyam <[EMAIL PROTECTED]> wrote:
> I have done this kind of thing before with servlets and asp.net but can't figure how 
> to do it
> with Apache + PHP. I was looking at mod_rewrite but then got scared!

That's the way I've done it in the past.

A friend of mine wrote some code (which I don't have) using the $argv
array that did the same thing but it didn't use mod_rewrite.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



[PHP] opendir and IIS

2004-10-05 Thread ccma
Hi All,

Currently Im battling a opendir on IIS(2003 server).

The manual says to set your path to "\\server\share\directory"
So i set it up
$path="zice\\itdept\$\\Mis";

Setting it that way results in:

"failed to open dir: Invalid argument" error.

tried reversing the slashes, same deal. tried via mapped drive letter,
same deal.

Anyone know the exact phrasing that will work for me? I have r,w,
directory browsing set on the shared servers dir for both the remote
IIS machine name as well as the IWPG account of the remote machine.

Thanks,

-ccma

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



Re: [PHP] opendir and IIS

2004-10-05 Thread Greg Donald
On Tue, 5 Oct 2004 10:22:56 -0500, ccma <[EMAIL PROTECTED]> wrote:
> Anyone know the exact phrasing that will work for me? I have r,w,
> directory browsing set on the shared servers dir for both the remote
> IIS machine name as well as the IWPG account of the remote machine.

I fixed this issue previously by mapping the share as a drive then
accessing it like:

"H:\\path\\to\\share"


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Read word documents on a Linux server

2004-10-05 Thread raditha dissanayake
Jacob Larsen wrote:
Can I via Php read word documents on a Linux server?
I haven't tried this but I guess probably not. My suggestion would be to 
look at the star office sdk from sun you will need to use java though.

I see COM, but that's only available for the Windows version of PHP.
Thanks,
Jacob

--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Session Problem

2004-10-05 Thread Brian
Make sure you are doing a session_start first.


On Tue, 5 Oct 2004 19:00:57 +0530, Kevin Javia <[EMAIL PROTECTED]> wrote:
> Hi there,
> 
> I have got PHP 5 installed on IIS6 with 'register_globals = on'.
> 
> When run my page with session variable at top of the page
> 
>  $_SESSION['_user'] == ""
> ..
> ?>
> 
> I got notice like "Notice: Undefined index: _user in E:\Projects\."
> 
> What can be the reason and what is the solution? _user variable is not
> registered before.
> 
> Thanks a ton for reading this far.
> 
> Kevin.
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

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



Re: [PHP] Can anyone help me with Attachments?

2004-10-05 Thread PHP Junkie
Ave,

I didn't find any php warnings... Instead there was a whole bunch of coding
much of which seemed like junk. I ran a search but no php warnings
anywhere.. When I open the pdf in a text editor.

What else can be wrong?

Thanks,
Junkie


On 10/4/04 4:46 PM, "Marek Kilimajer" <[EMAIL PROTECTED]> wrote:

> PHP Junkie wrote:
>> Ave,
>> 
>> I'm trying to send Attachments via a mail script... The only problem is, my
>> attached files go corrupted or damaged, and I don't understand why! Can
>> anyone help me? I've already made 2 posts earlier with my code and all and
>> no one responded. Really need some help here.
> 
> View the attachment in a text editor, you might see php warnings in it.
> 
> 

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



RE: [PHP] Can anyone help me with Attachments?

2004-10-05 Thread Jay Blanchard
[snip]
I didn't find any php warnings... Instead there was a whole bunch of
coding
much of which seemed like junk. I ran a search but no php warnings
anywhere.. When I open the pdf in a text editor.
[/snip]

So, you saw the binary information in the text editor? Can you open the
file with Adobe?

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



Re: [PHP] Recursive Interpolation

2004-10-05 Thread Chuck Wolber

Ah yes, thanks. Looks like it's mentioned here:

http://marc.theaimsgroup.com/?l=php-dev&m=109405450709578&w=2

Doesn't look like it's going to happen too soon though based on Sara's 
comment: "and I havn't personally had the motivation to actually get it 
done."

Looks like there's some traction for something like this. That's a good 
first step :)

-Chuck


On Tue, 5 Oct 2004, l0t3k wrote:

> if you check the internals archive, i think Sara said she had an
> interpolator on her plate...
> 
> 
> "Chuck Wolber" <[EMAIL PROTECTED]> wrote in message
> news:[EMAIL PROTECTED]
> > On Mon, 4 Oct 2004, Michael Sims wrote:
> >
> 
> 

-- 
http://www.quantumlinux.com 
 Quantum Linux Laboratories, LLC.
 ACCELERATING Business with Open Technology

 "The measure of the restoration lies in the extent to which we apply 
  social values more noble than mere monetary profit." - FDR

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



Re: [PHP] Can anyone help me with Attachments?

2004-10-05 Thread Marek Kilimajer
PHP Junkie wrote:
Ave,
I didn't find any php warnings... Instead there was a whole bunch of coding
much of which seemed like junk. I ran a search but no php warnings
anywhere.. When I open the pdf in a text editor.
Send a text file as an attachement, it will be easier to spot the error. 
You can then run diff on original and attachement.

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


Re: [PHP] Can anyone help me with Attachments?

2004-10-05 Thread PHP Junkie
Ave,

Exactly, that's the problem. I can very well see the binary information in
the attached PDF in a text editor ... But when I open it in Adobe... The
file does open, it's just that it's all blank. White pages. All wiped off.
All information erased!!


On 10/5/04 12:21 PM, "Jay Blanchard" <[EMAIL PROTECTED]>
wrote:

> [snip]
> I didn't find any php warnings... Instead there was a whole bunch of
> coding
> much of which seemed like junk. I ran a search but no php warnings
> anywhere.. When I open the pdf in a text editor.
> [/snip]
> 
> So, you saw the binary information in the text editor? Can you open the
> file with Adobe?
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

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



Re: [PHP] Question about handling credit cards

2004-10-05 Thread Gary Hotko
   Could you provide more information, code example or a how to to do this..

Thanks

On Mon, 04 Oct 2004 15:03:31 -0700, Matthew Fonda <[EMAIL PROTECTED]> wrote:
> The best way to store credit card numbers is to have them encrypted when
> they are stored in the database, and decrypted when they need to be
> used, that way it will be safer for the most part
> 
> On Mon, 2004-10-04 at 14:49, Ed Lazor wrote:
> > I'm looking at online stores and it seems like a lot of them maintain copies
> > of credit card numbers.  Is this true?  That seems like a "bad thing" to me,
> > especially in terms of liability and risk of hackers.  On the flip side, it
> > seems like there are legitimate reasons.  For example, if you bill the
> > customer when products ship, rather than when the order is received.  Or, if
> > the customer decides to have instock items ship now and back ordered items
> > ship when they arrive - which results in two shipping charges.
> >
> > How do you guys handle this?
> >
> > -Ed
> -- 
> Regards,
> Matthew Fonda
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

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



Re: [PHP] Can anyone help me with Attachments?

2004-10-05 Thread PHP Junkie
Ave,

The text file went through fine! Absolutely perfect... I attached a normal
text file with just one sentence. I sent it and it arrived in my mailbox
without any problems.. It opened and it had the sentence.. And no warnings
or errors.

Using my code, I'm able to send the HTML mail with 2 attachments. Everything
is fine except that the pdf attachments are just blank and corrupted. One
thing I would like to point out is that I'm only trying to send PDF files.
The purpose of my code is to send PDF files only, not any other type.


Here's my code.. 

This is the form to gather data:

 method=post
ENCTYPE="multipart/form-data" name="f1" id="f1" >

  
From
(Name):

  
  
From
(Email):

  
  
To
(First,Last):


  
  
To
(Email):

  
  
Subject:

  
  
Attachment
1 

  
  
Attachment
2 

  



  


And this is the PHP Code that handles the mail & attachment:

Test";
 $message_html = stripslashes($message_html);
 $message_text = "Informed Sources Inc.";
 $m = new CMIMEMail("$to_nameF $to_nameL <$to>","$from_name
<$from>",$subject);
 $m->mailbody($message_text, $message_html);
 if( $file1) {
 $m->attachFile_raw($file1,$file1_name,$file1_type);
 };
 if( $file2) {
 $m->attachFile_raw($file2,$file2_name,$file2_type);
 };
 $m->send();
?>

mailbody("This is simply text","This is HTML
text");
* $m->attach("example.html","text/html",$filebody);
* $m->attachFile("resume.gif","image/gif");
* $m->send();
*/

class CMIMEMail {
 var $to;
 var $boundary;
 var $smtp_headers;
 var $filename_real;
 var $body_plain;
 var $body_html;
 var $atcmnt;
 var $atcmnt_type;
 
 function CMIMEMail($to,$from,$subject,$priority=3) {
   $this->to=$to; $this->from=$from;
   $this->subject=$subject; $this->priority=$priority;
   $this->boundary="=_NextPart_".time()."_".md5(time())."_";
 }
 function  mailbody( $plain, $html="" ) {
   $this->body_plain=$plain;
   $this->body_html=$html;
 }
 function  attach( $name, $content_type, $data ) {
 }
 function  attachfile_raw( $fname, $mailFileName, $content_type ) {
   if([EMAIL PROTECTED]($fname,"r")) {
$this->atcmnt[$mailFileName]=fread($f,filesize($fname));
$this->atcmnt_type[$mailFileName]=$content_type;
fclose($f);
  } 
 }
 function  attachfile( $fname, $content_type ) {
attachfile_raw($fname,$fname,$content_type);
 }

 function  clear() {
   unset( $atcmnt );
   unset( $atcmnt_type );
 }
 
 function  makeheader() {
   $out ="From: ".$this->from."\n";
   $out.="Reply-To: ".$this->from."\n";
   $out.="MIME-Version: 1.0\n".
"Content-Type: multipart/mixed;\n\t boundary=\"".$this->boundary."\"\n".
"X-Priority: ".$this->priority."\n".
"X-Mailer: phpMimeMail ( http://www.informed-sources.com/ )\n";
   return $out;
 }
 function  makebody() {
   $boundary2= "=_NextAttachedPart_".time()."_".md5(time()+101)."_";
   $out="";
   if( " ".$this->body_html!=" " ) {
 $out="\nThis is a multi-part message in MIME format.\n\n";
 $out.="--".$this->boundary."\nContent-Type:
multipart/alternative;\n\tboundary=\"$boundary2\"\n";
 $out.="$body_plan\n".
   "--$boundary2\nContent-Type: text/plain\n".
#   "Content-Disposition: inline\n".
   "Content-Transfer-Encoding: quoted-printable\n\n".
   $this->body_plain.
   "\n\n--$boundary2\n".
   "Content-Type: text/html\n".
#   "Content-Disposition: attachment;\n\tfilename=\"message.html\"\n".
   "Conent-Transfer-Encoding: quoted-printable\n".
   "\n$this->body_html\n\n".
   "--$boundary2--\n";
   } else {
 $out="\n\n".$this->body_plain."\n\n";
 $out.="--".$this->boundary."\n".
"Content-Type: text/plain\n".
"Content-Transfer-Encoding: quoted-printable\n\n".
$this->body_plain.
"\n\n--".$this->boundary.
"\n";
   }
   if( is_array( $this->atcmnt_type ) ) {
 reset( $this->atcmnt_type);
 while( list($name, $content_type) = each($this->atcmnt_type) ) {
   $out.="\n--".$this->boundary."\nContent-Type:
$content_type\nContent-Transfer-Encoding: base64\nContent-Disposition:
attachment; filename=\"$name\"\n\n".
 chunk_split(base64_encode($this->atcmnt[$name]))."\n";
 }   
   }
   $out.="\n--".$this->boundary."--\n";
   return $out;
 }
 function  send(){
   echo "";
   mail( $this->to, $this->subject, $this->makebody(),$this->makeheader() );
   
 }
}

?>


On 10/5/04 12:24 PM, "Marek Kilimajer" <[EMAIL PROTECTED]> wrote:

> PHP Junkie wrote:
>> Ave,
>> 
>> I

[PHP] Re: UPS Online Tools and PHP?

2004-10-05 Thread Manuel Lemos
Hello,
On 10/04/2004 08:34 PM, Ed Lazor wrote:
Has anyone integrated the UPS Online Tools with their site using PHP?
 

http://www.ups.com/content/us/en/bussol/offering/technology/automated_shippi
ng/online_tools.html
You may want to take a look at this class that supports UPS:
http://www.phpclasses.org/shiptrack

--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: [PHP Attachement Problems

2004-10-05 Thread Manuel Lemos
Hello,
On 10/04/2004 10:24 AM, Php Junkie wrote:
I created a form which can accept 2 file attachments and send an HTML
Email... Everything works great... The files even get attached and sent, the
ONLY problem is... The PDF file I'm sending attached open up empty! They are
all blank.. Like everything has been wiped off from them!!
It sounds like it is arriving corrupted.
You may want to try this other class you can used for the same purpose 
and AFAIK does not corrupt attachments:

http://www.phpclasses.org/mimemessage
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] Re: PHP (anti) crash policy?

2004-10-05 Thread Manuel Lemos
Hello,
On 10/04/2004 11:53 AM, Olaf Van Der Spek wrote:
Why?
I think a large number of data handling functions would benefit from 
such a function.
And it'd make PHP more robust.

Because it is an hack to work around the lack of support for detection 
of corrupted data in zlib.

In the end you will be able to handle the failure of zlib but you will 
not be able to tell whether it failed because the file was too large 
to decompress or because it failed due to corrupted data.

I think it would be better that zlib would be able to detect corrupted 
data so you could eventually tell the user that the file is corrupted 
instead of misleading with a message saying there was not enough memory.

I know zlib itself doesn't crash due to invalid input.
Until you insist on this non-sense I am afraid you will have an hard 
convinicing anybody to change anything.

PHP does not crash. It just exits because an external library tells it 
to allocate more memory than the current limit.


However, even in that case, what do you do with valid input that causes 
out of memory errors?
Raise the memory limit.
The problem is that a corrupted file is not a valid input. It is making 
zlib behave abnormally and request an absurd amount of memory. If zlib 
behaved properly it would detect the corrupted data and would fail 
without attempting to request an erroneous amound of memory.

You certainly can't blame it on PHP memory allocation code because it 
has no way to determine if the requested amount of memory is erroneous 
or not.

I think you would do better if you complained to zlib developers than to 
PHP developers. I am sure that this problem does not affect only PHP but 
also other languages that use zlib for the same purposes.

--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
http://www.phpclasses.org/reviews/
Metastorage - Data object relational mapping layer generator
http://www.meta-language.net/metastorage.html
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Question about handling credit cards

2004-10-05 Thread Paul Waring
On Tue, 5 Oct 2004 12:29:53 -0400, Gary Hotko <[EMAIL PROTECTED]> wrote:
>Could you provide more information, code example or a how to to do this..

Have a look at the Mcrypt functions in PHP (you need to complie
support for this extension to access these features):

http://www.php.net/manual/en/ref.mcrypt.php

Paul

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



[PHP] --disable-url-fopen-wrapper gone?

2004-10-05 Thread Marten Lehmann
Hello,
one account of a user on our webserver was compromised using a feature 
of fopen to load external sources. As of the documentation, there shall 
be a configure option called "--disable-url-fopen-wrapper". 
Unfortunately, this option doesn't seem to exist in 4.3.9. How can I set 
a default for allow_url_fopen during the compilation? Or is the only way 
to set

allow_url_fopen=0
in the master php.ini?
Regards
Marten
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] sort multidim array

2004-10-05 Thread Kevin Coyner

I've been banging my head against the wall on this one.  Probably
trivial to the knowledgeable, but I'm stumped despite trying the various
sort functions as advertised on php.net.

I've got the following fields:

retailer  city   state   telephone   distance


Sample data looks like:

BLIND BROOK CLUB   PURCHASE, NY  (914) 939-1450  4.6
BURNING TREE CCGREENWICH, CT   (203) 869-9010  0
CENTURY COUNTRY CLUB  PURCHASE, NY  (914) 761-0400  4.6
FAIRVIEW CC  GREENWICH, CT   (203) 531-4283  2.2
..

All of this is in an array I'll call $zipArray.

When I get the data from mysql, it doesn't contain the 'distance' info.
The distance field is calculated and tacked onto each row by having
everything go through a foreach loop.

So I start with an array that has 4 data columns (retailer, city, state
and telephone) and I end up with an array that has 5 data columns
(retailer, city, state, telephone, and distance).

If I apply asort($zipArray) it sorts nicely on the first data column -
retailer.  But I need it to sort on the last data column - distance.

I think I've been staring at this too long.  Would appreciate any
guidance.

Thanks
Kevin

-- 

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



Re: [PHP] sort multidim array

2004-10-05 Thread Jasper Howard
This was just discusses in quite some detail. Everyone decieded that
usort() was the best and a couple peopel agreed that array_multisory()
works just fine. Check out that convo to get some pretty good details
on how to do this.


On Tue, 05 Oct 2004 13:04:44 -0400, Kevin Coyner <[EMAIL PROTECTED]> wrote:
> 
> I've been banging my head against the wall on this one.  Probably
> trivial to the knowledgeable, but I'm stumped despite trying the various
> sort functions as advertised on php.net.
> 
> I've got the following fields:
> 
> retailer  city   state   telephone   distance
> 
> Sample data looks like:
> 
> BLIND BROOK CLUB   PURCHASE, NY  (914) 939-1450  4.6
> BURNING TREE CCGREENWICH, CT   (203) 869-9010  0
> CENTURY COUNTRY CLUB  PURCHASE, NY  (914) 761-0400  4.6
> FAIRVIEW CC  GREENWICH, CT   (203) 531-4283  2.2
> ..
> 
> All of this is in an array I'll call $zipArray.
> 
> When I get the data from mysql, it doesn't contain the 'distance' info.
> The distance field is calculated and tacked onto each row by having
> everything go through a foreach loop.
> 
> So I start with an array that has 4 data columns (retailer, city, state
> and telephone) and I end up with an array that has 5 data columns
> (retailer, city, state, telephone, and distance).
> 
> If I apply asort($zipArray) it sorts nicely on the first data column -
> retailer.  But I need it to sort on the last data column - distance.
> 
> I think I've been staring at this too long.  Would appreciate any
> guidance.
> 
> Thanks
> Kevin
> 
> --
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


-- 
<<
Jasper Howard - Database Administration
ApexEleven.com
530 559 0107
--->>

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



Re: [PHP] Best and easy html text area replacement tool?

2004-10-05 Thread Scott Chapman
On Monday 04 October 2004 01:50 pm, Bosky, Dave wrote:
> I'm looking for an easy to use html textarea replacement script and figured
> this was the place to locate the most popular.
Dave,
I've done some research on this issue.  There are a few out there to look at:

HTMLArea (http://www.interactivetools.com/products/htmlarea/)

TinyMCE (http://tinymce.moxiecode.com/)

WYSIWYGPro (http://www.wysiwygpro.com/)

The big issue for me in my research is the ability to edit HTML on IE and also on 
Mozilla based browsers with no problems.  You will find that HTMLArea has problems in 
these areas.
For instance, when you boldface something in a wysiwyg editor using IE, it will 
in-line CSS code around the text you are making bold.
Mozilla browsers will put  around them.  They don't work across 
platforms.

TinyMCE is free and deals with these issues fairly well, but it doesn't have a 
cross-platform spell checker.

WYSIWYGPro costs money but it does it all and is made explicitly for use with PHP.

If you don't care about cross-platform usability then HTMLArea would be a good choice. 
TinyMCE is rather new but actively developed.

Good hunting!

Scott

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



[PHP] shiflett-clock.gif

2004-10-05 Thread Greg Donald
Did anyone ever solve the shiflett-clock.gif puzzle?

If so, what was the solution?  If not, are we going to be told at some point?

Thanks,


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



[PHP] BOA and PHP

2004-10-05 Thread Dan
Is it possible to run PHP with a BOA webserver? What have I to change to
make them work togehther?
Feedback is appriciated, thanks,
Daniel

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



RE: [PHP] shiflett-clock.gif

2004-10-05 Thread Jay Blanchard
[snip]
Did anyone ever solve the shiflett-clock.gif puzzle?

If so, what was the solution?  If not, are we going to be told at some
point?
[/snip]

I/we am/are apparently really ridiculously close.

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



Re: [PHP] Best and easy html text area replacement tool?

2004-10-05 Thread Jason Davidson
Whats this to do with PHP.. this should be in the javascript list.

Jason

Scott Chapman <[EMAIL PROTECTED]> wrote: 
> 
> On Monday 04 October 2004 01:50 pm, Bosky, Dave wrote:
> > I'm looking for an easy to use html textarea replacement script and figured
> > this was the place to locate the most popular.
> Dave,
> I've done some research on this issue.  There are a few out there to look at:
> 
> HTMLArea (http://www.interactivetools.com/products/htmlarea/)
> 
> TinyMCE (http://tinymce.moxiecode.com/)
> 
> WYSIWYGPro (http://www.wysiwygpro.com/)
> 
> The big issue for me in my research is the ability to edit HTML on IE and also
> on Mozilla based browsers with no problems.  You will find that HTMLArea has
> problems in these areas.
> For instance, when you boldface something in a wysiwyg editor using IE, it will
> in-line CSS code around the text you are making bold.
> Mozilla browsers will put  around them.  They don't work across
> platforms.
> 
> TinyMCE is free and deals with these issues fairly well, but it doesn't have a
> cross-platform spell checker.
> 
> WYSIWYGPro costs money but it does it all and is made explicitly for use with
> PHP.
> 
> If you don't care about cross-platform usability then HTMLArea would be a good
> choice. TinyMCE is rather new but actively developed.
> 
> Good hunting!
> 
> Scott
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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



Re: [PHP] shiflett-clock.gif

2004-10-05 Thread Chris Boget
> Did anyone ever solve the shiflett-clock.gif puzzle?

What's the puzzle?

thnx,
Chris

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



Re: [PHP] mail() and Verizon

2004-10-05 Thread Sam Smith

The solution was a simple -f (see it in the extra headers just before the
last [EMAIL PROTECTED]).

Sets the  envelope sender address when using sendmail with the  -f sendmail
option.

mail("[EMAIL PROTECTED], [EMAIL PROTECTED]", "Testing the simple mail
functions", "Did you get this one?", "From: [EMAIL PROTECTED] \n",
"[EMAIL PROTECTED]");


> I  believe the problem is that Verizon checks the MAIL FROM address
> during the SMTP session against the domain portion of the From
> header. If they don't match, the mail is rejected (or dropped). This
> was an issue for a webboard I use...

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



[PHP] PHP on Windows CE

2004-10-05 Thread Tomás Liendo
I wondered if is possible to run PHP applications in a PDA with Windows CE.
Do you know?

Ahead of time, thak you very much,

Tom.

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



Re: [PHP] shiflett-clock.gif

2004-10-05 Thread Daniel Purdy

[snip]

> Did anyone ever solve the shiflett-clock.gif puzzle?

What's the puzzle?
[/snip]

Go to http://shiflett.org and scroll down to "the race begins". The
puzzle is the clock.

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

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



RE: [PHP] Re: UPS Online Tools and PHP?

2004-10-05 Thread Ed Lazor
Thanks Manuel, I'll check it out.

-Ed


> -Original Message-
> http://www.ups.com/content/us/en/bussol/offering/technology/automated_ship
> pi
> > ng/online_tools.html
> 
> You may want to take a look at this class that supports UPS:
> 
> http://www.phpclasses.org/shiptrack

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



Re: [PHP] Re: PHP Attachement Problems

2004-10-05 Thread PHP Junkie
Ave,

I just tried your php mime class. I tried the test_attachment_message file.
It did the same to the pdf attachment.

Initially, it tested with a text and an image. The text attachment opened
without a problem but the image was giving an error in opening. I left the
text file attachment as is and attached my pdf file .. And it gave the same
error in opening.

At this point I'm inclined to believe that any kind of php attachment script
is sending through any Text Attachment but not any other kind of attachment.

I'm running an Apache Web Server on a Mac... Would that make a difference?

Junkie.


On 10/5/04 12:43 PM, "Manuel Lemos" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> On 10/04/2004 10:24 AM, Php Junkie wrote:
>> I created a form which can accept 2 file attachments and send an HTML
>> Email... Everything works great... The files even get attached and sent, the
>> ONLY problem is... The PDF file I'm sending attached open up empty! They are
>> all blank.. Like everything has been wiped off from them!!
> 
> It sounds like it is arriving corrupted.
> 
> You may want to try this other class you can used for the same purpose
> and AFAIK does not corrupt attachments:
> 
> http://www.phpclasses.org/mimemessage
> 

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



Re: [PHP] Re: PHP Attachement Problems

2004-10-05 Thread Greg Donald
On Tue, 05 Oct 2004 15:04:14 -0400, PHP Junkie <[EMAIL PROTECTED]> wrote:
> I just tried your php mime class. I tried the test_attachment_message file.
> It did the same to the pdf attachment.

Have you tried sending other PDFs by chance?  Have you tried opening
the PDF with other PDF viewers after transfer?  Just curious if you've
localized the issue to PHP or not.


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

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



Re: [PHP] Re: [PHP Attachement Problems - MAC ISSUE!!

2004-10-05 Thread PHP Junkie
Ave,

On a hunch.. I uploaded my original php script AND the php mime class to a
normal linux server with Apache web server... And all the scripts are
running fine! The PDF attachments go through fine.

So I finally found out.. It's a MAC issue! Using my scripts on the MAC
server is causing the problem. My problem however is, I have to use the MAC
and not a linux or windows or whatever. So what do I do now? How do I make
these scripts work fine on a MAC ??

Thanks,
Junkie



On 10/5/04 12:43 PM, "Manuel Lemos" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> On 10/04/2004 10:24 AM, Php Junkie wrote:
>> I created a form which can accept 2 file attachments and send an HTML
>> Email... Everything works great... The files even get attached and sent, the
>> ONLY problem is... The PDF file I'm sending attached open up empty! They are
>> all blank.. Like everything has been wiped off from them!!
> 
> It sounds like it is arriving corrupted.
> 
> You may want to try this other class you can used for the same purpose
> and AFAIK does not corrupt attachments:
> 
> http://www.phpclasses.org/mimemessage
> 

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



[PHP] Re: sending html email using php script

2004-10-05 Thread nipepsi
Ann a écrit :
Hi,
I am trying to send a html email from a php script. This script emails
a common information to all the members in the database. The only
problem is I cannot specify colors, hyperlinks etc..Html tags like
, ,  etc works though..
Could any one tell me what i might be doing wrong? Any help will be
greatly appreciated.
Thanks,
Ann
Code:
function mail_it($content, $subject, $email, $recipient) {
   global $attachment_chunk, $attachment_name, $attachment_type,
$attachment_sent, $bcc;
   global $db;
   global $msgbody;
   $ob = "=_OuterBoundary_000";
   $ib = "=_InnerBoundery_001";
   
   $sql_result = mysql_query("SELECT * FROM contacts", $db);
   echo "Emails sent to:";
 
   while($rs = mysql_fetch_array($sql_result)) 
	{
	$message  = "";
	$headers  = "";
	$recip= $rs["Email"];
	$headers  = "MIME-Version: 1.0\r\n"; 
	$headers .= "From: ".$email."\r\n"; 
   	$headers .= "To: ".$recip."\r\n"; 
   	$headers .= "Reply-To: ".$email."\r\n";
   	if ($bcc) $headers .= "Bcc: ".$bcc."\r\n"; 
   	$headers .= "X-Priority: 1\r\n"; 
   	$headers .= "X-Mailer: Formmail".VERSION."\r\n"; 
   	$headers .= "Content-Type:
multipart/mixed;\r\n\tboundary=\"".$ob."\"\r\n";
	
  $ToName= $rs["Salutation"]."".$rs["FirstName"]."
".$rs["LastName"];
	
	  
	$content = "Hello ".$ToName.",";
	$content .= $msgbody;
	$content .=" ";
	$content .="Thank you.";
	$content .=" ";
	$content .="Please send an email to 
href='mailto:[EMAIL PROTECTED]&subject='Re:Email Notifications' to get more
information.";
	

   		$message .= "This is a multi-part message in MIME format.\r\n";
	   	$message .= "\r\n--".$ob."\r\n";
   		$message .= "Content-Type:
multipart/alternative;\r\n\tboundary=\"".$ib."\"\r\n\r\n";
   		$message .= "\r\n--".$ib."\r\n";
   		//$message .= "Content-Type:
text/plain;\r\n\tcharset=\"iso-8859-1\"\r\n";
   		$message .= "Content-Type:
text/html;\r\n\tcharset=\"iso-8859-1\"\r\n";
   		$message .= "Content-Transfer-Encoding:
quoted-printable\r\n\r\n";
   		$message .= $content."\r\n\r\n";
   		$message .= "\r\n--".$ib."--\r\n";
   		if ($attachment_name && !$attachment_sent) {
  		$message .= "\r\n--".$ob."\r\n";
  		$message .= "Content-Type:
$attachment_type;\r\n\tname=\"".$attachment_name."\"\r\n";
  		$message .= "Content-Transfer-Encoding: base64\r\n";
  		$message .= "Content-Disposition:
attachment;\r\n\tfilename=\"".$attachment_name."\"\r\n\r\n";
  		$message .= $attachment_chunk;
  		$message .= "\r\n\r\n";
  		$attachment_sent = 1;
   			}
   		$message .= "\r\n--".$ob."--\r\n";
   
		mail($recip, $subject, $message, $headers);
	}
 
}
Use php.classmailer ; it 's a nice class
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] Re: [PHP Attachement Problems - MAC ISSUE!!

2004-10-05 Thread PHP Junkie
Manuel,

Really appreciate your help.

I created a new empty php file and put your given code in it. Upon running
the test.php in my browser, it prints exactly this in my browser:

could not open file

I have a PowerMac G5 Machine, with MacOS X. I have PHP 5 installed from
entropy.ch and have the in-built Apache Web Server. Also, the MacOS X ships
with Postfix Mail Server and I used the Postfix Enabler to configure it. So
I use the Postfix Mail Server.

Junkie



On 10/5/04 3:36 PM, "Manuel Lemos" <[EMAIL PROTECTED]> wrote:

>  $filename=$argv[1];
> $size=filesize($filename);
> if(!($file=fopen($filename,"rb")))
> die("could not open file ".$file_name);
> $data=fread($file,$size);
> echo "Size ",$size," Read ",strlen($data);
> fclose($file);
> ?>

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



[PHP] why this doesn't work as an external file but does internally?

2004-10-05 Thread Aaron Wolski
Hi guys,

I have this code Javascript code:

if (document.images) {

img1on = new Image();   img1on.src = "Graphics/"; 
img2on = new Image();   img2on.src = "Graphics/";  
img3on = new Image();   img3on.src = "Graphics/";
img4on = new Image();   img4on.src = "Graphics/"; 
img5on = new Image();   img5on.src = "Graphics/";  
img6on = new Image();   img6on.src = "Graphics/";


img1off = new Image();   img1off.src = "Graphics/"; 
img2off = new Image();   img2off.src = "Graphics/";  
img3off = new Image();   img3off.src = "Graphics/";
img4off = new Image();   img4off.src = "Graphics/"; 
img5off = new Image();   img5off.src = "Graphics/";  
img6off = new Image();   img6off.src = "";

}

When I include it in the main page it works without any problems. When I
link it as an external file it doesn't work.

As a side note, the following code example works in an external JS file:

img1off = new Image();   img1off.src = "Graphics/home_off.gif"; 

Anyone know why the external file with two variables is not working but
it does work with one variable?

Thanks! I appreciate the help!

Regards,

Aaron

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



Re: [PHP] something wrong with $_SERVER var

2004-10-05 Thread Merlin
Chuck Wolber wrote:
On Tue, 5 Oct 2004, Merlin wrote:

I am experiencing a strange behaviour with $_SERVER vars.
Somehow the var: $_SERVER[SERVER_PORT]  seems to be 443 even if
it is 80. I had following statement inside my app:
if ($_SERVER[SERVER_PORT] == '443' AND !$SSL){
header("Location:http://".$_SERVER[HTTP_HOST].$_SERVER[REQUEST_URI]);
exit;
}

You can start by putting a space between the "Location:" and the rest of 
your URL.

-Chuck

 I think this is not the problem. The real issue is that this command should 
not execute if run over regular port 80 http://...
But it did in some rar cases. How come?!

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


Re: [PHP] why this doesn't work as an external file but does internally?

2004-10-05 Thread John Nichel
Aaron Wolski wrote:
Hi guys,
I have this code Javascript code:

When I include it in the main page it works without any problems. When I
link it as an external file it doesn't work.
As a side note, the following code example works in an external JS file:
img1off = new Image();   img1off.src = "
?>Graphics/home_off.gif"; 

Anyone know why the external file with two variables is not working but
it does work with one variable?
What is "doesn't work"?  Does it not output the second variable?  Does 
it output php code?

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] why this doesn't work as an external file but does internally?

2004-10-05 Thread Jay Blanchard
[snip]
I have this code Javascript code:
[/snip]

And the web has these JavaScript lists! Quaint, no?

Anyhow, to make this work you will need to generate your JavaScript code
with PHP. 

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



Re: [PHP] Re: [PHP Attachement Problems - MAC ISSUE!!

2004-10-05 Thread PHP Junkie
Ave,

I replaced the code and added my PDF file in the required place, and this is
what it displays now:

Size 35823 Read 36704

I'll put in your address and send out the mail your way with the PDF
attachment using the class script.

Thanks a lot,

Junkie


On 10/5/04 3:51 PM, "Manuel Lemos" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> On 10/05/2004 04:40 PM, PHP Junkie wrote:
>> Really appreciate your help.
> 
> No problem. Sending mail with PHP is a saga to many users, not just
> Macs. If there is something that can be done to workaround PHP problems
> to avoid your problem, I will integrate it in that class.
> 
> 
>> I created a new empty php file and put your given code in it. Upon running
>> the test.php in my browser, it prints exactly this in my browser:
>> 
>> could not open file
> 
> Sorry, change it this way and replace your PDF file name where it says
> your-PDF-file-name-here.pdf .
> 
> 
>  $filename="your-PDF-file-name-here.pdf";
> $size=filesize($filename);
> if(!($file=fopen($filename,"rb")))
>die("could not open file ".$file_name);
> $data=fread($file,$size);
> echo "Size ",$size," Read ",strlen($data);
> fclose($file);
> ?>
> 
> 
>> I have a PowerMac G5 Machine, with MacOS X. I have PHP 5 installed from
>> entropy.ch and have the in-built Apache Web Server. Also, the MacOS X ships
>> with Postfix Mail Server and I used the Postfix Enabler to configure it. So
>> I use the Postfix Mail Server.
> 
> Hummm... there should be no problem. Can you try using the class script
> again and change it to send the message with the PDF attachment to:
> [EMAIL PROTECTED] ?

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



RE: [PHP] why this doesn't work as an external file but does internally?

2004-10-05 Thread Aaron Wolski


> -Original Message-
> From: Jay Blanchard [mailto:[EMAIL PROTECTED]
> Sent: October 5, 2004 3:52 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] why this doesn't work as an external file but does
> internally?
> 
[snip] 
> And the web has these JavaScript lists! Quaint, no?
[/snip]

If you look closely, it's tied in with PHP. But thanks your help!

[snip]
> Anyhow, to make this work you will need to generate your JavaScript
code
> with PHP.
[/snip]

If that was true then why does this work:

img1off = new Image();   img1off.src = "Graphics/home_off.gif";

I certainly didn't generate it with PHP and it was included as an
external file.

Thanks!

A

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



RE: [PHP] why this doesn't work as an external file but does internally?

2004-10-05 Thread Jay Blanchard
[snip]
If that was true then why does this work:

img1off = new Image();   img1off.src = "Graphics/home_off.gif";

I certainly didn't generate it with PHP and it was included as an
external file.
[/snip]

If this is true then your problem is solved. if not

echo "img1off = new Image();   img1off.src = . "$base_url .
"Graphics/home_off.gif";

I think I have the syntax correct

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



Re: [PHP] why this doesn't work as an external file but does internally?

2004-10-05 Thread John Nichel
Please reply to the list, and not just an individual person.
Aaron Wolski wrote:
-Original Message-
From: John Nichel [mailto:[EMAIL PROTECTED]
Sent: October 5, 2004 3:51 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] why this doesn't work as an external file but does
internally?
 

What is "doesn't work"?  Does it not output the second variable?  Does
it output php code?

When I say it doesn't work, the images don't appear. It's a simply
mouseover effect: image on and image off type of thing.
When the page loads... the main image (the off image) is visible but
when I move the mouse over an image it just shows blank (an X).
Does that make it more clear? Sorry.
No.  I turn my radio on, but it doesn't work, what's the problem?  See 
what I mean?  The question doesn't supply enough information to make an 
educated guess as to what the problem may be.

What error messages are produced?
What does the remotely included file output?
Does the second variable have value?
Can you provide a link to where we can see the issue at play?
So on, and so forth.
Look at the source of your page that "doesn't work", where the JS is 
supposed to be, and chances are, you'll see the problem.

--
John C. Nichel
ÜberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] why this doesn't work as an external file but does internally?

2004-10-05 Thread Matthew Sims
> Hi guys,
>
> I have this code Javascript code:
>
>   if (document.images) {
>
> img1on = new Image();   img1on.src = " ?>Graphics/";
> img2on = new Image();   img2on.src = " ?>Graphics/";



>
> Regards,
>
> Aaron
>

When you mix PHP and javascript together in an external file, the file
needs to be PHP and you should include it with PHP. I just recently went
through this. I had an external javascript file with some PHP in it. It
was originally called into the index.php page as:


RE: [PHP] why this doesn't work as an external file but does inte rnally?

2004-10-05 Thread Vail, Warren
Right on, a .js file is probably not processed by the PHP engine, but while
it's imbedded in a .php file, it is.  Apples and Oranges, no?

Warren Vail


-Original Message-
From: Aaron Wolski [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, October 05, 2004 1:01 PM
To: 'Jay Blanchard'; [EMAIL PROTECTED]
Subject: RE: [PHP] why this doesn't work as an external file but does
internally?




> -Original Message-
> From: Jay Blanchard [mailto:[EMAIL PROTECTED]
> Sent: October 5, 2004 3:52 PM
> To: [EMAIL PROTECTED]
> Subject: RE: [PHP] why this doesn't work as an external file but does 
> internally?
> 
[snip] 
> And the web has these JavaScript lists! Quaint, no?
[/snip]

If you look closely, it's tied in with PHP. But thanks your help!

[snip]
> Anyhow, to make this work you will need to generate your JavaScript
code
> with PHP.
[/snip]

If that was true then why does this work:

img1off = new Image();   img1off.src = "Graphics/home_off.gif";

I certainly didn't generate it with PHP and it was included as an external
file.

Thanks!

A

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

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



Re: [PHP] Read word documents on a Linux server

2004-10-05 Thread Rory Browne
I'd also try and find a way of automating openoffice. Check first
though, to ensure that the quality of the converted document is up to
scratch. Having that said, OO.o has a pretty good reputation for this.


On Tue, 05 Oct 2004 21:49:01 +0600, raditha dissanayake
<[EMAIL PROTECTED]> wrote:
> Jacob Larsen wrote:
> 
> > Can I via Php read word documents on a Linux server?
> 
> I haven't tried this but I guess probably not. My suggestion would be to
> look at the star office sdk from sun you will need to use java though.
> 
> >
> > I see COM, but that's only available for the Windows version of PHP.
> >
> > Thanks,
> > Jacob
> >
> 
> -- 
> Raditha Dissanayake.
> 
> http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
> Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
> Graphical User Inteface. Just 128 KB | with progress bar.
> 
> 
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
>

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



RE: [PHP] why this doesn't work as an external file but does internally?

2004-10-05 Thread Aaron Wolski
File with the JS code is called: jsstuff.php

Aaron

> -Original Message-
> From: Vail, Warren [mailto:[EMAIL PROTECTED]
> Sent: October 5, 2004 4:12 PM
> To: 'Aaron Wolski'; 'Jay Blanchard'; [EMAIL PROTECTED]
> Subject: RE: [PHP] why this doesn't work as an external file but does
> internally?
> 
> Right on, a .js file is probably not processed by the PHP engine, but
> while
> it's imbedded in a .php file, it is.  Apples and Oranges, no?
> 
> Warren Vail
> 
> 
> -Original Message-
> From: Aaron Wolski [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, October 05, 2004 1:01 PM
> To: 'Jay Blanchard'; [EMAIL PROTECTED]
> Subject: RE: [PHP] why this doesn't work as an external file but does
> internally?
> 
> 
> 
> 
> > -Original Message-
> > From: Jay Blanchard [mailto:[EMAIL PROTECTED]
> > Sent: October 5, 2004 3:52 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: [PHP] why this doesn't work as an external file but
does
> > internally?
> >
> [snip]
> > And the web has these JavaScript lists! Quaint, no?
> [/snip]
> 
> If you look closely, it's tied in with PHP. But thanks your help!
> 
> [snip]
> > Anyhow, to make this work you will need to generate your JavaScript
> code
> > with PHP.
> [/snip]
> 
> If that was true then why does this work:
> 
> img1off = new Image();   img1off.src = " ?>Graphics/home_off.gif";
> 
> I certainly didn't generate it with PHP and it was included as an
external
> file.
> 
> Thanks!
> 
> A
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

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



[PHP] A question of style....

2004-10-05 Thread bclem
So I'm sitting here writing code and I'm thinking about my own style of writing
and formatting my php code(I use a mix of the pear standard and my own flava).
What else do you guy's use?

What style should I base my code formatting on in order to be accepted widely by
the php community at large?


-Brent



This message was sent using IMP, the Internet Messaging Program.

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



[PHP] Upload problems

2004-10-05 Thread Pablo Gosse
Hi, folks.  I'm running into a strange upload problem and am not sure if
it's a php or apache issue.

I can't seem to upload any files bigger than 511k.  511k will upload
fine, but 512k returns a "Document contains no data" error.

I've tried this with a text file, adding and removing lines until it
uploaded and wouldn't upload.

I've also tried multiple file formats, and it's the same for all.

Has anyone run into this before?  I thought it might be a problem with
the LimitRequestBody directive in the apache config file, but that
directive is not used anywhere in the file.

Any ideas?

Cheers and TIA,

Pablo

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



[PHP] Order of extensions in php.ini matters?

2004-10-05 Thread CSN
I'm trying to use the EXIF extension (PHP 5, Windows
XP). Order didn't seem to matter before (PHP 4). But
now, if my php.ini is like:

extension=php_exif.dll
extension=php_mbstring.dll

PHP gives an "unable to load module" error. But if I
put the mbstring extension before exif in php.ini, it
works. What's up?

CSN


__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

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



RE: [PHP] A question of style....

2004-10-05 Thread Jay Blanchard
[snip]
So I'm sitting here writing code and I'm thinking about my own style of
writing
and formatting my php code(I use a mix of the pear standard and my own
flava).
What else do you guy's use?

What style should I base my code formatting on in order to be accepted
widely by
the php community at large?
[/snip]

Anything that doesn't use the word 'flava' :)

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



RE: [PHP] Upload problems

2004-10-05 Thread Jay Blanchard
[snip]

Hi, folks.  I'm running into a strange upload problem and am not sure if
it's a php or apache issue.

I can't seem to upload any files bigger than 511k.  511k will upload
fine, but 512k returns a "Document contains no data" error.

I've tried this with a text file, adding and removing lines until it
uploaded and wouldn't upload.

I've also tried multiple file formats, and it's the same for all.

Has anyone run into this before?  I thought it might be a problem with
the LimitRequestBody directive in the apache config file, but that
directive is not used anywhere in the file.

Any ideas?
[/snip]

Look in your php.ini for max_upload_size or something like it.

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



Re: [PHP] Upload problems

2004-10-05 Thread PHP Junkie
Ave,

What's the upload_max_filesize  set to in your php.ini ? Under "File
Uploads" in the php.ini, you will find this value.

Junkie


On 10/5/04 4:33 PM, "Pablo Gosse" <[EMAIL PROTECTED]> wrote:

> Hi, folks.  I'm running into a strange upload problem and am not sure if
> it's a php or apache issue.
> 
> I can't seem to upload any files bigger than 511k.  511k will upload
> fine, but 512k returns a "Document contains no data" error.
> 
> I've tried this with a text file, adding and removing lines until it
> uploaded and wouldn't upload.
> 
> I've also tried multiple file formats, and it's the same for all.
> 
> Has anyone run into this before?  I thought it might be a problem with
> the LimitRequestBody directive in the apache config file, but that
> directive is not used anywhere in the file.
> 
> Any ideas?
> 
> Cheers and TIA,
> 
> Pablo
> 
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
> 

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



RE: [PHP] why this doesn't work as an external file but does internally?

2004-10-05 Thread Aaron Wolski


> -Original Message-
> From: John Nichel [mailto:[EMAIL PROTECTED]
> Sent: October 5, 2004 4:06 PM
> To: PHP Mailing Lists
> Subject: Re: [PHP] why this doesn't work as an external file but does
> internally?
> 
> Please reply to the list, and not just an individual person.
> 
> No.  I turn my radio on, but it doesn't work, what's the problem?  See
> what I mean?  The question doesn't supply enough information to make
an
> educated guess as to what the problem may be.
> 
> What error messages are produced?
> What does the remotely included file output?
> Does the second variable have value?
> Can you provide a link to where we can see the issue at play?
> So on, and so forth.
> 
> Look at the source of your page that "doesn't work", where the JS is
> supposed to be, and chances are, you'll see the problem.

Ok.. here are 3 links:

https://celestica.tristarpromotions.com/NEW/index2.php

This link... you'll see that the rollover effects on the top menu work.
The external JS file (called: jsstuffnew.php) has code that looks like:

img1on = new Image();   img1on.src = "Graphics/home_on.gif";

https://celestica.tristarpromotions.com/NEW/index.php

This link... you'll see that the rollover effects on the top menu DO NOT
work. The external JS file (called: jsstuff.php) has code that looks
like:

img1on = new Image();   img1on.src = "Graphics/";

As you can see, the difference between the two is the fact that the
image FILE NAME is hard coded into the file as opposed to calling.


https://celestica.tristarpromotions.com/NEW/index3.php

This link... you'll see that the rollover effects work as well. Instead
of having an external file I have embedded the JS code directly into the
page.

Additionally, I have use code that looks like:

img1on = new Image();   img1on.src = "Graphics/";


Having visuals... does that help communicate what the problem is?

In terms of what errors I am seeing, etc... I cannot tell you that
because NO errors come up at all, even with the external pages.

Thanks John. Hope I explained it a bit better this time around.

Regards,

Aaron

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



RE: [PHP] A question of style....

2004-10-05 Thread Ed Lazor
Chapter 1 of Advanced PHP Programming, by George Schlossnagle, ISBN
0-672-32561-6.

http://www.blueshoes.org/en/developer/coding_guidelines/


> -Original Message-
> So I'm sitting here writing code and I'm thinking about my own style of
> writing
> and formatting my php code(I use a mix of the pear standard and my own
> flava).
> What else do you guy's use?
> 
> What style should I base my code formatting on in order to be accepted
> widely by
> the php community at large?

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



RE: [PHP] Order of extensions in php.ini matters?

2004-10-05 Thread Ed Lazor
You have the correct order.  Exif relies on functionality provided by
mbstring.dll, therefore it must be loaded after it.

> -Original Message-
> I'm trying to use the EXIF extension (PHP 5, Windows
> XP). Order didn't seem to matter before (PHP 4). But
> now, if my php.ini is like:
> 
> extension=php_exif.dll
> extension=php_mbstring.dll
> 
> PHP gives an "unable to load module" error. But if I
> put the mbstring extension before exif in php.ini, it
> works. What's up?

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



RE: [PHP] Upload problems

2004-10-05 Thread Pablo Gosse
[snip]
> What's the upload_max_filesize  set to in your php.ini ? Under "File
> Uploads" in the php.ini, you will find this value. 
[/snip]

That's not it.  That's set to 30M.  This domain was just transferred
over to a new server, and this problem did not exist on the old one, so
while I am pretty certain it's something on the server side, I thought
I'd throw it out in case anyone else might have run up against this.

Thanks,
Pablo

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



Re: [PHP] Read word documents on a Linux server

2004-10-05 Thread Jacob Larsen
Jacob Larsen wrote:
Can I via Php read word documents on a Linux server?
I see COM, but that's only available for the Windows version of PHP.
I found this:
http://word2x.sourceforge.net/
But I had hopped to find a Php class, so that I can be sure that it will 
work in a web-hotel.

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


Re: [PHP] Re: [PHP Attachement Problems - MAC ISSUE!!

2004-10-05 Thread Marek Kilimajer
PHP Junkie wrote:
Ave,
On a hunch.. I uploaded my original php script AND the php mime class to a
normal linux server with Apache web server... And all the scripts are
running fine! The PDF attachments go through fine.
So I finally found out.. It's a MAC issue! Using my scripts on the MAC
server is causing the problem. My problem however is, I have to use the MAC
and not a linux or windows or whatever. So what do I do now? How do I make
these scripts work fine on a MAC ??
Try direct connection to SMTP server, the class Manuel pointed to will 
help you with this.

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


Re: [PHP] Question about handling credit cards

2004-10-05 Thread Andrew Kreps
On Mon, 4 Oct 2004 14:49:44 -0700, Ed Lazor <[EMAIL PROTECTED]> wrote:
> I'm looking at online stores and it seems like a lot of them maintain copies
> of credit card numbers.  Is this true?  That seems like a "bad thing" to me,
> especially in terms of liability and risk of hackers.  On the flip side, it
> seems like there are legitimate reasons.  For example, if you bill the
> customer when products ship, rather than when the order is received.  Or, if
> the customer decides to have instock items ship now and back ordered items
> ship when they arrive - which results in two shipping charges.
> 
> How do you guys handle this?


Some other things to consider...

Never display the full credit card number on the front-end of your
application.  It's a common practice to display the last 4 digits of
the card so the customer can see which card is going to be charged.  I
store those numbers in a separate field so I never have to send the
entire card number to the front-end application.

You may want to erase the stored credit card numbers (attached to the
user accounts, not to the orders) in the event that the customer uses
your 'lost password' functionality.  This will help minimize the
threat from a hijacked account, and some customers appreciate the
extra dose of security.

Along those lines, make sure you have the credit card numbers attached
to the order, and not simply to the customer account.  I once had the
pleasure of maintaining a site that had CC's stored with the customer
account.  I ended up with a situation where 2 orders were placed by
one customer with different credit cards in a short period of time. 
Since the first order hadn't shipped when the second was placed, the
card number on the first order was overwritten with the number from
the second order.  Messy!

In conclusion, storing credit cards is an accepted feature by most
customers these days.  You'll want to have an opt out for those that
don't wish it to be remembered when they log back in, but I can't
imagine an E-Commerce application that doesn't store the credit card
with the order.

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



RE: [PHP] Upload problems

2004-10-05 Thread Pablo Gosse
[snip]
> Look in your php.ini for max_upload_size or something like it.
[/snip]

'Twas an apache problem.  Thanks the help.

Cheers,

Pablo

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



Re: [PHP] why this doesn't work as an external file but does internally?

2004-10-05 Thread Curt Zirzow
* Thus wrote Aaron Wolski:
> 
> 
> > 
> > What error messages are produced?
> > What does the remotely included file output?
> > Does the second variable have value?
> > Can you provide a link to where we can see the issue at play?
> > So on, and so forth.
> > 
> > Look at the source of your page that "doesn't work", where the JS is
> > supposed to be, and chances are, you'll see the problem.
> 
> Ok.. here are 3 links:
> 
> https://celestica.tristarpromotions.com/NEW/index2.php
> 
> This link... you'll see that the rollover effects on the top menu work.
> The external JS file (called: jsstuffnew.php) has code that looks like:
> 
> img1on = new Image();   img1on.src = " ?>Graphics/home_on.gif";
> 
> https://celestica.tristarpromotions.com/NEW/index.php
> 
> This link... you'll see that the rollover effects on the top menu DO NOT
> work. The external JS file (called: jsstuff.php) has code that looks
> like:
> 
> img1on = new Image();   img1on.src = " ?>Graphics/";

$base_url and $img_home_on have no value in jsstuff.php thus you
have a javascript that results in:

   img1on.src = "Graphics/"

Also, you should also send a javascript header with the jsstuff.php
file:
  header('Content-Type: application/x-javascript');

Curt
-- 
The above comments may offend you. flame at will.

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



Re: [PHP] mail() and Verizon

2004-10-05 Thread Sam Smith

The solution was a simple -f (see it in the extra headers just before the
last [EMAIL PROTECTED]).

Sets the  envelope sender address when using sendmail with the  -f sendmail
option.

mail("[EMAIL PROTECTED], [EMAIL PROTECTED]", "Testing the simple mail
functions", "Did you get this one?", "From: [EMAIL PROTECTED] \n",
"[EMAIL PROTECTED]");


> I  believe the problem is that Verizon checks the MAIL FROM address
> during the SMTP session against the domain portion of the From
> header. If they don't match, the mail is rejected (or dropped). This
> was an issue for a webboard I use...

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



Re: [PHP] why this doesn't work as an external file but does internally?

2004-10-05 Thread John Nichel
Aaron Wolski wrote:
Ok.. here are 3 links:
https://celestica.tristarpromotions.com/NEW/index2.php
This link... you'll see that the rollover effects on the top menu work.
The external JS file (called: jsstuffnew.php) has code that looks like:
img1on = new Image();   img1on.src = "Graphics/home_on.gif";
https://celestica.tristarpromotions.com/NEW/index.php
This link... you'll see that the rollover effects on the top menu DO NOT
work. The external JS file (called: jsstuff.php) has code that looks
like:
img1on = new Image();   img1on.src = "Graphics/";
As you can see, the difference between the two is the fact that the
image FILE NAME is hard coded into the file as opposed to calling.
https://celestica.tristarpromotions.com/NEW/index3.php
This link... you'll see that the rollover effects work as well. Instead
of having an external file I have embedded the JS code directly into the
page.
Additionally, I have use code that looks like:
img1on = new Image();   img1on.src = "Graphics/";
Having visuals... does that help communicate what the problem is?
Yes, the output of your JavaScript in the second example is missing 
$img_home_on (it's outputting nothing).  Where does this variable get 
set?  How about posting the php code for 
https://celestica.tristarpromotions.com/NEW/jsstuff.php

--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] A question of style....

2004-10-05 Thread John Nichel
Jay Blanchard wrote:
Anything that doesn't use the word 'flava' :)
What if I name all my variables after Rocky characters? ;)
Now for the real can of worms...
On odd lines, I use spaces, and on even lines, I use tabs.

The above is an attempt at humor.
The below is an attempt at addressing the question.

http://www.google.com/search?hl=en&ie=UTF-8&q=php+code+standards&btnG=Google+Search
--
By-Tor.com
It's all about the Rush
http://www.by-tor.com
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


RE: [PHP] Upload problems

2004-10-05 Thread Dennis Gearon
Would you mind sharing what it was so that it hits the archives and a few 'enquiring 
minds'?
"Pablo Gosse" <[EMAIL PROTECTED]> wrote:

[snip]
Look in your php.ini for max_upload_size or something like it.
[/snip]
'Twas an apache problem.  Thanks the help.
Cheers,
Pablo

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


Re: [PHP] Upload problems

2004-10-05 Thread raditha dissanayake
Dennis Gearon wrote:
Would you mind sharing what it was so that it hits the archives and a 
few 'enquiring minds'?
it probably was the LimitRequestBody apache directive which is set to 
512 Kb in some 'out of the box' installations.

--
Raditha Dissanayake.

http://www.radinks.com/sftp/ | http://www.raditha.com/megaupload
Lean and mean Secure FTP applet with | Mega Upload - PHP file uploader
Graphical User Inteface. Just 128 KB | with progress bar.
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php