php-general Digest 16 Jul 2003 03:54:51 -0000 Issue 2178

Topics (messages 155295 through 155360):

Re: ANY ONE CAN TELL ME WHAT PORT mssql_connect uses?
        155295 by: Nabil
        155296 by: Liberty Young
        155345 by: Michael Sims

problem:   The PHP CGI cannot be accessed directly.
        155297 by: pehepe php

How to use ph to set meta tags ?
        155298 by: Daniel Szasz
        155299 by: Mike Brum
        155300 by: Johnny Martinez
        155301 by: Leif K-Brooks
        155302 by: Curt Zirzow

Re: timestamp problem !!
        155303 by: Boaz Yahav

How can I display an image within a script?
        155304 by: Dan Anderson
        155305 by: Shena Delian O'Brien
        155306 by: Chris Boget
        155308 by: Shena Delian O'Brien
        155312 by: Curt Zirzow
        155320 by: David Nicholson
        155357 by: ed.homes2see.com

simple imap functions
        155307 by: Bryan Koschmann - GKT
        155309 by: David Nicholson
        155324 by: Bryan Koschmann - GKT

HTTPS POST without user/client intervention
        155310 by: PHP List
        155311 by: Chris Shiflett
        155313 by: PHP List
        155314 by: Chris Shiflett

Exec command not working through php
        155315 by: Mike Morton
        155321 by: David Nicholson
        155322 by: Mike Morton
        155323 by: David Nicholson
        155330 by: Mike Morton

help me please!
        155316 by: pehepe php
        155319 by: DvDmanDT

session across satelite windows
        155317 by: Thomas Hochstetter

Problem with Apache Web Server config file and PHP working together Please help!!
        155318 by: karen santmyer
        155337 by: Baroiller Pierre-Emmanuel

value not passed
        155325 by: Joaco
        155327 by: Johnny Martinez
        155336 by: Baroiller Pierre-Emmanuel
        155346 by: Curt Zirzow

Object can not be used after a session
        155326 by: Matt Silva
        155354 by: Matt Silva
        155356 by: Mike Migurski

How to store a file into MSSQL?
        155328 by: Javier
        155334 by: Baroiller Pierre-Emmanuel
        155344 by: Javier

HTML email with Outlook
        155329 by: Tim Thorburn
        155331 by: Jim Lucas
        155332 by: Baroiller Pierre-Emmanuel
        155333 by: Johnny Martinez
        155338 by: Curt Zirzow
        155339 by: Johnny Martinez
        155340 by: Mike Brum
        155343 by: Manuel Lemos
        155355 by: Tim Thorburn

XML Array
        155335 by: Michael Smith
        155342 by: Evan Nemerson
        155347 by: Mike Migurski

Re: DOMXML...
        155341 by: Michael Smith

Re: socket programming
        155348 by: Michael P. Carel
        155352 by: Chris Shiflett
        155353 by: David Nicholson

Insert leading zeros
        155349 by: Matt Palermo
        155350 by: Curt Zirzow
        155351 by: Matt Palermo

It's possible to read version info from a exe/dll....?
        155358 by: Daniel Szasz

multiple databases
        155359 by: Paulo Neves
        155360 by: Curt Zirzow

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
how can i specify the port for the direct connection
mssql_connect()

can u give me some hints regarding the FreeTDS
if i used it then i have to confugure the DSN in liunx am i wrong?


"Michael Sims" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
On Tue, 15 Jul 2003 11:00:27 +0300, you wrote:

>WHAT PORTS PHP USE WHEN COMUNICATING WITH MSSQL SERVER OVER THE NETWORK?

I only have experience with MS SQL Server 7.  It listens on TCP port
1433.

>I have an Linux server running Apache/PHP/MySQL.
>and I need to connect to another server running  MSSQL server 7
>
>THE POINT IS  the only way I have to connect is throu ODBC connection
>because the network administrator only allowed me to connect thru port 1433
>that ODBC uses..

If it's SQL version 7 then you can use this same port for a "direct"
connection.  I know, my companies public web site connects via this
port to an SQL server behind our firewall, and has done so for well
over a year without issue.

>I tried to make it direct connection, but this way uses many ports that the
>firewall won't allowed..

Not with version 7.

>I heard about FreeDTS and iODBC, but I need some advice and notes to make
it
>easy for me..

FreeTDS works like a charm, it's what we use...



--- End Message ---
--- Begin Message ---
On Tue, 2003-07-15 at 01:00, Nabil wrote:
> I tried to make it direct connection, but this way uses many ports that the
> firewall won't allowed..
> He said for security reasons that he can't open those ports to prevents
> hackers to use them ... do u think this is a true ? any advice what port the
> direct connection uses??? does it uses NetBIOS?
> 
Your security admin knows your network and needs better than us...from
what you told us, he's not doing anything dumb. 

> if he was right ... so I have to change to ODBC
> I heard about FreeDTS and iODBC, but I need some advice and notes to make it
> easy for me..
> 
iODBC and FreeDTS work GREAT!!! 

I've gone through the hassle of installing it on a Mandrake Machine, and
it wasn't a huge pain in the keyster. On Mandrake 9.0, the drivers and
RPMS were outdated, and they were flakey. 

However, apt-get install unixodbc in Debian unstable works like a charm,
if you are willing to give up ODBCConfig and DataManger(I or II). 

> Please HELP.. and your valuable comments will be appreciated..
> 
> Nabil
> 
> 
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
On Tue, 15 Jul 2003 19:36:42 +0300, you wrote:

>how can i specify the port for the direct connection
>mssql_connect()

I've never had the need to do this, so I cannot verify that this
works, but I believe you can supply a port number in the servername
argument:

mssql_connect('192.168.0.1:1433', 'someuser', 'somepass');

You can also define this in the FreeTDS "interfaces" file, I believe,
but again I'm not sure as I use the default port.

>can u give me some hints regarding the FreeTDS

Read this article, it helped me out immensely when I set it all up:

http://www.phpbuilder.com/columns/alberto20000919.php3

>if i used it then i have to confugure the DSN in liunx am i wrong?

Not sure what you mean here.  If you're referring to a Windows "Data
Source Name" then that is not really relevant on a Linux platform.  If
you have access to port 1433 on the SQL server all you need to do is
to download and install FreeTDS (follow the article above for help,
and when all else fails read the FreeTDS documentation), then rebuild
PHP with the "--with-sybase" option.  After you have done that you can
simply supply an IP address or hostname to the mssql_connect() call.

Give it a shot and if you run into problems I'd be glad to try an
answer any specific questions you may have.

--- End Message ---
--- Begin Message ---
My system is windows 98 second edition
im using pws
i built php 4.2.2
when ý struggle to reach any .php file for example 127.0.0.1/sample.php
this error occur:



Security Alert! The PHP CGI cannot be accessed directly.
This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.


_________________________________________________________________
The new MSN 8: advanced junk mail protection and 2 months FREE* http://join.msn.com/?page=features/junkmail



--- End Message ---
--- Begin Message ---
Hello

I wish to create be able to put in the meta tags value from functions.
How can be done ?

Here is part of the code :


<?php
  function mAuthor() {
    $Author = "Daniel Szasz";
    return $Author;
  };
?>


<?

?>

<HTML>
<HEAD>

<META http-equiv=Content-Type content="text/html; charset=windows-1252">

<META NAME="mAuthor" CONTENT= <? mAuthor() ?> >
</HEAD>
</HTML>

Thanks a lot for the help

Daniel




--- End Message ---
--- Begin Message ---
You're close but instead of <? mAuthor() ?> try 

<?php print mAuthor(); ?>

That will print the return value of your function - which by example is
"Daniel Szasz".

-M

