August 26th, 2002, 02:36 AM
I'm new to PHP and I'm working through the article on Building a PHP-Based Mail Client.
Great article, but when I run the compose message script and press the "send" icon I get an error saying that there's no recipient entered when in fact I have entered that information.
In looking at the code I note that it's not using a form with a Submit button and then testing for a $Submit variable to see whether the data needs to be parsed and processed.
I would greatly appreciate it if someone could explain to me this usage, and how it works, and also where I could find some documentation on this.
Thanx in advance for any and all help.
August 26th, 2002, 07:30 AM
Could you post the link to this article, it's often easier to look at the code to identify and explain something than based on an explanation, well thats what I find anyway
-- SilkySmooth --
August 26th, 2002, 09:07 AM
The article is at http://www.devshed.com/Server_Side/P...il1/page1.html
August 27th, 2002, 05:38 PM
August 27th, 2002, 06:23 PM
document.forms.submit() refers to an array of forms (as in if you have more than one form). Try this: document.myform.submit() and <FORM NAME="myform"> (where 'my form' is the name of your form).
Joe of 4Life
Joe of 4Life
Check out 4Life
August 27th, 2002, 07:44 PM
Many thanx for this.
So, to be sure I understand this, PHP builds an internal array of forms (defined with the <form> tag) and then this array gets referred to by it's zero based index offset into the array?
I presume that the index order would be the sequence within the form within which the individual form definitions are declared.
Of course, that didn't answer the other part of my question, which was why the contents of the variables ($to, $from, etc) were not being passed to the recipient form.
Anybody got any clues on that aspect?
August 27th, 2002, 08:56 PM
I'm looking at the source code right now, and the first thing I noticed is that the send.php page is not using $_POST["to"], but rather just the var $to. Using $_POST array instead of just the plain var is something that PHP has implemented in the newer versions OR if register globals if turned off in php.ini you must use the $_POST array.
However, are you able to get any data from the compose.php script? If you are, that's not it, and I shall keep looking.
August 27th, 2002, 11:54 PM
Thanx very much for the detailed reply.
>> they work very well together. This is part of the DOM
>> (Document Object Model) which works very much like a on
>> big object
More good stuff for me to research.
>> the first thing I noticed is that the send.php page is not
>> using $_POST["to"], but rather just the var $to. Using
>> $_POST array instead of just the plain var is something
>> that PHP has implemented in the newer versions OR if
>> register globals if turned off in php.ini you must use the
>> $_POST array.
OK. This sounds very much like it may be the source of my problem.
>> However, are you able to get any data from the
>> compose.php script?
No, not directly, and hence the reason for my query. I couldn't see how the data was being passed on to the next script.
It wasn't set up as a set of session variables, it wasn't being passed directly to the send.php script in the action directive, and I was getting an error in send saying that there was no valid "to" address.
For now I've worked around this by adding the variables to the action directive, but I'd like to understand the code as it was originally written.
I suspect that you've pointed me in the right direction, and for that I thank you.