[Newbie/PHP 4.4.8] Right way to check POST parameters?

[Newbie/PHP 4.4.8] Right way to check POST parameters?

am 18.01.2008 01:21:26 von DFS

Hello

I need customers to be able to send us e-mails from our VB
Classic application using the MSWinsock ActiveX control.

Since there's no easy way to find the address of their SMTP server, I
figured it'd be easier to have it call a PHP script, and send data
with the POST method.

I'm sure there's a cleaner way to check that POST parameters were
correctly sent, but I couldn't find an example:

========
//Check input $_POST[] params: author, subject, body
function CheckInput(){
return false;

if(isset($_POST)) {
foreach($_POST as $key=>$val) {
if (isset($val)) {
return true;
}
}
}

if CheckInput() {
$to = "support@acme.com";
$subject = "[myapp"] " . $_POST['subject'];
$body = $_POST['body'];
$headers = "From: " . $_POST['author'] . "\r\n"; //. "
//php@svpi.biz\r\n" .
if (mail($to, $subject, $body,$headers)) {
echo("

Message successfully sent!

");
} else {
echo("

Message delivery failed...

");
}
} else {
echo("

Check POST parameters!

");
}

?>
========

Thank you.

Re: [Newbie/PHP 4.4.8] Right way to check POST parameters?

am 18.01.2008 02:03:32 von Jerry Stuckle

Gilles Ganault wrote:
> Hello
>
> I need customers to be able to send us e-mails from our VB
> Classic application using the MSWinsock ActiveX control.
>
> Since there's no easy way to find the address of their SMTP server, I
> figured it'd be easier to have it call a PHP script, and send data
> with the POST method.
>

Why on earth would you need the address of their SMTP server? Even if
you had it, you wouldn't be able to send a message through it if it were
correctly configured.

> I'm sure there's a cleaner way to check that POST parameters were
> correctly sent, but I couldn't find an example:
>

Maybe that's because POSTed values are very specific to the form doing
the posting?

> ========
> > //Check input $_POST[] params: author, subject, body
> function CheckInput(){
> return false;
>
> if(isset($_POST)) {
> foreach($_POST as $key=>$val) {
> if (isset($val)) {
> return true;
> }
> }
> }
>

What do you expect this to do? Right now all it does is return false.
And even if you move your "return false;" statement to the bottom, all
it will do is see if $_POST is set, and if so, it will see if one value
in the $_POST array is set. If so, the function returns true. It does
not see if what key(s) you get are what you expect, or if the data
itself is valid.

> if CheckInput() {
> $to = "support@acme.com";
> $subject = "[myapp"] " . $_POST['subject'];
> $body = $_POST['body'];
> $headers = "From: " . $_POST['author'] . "\r\n"; //. "
> //php@svpi.biz\r\n" .
> if (mail($to, $subject, $body,$headers)) {
> echo("

Message successfully sent!

");
> } else {
> echo("

Message delivery failed...

");
> }
> } else {
> echo("

Check POST parameters!

");
> }
>
> ?>
> ========
>
> Thank you.
>


And leaving yourself open to be a SPAM generator - not to mention some
syntax errors.

But if you want form mail, why not just do it all in VBScript. That's
what I do in the couple of ASP sites I have.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: [Newbie/PHP 4.4.8] Right way to check POST parameters?

am 18.01.2008 05:02:32 von DFS

On Thu, 17 Jan 2008 20:03:32 -0500, Jerry Stuckle
wrote:
>Why on earth would you need the address of their SMTP server?

Because it was easier to suck connect to their SMTP server with the
MSWinsock control and send a few lines of code, than it is to format
data and send them to a remote PHP script with the POST method.

> Even if you had it, you wouldn't be able to send a message through it if it were
>correctly configured.

Why not? I've already done it before.

>But if you want form mail, why not just do it all in VBScript. That's
>what I do in the couple of ASP sites I have.

I don't want to use VBScript.

For those interested, here's some code I found that seems to do the
job:

=================
foreach ($_POST as $k => $v) {
if(!isset($_POST[$k]) || !strlen($_POST[$k])) {
echo "$k not set!

";
exit;
}
}

$fp = fopen ("stuff_received.txt", "w");
fputs ($fp,$_POST['etab']);
fputs ($fp,$_POST['sujet']);
fputs ($fp,$_POST['message']);
fclose($fp);
?>
=================

Re: Right way to check POST parameters?

am 18.01.2008 05:17:56 von yawnmoth

On Jan 17, 7:03 pm, Jerry Stuckle wrote:
> Gilles Ganault wrote:
> > Hello
>
> > I need customers to be able to send us e-mails from our VB
> > Classic application using the MSWinsock ActiveX control.
>
> > Since there's no easy way to find the address of their SMTP server, I
> > figured it'd be easier to have it call a PHP script, and send data
> > with the POST method.
>
> Why on earth would you need the address of their SMTP server? Even if
> you had it, you wouldn't be able to send a message through it if it were
> correctly configured.

I think you misunderstand the request. I think, although I can't say
for sure, that what Gilles Ganault would be doing if he had a
customers SMTP server is that he'd be using the VB Classic app to send
out the email through their SMTP server. Since the VB Classic app
would be running on the customers computer, using their SMTP server
shouldn't be a problem.

What is a problem is that he doesn't know how to get the customers
SMTP server, so he's planning on having the VB Classic app send an
HTTP POST request to a PHP script that'll send the email, instead.

As for ways around this... well, Gilles Ganault could set up an SMTP
server that his customers could use. This SMTP server could require a
valid username and password for emails to be sent out. Or the PHP
script could require the username and password.

But that wasn't exactly what Gilles Ganault asked for, either. So to
answer the question that was asked... you could just do something
like this:

$required_keys = ...;
for ($i=0;$i if (!isset($_POST[$required_keys[$i]])) {
return false;
}
}
return true;

Of course, that only tests whether or not the appropriate keys are
set. If, in order to qualify as being "correctly sent", these
parameters need to be checked against a regular expression, or
something... well, you could just test them on a case by case basis.
eg.

if (!preg_match('#...#', $_POST['whatever'])) {
return false;
}

if (!preg_match('#...#', $_POST['whatever2'])) {
return false;
}

return true;

Or you could have two arrays. One with required parameter names and
another that uses select parameter names as keys and sets those keys
to certain regular expressions.

There are lots of solutions...

Re: [Newbie/PHP 4.4.8] Right way to check POST parameters?

am 18.01.2008 05:39:31 von Jerry Stuckle

Gilles Ganault wrote:
> On Thu, 17 Jan 2008 20:03:32 -0500, Jerry Stuckle
> wrote:
>> Why on earth would you need the address of their SMTP server?
>
> Because it was easier to suck connect to their SMTP server with the
> MSWinsock control and send a few lines of code, than it is to format
> data and send them to a remote PHP script with the POST method.
>

And if their server is properly configured, the email will stop right
there. You can't do it with my SMTP server, for instance. In fact, if
you try to use a MSWinsock control on my system, I'm gone - never to return.

>> Even if you had it, you wouldn't be able to send a message through it if it were
>> correctly configured.
>
> Why not? I've already done it before.
>

If it's correctly configured, you will not be able to do so.

>> But if you want form mail, why not just do it all in VBScript. That's
>> what I do in the couple of ASP sites I have.
>
> I don't want to use VBScript.
>

You're already using VBScript. That seems to be the more likely
candidate, rather than try to mix and match. But whatever...

> For those interested, here's some code I found that seems to do the
> job:
>
> =================
> > foreach ($_POST as $k => $v) {
> if(!isset($_POST[$k]) || !strlen($_POST[$k])) {
> echo "$k not set!

";
> exit;
> }
> }
>
> $fp = fopen ("stuff_received.txt", "w");
> fputs ($fp,$_POST['etab']);
> fputs ($fp,$_POST['sujet']);
> fputs ($fp,$_POST['message']);
> fclose($fp);
> ?>
> =================
>

Which does nothing with email.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Right way to check POST parameters?

am 18.01.2008 05:44:25 von Jerry Stuckle

yawnmoth wrote:
> On Jan 17, 7:03 pm, Jerry Stuckle wrote:
>> Gilles Ganault wrote:
>>> Hello
>>> I need customers to be able to send us e-mails from our VB
>>> Classic application using the MSWinsock ActiveX control.
>>> Since there's no easy way to find the address of their SMTP server, I
>>> figured it'd be easier to have it call a PHP script, and send data
>>> with the POST method.
>> Why on earth would you need the address of their SMTP server? Even if
>> you had it, you wouldn't be able to send a message through it if it were
>> correctly configured.
>
> I think you misunderstand the request. I think, although I can't say
> for sure, that what Gilles Ganault would be doing if he had a
> customers SMTP server is that he'd be using the VB Classic app to send
> out the email through their SMTP server. Since the VB Classic app
> would be running on the customers computer, using their SMTP server
> shouldn't be a problem.
>

No, I understand. It won't work on my system - my SMTP server won't
accept it, and my firewalls will prevent the app from ever getting to
the server. That plus the security on my browser won't let it start.

> What is a problem is that he doesn't know how to get the customers
> SMTP server, so he's planning on having the VB Classic app send an
> HTTP POST request to a PHP script that'll send the email, instead.
>

Yes, I understand that.

> As for ways around this... well, Gilles Ganault could set up an SMTP
> server that his customers could use. This SMTP server could require a
> valid username and password for emails to be sent out. Or the PHP
> script could require the username and password.
>

A lot of work.

> But that wasn't exactly what Gilles Ganault asked for, either. So to
> answer the question that was asked... you could just do something
> like this:
>
> $required_keys = ...;
> for ($i=0;$i > if (!isset($_POST[$required_keys[$i]])) {
> return false;
> }
> }
> return true;
>
> Of course, that only tests whether or not the appropriate keys are
> set. If, in order to qualify as being "correctly sent", these
> parameters need to be checked against a regular expression, or
> something... well, you could just test them on a case by case basis.
> eg.
>
> if (!preg_match('#...#', $_POST['whatever'])) {
> return false;
> }
>
> if (!preg_match('#...#', $_POST['whatever2'])) {
> return false;
> }
>
> return true;
>
> Or you could have two arrays. One with required parameter names and
> another that uses select parameter names as keys and sets those keys
> to certain regular expressions.
>
> There are lots of solutions...
>

Yep, but there are even more solutions which will make his contact page
an open door for spammers. And since he doesn't know anything about
PHP, he's going to be very hard pressed to get a solution which works
and is secure, unless he's willing to pay someone for it.

Which is why I recommended just doing it in VBScript. He's already
familiar with it, it can be done using his SMTP server and it works well.

A better solution in this case, IMHO.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Right way to check POST parameters?

am 18.01.2008 11:56:51 von Toby A Inkster

Jerry Stuckle wrote:

> No, I understand. It won't work on my system - my SMTP server won't
> accept it, and my firewalls will prevent the app from ever getting to
> the server. That plus the security on my browser won't let it start.

What has your browser got to do with it? Giles isn't writing a web page --
he's writing a Win32 GUI application.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 18 days, 22:09.]

Ham vs Bacon vs Pork
http://tobyinkster.co.uk/blog/2008/01/17/pork-etc/

Re: [Newbie/PHP 4.4.8] Right way to check POST parameters?

am 18.01.2008 12:05:36 von Toby A Inkster

Gilles Ganault wrote:

> //Check input $_POST[] params: author, subject, body function

function CheckInput2 ()
{
$args = func_get_args();
foreach ($args as $a)
{
if (!isset($_POST[$a])) return false;
if (!strlen($_POST[$a])) return false;
}
}

if (CheckInput2('author', 'subject', 'body'))
{
$to = "support@example.com";
// Please use example.com for examples, unless the owner of
// acme.com has given you permission to use their domain name.

$subject = "[myapp] "
. preg_replace('/[\r\n]/', '', $_POST['subject']);
$body = $_POST['body'];
$headers = preg_replace('/[\r\n]/', '', $_POST['author']) . "\r\n";

if (mail($to, $subject, $body, $headers))
echo "

Message successfully sent!

";
else
echo "

Message delivery failed...

";
}
else
{
echo "

Check POST parameters!

";
}

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 18 days, 22:10.]

Ham vs Bacon vs Pork
http://tobyinkster.co.uk/blog/2008/01/17/pork-etc/

Re: Right way to check POST parameters?

am 18.01.2008 12:55:11 von Jerry Stuckle

Toby A Inkster wrote:
> Jerry Stuckle wrote:
>
>> No, I understand. It won't work on my system - my SMTP server won't
>> accept it, and my firewalls will prevent the app from ever getting to
>> the server. That plus the security on my browser won't let it start.
>
> What has your browser got to do with it? Giles isn't writing a web page --
> he's writing a Win32 GUI application.
>

OK, but my firewall still stops it. And the server itself won't accept it.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Right way to check POST parameters?

am 18.01.2008 13:05:36 von Toby A Inkster

Jerry Stuckle wrote:

> OK, but my firewall still stops it. And the server itself won't accept
> it.

The server itself would accept it, assuming that it accepts
unauthenticated SMTP connections from your normal mail client (most do).

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 18 days, 23:18.]

Ham vs Bacon vs Pork
http://tobyinkster.co.uk/blog/2008/01/17/pork-etc/

Re: [Newbie/PHP 4.4.8] Right way to check POST parameters?

am 18.01.2008 13:50:23 von DFS

On Thu, 17 Jan 2008 23:39:31 -0500, Jerry Stuckle
wrote:
>there. You can't do it with my SMTP server, for instance. In fact, if
>you try to use a MSWinsock control on my system, I'm gone - never to return.

The applications that we sell them happens to be written in VB Classic
;-)

>If it's correctly configured, you will not be able to do so.

We're not talking about the same thing. I'm not trying to connect to
the target MTA, but connect to the user's ISP's MTA, just like any
e-mail client they have on their PC.

>Which does nothing with email.

Not yet.

Re: [Newbie/PHP 4.4.8] Right way to check POST parameters?

am 18.01.2008 13:51:00 von DFS

On Fri, 18 Jan 2008 11:05:36 +0000, Toby A Inkster
wrote:
>function CheckInput2 ()

Thanks for the fish :-)

Re: Right way to check POST parameters?

am 18.01.2008 13:54:22 von DFS

On Thu, 17 Jan 2008 20:17:56 -0800 (PST), yawnmoth
wrote:
>As for ways around this... well, Gilles Ganault could set up an SMTP
>server that his customers could use.

No, I've already tried this in the past: Well-configured MTA's won't
accept incoming connections from non-legit source MTA's, such as
someone running an SMTP server on their PC, instead of sending e-mail
through their ISP's server.

>There are lots of solutions...

Thanks for the help. The code in the other post should be good enough,
especially since I already check in the VB app that the three fields
are filled when the user clicks on Send.

Re: Right way to check POST parameters?

am 18.01.2008 13:57:39 von DFS

On Fri, 18 Jan 2008 06:55:11 -0500, Jerry Stuckle
wrote:
>OK, but my firewall still stops it. And the server itself won't accept it.

Our VB applications are already set up on users' PC, and those having
a firewall that checks outgoing connections are already set up to
allow outgoing connections. I'm just adding a new feature to this
existing application so that they can send us a message right from our
app instead of having to use an e-mail client (which most of them
don't have any experience with anyway).

So... the VB app uses the MSWinsock OCX to connect to our web server
and call a PHP script that just reads in the $_POST parameters, and
sends an e-mail with those to support@acme.com . Nothing fancy, and
it's all we need.

Re: Right way to check POST parameters?

am 18.01.2008 14:03:48 von colin.mckinnon

On Jan 18, 12:57 pm, Gilles Ganault wrote:
> On Fri, 18 Jan 2008 06:55:11 -0500, Jerry Stuckle
>
> wrote:
> >OK, but my firewall still stops it. And the server itself won't accept it.
>
> Our VB applications are already set up on users' PC, and those having
> a firewall that checks outgoing connections are already set up to
> allow outgoing connections. I'm just adding a new feature to this
> existing application so that they can send us a message right from our
> app instead of having to use an e-mail client (which most of them
> don't have any experience with anyway).
>
> So... the VB app uses the MSWinsock OCX to connect to our web server
> and call a PHP script that just reads in the $_POST parameters, and
> sends an e-mail with those to supp...@acme.com . Nothing fancy, and
> it's all we need.

FWIW I would say MAPI is a much more sensible solution than going
round the houses with Posting to webservers - it also avoids a lot of
potential security problems.

C.

Re: Right way to check POST parameters?

am 18.01.2008 14:58:43 von DFS

On Fri, 18 Jan 2008 05:03:48 -0800 (PST), "C.
(http://symcbean.blogspot.com/)" wrote:
>FWIW I would say MAPI is a much more sensible solution than going
>round the houses with Posting to webservers - it also avoids a lot of
>potential security problems.

I thought about using MAPI, but considering how difficult our
customers are to support (90% are totally clueless about computers,
and too far to drive there), that I need a solution that works, and on
W2K, XPSP(0|1|2), and Vista.

Originally, I prefered to not use any OCX, but hitting the Winsock DLL
directly is just too much code.

Are my fears about MAPI unjustified?

Re: Right way to check POST parameters?

am 18.01.2008 16:31:00 von Toby A Inkster

Gilles Ganault wrote:

> Are my fears about MAPI unjustified?

IIRC MAPI is only a good solution if they have Outlook or OE set up on
their machine. If they use a different mail client, then chances are you
won't be able to use MAPI.

I could be wrong though -- this is not the best newsgroup for asking for
MAPI advice.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 19 days, 2:43.]

Ham vs Bacon vs Pork
http://tobyinkster.co.uk/blog/2008/01/17/pork-etc/

Re: [Newbie/PHP 4.4.8] Right way to check POST parameters?

am 18.01.2008 19:45:13 von Jerry Stuckle

Gilles Ganault wrote:
> On Thu, 17 Jan 2008 23:39:31 -0500, Jerry Stuckle
> wrote:
>> there. You can't do it with my SMTP server, for instance. In fact, if
>> you try to use a MSWinsock control on my system, I'm gone - never to return.
>
> The applications that we sell them happens to be written in VB Classic
> ;-)
>
>> If it's correctly configured, you will not be able to do so.
>
> We're not talking about the same thing. I'm not trying to connect to
> the target MTA, but connect to the user's ISP's MTA, just like any
> e-mail client they have on their PC.
>

You're trying to connect to the user's MTA from your server? Good luck.
A correctly configured server won't allow it.

Or, if you're going to connect from the user's machine, then they will
have to install PHP on their machine.

>> Which does nothing with email.
>
> Not yet.
>



--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Right way to check POST parameters?

am 18.01.2008 19:46:30 von Jerry Stuckle

Gilles Ganault wrote:
> On Fri, 18 Jan 2008 06:55:11 -0500, Jerry Stuckle
> wrote:
>> OK, but my firewall still stops it. And the server itself won't accept it.
>
> Our VB applications are already set up on users' PC, and those having
> a firewall that checks outgoing connections are already set up to
> allow outgoing connections. I'm just adding a new feature to this
> existing application so that they can send us a message right from our
> app instead of having to use an e-mail client (which most of them
> don't have any experience with anyway).
>
> So... the VB app uses the MSWinsock OCX to connect to our web server
> and call a PHP script that just reads in the $_POST parameters, and
> sends an e-mail with those to support@acme.com . Nothing fancy, and
> it's all we need.
>

So you're going to force all of your users to install PHP on their
machines? Good luck - PHP is running on the server, not the client.
And a correctly configured MTA won't allow you to connect to it from
your server.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Right way to check POST parameters?

am 18.01.2008 19:50:35 von Jerry Stuckle

Toby A Inkster wrote:
> Jerry Stuckle wrote:
>
>> OK, but my firewall still stops it. And the server itself won't accept
>> it.
>
> The server itself would accept it, assuming that it accepts
> unauthenticated SMTP connections from your normal mail client (most do).
>

Toby,

Most MTA's accept unauthenticated connections when the destination
mailbox is in their domain. Those who accept it for other domains are
known as spam relays.

Both my main and backup ISP's (Comcast and ATT Global) do not accept
unauthenticated connections, even from their own networks, unless it's
for their own domain.

And this wouldn't be coming from the client, anyway. It would be coming
from Gilles' web server.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Right way to check POST parameters?

am 18.01.2008 19:52:14 von Jerry Stuckle

Gilles Ganault wrote:
> On Thu, 17 Jan 2008 20:17:56 -0800 (PST), yawnmoth
> wrote:
>> As for ways around this... well, Gilles Ganault could set up an SMTP
>> server that his customers could use.
>
> No, I've already tried this in the past: Well-configured MTA's won't
> accept incoming connections from non-legit source MTA's, such as
> someone running an SMTP server on their PC, instead of sending e-mail
> through their ISP's server.
>

Most do if the destination is for their own domain. Some are configured
not to accept connections from SMTP servers on dynamic addresses, but
that's a small minority, in my experience.

>> There are lots of solutions...
>
> Thanks for the help. The code in the other post should be good enough,
> especially since I already check in the VB app that the three fields
> are filled when the user clicks on Send.
>


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: [Newbie/PHP 4.4.8] Right way to check POST parameters?

am 18.01.2008 20:06:05 von Courtney

Jerry Stuckle wrote:
> Gilles Ganault wrote:
>> On Thu, 17 Jan 2008 23:39:31 -0500, Jerry Stuckle
>> wrote:
>>> there. You can't do it with my SMTP server, for instance. In fact,
>>> if you try to use a MSWinsock control on my system, I'm gone - never
>>> to return.
>>
>> The applications that we sell them happens to be written in VB Classic
>> ;-)
>>
>>> If it's correctly configured, you will not be able to do so.
>>
>> We're not talking about the same thing. I'm not trying to connect to
>> the target MTA, but connect to the user's ISP's MTA, just like any
>> e-mail client they have on their PC.
>>
>
> You're trying to connect to the user's MTA from your server?

I know its Friday, but surely you aren't squiffy yet.

He clearly states he is connecting to the users' ISP's MTA.

> Good luck.
> A correctly configured server won't allow it.
>

Of fer fux sake. I am almost at the point of correctly configuring my
killfile..one day, just once,. make the truth more important than
winning an argument will ya?

> Or, if you're going to connect from the user's machine, then they will
> have to install PHP on their machine.

Re: [Newbie/PHP 4.4.8] Right way to check POST parameters?

am 19.01.2008 02:48:03 von Jerry Stuckle

The Natural Philosopher wrote:
> Jerry Stuckle wrote:
>> Gilles Ganault wrote:
>>> On Thu, 17 Jan 2008 23:39:31 -0500, Jerry Stuckle
>>> wrote:
>>>> there. You can't do it with my SMTP server, for instance. In fact,
>>>> if you try to use a MSWinsock control on my system, I'm gone - never
>>>> to return.
>>>
>>> The applications that we sell them happens to be written in VB Classic
>>> ;-)
>>>
>>>> If it's correctly configured, you will not be able to do so.
>>>
>>> We're not talking about the same thing. I'm not trying to connect to
>>> the target MTA, but connect to the user's ISP's MTA, just like any
>>> e-mail client they have on their PC.
>>>
>>
>> You're trying to connect to the user's MTA from your server?
>
> I know its Friday, but surely you aren't squiffy yet.
>
> He clearly states he is connecting to the users' ISP's MTA.
>

That's right. And I repeat. He's going to connect to it from his
server? The user isn't running PHP on the browser!

>> Good luck. A correctly configured server won't allow it.
>>
>
> Of fer fux sake. I am almost at the point of correctly configuring my
> killfile..one day, just once,. make the truth more important than
> winning an argument will ya?
>

Please do. I'm tired of your poor-ass comments because you can't read.

So just stuff you head back up your ass and go to hell.

>> Or, if you're going to connect from the user's machine, then they will
>> have to install PHP on their machine.
>


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: [Newbie/PHP 4.4.8] Right way to check POST parameters?

am 19.01.2008 11:56:08 von Toby A Inkster

Jerry Stuckle wrote:

> You're trying to connect to the user's MTA from your server? Good luck.
> A correctly configured server won't allow it.

It is quite clear that he is not attempting the above.

> Or, if you're going to connect from the user's machine, then they will
> have to install PHP on their machine.

Yes, this is what he is trying to do. But the user will not have to
install PHP on their machine. He stated in his original post that his
application is written in VisualBASIC, not PHP.

Although he does not explicitly state it, it's likely that it will be
distributed in compiled EXE form, so the only additional software that the
user will need to install is Windows (or a Windows replacement such as
WINE).

Where PHP comes in is that he's had problems connecting to the user's
outgoing mail server, because he can't guess the IP address. And rather
than having the user configure the outgoing server himself, which might
prove too confusing for them, he's decided that his VB app will send the
message via HTTP to a server with a known address, running PHP.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 19 days, 22:04.]

Ham vs Bacon vs Pork
http://tobyinkster.co.uk/blog/2008/01/17/pork-etc/

Re: Right way to check POST parameters?

am 19.01.2008 11:57:45 von Toby A Inkster

Jerry Stuckle wrote:

> And this wouldn't be coming from the client, anyway. It would be coming
> from Gilles' web server.

If you read the OP carefully, then you'll see that it *would* be coming
from a VB app on the client, but that Giles has already abandoned this
idea as it would be too difficult to guess the IP address of the user's
outgoing mail server.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 19 days, 22:09.]