-----Original Message-----
From: Daniel Szasz [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 15, 2003 3:07 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How to use ph to set meta tags ?


Hello

I wish to create be able to put in the meta tags value from functions.
How can be done ?

Here is part of the code :


<?php
  function mAuthor() {
    $Author = "Daniel Szasz";
    return $Author;
  };
?>


<?

?>

<HTML>
<HEAD>

<META http-equiv=Content-Type content="text/html; charset=windows-1252">

<META NAME="mAuthor" CONTENT= <? mAuthor() ?> >
</HEAD>
</HTML>

Thanks a lot for the help

Daniel




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





--- End Message ---
--- Begin Message ---
<?php
  function mAuthor() {
    $Author = 'Daniel Szasz';
    print $Author;
  };
?>

Then use: 
META NAME="Author" CONTENT="<? mAuthor(); ?>">

Notice I replaced 
$Author = "Daniel Szasz";
with
$Author = 'Daniel Szasz';

This tells php to just assign the value to the variable and not to bother
performing any interpretation on it. This speeds up your script
intepretation. You also forgot the ';' in the html/php statement for the
Meta Name.

HTH,
Johnny

-----Original Message-----
From: Daniel Szasz [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 12:07 PM
To: [EMAIL PROTECTED]
Subject: [PHP] How to use ph to set meta tags ?


Hello

I wish to create be able to put in the meta tags value from functions.
How can be done ?

Here is part of the code :


<?php
  function mAuthor() {
    $Author = "Daniel Szasz";
    return $Author;
  };
?>


<?

?>

<HTML>
<HEAD>

<META http-equiv=Content-Type content="text/html; charset=windows-1252">

<META NAME="mAuthor" CONTENT= <? mAuthor() ?> >
</HEAD>
</HTML>

Thanks a lot for the help

Daniel




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

--- End Message ---
--- Begin Message ---
I wish to create be able to put in the meta tags value from functions.
How can be done ?

Here is part of the code :


<?php function mAuthor() { $Author = "Daniel Szasz"; return $Author; }; ?>


<?


?>

<HTML>
<HEAD>

<META http-equiv=Content-Type content="text/html; charset=windows-1252">



<META NAME="mAuthor" CONTENT= <?php echo mAuthor() ?> >

</HEAD>
</HTML>



-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.



--- End Message ---
--- Begin Message ---
Daniel Szasz <[EMAIL PROTECTED]> wrote:
> Hello
> 
> I wish to create be able to put in the meta tags value from functions.
> How can be done ?
> 
> Here is part of the code :
> 
> 
> <?php
>   function mAuthor() {
>     $Author = "Daniel Szasz";
>     return $Author;
>   };
> ?>
> [...]
> <HTML>
> <HEAD>
> 
> <META http-equiv=Content-Type content="text/html; charset=windows-1252">
> 
> <META NAME="mAuthor" CONTENT= <? mAuthor() ?> >

You might also want to make sure that it is quoted:

  <META NAME="mAuthor" CONTENT="<?echo  mAuthor() ?>" >


Curt 
-- 


--- End Message ---
--- Begin Message ---
Read the last comment at the bottom of this page :
http://www.weberdev.com/get_example.php3?count=787

Sincerely

berber

Visit http://www.weberdev.com/ Today!!!
To see where PHP might take you tomorrow.


-----Original Message-----
From: Nabil [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 15, 2003 8:00 PM
To: [EMAIL PROTECTED]
Subject: [PHP] timestamp problem !!


i have

<?php
$timy = '20030714012548';  // time stamp from MySQL
echo strtotime = ($timy);
$date = ("Y-m-d" , $timy);
?>

and i have a wrong result.... how can i extract the YYYY-MM-DD from the
string $timy....

Please Advice....

Nabil



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


--- End Message ---
--- Begin Message ---
Because of restrictive safe mode settings I cannot display images from
their folder.  Is there a way to embed them within a web page?

i.e.

<?php
print "<IMAGE START>\n";
readfile('image.jpeg');
print "</IMAGE END>\n";
?>

Thanks in advance,

Dan Anderson


--- End Message ---
--- Begin Message --- That's a very good question. I'd like to know the answer to that as well.

Dan Anderson wrote:
Because of restrictive safe mode settings I cannot display images from
their folder.  Is there a way to embed them within a web page?

i.e.

<?php
print "<IMAGE START>\n";
readfile('image.jpeg');
print "</IMAGE END>\n";
?>

Thanks in advance,

Dan Anderson



--- End Message ---
--- Begin Message ---
> > Because of restrictive safe mode settings I cannot display images from
> > their folder.  Is there a way to embed them within a web page?
> That's a very good question. I'd like to know the answer to that as well.

A plethora of answers can be found here:

http://www.phpbuilder.com/search/?sort=Score&method=and&config=mail&restrict=&exclude=&words=inline+image+database

What you are asking for is the same basic concept.

Chris


--- End Message ---
--- Begin Message ---
I think here would be a good place to start looking:
http://www.php.net/manual/en/ref.image.php

Dan Anderson wrote:
Because of restrictive safe mode settings I cannot display images from
their folder.  Is there a way to embed them within a web page?

i.e.

<?php
print "<IMAGE START>\n";
readfile('image.jpeg');
print "</IMAGE END>\n";
?>

Thanks in advance,

Dan Anderson



--- End Message ---
--- Begin Message ---
Dan Anderson <[EMAIL PROTECTED]> wrote:
> Because of restrictive safe mode settings I cannot display images from
> their folder.  Is there a way to embed them within a web page?

I'm not entirely clear what you mean by not being able to display images
from their folder, can you explain that more.  HTML doesn't allow for
embeded images. 

> 
> i.e.
> 
> <?php
> print "<IMAGE START>\n";
> readfile('image.jpeg');
> print "</IMAGE END>\n";
> ?>

Ok, assuming that the image files are outside the public web tree and
you can read them with a script. You will have to write a php script
that will read the file (sending the appropriate headers).

So your script will generate html like
<img src="/showimage.php?file=filename.jpg">

then showimage.php will do something:
header('content-type: appropricate/type');
// content-length would be good
readfile($file);


HTH
Curt
-- 


--- End Message ---
--- Begin Message ---
Hello,

This is a reply to an e-mail that you wrote on Tue, 15 Jul 2003 at 21:14,
lines prefixed by '>' were originally written by you.
> Ok, assuming that the image files are outside the public web tree and
> you can read them with a script. You will have to write a php script
> that will read the file (sending the appropriate headers).
> So your script will generate html like
> <img src="/showimage.php?file=filename.jpg">
> then showimage.php will do something:
> header('content-type: appropricate/type');
> // content-length would be good
> readfile($file);

My addition to this advice would be to make sure you do some sort of
validation of $_GET['file'] before you use it within the readfile()
function or you have a security problem.  For example people could send a
request for /showimage.php?file=yourscript.php and they would be
presented with the source code to your PHP script.

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

          Professional Web Development by David Nicholson
                    http://www.djnicholson.com/

    QuizSender.com - How well do your friends actually know you?
                     http://www.quizsender.com/
                    (developed entirely in PHP)

--- End Message ---
--- Begin Message ---
Yes, the method below would work just fine if you only needed to display
one image. Trying it on a second image within the same generated page 
would give you a "headers already sent" error.

Ed

> Ok, assuming that the image files are outside the public web tree and
> you can read them with a script. You will have to write a php script
> that will read the file (sending the appropriate headers).
> 
> So your script will generate html like
> <img src="/showimage.php?file=filename.jpg">
> 
> then showimage.php will do something:
> header('content-type: appropricate/type');
> // content-length would be good
> readfile($file);
> 
> HTH Curt --


--- End Message ---
--- Begin Message ---
Hello,

Does anyone have any good examples of simple imap functions? Basically I
am just looking to return the number of new messages for a few folders in
my account. I would like to modify it later to show the headers (from,
subject) but just a new message count is sufficient.

I would like to have this in a page that refreshes every 20-30 seconds or
so, will there be any problems with this?

Thanks in advance,

        Bryan


--- End Message ---
--- Begin Message ---
Hello,

This is a reply to an e-mail that you wrote on Tue, 15 Jul 2003 at 20:49,
lines prefixed by '>' were originally written by you.
> Does anyone have any good examples of simple imap functions?
Basically
> am just looking to return the number of new messages for a few folders
> my account. I would like to modify it later to show the headers (from,
> subject) but just a new message count is sufficient.
> I would like to have this in a page that refreshes every 20-30 seconds
> so, will there be any problems with this?

You could compile PHP with the IMAP functions and use them:
http://uk2.php.net/imap

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

          Professional Web Development by David Nicholson
                    http://www.djnicholson.com/

    QuizSender.com - How well do your friends actually know you?
                     http://www.quizsender.com/
                    (developed entirely in PHP)

--- End Message ---
--- Begin Message ---
On Tue, 15 Jul 2003, David Nicholson wrote:
>
> You could compile PHP with the IMAP functions and use them:
> http://uk2.php.net/imap

That is what I was referring to looking for examples using these
functions as a whole.

        Bryan


--- End Message ---
--- Begin Message ---
I am writing a php script to accept an HTTPS POST of data from a remote
site, process the data, and send an HTTPS POST response back (not
necessarily to the same remote site). I can do this pretty easily in
PERL (which I may have to if I can't find a PHP solution).  Also I need
to do the https post without any kind of client or user interaction. I
have checked through php.net and phpbuilder.com but have only come up
with things for HTTP POST (no SSL Encryption).  Anyone run across
something like this, or can point me in a direction to look?

-- 
Woody

In a world without boundaries why
do we need Gates and Windows?


--- End Message ---
--- Begin Message ---
--- PHP List <[EMAIL PROTECTED]> wrote:
> I am writing a php script to accept an HTTPS POST of data from a
> remote site, process the data, and send an HTTPS POST response back
> (not necessarily to the same remote site).

Can you perhaps rephrase what you are trying to do? The way I interpret what
you are asking may be much simpler than what you really mean to do.

To "accept" an HTTPS POST only requires that your Web server is SSL-enabled.
There is nothing special you must do. For example, a PHP script can print out
all posted data like this:

print_r($_POST);

This simple example also replies to the remote site (over SSL) that sent the
HTTPS request, since that's where standard out goes. Basically, since SSL lies
between TCP and HTTP, by the time your PHP script gets the data, there is
really no difference. The difference is in the Web server, not the code (unless
you want to check whether the current connection is SSL).

As for sending a POST request to a remote site via SSL, just check out cURL,
which also has a convenient PEAR package.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

--- End Message ---
--- Begin Message ---
On Tue, 2003-07-15 at 15:12, Chris Shiflett wrote:
> --- PHP List <[EMAIL PROTECTED]> wrote:
> > I am writing a php script to accept an HTTPS POST of data from a
> > remote site, process the data, and send an HTTPS POST response back
> > (not necessarily to the same remote site).
> 
> Can you perhaps rephrase what you are trying to do? The way I interpret what
> you are asking may be much simpler than what you really mean to do.
> 
> To "accept" an HTTPS POST only requires that your Web server is SSL-enabled.
> There is nothing special you must do. For example, a PHP script can print out
> all posted data like this:
> 
> print_r($_POST);
Yup...I already accept the https posts just fine...

<snip...>
> 
> As for sending a POST request to a remote site via SSL, just check out cURL,
> which also has a convenient PEAR package.

This is what I am trying to do...and thanks for point out cURL...I will
check it out.

Sorry for being unclear...

-- 
Woody

In a world without boundaries why
do we need Gates and Windows?


--- End Message ---
--- Begin Message ---
--- PHP List <[EMAIL PROTECTED]> wrote:
> > As for sending a POST request to a remote site via SSL, just check
> > out cURL, which also has a convenient PEAR package.
> 
> This is what I am trying to do...and thanks for point out cURL...I will
> check it out.

In that case, you should find this helpful:

http://www.php.net/curl

If you like PEAR, this might be handy:

http://pear.php.net/Net_Curl

cURL does support SSL, so it should provide what you need.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

--- End Message ---
--- Begin Message ---
I have the following exec command in php:
exec("/bin/sed -f $GLOBALS[TMP_MAIL_DIR]"."cmdfile
$GLOBALS[TMP_MAIL_DIR]"."$mailid >
$GLOBALS[TMP_MAIL_DIR]"."$mailid"."tmp",$results);

Which does a search and replace using the sed command file:
s/&#39;/'/g
s/&quot;/"/g

Now, executed command line, this works beautifully, the input file is parsed
and the results go to the output file - BUT when run via php, the output
file is blank, empty, no data at all.

Permissions are not the problem, I went so far as to 777 the directory and
file, still the same results.

Running PHP 4.1.2 on Linux Redhat something or another.

I am sure that it is something simple, but it is driving me crazy!

Oh, and yes, globals are on here - if I print out the exec line with the
dynamically generated paths, etc, then execute that through the terminal, no
problem.

If anyone has run into this with exec commands before or can suggest a
different way to run this command, I would love to hear it!

TIA 

--
Cheers

Mike Morton

****************************************************
*
* Tel: 905-465-1263
* Email: [EMAIL PROTECTED]
*
****************************************************

"Indeed, it would not be an exaggeration to describe the history of the
computer industry for the past decade as a massive effort to keep up with
Apple."
- Byte Magazine

Given infinite time, 100 monkeys could type out the complete works of
Shakespeare. Win 98 source code? Eight monkeys, five minutes.
-- NullGrey 


--- End Message ---
--- Begin Message ---
Hello,

This is a reply to an e-mail that you wrote on Tue, 15 Jul 2003 at 21:30,
lines prefixed by '>' were originally written by you.
> I have the following exec command in php:
> exec("/bin/sed -f $GLOBALS[TMP_MAIL_DIR]"."cmdfile
> $GLOBALS[TMP_MAIL_DIR]"."$mailid >
> $GLOBALS[TMP_MAIL_DIR]"."$mailid"."tmp",$results);
> Which does a search and replace using the sed command file:
> s/'/'/g
> s/"/"/g
> Now, executed command line, this works beautifully, the input file is
> parsed
> and the results go to the output file - BUT when run via php, the
> output
> file is blank, empty, no data at all.
> Permissions are not the problem, I went so far as to 777 the directory
> and
> file, still the same results.
> Running PHP 4.1.2 on Linux Redhat something or another.
> I am sure that it is something simple, but it is driving me crazy!
> Oh, and yes, globals are on here - if I print out the exec line with
> the
> dynamically generated paths, etc, then execute that through the
> terminal, no
> problem.
> If anyone has run into this with exec commands before or can suggest a
> different way to run this command, I would love to hear it!

Put this line of code in your script:

echo "/bin/sed -f $GLOBALS[TMP_MAIL_DIR]"."cmdfile
$GLOBALS[TMP_MAIL_DIR]"."$mailid >
$GLOBALS[TMP_MAIL_DIR]"."$mailid"."tmp";

and check that it contains what you expect it to.

All the best,

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

          Professional Web Development by David Nicholson
                    http://www.djnicholson.com/

    QuizSender.com - How well do your friends actually know you?
                     http://www.quizsender.com/
                    (developed entirely in PHP)

--- End Message ---
--- Begin Message ---
"if I print out the exec line with the
dynamically generated paths, etc, then execute that through the terminal, no
problem. "

>From the first email meaning that I did just like you suggested already and
it works in the terminal and contains exactly what I expect it to.

But thanks :)


On 7/15/03 6:09 PM, "David Nicholson" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> This is a reply to an e-mail that you wrote on Tue, 15 Jul 2003 at 21:30,
> lines prefixed by '>' were originally written by you.
>> I have the following exec command in php:
>> exec("/bin/sed -f $GLOBALS[TMP_MAIL_DIR]"."cmdfile
>> $GLOBALS[TMP_MAIL_DIR]"."$mailid >
>> $GLOBALS[TMP_MAIL_DIR]"."$mailid"."tmp",$results);
>> Which does a search and replace using the sed command file:
>> s/'/'/g
>> s/"/"/g
>> Now, executed command line, this works beautifully, the input file is
>> parsed
>> and the results go to the output file - BUT when run via php, the
>> output
>> file is blank, empty, no data at all.
>> Permissions are not the problem, I went so far as to 777 the directory
>> and
>> file, still the same results.
>> Running PHP 4.1.2 on Linux Redhat something or another.
>> I am sure that it is something simple, but it is driving me crazy!
>> Oh, and yes, globals are on here - if I print out the exec line with
>> the
>> dynamically generated paths, etc, then execute that through the
>> terminal, no
>> problem.
>> If anyone has run into this with exec commands before or can suggest a
>> different way to run this command, I would love to hear it!
> 
> Put this line of code in your script:
> 
> echo "/bin/sed -f $GLOBALS[TMP_MAIL_DIR]"."cmdfile
> $GLOBALS[TMP_MAIL_DIR]"."$mailid >
> $GLOBALS[TMP_MAIL_DIR]"."$mailid"."tmp";
> 
> and check that it contains what you expect it to.
> 
> All the best,
> 
> David.

--
Cheers

Mike Morton

****************************************************
*
* Tel: 905-465-1263
* Email: [EMAIL PROTECTED]
*
****************************************************

"Indeed, it would not be an exaggeration to describe the history of the
computer industry for the past decade as a massive effort to keep up with
Apple."
- Byte Magazine

Given infinite time, 100 monkeys could type out the complete works of
Shakespeare. Win 98 source code? Eight monkeys, five minutes.
-- NullGrey 


--- End Message ---
--- Begin Message ---
Hello,

This is a reply to an e-mail that you wrote on Tue, 15 Jul 2003 at 23:17,
lines prefixed by '>' were originally written by you.
> "if I print out the exec line with the
> dynamically generated paths, etc, then execute that through the
> terminal, no
> problem. "
> >From the first email meaning that I did just like you suggested
> already and
> it works in the terminal and contains exactly what I expect it to.
> But thanks :)

Sorry, I jumped over that in your original mail! I amy as well try and be
of help again then...

Does the user on the system that your webserver runs as have permission to
execute the program you are trying to execute?

Do you expect the program to have any output, if so is it appearing in
your $results array? is anything being put in the $results array?

Also, you could try using the third optional paramater for the exec
function to retrieve the return status of the command you are executing.

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

          Professional Web Development by David Nicholson
                    http://www.djnicholson.com/

    QuizSender.com - How well do your friends actually know you?
                     http://www.quizsender.com/
                    (developed entirely in PHP)

--- End Message ---
--- Begin Message ---
David:

Permissions were the first guess - I chmoded 777 everything - still no go.

On the server, there should be a second file created identical to the first
with the results of the sed find and replace in it - the only thing that is
created is a blank file.

So, it is not permissions, nothing is returned in the results array, and the
exact same query run on the server command line works properly - the only
difference between it executing through php and command line is, as far as I
can tell, the user being apache for the php exec and a different user
command line, but with mode 777 on the files and directories (ya ya, I know
that is not secure but it is just for testing purposes ;)) the user should
not make a difference.....

On 7/15/03 6:23 PM, "David Nicholson" <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> This is a reply to an e-mail that you wrote on Tue, 15 Jul 2003 at 23:17,
> lines prefixed by '>' were originally written by you.
>> "if I print out the exec line with the
>> dynamically generated paths, etc, then execute that through the
>> terminal, no
>> problem. "
>>> From the first email meaning that I did just like you suggested
>> already and
>> it works in the terminal and contains exactly what I expect it to.
>> But thanks :)
> 
> Sorry, I jumped over that in your original mail! I amy as well try and be
> of help again then...
> 
> Does the user on the system that your webserver runs as have permission to
> execute the program you are trying to execute?
> 
> Do you expect the program to have any output, if so is it appearing in
> your $results array? is anything being put in the $results array?
> 
> Also, you could try using the third optional paramater for the exec
> function to retrieve the return status of the command you are executing.
> 
> David.

--
Cheers

Mike Morton

****************************************************
*
* Tel: 905-465-1263
* Email: [EMAIL PROTECTED]
*
****************************************************

"Indeed, it would not be an exaggeration to describe the history of the
computer industry for the past decade as a massive effort to keep up with
Apple."
- Byte Magazine

Given infinite time, 100 monkeys could type out the complete works of
Shakespeare. Win 98 source code? Eight monkeys, five minutes.
-- NullGrey 


--- End Message ---
--- Begin Message ---
My system is windows 98 second edition
im using pws
i built php 4.2.2
when ý struggle to reach any .php file for example 127.0.0.1/sample.php
this error occur:



Security Alert! The PHP CGI cannot be accessed directly.
This PHP CGI binary was compiled with force-cgi-redirect enabled. This means that a page will only be served up if the REDIRECT_STATUS CGI variable is set, e.g. via an Apache Action directive.



please help me!!!!!!!!!!


_________________________________________________________________
Add photos to your messages with MSN 8. Get 2 months FREE*. http://join.msn.com/?page=features/featuredemail



--- End Message ---
--- Begin Message ---
It's a php.ini options named like force_redirect or something...

"Pehepe Php" <[EMAIL PROTECTED]> skrev i meddelandet
news:[EMAIL PROTECTED]
> My system is windows 98 second edition
> im using pws
> i built php 4.2.2
> when ý struggle to reach any .php file for example 127.0.0.1/sample.php
> this error occur:
>
>
>
> Security Alert! The PHP CGI cannot be accessed directly.
> This PHP CGI binary was compiled with force-cgi-redirect enabled. This
means
> that a page will only be served up if the REDIRECT_STATUS CGI variable is
> set, e.g. via an Apache Action directive.
>
>
> please help me!!!!!!!!!!
>
> _________________________________________________________________
> Add photos to your messages with MSN 8. Get 2 months FREE*.
> http://join.msn.com/?page=features/featuredemail
>



--- End Message ---
--- Begin Message ---
Hi again.

 

I am having a problem with session variables spanning over different
windows.

What I am doing is to supply links in an admin interface that open satellite
windows, opened via JS. The window scripts check for a variable to be
present ($_SESSION[]). I am doing this so that the scripts cannot be called without
being successfully logged in.

The problem is this:

Opening the first window is fine, but when closed (with window.close()) and
tried to reopen, the $_SESSION variable test works out to be false. Why?

 

I am passing the session number through to the windows (as a variable called
$sesi). I checked the session folder, and it seems that the session is not
destroyed. All scripts call session_start(). What is happening? I know that
the manual says that we have to send the session number to the next pages.

Does it have anything to do with JS (I doubt).

 

Help is appreciated.

 

Below you find the calling snipps:

 

[snip]

 

#

## Check for valid session variable

# 

session_start();

require("../../scripts/generic/major.class.php");

$gsql = new sql;

if ($_SESSION['uid'])

{

…

 

#

## open the window with js

#
… onclick="openwin('update','<?php echo $tid;?>','<?echo
session_id();?>','<?php echo $uid;?>','430','480','cwin','no','no')" />

function openwin(type,id,sess,uid,h,w,win,loc,scrl){
 
window.open("xtemp/"+type+".php?sesi="+sess+"&id="+id+"&uid="+uid+"",win,"height="+h+",width="+w+",left=0,top=0,alwaysRaised=yes,directories=no,dependent=yes,location="+loc+",status=no,titlebar=no,resizable=no,menubar=no,scrollbars="+scrl+"");

}

 

 

Thomas

-- 
+++ GMX - Mail, Messaging & more  http://www.gmx.net +++

Jetzt ein- oder umsteigen und USB-Speicheruhr als Prämie sichern!


--- End Message ---
--- Begin Message ---
HI:
 
     I installed Apache Web Server on my laptop which has Windows XP.  I then 
installed PHP.  I followed the directions in the book I had on installing apache and 
php and what to add to the apache configuration file.
 
      Here is what is happening:  After installing everything, I tested my Apache web 
server installation first and saw the apache web server page like the book said.  Then 
it said to do a little php program - which had phpinfo() in it.  But when I retyped 
the url I got a message that asked me did I want to download a file, which was the php 
program file.
 
      The PHP is 4.3.2 and the apache web server is 2.0.  What am I doing wrong?  
Should I use apache 1.3.2?
 
       Please help.  I understand everything, just don't know why it is prompting me 
to download a file.
 
       Thanks.
 
Karen



---------------------------------
Do you Yahoo!?
SBC Yahoo! DSL - Now only $29.95 per month!

--- End Message ---
--- Begin Message ---
Have you loaded php module into apache ?
Have you defined .php files into your httpd.conf ?

Try with easyphp on windows... I can't help you more... I hate windows! :D

Regards,
P.E Baroiller

"Karen Santmyer" <[EMAIL PROTECTED]> a écrit dans le message de
news:[EMAIL PROTECTED]
> HI:
>
>      I installed Apache Web Server on my laptop which has Windows XP.  I
then installed PHP.  I followed the directions in the book I had on
installing apache and php and what to add to the apache configuration file.
>
>       Here is what is happening:  After installing everything, I tested my
Apache web server installation first and saw the apache web server page like
the book said.  Then it said to do a little php program - which had
phpinfo() in it.  But when I retyped the url I got a message that asked me
did I want to download a file, which was the php program file.
>
>       The PHP is 4.3.2 and the apache web server is 2.0.  What am I doing
wrong?  Should I use apache 1.3.2?
>
>        Please help.  I understand everything, just don't know why it is
prompting me to download a file.
>
>        Thanks.
>
> Karen
>
>
>
> ---------------------------------
> Do you Yahoo!?
> SBC Yahoo! DSL - Now only $29.95 per month!



--- End Message ---
--- Begin Message ---
Can anyone tell me why the addDivName field is always passed as a blank...
This is killing me.

<?php if($i <= 8) {?>
    <td>
         <input type="text" name="addDivName" class="textfield">
     </td>
      <td align="right">
            <a href="<?php print
"index.php?op=addDivision&total=".$i."&addDivName=".$addDivName; ?>">
                 <img src="<?php print SITE_DIR
?>_img/_buttons/btn_additem.gif"
                      width="58" height="15" alt="" border="0" />
            </a>
      </td>
 <?php } ?>

Whenever I click on the anchor everything is sent thru except the value of
addDivName?



--- End Message ---
--- Begin Message ---
No value is assigned in the code you listed. What is before this block? 
If $addDivName isn't given a value then nothing is posted. Are you trying to
have the text field populate this info? If so, you are getting your program
flow wrong.

Johnny

-----Original Message-----
From: Joaco [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 3:39 PM
To: [EMAIL PROTECTED]
Subject: [PHP] value not passed


Can anyone tell me why the addDivName field is always passed as a blank...
This is killing me.

<?php if($i <= 8) {?>
    <td>
         <input type="text" name="addDivName" class="textfield">
     </td>
      <td align="right">
            <a href="<?php print
"index.php?op=addDivision&total=".$i."&addDivName=".$addDivName; ?>">
                 <img src="<?php print SITE_DIR
?>_img/_buttons/btn_additem.gif"
                      width="58" height="15" alt="" border="0" />
            </a>
      </td>
 <?php } ?>

Whenever I click on the anchor everything is sent thru except the value of
addDivName?



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

--- End Message ---
--- Begin Message ---
did you put a <form name="" method="POST/GET"> before in your script ?
What I see in your script is : addDivName is a text input field, without
value..
so, if you click on you link, is $addDivName wasn't set before, the content
is... empty! :)

I can't help you more with your tiny sample :(


Regards,
P.E. Baroiller

"Joaco" <[EMAIL PROTECTED]> a écrit dans le message de
news:[EMAIL PROTECTED]
> Can anyone tell me why the addDivName field is always passed as a blank...
> This is killing me.
>
> <?php if($i <= 8) {?>
>     <td>
>          <input type="text" name="addDivName" class="textfield">
>      </td>
>       <td align="right">
>             <a href="<?php print
> "index.php?op=addDivision&total=".$i."&addDivName=".$addDivName; ?>">
>                  <img src="<?php print SITE_DIR
> ?>_img/_buttons/btn_additem.gif"
>                       width="58" height="15" alt="" border="0" />
>             </a>
>       </td>
>  <?php } ?>
>
> Whenever I click on the anchor everything is sent thru except the value of
> addDivName?
>
>



--- End Message ---
--- Begin Message ---
Joaco <[EMAIL PROTECTED]> wrote:
> Can anyone tell me why the addDivName field is always passed as a blank...
> This is killing me.
> 
> <?php if($i <= 8) {?>
>     <td>
>          <input type="text" name="addDivName" class="textfield">

This isnt getting submited when you press the link.

>      </td>
>       <td align="right">
>             <a href="<?php print
> "index.php?op=addDivision&total=".$i."&addDivName=".$addDivName; ?>">
>                  <img src="<?php print SITE_DIR
> ?>_img/_buttons/btn_additem.gif"
>                       width="58" height="15" alt="" border="0" />
>             </a>

The 'a href' wont pass the variable addDivName that the user has just
entered in the textbox above. You'll want to change that href to
something like:
<input type="image" src="btn_additem.gif">

Be sure that you have set up the form earlier in the file.

>       </td>



>  <?php } ?>
> 
> Whenever I click on the anchor everything is sent thru except the value of
> addDivName?
 

Curt
-- 


--- End Message ---
--- Begin Message ---
Hi I was wondering if anybody has any Ideas about or has experienced
this....

I create a new object and then assign it to a session var

$customer = new Customer($_GET['facilityID'], $_GET['customerID']);
$_SESSION['acceptPayment']['customer'] = $customer;

but later when I access that session var [in the the same file but in a different function and different instance], php gives me an error saying:

"The script tried to execute a methode or access a property of an incomplete object. Pleas ensure that the class definition lt;bgt;customerlt;/bgt; of the object you are trying to operate on was loaded _before_ the session was started
at <filepath>/acceptPayment.php line 103"


I did a little reading (rtfm) on php.net and saw that if session.auto_start is turned on, you couldn't use Objects with sessions. Well I checked my ini and the session.auto_start was set to 0, so I am now scratching my head in confusion.

I require_once the Customer class and start the session after the requires and 
includes, so then I thought ok require_once
so I change it to require and then it doesn't load the class the for some reason 
(sigh).

Thanks for your help in advance
Matt


--- End Message ---
--- Begin Message ---
It turns out when I was assigning the object to the session var, the object was not 
getting
serialized.  Serializing takes a variable and makes it into a string describing the 
variable and
the value.  This could be done for any variable type except  Resources (MySQL 
connection vars) and
Results (the result from a query).

Serialization happens automatically through the session_register() function, but you 
can only
use session_register if the the register_globals is turned on in the ini.  I would 
like to move away
from the the practice of using globals and eventually turn off the register_globals.

For some reason I tried to register my $customer object using the 
session_register("customer") and
that seem to fail (not the actual registering, but the reuse of the object) so now 
this is a solution that I
saw in the php documentation:

$customer = new Customer($_GET['facilityID'], $_GET['customerID']);
$_SESSION['acceptPayment']['serializedCustomer'] = serialize($customer);

so now when I have moved on to another page or another instance of the same page and
I want to access the object from the session var, I do so like this:

$customer = unserialize($_SESSION['acceptPayment']['serializedCustomer']);

and now you can access the object.  There is a hidden jewl about this method, I now no 
longer
have to include or require the class file because it is already defined in the 
serialized string.

Matt

Matt Silva wrote:
Hi I was wondering if anybody has any Ideas about or has experienced
this....

I create a new object and then assign it to a session var

$customer = new Customer($_GET['facilityID'], $_GET['customerID']);
$_SESSION['acceptPayment']['customer'] = $customer;

but later when I access that session var [in the the same file but in a different function and different instance], php gives me an error saying:

"The script tried to execute a methode or access a property of an incomplete object. Pleas ensure that the class definition lt;bgt;customerlt;/bgt; of the object you are trying to operate on was loaded _before_ the session was started
at <filepath>/acceptPayment.php line 103"


I did a little reading (rtfm) on php.net and saw that if session.auto_start is turned on, you couldn't use Objects with sessions. Well I checked my ini and the session.auto_start was set to 0, so I am now scratching my head in confusion.

I require_once the Customer class and start the session after the requires and includes, so then I thought ok require_once
so I change it to require and then it doesn't load the class the for some reason (sigh).


Thanks for your help in advance
Matt



--- End Message ---
--- Begin Message ---
>$customer = new Customer($_GET['facilityID'], $_GET['customerID']);
>$_SESSION['acceptPayment']['serializedCustomer'] = serialize($customer);
>
>so now when I have moved on to another page or another instance of the
>same page and I want to access the object from the session var, I do so
>like this:
>
>$customer =
>unserialize($_SESSION['acceptPayment']['serializedCustomer']);
>
>and now you can access the object.  There is a hidden jewl about this
>method, I now no longer have to include or require the class file because
>it is already defined in the serialized string.

Really, you don't need the serialize/unserialize in there, as they are
handled automagically. $_SESSION['customer'] = $customer; and
$customer = $_SESSION['customer'] should work just fine. I'm doing this
with 4.3.2, and a casual glance at my sess_* files in /tmp shows that the
objects are stored in serialized form and the __sleep() method is called
the usual way.

My understanding is that classes must be defined prior to unserializing an
object if you dan't want to risk having the object becoming disassociated
from its class, but your method above does have the advantage that you
decide when that serialization takes places and can load the classes
there, rather than having to do so prior to session_start().

http://www.php.net/manual/en/language.oop.serialization.php

---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca            http://mike.teczno.com/contact.html


--- End Message ---
--- Begin Message ---
Hi everybody, I've trying to store a into a MSSQL Server (7 or 2k) using 
an example I found on the web (www.php.net).

Is it possible that PHP (4.3.2) just store 4k of data? Because after 
inserting a test image with:

$oDatos is an object that handles queries.

 // storing a file
$datastring = join('',file("logo2.jpg"));
$data = unpack("H*hex", $datastring);
$oDatos->query( "insert into temp_test (test) values ( 0x" . $data['hex'] 
.")" );

A select will return a 4K file. Is it possible?

$row = $oDatos->getData("select test from temp_test");
//file://$row = mssql_fetch_assoc($result);
$fp = fopen('copy.jpg','w');


So... is there anyway to store a file that it is larger than 4K? Or am I 
missing something? :)

Thanks.

-- 
*** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig)

--- End Message ---
--- Begin Message ---
How is defined your temp_test table ?
PHP don't truncate content...
you only need to define a binary blob field and store data into it..

regard,
P.E. Baroiller

"Javier" <[EMAIL PROTECTED]> a écrit dans le message de
news:[EMAIL PROTECTED]
> Hi everybody, I've trying to store a into a MSSQL Server (7 or 2k) using
> an example I found on the web (www.php.net).
>
> Is it possible that PHP (4.3.2) just store 4k of data? Because after
> inserting a test image with:
>
> $oDatos is an object that handles queries.
>
>  // storing a file
> $datastring = join('',file("logo2.jpg"));
> $data = unpack("H*hex", $datastring);
> $oDatos->query( "insert into temp_test (test) values ( 0x" . $data['hex']
> .")" );
>
> A select will return a 4K file. Is it possible?
>
> $row = $oDatos->getData("select test from temp_test");
> //file://$row = mssql_fetch_assoc($result);
> $fp = fopen('copy.jpg','w');
>
>
> So... is there anyway to store a file that it is larger than 4K? Or am I
> missing something? :)
>
> Thanks.
>
> -- 
> *** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig)



