FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Trouble with sending e-mail from simple php script
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Trouble with sending e-mail from simple php script [message #176565 is a reply to message #176563] Mon, 09 January 2012 17:00 Go to previous messageGo to next message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma: 0
Senior Member
In article
<be2f03d3-5286-4919-a07a-0f2e93c73408(at)o14g2000vbo(dot)googlegroups(dot)com>,
Captain Paralytic <paul_lautman(at)yahoo(dot)com> wrote:

> On Jan 9, 2:50 pm, Tim Streater <timstrea...@greenbee.net> wrote:
>> In article
>> <36944289-58f2-4cc9-a12f-386aa9ad6...@y7g2000vbe.googlegroups.com>,
>>  Captain Paralytic <paul_laut...@yahoo.com> wrote:

>>> On Jan 9, 1:40 pm, C <wrong.addres...@gmail.com> wrote:
>>>> On Jan 9, 2:36 pm, Captain Paralytic <paul_laut...@yahoo.com> wrote:
>>
>>>> > On Jan 8, 6:57 pm, C <wrong.addres...@gmail.com> wrote:
>>
>>>> > > I added four lines for those four variables.
>>>> > > What does this really do? I already have those values in the
>>>> > > variables. Why do we have to do this?
>>
>>>> > You only have those values in variables if you are relying on
>>>> > register_globals being on. The php manual has this to say on that
>>>> > subject:
>>
>>>> > Warning
>>>> > This feature has been DEPRECATED as of PHP 5.3.0. Relying on this
>>>> > feature is highly discouraged.
>>
>>>> > 'nuff said?
>>
>>>> THIS MIGHT BE IT. I will try at home in the evening.
>>
>>> There is no "might" about it. Jeff's suggested lines:
>>
>>> $name = $_POST['name'];
>>> $orgn = $_POST['orgn'] etc etc
>>
>>> are the way it is done nowadays, because register_globals no longer is.
>>
>> Doing it this way provides some security. It means that the *only* way
>> to get that data is via the $_POST array. So that means that your script
>> doesn't start off with values in variables, assume they're OK, and use
>> them. The old way meant someone could just run your script and preset
>> *any* variable, even one you didn't mean to have set by the web page. So
>> if you forgot to initialise $delete, but instead relied on it being null
>> by default, and your code has this:
>>
>> if  ($delete==1)
>>    {
>>    delete_complete_file_system ();
>>    }
>>
>> the bad guy could easily do you some damage.

> I think I already knew that! And sorry but your post will now be
> archived regardless of your setting.

And for reasons best known to yourself, you introduced many blank lines
near the top of your post and failed to snip my .sig.

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
Re: Trouble with sending e-mail from simple php script [message #176566 is a reply to message #176560] Mon, 09 January 2012 17:01 Go to previous messageGo to next message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma: 0
Senior Member
In article
<a89e1ca8-5d6a-401a-aa81-bba71d5bc00a(at)v13g2000yqc(dot)googlegroups(dot)com>,
C <wrong(dot)address(dot)1(at)gmail(dot)com> wrote:

> On Jan 9, 3:53 pm, Captain Paralytic <paul_laut...@yahoo.com> wrote:
>> On Jan 9, 1:40 pm, C <wrong.addres...@gmail.com> wrote:

>>> On Jan 9, 2:36 pm, Captain Paralytic <paul_laut...@yahoo.com> wrote:
>>
>>>> On Jan 8, 6:57 pm, C <wrong.addres...@gmail.com> wrote:
>>
>>>> > I added four lines for those four variables.
>>>> > What does this really do? I already have those values in the
>>>> > variables. Why do we have to do this?
>>
>>>> You only have those values in variables if you are relying on
>>>> register_globals being on. The php manual has this to say on that
>>>> subject:
>>
>>>> Warning
>>>> This feature has been DEPRECATED as of PHP 5.3.0. Relying on this
>>>> feature is highly discouraged.
>>
>>>> 'nuff said?
>>
>>> THIS MIGHT BE IT. I will try at home in the evening.
>>
>> There is no "might" about it. Jeff's suggested lines:
>>
> -> $name = $_POST['name'];
> -> $orgn = $_POST['orgn'] etc etc
> ->
> -> are the way it is done nowadays, because register_globals no longer
> is.- Hide quoted text -

> You are right. This worked. I think I could also have set register
> globals to on in PHP.INI.

Well you could have done but don't, OK?

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
Re: Trouble with sending e-mail from simple php script [message #176567 is a reply to message #176458] Mon, 09 January 2012 17:23 Go to previous messageGo to next message
Luuk is currently offline  Luuk
Messages: 329
Registered: September 2010
Karma: 0
Senior Member
On 07-01-2012 20:01, C wrote:
> I have a simple form which is handled in a *.htm file by
>
> <FORM METHOD="POST" ACTION="send_msg.php">
> <PRE>
> Your name <INPUT TYPE="text" NAME="name" MAXLENGTH=35 SIZE=50>
> Company <INPUT TYPE="text" NAME="orgn" MAXLENGTH=60 SIZE=50>
> City and country <INPUT TYPE="text" NAME="locn"
> MAXLENGTH=60 SIZE=50>
> Your e-mail address <INPUT TYPE="text" NAME="emad" MAXLENGTH=60
> SIZE=50>
> Your message <TEXTAREA NAME="question" WRAP=VIRTUAL
> ROWS=5 COLS=45></TEXTAREA>
> <INPUT TYPE="submit" VALUE="Send message">
> </PRE>
> </FORM>
>
> Then the send_msg.php should send the e-mail by the following code
> (but does not send e-mail). What am I doing wrong?
>
> <?php
> $date = date("F jS Y, h:iA");
> if ($name == "" && $question == "") {exit;}

What do you expect that this last line does do?

--
Luuk
Re: Trouble with sending e-mail from simple php script [message #176580 is a reply to message #176565] Tue, 10 January 2012 09:58 Go to previous messageGo to next message
Captain Paralytic is currently offline  Captain Paralytic
Messages: 204
Registered: September 2010
Karma: 0
Senior Member
On Jan 9, 5:00 pm, Tim Streater <timstrea...@greenbee.net> wrote:
> In article
> <be2f03d3-5286-4919-a07a-0f2e93c73...@o14g2000vbo.googlegroups.com>,
>  Captain Paralytic <paul_laut...@yahoo.com> wrote:
>
>
>
>
>
>
>
>
>
>> On Jan 9, 2:50 pm, Tim Streater <timstrea...@greenbee.net> wrote:
>>> In article
>>> <36944289-58f2-4cc9-a12f-386aa9ad6...@y7g2000vbe.googlegroups.com>,
>>>  Captain Paralytic <paul_laut...@yahoo.com> wrote:
>>>> On Jan 9, 1:40 pm, C <wrong.addres...@gmail.com> wrote:
>>>> > On Jan 9, 2:36 pm, Captain Paralytic <paul_laut...@yahoo.com> wrote:
>
>>>> > > On Jan 8, 6:57 pm, C <wrong.addres...@gmail.com> wrote:
>
>>>> > > > I added four lines for those four variables.
>>>> > > > What does this really do? I already have those values in the
>>>> > > > variables. Why do we have to do this?
>
>>>> > > You only have those values in variables if you are relying on
>>>> > > register_globals being on. The php manual has this to say on that
>>>> > > subject:
>
>>>> > > Warning
>>>> > > This feature has been DEPRECATED as of PHP 5.3.0. Relying on this
>>>> > > feature is highly discouraged.
>
>>>> > > 'nuff said?
>
>>>> > THIS MIGHT BE IT. I will try at home in the evening.
>
>>>> There is no "might" about it. Jeff's suggested lines:
>
>>>> $name = $_POST['name'];
>>>> $orgn = $_POST['orgn'] etc etc
>
>>>> are the way it is done nowadays, because register_globals no longer is.
>
>>> Doing it this way provides some security. It means that the *only* way
>>> to get that data is via the $_POST array. So that means that your script
>>> doesn't start off with values in variables, assume they're OK, and use
>>> them. The old way meant someone could just run your script and preset
>>> *any* variable, even one you didn't mean to have set by the web page. So
>>> if you forgot to initialise $delete, but instead relied on it being null
>>> by default, and your code has this:
>
>>> if  ($delete==1)
>>>    {
>>>    delete_complete_file_system ();
>>>    }
>
>>> the bad guy could easily do you some damage.
>> I think I already knew that! And sorry but your post will now be
>> archived regardless of your setting.
>
> And for reasons best known to yourself, you introduced many blank lines
> near the top of your post and failed to snip my .sig.
>
> --
> Tim
>
> "That excessive bail ought not to be required, nor excessive fines imposed,
> nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

Snipping you sig would have prevented your complete message from
staying in the archive.
Re: Trouble with sending e-mail from simple php script [message #176582 is a reply to message #176580] Tue, 10 January 2012 10:18 Go to previous messageGo to next message
Tim Streater is currently offline  Tim Streater
Messages: 328
Registered: September 2010
Karma: 0
Senior Member
In article
<2aca34ea-2565-446f-9b55-d14d7eeea0f2(at)p4g2000vbt(dot)googlegroups(dot)com>,
Captain Paralytic <paul_lautman(at)yahoo(dot)com> wrote:

> On Jan 9, 5:00 pm, Tim Streater <timstrea...@greenbee.net> wrote:
>> In article
>> <be2f03d3-5286-4919-a07a-0f2e93c73...@o14g2000vbo.googlegroups.com>,
>>  Captain Paralytic <paul_laut...@yahoo.com> wrote:

>>> I think I already knew that! And sorry but your post will now be
>>> archived regardless of your setting.
>>
>> And for reasons best known to yourself, you introduced many blank lines
>> near the top of your post and failed to snip my .sig.

> Snipping you sig would have prevented your complete message from
> staying in the archive.

And this is relevant just *how*, precisely, to anything at all?

--
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted" -- Bill of Rights 1689
Re: Trouble with sending e-mail from simple php script [message #176583 is a reply to message #176582] Tue, 10 January 2012 10:20 Go to previous message
Captain Paralytic is currently offline  Captain Paralytic
Messages: 204
Registered: September 2010
Karma: 0
Senior Member
On Jan 10, 10:18 am, Tim Streater <timstrea...@greenbee.net> wrote:
> In article
> <2aca34ea-2565-446f-9b55-d14d7eeea...@p4g2000vbt.googlegroups.com>,
>  Captain Paralytic <paul_laut...@yahoo.com> wrote:
>
>> On Jan 9, 5:00 pm, Tim Streater <timstrea...@greenbee.net> wrote:
>>> In article
>>> <be2f03d3-5286-4919-a07a-0f2e93c73...@o14g2000vbo.googlegroups.com>,
>>>  Captain Paralytic <paul_laut...@yahoo.com> wrote:
>>>> I think I already knew that! And sorry but your post will now be
>>>> archived regardless of your setting.
>
>>> And for reasons best known to yourself, you introduced many blank lines
>>> near the top of your post and failed to snip my .sig.
>> Snipping you sig would have prevented your complete message from
>> staying in the archive.
>
> And this is relevant just *how*, precisely, to anything at all?

Do you really need this explained?
Pages (2): [ «    1  2]  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: scoping inside a block
Next Topic: Best PHP Training | PHP Development Training | PHP Training Institute
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 18:48:32 GMT 2024

Total time taken to generate the page: 0.02550 seconds