Ham vs Bacon vs Pork
http://tobyinkster.co.uk/blog/2008/01/17/pork-etc/

Re: Right way to check POST parameters?

am 19.01.2008 11:58:17 von Toby A Inkster

Jerry Stuckle wrote:

> So you're going to force all of your users to install PHP on their
> machines? Good luck - PHP is running on the server, not the client.

Read the original post. The client-side app is written in VB, not PHP.

--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 19 days, 22:11.]

Ham vs Bacon vs Pork
http://tobyinkster.co.uk/blog/2008/01/17/pork-etc/

Re: [Newbie/PHP 4.4.8] Right way to check POST parameters?

am 19.01.2008 14:01:15 von Jerry Stuckle

Toby A Inkster wrote:
> Jerry Stuckle wrote:
>
>> You're trying to connect to the user's MTA from your server? Good luck.
>> A correctly configured server won't allow it.
>
> It is quite clear that he is not attempting the above.
>
>> Or, if you're going to connect from the user's machine, then they will
>> have to install PHP on their machine.
>
> Yes, this is what he is trying to do. But the user will not have to
> install PHP on their machine. He stated in his original post that his
> application is written in VisualBASIC, not PHP.
>

I'm not entirely sure that's true. He's talked about POSTing data -
which would be to the server.