--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] (Baroiller Pierre-Emmanuel) wrote in
news:[EMAIL PROTECTED]: 

The field test is defined in SQL Server as "image".

> How is defined your temp_test table ?
> PHP don't truncate content...
> you only need to define a binary blob field and store data into it..
> 
> regard,
> P.E. Baroiller



-- 
*** s2r - public key: (http://leeloo.mine.nu/s2r-gmx.sig)

--- End Message ---
--- Begin Message --- Hi,

I've made a PHP script that sends out an automatic email through my servers cron system, it works well, but I thought I'd try to do some HTML email to get things to line up a little better.

To do so, I added the following line in my mail() command: -Type: text/html; charset=iso-8859-1

When I check the messages sent out with Eudora, the HTML email comes in perfectly. However, when I check with Outlook Express 6 - I get the actual HTML code rather than the nicely formatted email that I had created.

Should I be using another line in my mail() command? I've recieved HTML email before with Outlook Express on my machine without changing any settings at all. Also, I had sent an email from my script to hotmail and the HTML email worked fine there too.

Any thoughts?

Thanks
-Tim



--- End Message ---
--- Begin Message ---
I would take a look at the headers of an email that does render html
correctly in outlook and see what you are missing.

Trial and error.

Jim Lucas

----- Original Message -----
From: "Tim Thorburn" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 15, 2003 3:48 PM
Subject: [PHP] HTML email with Outlook


> Hi,
>
> I've made a PHP script that sends out an automatic email through my
servers
> cron system, it works well, but I thought I'd try to do some HTML email to
> get things to line up a little better.
>
> To do so, I added the following line in my mail() command: -Type:
> text/html; charset=iso-8859-1
>
> When I check the messages sent out with Eudora, the HTML email comes in
> perfectly.  However, when I check with Outlook Express 6 - I get the
actual
> HTML code rather than the nicely formatted email that I had created.
>
> Should I be using another line in my mail() command?  I've recieved HTML
> email before with Outlook Express on my machine without changing any
> settings at all.  Also, I had sent an email from my script to hotmail and
> the HTML email worked fine there too.
>
> Any thoughts?
>
> Thanks
> -Tim
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


--- End Message ---
--- Begin Message ---
Hi,
try with adding this :
$header = "Content-Type: text/html;
charset=\"iso-8859-1\"\nContent-Transfer-Encoding: 8bit\n\n";

If it don't work, try to build multipart email ...

Regards,
P.E. Baroiller

"Tim Thorburn" <[EMAIL PROTECTED]> a écrit dans le message de
news:[EMAIL PROTECTED]
> Hi,
>
> I've made a PHP script that sends out an automatic email through my
servers
> cron system, it works well, but I thought I'd try to do some HTML email to
> get things to line up a little better.
>
> To do so, I added the following line in my mail() command: -Type:
> text/html; charset=iso-8859-1
>
> When I check the messages sent out with Eudora, the HTML email comes in
> perfectly.  However, when I check with Outlook Express 6 - I get the
actual
> HTML code rather than the nicely formatted email that I had created.
>
> Should I be using another line in my mail() command?  I've recieved HTML
> email before with Outlook Express on my machine without changing any
> settings at all.  Also, I had sent an email from my script to hotmail and
> the HTML email worked fine there too.
>
> Any thoughts?
>
> Thanks
> -Tim
>
>



--- End Message ---
--- Begin Message ---
$headers  = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

Does this help?

Johnny

-----Original Message-----
From: Tim Thorburn [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 3:48 PM
To: [EMAIL PROTECTED]
Subject: [PHP] HTML email with Outlook


Hi,

I've made a PHP script that sends out an automatic email through my servers 
cron system, it works well, but I thought I'd try to do some HTML email to 
get things to line up a little better.

To do so, I added the following line in my mail() command: -Type: 
text/html; charset=iso-8859-1

When I check the messages sent out with Eudora, the HTML email comes in 
perfectly.  However, when I check with Outlook Express 6 - I get the actual 
HTML code rather than the nicely formatted email that I had created.

Should I be using another line in my mail() command?  I've recieved HTML 
email before with Outlook Express on my machine without changing any 
settings at all.  Also, I had sent an email from my script to hotmail and 
the HTML email worked fine there too.

Any thoughts?

Thanks
-Tim



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

--- End Message ---
--- Begin Message ---
Tim Thorburn <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I've made a PHP script that sends out an automatic email through my servers 
> cron system, it works well, but I thought I'd try to do some HTML email to 
> get things to line up a little better.
> 
> To do so, I added the following line in my mail() command: -Type: 
> text/html; charset=iso-8859-1
> When I check the messages sent out with Eudora, the HTML email comes in 
> perfectly.  However, when I check with Outlook Express 6 - I get the actual 
> HTML code rather than the nicely formatted email that I had created.
> 
> Should I be using another line in my mail() command?  I've recieved HTML 
> email before with Outlook Express on my machine without changing any 
> settings at all.  Also, I had sent an email from my script to hotmail and 
> the HTML email worked fine there too.

there are different ways to send html in an email and also very wrong
ways to send html in an email; very debatable topic from what I've seen.
I think your best bet is to use something like:

  http://phpmailer.sourceforge.net/

You can send both plain/text and html. Remember not all email clients
support email. And a lot of people dont like it at all. 

Of course if this is only for you to see I guess you can ignore all that
i said :)



Curt
-- 





--- End Message ---
--- Begin Message ---
"Remember not all email clients support email." 

Did I read that right or is it a typo?

J

-----Original Message-----
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 4:17 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] HTML email with Outlook


