Re: [PHP] Sendmail Return-Path

2004-07-27 Thread Enda Nagle - Lists
Hi Justin,

I just tried this code:

$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "From: Webstore <[EMAIL PROTECTED]>\n";
$headers .= "To: $email_address\n";
$headers .= "Bcc: [EMAIL PROTECTED]";
$headers .= "X-Priority: 1\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: My Website\n";
$headers .= "X-Return-path: ME <[EMAIL PROTECTED]>\n";
$subject = "Your Order";
$from = "[EMAIL PROTECTED]";

$message .="xx";

mail($to, $subject, $message, $from, $headers)
 or print "Could not send mail to customer";

But I get a SAFE MODE error, so I guess I¹ll just have to try that PEAR
package.

Regards

Enda
--

On 27/07/2004 22:25, "Justin Patrin" <[EMAIL PROTECTED]> wrote:

> On Tue, 27 Jul 2004 22:07:52 +0100, Enda Nagle - Lists
> <[EMAIL PROTECTED]> wrote:
>> > Hi Guys,
>> > 
>> > I¹m using PHP¹s mail() function on several sites, but have difficulty
>> > sometimes with the mails being tagged as SPAM.
>> > 
>> > I want to have the Return-Path set to the site admin, but can¹t see where
>> to
>> > do this.
>> > 
>> > I know that it can be done at server root level but I can¹t really do that
>> > as its a shared server.
>> > 
>> > I do have my own php.ini file for my site, but can only see the following
>> > vars:
>> > 
>> > mail function]
>> > ; For Win32 only.
>> > SMTP = localhost
>> > 
>> > ; For Win32 only.
>> > sendmail_from = [EMAIL PROTECTED]
>> > 
>> > ; For Unix only.  You may supply arguments as well (default: "sendmail -t
>> > -i").
>> > sendmail_path = /usr/sbin/sendmail -t -i
>> > 
>> > I¹m working off a Linux box, so presumably I can¹t use the sendmail_from
>> > variable?
> 
> Nope, that's only for windows.
> 
>> > 
>> > I also tried to set the following variable in the headers for the mail:
>> > 
>> > $headers .= "X-Return-path: ME <[EMAIL PROTECTED]>\r\n";
> 
> This should work if you put it in the right place in the call. Try
> just \n as well. If it doesn't work, try using a mailing class such
> as:
> 
> http://pear.php.net/package/Mail
> 
>> > 
>> > Any help appreciated,
>> > 
>> > Thanks
>> > 
>> > Enda
>> > --
>> > 
>> > - + - + - + - + - + - + - + - + - + - + - + - + -
>> > 
>> > Enda Nagle
>> > +353 86 168 0774
>> > [EMAIL PROTECTED]
>> > www.category9.com
>> > 
>> > - + - + - + - + - + - + - + - + - + - + - + - + -
>> > 
>> > !DSPAM:4106c542182671082813648!
>> > 
> 




Re: [PHP] html text area and mysql text fields

2004-07-27 Thread Enda Nagle - Lists
I usually leave the string intact in the database because if you need to
show it in an admin area or something, you don¹t need to convert it back
again before populating the text area.

Suppose it just comes down to personal preference... Or is there a specific
benefit to doing it this way?

Regards

Enda
--


- + - + - + - + - + - + - + - + - + - + - + - + -

Enda Nagle
+353 86 168 0774
[EMAIL PROTECTED]
www.category9.com

- + - + - + - + - + - + - + - + - + - + - + - + -




On 27/07/2004 22:55, "Matthew Sims" <[EMAIL PROTECTED]> wrote:

>> > Hi,
>> >
>> > If I have a html textarea for inputting text into a database text field
>> > how can I keep the formatting of the entered text?
>> >
>> > i.e. on the html textarea if the user enters carriage returns i.e. a new
>> > paragraph I want that to go into the database then when I retrieve it and
>> > display it on a normal html page I want to keep those carriage returns!
>> >
>> > Thanks
>> >
>> > Matt
> 
> Before injecting textarea data into a DB use this:
> 
> $_POST["textarea"] = str_replace("\n","",$_POST["textarea"]);
> 
> When retrieving data from the DB for a textarea use this before displaying:
> 
> $_POST["textarea"] = str_replace("","\n",$_POST["textarea"]);




[PHP] Sendmail Return-Path

2004-07-27 Thread Enda Nagle - Lists
Hi Guys,

I¹m using PHP¹s mail() function on several sites, but have difficulty
sometimes with the mails being tagged as SPAM.

I want to have the Return-Path set to the site admin, but can¹t see where to
do this.

I know that it can be done at server root level but I can¹t really do that
as its a shared server.

I do have my own php.ini file for my site, but can only see the following
vars:

mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = [EMAIL PROTECTED]

; For Unix only.  You may supply arguments as well (default: "sendmail -t
-i").
sendmail_path = /usr/sbin/sendmail -t -i

I¹m working off a Linux box, so presumably I can¹t use the sendmail_from
variable?

I also tried to set the following variable in the headers for the mail:

$headers .= "X-Return-path: ME <[EMAIL PROTECTED]>\r\n";

Any help appreciated,

Thanks

Enda
--


- + - + - + - + - + - + - + - + - + - + - + - + -

Enda Nagle
+353 86 168 0774
[EMAIL PROTECTED]
www.category9.com

- + - + - + - + - + - + - + - + - + - + - + - + -




[PHP] Sessions Timeout

2004-07-27 Thread Enda Nagle - Lists
Hi Guys,

I have a problem with a site where I¹m using sessions.

Basically, I have it so that someone enters the site and their session
(shopping cart ref) is created on entry (unless it already exists) and all
variables are stored in the session.

Problem is that when someone goes so far in the ordering process, and then
(for whatever reason) leaves the site, and comes back hours, seconds or
whatever later, and goes again to place an order, the details are different
(time), and the session stays the same so the order entry is entered twice
in the database.

I have gotten around this by checking for the existence of the database
entry for that person and session, and if the entry exists, then I just
update the details, but I¹m wondering if there might be a better way of
doing this?

I had looked at the idea of sessions expiring and found the following in my
php.ini file, and see that the session lifetime is set to 24mins, but am
wondering if there is any given reason why I should change this (or not!).

session.cookie_lifetime = 0
session.gc_maxlifetime = 1440

Thanks for the help,

Enda
--


- + - + - + - + - + - + - + - + - + - + - + - + -

Enda Nagle
+353 86 168 0774
[EMAIL PROTECTED]
www.category9.com

- + - + - + - + - + - + - + - + - + - + - + - + -





Re: [PHP] sessions

2004-06-04 Thread Enda Nagle - Lists
Mark,

You need to do this:
$name = " . $FirstName . " , " . $LastName . ";

Regards

Enda
--




On 05/06/2004 01:22, "BigMark" <[EMAIL PROTECTED]> wrote:

> why is this not working. I am using instead of a form ($name =
> $_POST[name];)
> and linking to it from a users logged in page.
> 
> $FirstName = $_SESSION['first_name'];
> $LastName = $_SESSION['last_name'];
> $name = "$FirstName , $LastName";
> 
> Mark




Re: [PHP] Multiple Update from one form

2004-05-18 Thread Enda Nagle - Lists
Hi Miles,

Thanks for the reply.

I see what you¹re doing there and had looked at the foreach() functionality,
but am I right in saying that I still need to use the multidimensional array
since there are three variables in each line? (id, tracking, kb_ship)?

Enda
--


On 19/05/2004 00:58, "Miles Thompson" <[EMAIL PROTECTED]> wrote:

> At 07:56 PM 5/18/2004, Enda Nagle - Lists wrote:
> 
>> >Its OK guys,
>> >
>> >Got something else myself.
>> >Here¹s the solution... Any suggestions appreciated...
>> >
>> >
>> >/
>> >// UPDATE PART
>> >/
>> >$i=1;
>> >
>> >//while ($ordersinfo[$i])
>> >while ($i < $total)
>> >{
>> >$session = $ordersinfo[$i][session];
>> >$tracking = $ordersinfo[$i][tracking];
>> >$kb_ship = $ordersinfo[$i][kb_ship];
>> >
>> >$update = mysql_query("UPDATE products_orders SET tracking='$tracking',
>> >kb_ship='$kb_ship' WHERE session='$session'") or die (mysql_error());
>> >
>> >$i++;
>> >}
>> >
>> >/
>> >// MAIN PART
>> >/
>> >...
>> >> >name=\"ordersinfo[$i][tracking]\" value=\"" . $roworders[tracking] . "\"
>> >size=25>
>> >...
>> >
>> >
>> >Regards
>> >
>> >Enda
>> >--
>> >
>> >
>> >On 18/05/2004 23:20, "Enda Nagle - Lists" <[EMAIL PROTECTED]> wrote:
>> >
>>> > > Hi
>>> > >
>>> > > I have a current application where I am listing a table of order
>>> details,
>>> > > where a fulfillment company can enter the tracking number and the cost
of
>>> > > the shipment.
>>> > >
>>> > > At present, I have up to 40 orders displayed, and when they click on the
>>> > > Œupdate¹ button, the code executes as
>>> > >
>>> > > if ((isset($tracking1)) && (isset($kb_ship1))){
>>> > >   $update=mysql_query("UPDATE orders SET
>>> > > tracking='$tracking1',kb_ship='$kb_ship1' WHERE order_ref =
>> > '$ref1'",$link);
>>> > > }
>>> > >
>>> > > And this continues as tracking 2... tracking40.
>>> > >
>>> > > I would like to implement something like
>>> > >
>>> > >   foreach ($_POST["ref"]){
>>> > >   $update=mysql_query("UPDATE orders SET
>>> > > tracking='$tracking',kb_ship='$kb_ship' WHERE order_ref =
>>> '$ref'",$link);
>>> > >   }
>>> > >
>>> > > Instead, but I¹m not so sure how I can do this, given that form
>>> variables
>>> > > cannot be named the same etc.
>>> > >
>>> > > I¹m sure that there¹s a better way that the way in which I¹m doing it
>> > at the
>>> > > moment, so any input would be appreciated.
>>> > >
>>> > > Thanks
>>> > >
>>> > > Enda
>>> > > --
>>> > >
>>> > >
> 
> Enda,
> 
> This is close to your situation, but I only needed a one dimensional array
> for a bulk delete. So the form part has this line:
>  print( '');
> There's no need for a subscript in the form - there are presently a
> potential of 963 elements in this array. When we check for bulk delete it's
> never contiguous, we skip down the list, so array is v. sparse.
> 
> And the processing part uses this loop:
> 
>  foreach ($chkdelete as $value){
>  $sql = "delete from subscriber where sub_key = '$value'";
>  $result = mysql_query($sql);
>  }
> 
> This way I'm in no danger of hitting a missing subscript as I might if I
> used $chkdelete[ $i ], incrementing $i
> 
> HTH - Miles




Re: [PHP] Multiple Update from one form

2004-05-18 Thread Enda Nagle - Lists
Its OK guys,

Got something else myself.
Here¹s the solution... Any suggestions appreciated...


/
// UPDATE PART
/
$i=1; 

//while ($ordersinfo[$i])
while ($i < $total)
{
$session = $ordersinfo[$i][session];
$tracking = $ordersinfo[$i][tracking];
$kb_ship = $ordersinfo[$i][kb_ship];

$update = mysql_query("UPDATE products_orders SET tracking='$tracking',
kb_ship='$kb_ship' WHERE session='$session'") or die (mysql_error());

$i++;
}

/
// MAIN PART
/
...

...


Regards

Enda
--


On 18/05/2004 23:20, "Enda Nagle - Lists" <[EMAIL PROTECTED]> wrote:

> Hi
> 
> I have a current application where I am listing a table of order details,
> where a fulfillment company can enter the tracking number and the cost of
> the shipment.
> 
> At present, I have up to 40 orders displayed, and when they click on the
> Œupdate¹ button, the code executes as
> 
> if ((isset($tracking1)) && (isset($kb_ship1))){
>   $update=mysql_query("UPDATE orders SET
> tracking='$tracking1',kb_ship='$kb_ship1' WHERE order_ref = '$ref1'",$link);
> }
> 
> And this continues as tracking 2... tracking40.
> 
> I would like to implement something like
> 
>   foreach ($_POST["ref"]){
>   $update=mysql_query("UPDATE orders SET
> tracking='$tracking',kb_ship='$kb_ship' WHERE order_ref = '$ref'",$link);
>   }
> 
> Instead, but I¹m not so sure how I can do this, given that form variables
> cannot be named the same etc.
> 
> I¹m sure that there¹s a better way that the way in which I¹m doing it at the
> moment, so any input would be appreciated.
> 
> Thanks
> 
> Enda
> --
> 
> 




[PHP] Multiple Update from one form

2004-05-18 Thread Enda Nagle - Lists
Hi

I have a current application where I am listing a table of order details,
where a fulfillment company can enter the tracking number and the cost of
the shipment.

At present, I have up to 40 orders displayed, and when they click on the
Œupdate¹ button, the code executes as

if ((isset($tracking1)) && (isset($kb_ship1))){
  $update=mysql_query("UPDATE orders SET
tracking='$tracking1',kb_ship='$kb_ship1' WHERE order_ref = '$ref1'",$link);
}

And this continues as tracking 2... tracking40.

I would like to implement something like

  foreach ($_POST["ref"]){
  $update=mysql_query("UPDATE orders SET
tracking='$tracking',kb_ship='$kb_ship' WHERE order_ref = '$ref'",$link);
  }

Instead, but I¹m not so sure how I can do this, given that form variables
cannot be named the same etc.

I¹m sure that there¹s a better way that the way in which I¹m doing it at the
moment, so any input would be appreciated.

Thanks

Enda
--



[PHP] ip to country

2004-03-20 Thread Enda Nagle
I have a site that will have different pricing by world region / country and
also offer different currencies.

Presently, the user has to select their country from a select menu and
submit the form, but I would like to eliminate this step if possible, and
set the country according to their IP address.

I had a quick look at http://www.iptocountry.com but was wondering if there
was a way of doing this with PHP functions?

I know its in use on the php.net and google.com sites (when I go to either I
get ie.php.net or google.ie) so was wondering if its costly / easy to
implement?

Thanks for the help,

Enda
--


Enda Nagle
+353 86 168 0774
[EMAIL PROTECTED]
www.nightsol.net

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



RE: [PHP] PDF

2004-02-18 Thread Enda Nagle
Juan,

Try doing something like this:

define('DOLLAR',chr(36));

Just replace the DOLLAR and the chr value with the chatacter number and
reference the variables in the PDF...

Regards

Enda
--


-Original Message-
From: Juan Torres [mailto:[EMAIL PROTECTED]
Sent: 18 February 2004 10:54
To: [EMAIL PROTECTED]
Subject: [PHP] PDF


Hi,

How can I  write special characters (á, ö, ñ, ç,...) in a pdf document?

I'm using pdflib.

Greetings.

--
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] MS SQL / PHP

2004-01-27 Thread Enda Nagle
Got it!

The rs objects need to be written as follows:

to give the following code:

$list2 = $conn->Execute("SELECT * FROM elive.registration") or
DIE($conn->ErrorMsg());

while (!$list2->EOF){

  $Msku = $list2->Fields("sku");
  $Mname = $list2->Fields("name");
  $Memailaddress = $list2->Fields("emailadd");
  $Mcountry = $list2->Fields("country");
  $Mnumdevices = $list2->Fields("numdevices");
  $Msource = $list2->Fields("source");

print ("" . $list2->Fields["sku"]->value . "" .
$list2->Fields["name"]->value . "" .
$list2->Fields["emailadd"]->value . "" .
$list2->Fields["country"]->value . "" .
$list2->Fields["numdevices"]->value . "" .
$list2->Fields["source"]->value . "");

$list2->MoveNext();
}

-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED]
Sent: 27 January 2004 14:34
To: Enda Nagle
Cc: PHP List
Subject: Re: [PHP] MS SQL / PHP


You need to find out what $list2->Fields("sku"); returns. This is not
php anymore, check COM reference.

Enda Nagle wrote:

> Hi Marek,
>
> Thanks for your reply.
>
> Tried that and got the following output:
> COM Object ( [0] => Resource id #3 ) COM Object ( [0] => Resource id #9 )
> COM Object ( [0] => Resource id #15 ) COM Object ( [0] => Resource id
#21 )
>
> There are 4 records in the table at the moment, and its performing the
loop
> etc for the recordset but just isn't returning the data (or returning data
> in a readable format).
>
> Thanks
>
> Enda
> --
>
>
>
> -Original Message-
> From: Marek Kilimajer [mailto:[EMAIL PROTECTED]
> Sent: 27 January 2004 14:05
> To: Enda Nagle
> Cc: PHP List
> Subject: Re: [PHP] MS SQL / PHP
>
>
> try print_r($Msku) and see what comes out
>
> Enda Nagle wrote:
>
>
>>I have a potentially stupid problem with PHP and MSSQL on a Windows
>>server...
>>
>>I can connect to the database and insert data to the tables etc but cannot
>>retrieve data...
>>
>>This is the code I'm using:
>>
>>//---
>>$list2 = $conn->Execute("SELECT * FROM elive.registration") or
>>DIE($conn->ErrorMsg());
>>
>>while (!$list2->EOF){
>>
>>  $Msku = $list2->Fields("sku");
>>  $Mname = $list2->Fields("name");
>>  $Memailaddress = $list2->Fields("emailadd");
>>  $Mcountry = $list2->Fields("country");
>>  $Mnumdevices = $list2->Fields("numdevices");
>>  $Msource = $list2->Fields("source");
>>
>>echo
>>
>
>
"$Msku$Mname$Memailaddress$Mcountry<
>
>>td>$Mnumdevices$Msource";
>>  $list2->MoveNext();
>>}
>>//---
>>
>>The returned info is:
>>
>> Object  Object  Object  Object  Object  Object
>>
>>Am I doing something stupid?
>>
>>Presumably, the code is the same as I am already using on an adodb
>>connection on a Linux box to a MySQL server?
>>
>>Thanks for the help
>>
>>Enda
>>Enda Nagle
>>+353 86 168 0774
>>[EMAIL PROTECTED]
>>www.nightsol.net
>>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>

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

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



RE: [PHP] MS SQL / PHP

2004-01-27 Thread Enda Nagle
Hi Marek,

Thanks for your reply.

Tried that and got the following output:
COM Object ( [0] => Resource id #3 ) COM Object ( [0] => Resource id #9 )
COM Object ( [0] => Resource id #15 ) COM Object ( [0] => Resource id #21 )

There are 4 records in the table at the moment, and its performing the loop
etc for the recordset but just isn't returning the data (or returning data
in a readable format).

Thanks

Enda
--



-Original Message-
From: Marek Kilimajer [mailto:[EMAIL PROTECTED]
Sent: 27 January 2004 14:05
To: Enda Nagle
Cc: PHP List
Subject: Re: [PHP] MS SQL / PHP


try print_r($Msku) and see what comes out

Enda Nagle wrote:

> I have a potentially stupid problem with PHP and MSSQL on a Windows
> server...
>
> I can connect to the database and insert data to the tables etc but cannot
> retrieve data...
>
> This is the code I'm using:
>
> //---
> $list2 = $conn->Execute("SELECT * FROM elive.registration") or
> DIE($conn->ErrorMsg());
>
> while (!$list2->EOF){
>
>   $Msku = $list2->Fields("sku");
>   $Mname = $list2->Fields("name");
>   $Memailaddress = $list2->Fields("emailadd");
>   $Mcountry = $list2->Fields("country");
>   $Mnumdevices = $list2->Fields("numdevices");
>   $Msource = $list2->Fields("source");
>
> echo
>
"$Msku$Mname$Memailaddress$Mcountry<
> td>$Mnumdevices$Msource";
>   $list2->MoveNext();
> }
> //---
>
> The returned info is:
>
>  Object  Object  Object  Object  Object  Object
>
> Am I doing something stupid?
>
> Presumably, the code is the same as I am already using on an adodb
> connection on a Linux box to a MySQL server?
>
> Thanks for the help
>
> Enda
> Enda Nagle
> +353 86 168 0774
> [EMAIL PROTECTED]
> www.nightsol.net
>

--
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] MS SQL / PHP

2004-01-27 Thread Enda Nagle
I have a potentially stupid problem with PHP and MSSQL on a Windows
server...

I can connect to the database and insert data to the tables etc but cannot
retrieve data...

This is the code I'm using:

//---
$list2 = $conn->Execute("SELECT * FROM elive.registration") or
DIE($conn->ErrorMsg());

while (!$list2->EOF){

  $Msku = $list2->Fields("sku");
  $Mname = $list2->Fields("name");
  $Memailaddress = $list2->Fields("emailadd");
  $Mcountry = $list2->Fields("country");
  $Mnumdevices = $list2->Fields("numdevices");
  $Msource = $list2->Fields("source");

echo
"$Msku$Mname$Memailaddress$Mcountry<
td>$Mnumdevices$Msource";
  $list2->MoveNext();
}
//---

The returned info is:

 Object  Object  Object  Object  Object  Object

Am I doing something stupid?

Presumably, the code is the same as I am already using on an adodb
connection on a Linux box to a MySQL server?

Thanks for the help

Enda
Enda Nagle
+353 86 168 0774
[EMAIL PROTECTED]
www.nightsol.net

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



Re: [PHP] Email to database

2003-09-05 Thread Enda Nagle
Its working ok now ­ I changed the error in the headers, but I had added in
another BCC item which was causing the repeated emails.

Working great now Jay ­ thanks a mil for your help!

Regards

Enda
--


On 9/5/03 2:59 PM, "Jay Blanchard" <[EMAIL PROTECTED]>
wrote:

> [snip]
> email1 - gets a copy of each message
> email2 - gets his message and  the one for email3
> email3 - gets his own message
> [/snip]
> 
> Did you change that header line as recommended?


- + - + - + - + - + - + - + - + - + - + - + - + -

Enda Nagle
+353 86 168 0774
[EMAIL PROTECTED]
www.nightsol.net

- + - + - + - + - + - + - + - + - + - + - + - + -




Re: [PHP] Email to database

2003-09-05 Thread Enda Nagle
Jay,

The $to variable is [EMAIL PROTECTED]
Then the emails are pulled from the database in the following order:
email1, email2, email3

The result is:
[EMAIL PROTECTED] ­ gets a copy of each message (fine since its the
$to address for each mail)
email1 ­ gets a copy of each message
email2 ­ gets his message and  the one for email3
email3 ­ gets his own message

Any ideas?

Enda
--



 On 9/5/03 2:29 PM, "Jay Blanchard" <[EMAIL PROTECTED]>
wrote:

> [snip]
> Is there something like MoveNext I should use for the mail function?
> If I put the $headers in the while loop it just keeps adding to the
> $headers
> instead of sending each mail separately as I want it to.
> 
> ..
>> > while($row = mysql_fetch_array($result1))
>> >   {
>> > $headers .= "MIME-Version: 1.0\r\n";
> 
> [/snip]
> 
> I just noticed thischange the first header varaible line to
> 
> $headers = "MIME-Version: 1.0\r\n";
> 
> You are concatting the headers each time instead of resetting them


- + - + - + - + - + - + - + - + - + - + - + - + -

Enda Nagle
+353 86 168 0774
[EMAIL PROTECTED]
www.nightsol.net

- + - + - + - + - + - + - + - + - + - + - + - + -




Re: [PHP] Email to database

2003-09-05 Thread Enda Nagle
I¹ve defined $to earlier on ­ only thing is it still doesn¹t work correctly
with the mail() function inside the while loop.
The reason I wanted it in here was I¹m using the person¹s first name in the
body of the mail.

Should I just populate an array with the details of the users (first_name,
email_address) in the while loop, and then use this to send the mail? This
would just produce the same result though?

Is there something like MoveNext I should use for the mail function?
If I put the $headers in the while loop it just keeps adding to the $headers
instead of sending each mail separately as I want it to.

Thanks for the help

Enda
--




 9/5/03 1:15 PM, "Jay Blanchard" <[EMAIL PROTECTED]>
wrote:

> [snip]
> while($row = mysql_fetch_array($result1))
>   {
> $headers .= "MIME-Version: 1.0\r\n";
> $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
> $headers .= "From: Website \r\n";
> $headers .= "To: $row[email_address]\r\n";
> $headers .= "X-Priority: 1\r\n";
> $headers .= "X-MSMail-Priority: Normal\r\n";
> $headers .= "X-Mailer: MyWebsite";
> $subject = "$subject";
> $message = "aaa bgcolor=ff>aaa";
> 
>mail($to, $subject, $message, $headers)
> or print "Could not send mail to customer";
> 
> print "mail sent to
> $row[email_address]";
> }
> [/snip]
> 
> At first glance  $to is undefined. When testing set
> error_reporting(E_ALL); to catch these kinds of things. Is it possible
> that you define $to as your e-mail address somewhere else and each time
> the thing loops it sends you a copy?
> 
> 
> Have a pleasant, productive and prosperous day.


- + - + - + - + - + - + - + - + - + - + - + - + -

Enda Nagle
+353 86 168 0774
[EMAIL PROTECTED]
www.nightsol.net

- + - + - + - + - + - + - + - + - + - + - + - + -




[PHP] Email to database

2003-09-05 Thread Enda Nagle
Hi

I am using a PHP / MySQL combination to send an email to all users in a
table.

When I run the script, say address1 in the resultset is [EMAIL PROTECTED],
address2 is [EMAIL PROTECTED] & address3 is [EMAIL PROTECTED] ­ When I run
the script, mail is sent to address1,address2 & address3. Problem is I get
copies of all mails sent to the first address pulled from the table.

Any help appreciated.

Thanks

Enda
--

=
PHP Code
=
$result1=mysql_query("select DISTINCT first_name,last_name,email_address
from  WHERE 1 ORDER BY id",$link);

//-

while($row = mysql_fetch_array($result1))
  {
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: Website \r\n";
$headers .= "To: $row[email_address]\r\n";
$headers .= "X-Priority: 1\r\n";
$headers .= "X-MSMail-Priority: Normal\r\n";
$headers .= "X-Mailer: MyWebsite";
$subject = "$subject";
$message = "aa";

   mail($to, $subject, $message, $headers)
or print "Could not send mail to customer";
    
print "mail sent to
$row[email_address]";
}


- + - + - + - + - + - + - + - + - + - + - + - + -

Enda Nagle
+353 86 168 0774
[EMAIL PROTECTED]
www.nightsol.net

- + - + - + - + - + - + - + - + - + - + - + - + -




RE: [PHP] pdf information..

2003-07-16 Thread Enda Nagle
I used FPDF (http://www.fpdf.org) to do a system for a customer where he
could generate invoices and shipping labels.

I just used A4 page size but I remember seeing in the documentation that
you can specify sizes of pages etc.

Also the PDFs work on mm, not pixels.

I know you can embed 300dpi images into the PDF, any time I printed them
they turned out ok.

Best of all, its free and you don't need to use PDF Lib.

Enda
--




-Original Message-
From: Louie Miranda [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 16, 2003 8:30 AM
To: [EMAIL PROTECTED]
Subject: [PHP] pdf information..


Hello,

I have been given a task to generate a business card program over the
web. The option that i can think of it to make it easier is generate a
pdf based on the user's experience over my preview program on the web.

Now im wondering does pdf have those image resolution size? I mean on
image you can specify 100x100 pixels and make the resolution into
300dpi. How about pdf?

--
Thank you,
Louie Miranda ([EMAIL PROTECTED])



-- 
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] Simple forms query

2003-07-09 Thread Enda Nagle
Hi guys,

Thanks a mil - works great.

I'm trying to develop a shopping cart in PHP/MySQL so I'll no doubt be
back soon with more queries - thanks

Enda
--



-Original Message-
From: Matt Matijevich [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, July 09, 2003 5:17 PM
To: 
Subject: Re: [PHP] Simple forms query


I am not 100% sure but I think you could use the $_POST array or the
$_GET array (depending on the method of your form) with the print_r
function.

>>> "Enda Nagle" <[EMAIL PROTECTED]> 07/09/03 11:04AM >>>
I know this has prob been gone through hundreds of times...

I have a form, and I want to display all the form variables on the
target page - without having to use separate print statements for each
variable.



-- 
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] Simple forms query

2003-07-09 Thread Enda Nagle
I know this has prob been gone through hundreds of times...

I have a form, and I want to display all the form variables on the
target page - without having to use separate print statements for each
variable.

tks

-
Enda Nagle   +353 86 168 0774
[EMAIL PROTECTED]www.nightsol.net
-


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