> Although he does not explicitly state it, it's likely that it will be
> distributed in compiled EXE form, so the only additional software that the
> user will need to install is Windows (or a Windows replacement such as
> WINE).
>
> Where PHP comes in is that he's had problems connecting to the user's
> outgoing mail server, because he can't guess the IP address. And rather
> than having the user configure the outgoing server himself, which might
> prove too confusing for them, he's decided that his VB app will send the
> message via HTTP to a server with a known address, running PHP.
>

Yes, his server. Then he's going to try to connect to their MTA from
his server. Which doesn't work.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Right way to check POST parameters?

am 19.01.2008 14:01:48 von Jerry Stuckle

Toby A Inkster wrote:
> Jerry Stuckle wrote:
>
>> So you're going to force all of your users to install PHP on their
>> machines? Good luck - PHP is running on the server, not the client.
>
> Read the original post. The client-side app is written in VB, not PHP.
>

I can read, Toby. I understand how it's written.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: Right way to check POST parameters?

am 19.01.2008 14:02:51 von Jerry Stuckle

Toby A Inkster wrote:
> Jerry Stuckle wrote:
>
>> And this wouldn't be coming from the client, anyway. It would be coming
>> from Gilles' web server.
>
> If you read the OP carefully, then you'll see that it *would* be coming
> from a VB app on the client, but that Giles has already abandoned this
> idea as it would be too difficult to guess the IP address of the user's
> outgoing mail server.
>

But he's still asking about how to connect to the client's MTA....

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

Re: [Newbie/PHP 4.4.8] Right way to check POST parameters?

am 20.01.2008 00:46:11 von Toby A Inkster

Jerry Stuckle wrote:

> Then he's going to try to connect to their MTA from his server.

No. No, he isn't.


--
Toby A Inkster BSc (Hons) ARCS
[Geek of HTML/SQL/Perl/PHP/Python/Apache/Linux]
[OS: Linux 2.6.17.14-mm-desktop-9mdvsmp, up 20 days, 10:59.]

Ham vs Bacon vs Pork
http://tobyinkster.co.uk/blog/2008/01/17/pork-etc/