Tim Thorburn <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I've made a PHP script that sends out an automatic email through my
servers 
> cron system, it works well, but I thought I'd try to do some HTML email to

> get things to line up a little better.
> 
> To do so, I added the following line in my mail() command: -Type: 
> text/html; charset=iso-8859-1
> When I check the messages sent out with Eudora, the HTML email comes in 
> perfectly.  However, when I check with Outlook Express 6 - I get the
actual 
> HTML code rather than the nicely formatted email that I had created.
> 
> Should I be using another line in my mail() command?  I've recieved HTML 
> email before with Outlook Express on my machine without changing any 
> settings at all.  Also, I had sent an email from my script to hotmail and 
> the HTML email worked fine there too.

there are different ways to send html in an email and also very wrong
ways to send html in an email; very debatable topic from what I've seen.
I think your best bet is to use something like:

  http://phpmailer.sourceforge.net/

You can send both plain/text and html. Remember not all email clients
support email. And a lot of people dont like it at all. 

Of course if this is only for you to see I guess you can ignore all that
i said :)



Curt
-- 





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

--- End Message ---
--- Begin Message ---
By the context, I'm sure it should read "...not all email clients
support HTML."

(I got a laugh out of it though ;)

-----Original Message-----
From: Johnny Martinez [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 15, 2003 7:21 PM
To: 'Curt Zirzow'; [EMAIL PROTECTED]
Subject: RE: [PHP] HTML email with Outlook


"Remember not all email clients support email." 

Did I read that right or is it a typo?

J

-----Original Message-----
From: Curt Zirzow [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 4:17 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] HTML email with Outlook


Tim Thorburn <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I've made a PHP script that sends out an automatic email through my
servers 
> cron system, it works well, but I thought I'd try to do some HTML 
> email to

> get things to line up a little better.
> 
> To do so, I added the following line in my mail() command: -Type:
> text/html; charset=iso-8859-1
> When I check the messages sent out with Eudora, the HTML email comes
in 
> perfectly.  However, when I check with Outlook Express 6 - I get the
actual 
> HTML code rather than the nicely formatted email that I had created.
> 
> Should I be using another line in my mail() command?  I've recieved 
> HTML
> email before with Outlook Express on my machine without changing any 
> settings at all.  Also, I had sent an email from my script to hotmail
and 
> the HTML email worked fine there too.

there are different ways to send html in an email and also very wrong
ways to send html in an email; very debatable topic from what I've seen.
I think your best bet is to use something like:

  http://phpmailer.sourceforge.net/

You can send both plain/text and html. Remember not all email clients
support email. And a lot of people dont like it at all. 

Of course if this is only for you to see I guess you can ignore all that
i said :)



Curt
-- 





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





--- End Message ---
--- Begin Message --- Hello,

On 07/15/2003 07:48 PM, Tim Thorburn wrote:
I've made a PHP script that sends out an automatic email through my servers cron system, it works well, but I thought I'd try to do some HTML email to get things to line up a little better.

To do so, I added the following line in my mail() command: -Type: text/html; charset=iso-8859-1

When I check the messages sent out with Eudora, the HTML email comes in perfectly. However, when I check with Outlook Express 6 - I get the actual HTML code rather than the nicely formatted email that I had created.

Should I be using another line in my mail() command? I've recieved HTML email before with Outlook Express on my machine without changing any settings at all. Also, I had sent an email from my script to hotmail and the HTML email worked fine there too.

That looks like one of the bugs of the mail() function that never got fixed. In that case you may want to try this class that has built-in workarounds for some of the mail() function bugs.


http://www.phpclasses.org/mimemessage

--

Regards,
Manuel Lemos

Free ready to use OOP components written in PHP
http://www.phpclasses.org/


--- End Message ---
--- Begin Message --- Thanks to all those who responded, as always, spelling is key. Where I had -Type: text/html ... it should have read Content-Type : text/html ...

So it works for now, and hopefully will continue to. I know that there are a number of email programs out there that do not support HTML mail, as well I know there are a great many of individuals who do not enjoy it either. We're just running a trial base here to see what works, if it turns out that the majority of our customers do not enjoy it, then we'll switch to plain text (actually built the plain-text one first, this is just an add-on)





--- End Message ---
--- Begin Message --- Hey,

I'm looking for a function to take an XML file and turn it into a PHP array with the same structure. So if I have:

<template>
        <color>#000000</color>
        <background>image.jpg</background>
</template>

It would give me an array:

Array (
        [template] => Array (
                [color] => #000000
                [background] => image.jpg
        )
)

Anyone know of anything like that?

-Michael
--
Pratt Museum IT Intern
All programmers are playwrights and all computers are lousy actors.


--- End Message ---
--- Begin Message ---
I seem to remember seeing something like that on hotscripts.com...


On Tuesday 15 July 2003 03:58 pm, Michael Smith wrote:
> Hey,
>
> I'm looking for a function to take an XML file and turn it into a PHP
> array with the same structure. So if I have:
>
> <template>
>       <color>#000000</color>
>       <background>image.jpg</background>
> </template>
>
> It would give me an array:
>
> Array (
>       [template] => Array (
>               [color] => #000000
>               [background] => image.jpg
>       )
> )
>
> Anyone know of anything like that?
>
> -Michael

-- 
"He's a born-again Christian. The trouble is, he suffered brain damage during 
rebirth."

-Unknown


--- End Message ---
--- Begin Message ---
>I'm looking for a function to take an XML file and turn it into a PHP
>array with the same structure. So if I have:

It's not one function, but you could use xml_parse() with
appropriately-defined handlers for character data and open/close elements:
http://php.net/xml

There is also http://php.net/xml_parse_into_struct, which doesn't generate
exactly what you want, but it "generates structures amenable of being
transversed in a tree fashion."

-mike.

---------------------------------------------------------------------
michal migurski- contact info and pgp key:
sf/ca            http://mike.teczno.com/contact.html


--- End Message ---
--- Begin Message --- This is not an option for me... I'm writing a CMS and want to be able to do things for other users without specific compile options.

-Michael
Russell P Jones wrote:
This may not be what you are looking for, but the DOMXML object since PHP
4.0 works great --- you do have to compile PHP using the --with-dom

For example... If i am dealing with the following structure...

<contacts>
  <contact>
  <name>Russ</name>
  <phone>919.919.1919</phone>
  </contact>
  <contact>
  <name>Other</name>
  <phone>912.932.9328</phone>
  </contact>
</contacts>

and the name of this xml file is contacts.xml

I would do the following...

$xmlDoc = domxml_open_file('xml/contacts.xml');
$root   = $xmlDoc->document_element();
$contacts = $root->children();

// this new $contacts file is an array of the xml tree. For example, to
call up the first set of contact info, the info for russ, just use
$contacts[0]

// but there is more. say you want to learn about this contacts[0] node,
such as pull the name russ. First, you have to get all the chirlden of
this node... so you can do...

$node_to_work_with = $contacts[0]->children();

// now this $node_to_work_with is an array with all the children,
including the name, phone, etc. built in + information about these
children. for example...

echo $node_to_work_with[0]->get_content();

// that would print Russ

echo $node_to_work_with[1]->get_content();

// that would print the Phone Number

echo $node_to_work_with[0]->name();

// that would print "Name" as in the name of the node, which
coincidentally happens to be name...

--Russ



--
Pratt Museum IT Intern
All programmers are playwrights and all computers are lousy actors.


--- End Message ---
--- Begin Message ---
> > Hi to all,
> >
> > Is it possible to run php in the web running in a specified port without
> > installing apache in Linux?
> >
> > Can anyone give a sample code for this? I'm searching this for a week
but i
> > really can find one. Please help us.
> >
> >
> >
> > Regards,
> >
> > Mike
> >
> Do you mean to host websites with ONLY php and without webserver? Or do
> you mean using PHP for something else then web, to make it listen for
> incomming connections?

Actually i want to create a server utility that can be administered through
web via a certain port, i'm afraid not to use php as an apache module
because the server might have an existing webserver installed, so i came out
into an idea to use php cgi/cli to run in a specified port and view it in
the web. It is somewhat similar to some existing utilities such as WEBMIN
which use perl cgi, but i really dont have a very good start since i dont
have enough examples for this. I've already opened opened port for this as
what David said  but i cant see the output in the web.

He'res what i've did in my Redhat linux 6.x

inetd.conf:
samples stream  tcp     nowait.1000     root.root
/usr/local/mikecarel/samples samples

services:
samples 6886/tcp

samples:
#!/usr/local/bin/php -q
<?php
echo "Content-Type: text/html;charset=iso-8859-1";
echo "\n";
echo "<html>hello </html>";
?>

Am I in a right track? or is it possible with this? Do i missed something
here?

Thanks in advance.


Mike



--- End Message ---
--- Begin Message ---
--- "Michael P. Carel" <[EMAIL PROTECTED]> wrote:
> Actually i want to create a server utility that can be
> administered through web via a certain port, i'm afraid not
> to use php as an apache module because the server might have
> an existing webserver installed, so i came out into an idea
> to use php cgi/cli to run in a specified port and view it in
> the web.

This is pretty easy to do, but I should warn that PHP's socket support is still
labeled as experimental, though I have found it to be very stable, and I know
of no plans to change the API.

Quite a while ago now, I wrote a simple HTTP proxy in PHP that listens on port
4887 by default. It is a single script, so it is pretty easy to follow, and
you're welcome to check it out at http://protoscope.org/. It is probably a
better example than I could come up with here.

Hope that helps.

Chris

=====
Become a better Web developer with the HTTP Developer's Handbook
http://httphandbook.org/

--- End Message ---
--- Begin Message ---
Hello,

This is a reply to an e-mail that you wrote on Wed, 16 Jul 2003 at 01:34,
lines prefixed by '>' were originally written by you.
> I've already opened opened port for
> this as
> what David said  but i cant see the output in the web.
> He'res what i've did in my Redhat linux 6.x
<snip>
> Am I in a right track? or is it possible with this? Do i missed
> something
> here?

I am not very familiar with *nix administration at all so if anyone wants
to jump in and correct anything I have said wrong feel free.

Maybe try and have the command inetd is set to execute as
/usr/local/bin/php -q /usr/local/mikecarel/samples
instead of using a shebang line and having your PHP file executable and
see if that works?

David.

--
phpmachine :: The quick and easy to use service providing you with
professionally developed PHP scripts :: http://www.phpmachine.com/

          Professional Web Development by David Nicholson
                    http://www.djnicholson.com/

    QuizSender.com - How well do your friends actually know you?
                     http://www.quizsender.com/
                    (developed entirely in PHP)

--- End Message ---
--- Begin Message ---
I have a string of digits that looks like something like these:  0025,
1234, 0001, 1003, and so on.  They are all 4 digits in length.  Then
when I increment one of them by 1, I want to still have 4 digits for the
value (it should insert the leading zeros if needed).  Is there any type
of function that will force the incremented value to be exactly 4 digits
no matter what number it increments?  Please let me know if there is a
function that will insert these leading zeros or truncate it to 4 digits
if necessary.  Thanks.
 
Matt

--- End Message ---
--- Begin Message ---
Matt Palermo <[EMAIL PROTECTED]> wrote:
> I have a string of digits that looks like something like these:  0025,
> 1234, 0001, 1003, and so on.  They are all 4 digits in length.  Then
> when I increment one of them by 1, I want to still have 4 digits for the
> value (it should insert the leading zeros if needed).  Is there any type
> of function that will force the incremented value to be exactly 4 digits
> no matter what number it increments?  Please let me know if there is a
> function that will insert these leading zeros or truncate it to 4 digits
> if necessary.  Thanks.

$var = sprintf("%04d", $var+1);

Curt
-- 


--- End Message ---
--- Begin Message ---
Thanks a lot.  It works like a charm!

-----Original Message-----
From: Curt Zirzow [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 15, 2003 8:45 PM
To: [EMAIL PROTECTED]
Subject: Re: [PHP] Insert leading zeros

Matt Palermo <[EMAIL PROTECTED]> wrote:
> I have a string of digits that looks like something like these:  0025,
> 1234, 0001, 1003, and so on.  They are all 4 digits in length.  Then
> when I increment one of them by 1, I want to still have 4 digits for
the
> value (it should insert the leading zeros if needed).  Is there any
type
> of function that will force the incremented value to be exactly 4
digits
> no matter what number it increments?  Please let me know if there is a
> function that will insert these leading zeros or truncate it to 4
digits
> if necessary.  Thanks.

$var = sprintf("%04d", $var+1);

Curt
-- 


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


--- End Message ---
--- Begin Message ---
Hello

I wish my php script to present the list of files . That's easy.I also wish
to make it to read the version info from "exe & dll" .Is this possible ?

Thanks

Daniel




--- End Message ---
--- Begin Message ---
Hi,

 

How can I set up PHP to work with multiple databases in the same page?
(not tables)

 

 

That's all,

 

Thanks

 

PN

 


--- End Message ---
--- Begin Message ---
Paulo Neves <[EMAIL PROTECTED]> wrote:
> Hi,
> 
>  
> 
> How can I set up PHP to work with multiple databases in the same page?
> (not tables)
 
$dbh1 = server_connect(params...);
$dbh2 = server_connect(params...);

Just be sure to pass the optional $dbh1 or $dbh2 to the appropriate
query.

$result1 = server_query($sql_fordb1, $dbh1);
$result2 = server_query($sql_fordb2, $dbh2);

> 
> That's all,
> Thanks
> 
No problem

Curt
-- 


--- End Message ---

Reply via email to