I am using this mail script with a from on my page. I don't really speak php, but had this working great, several times in the past. Now I am getting these weird error notices from this mail form script I have been using. I have never had any issues with this script before and have used it on quite a few different servers. I had this on another sever before and it was working, but after it got moved, it has been giving me these error messages, that I don't know what to do with. Could it be that the server is running a version of php that is too old? Wrong platform?
Here is what I get if I submit this from.
Notice: Undefined index: mail_newline in D:\hshome\c21bestv\c21nicabeachfront.com\formmail2.php on line 374
Notice: Undefined index: alias_method in D:\hshome\c21bestv\c21nicabeachfront.com\formmail2.php on line 403
Notice: Undefined index: alias_method in D:\hshome\c21bestv\c21nicabeachfront.com\formmail2.php on line 403
etc...
Then further down:
Warning: Cannot modify header information - headers already sent by (output started at D:\hshome\c21bestv\c21sanjuan.com\formmail2.php:374) in D:\hshome\c21bestv\c21sanjuan.com\formmail2.php on line 571
[PHPFormMail] Normal e-mail sent from IP 69.105.225.52
Also, when I get the e-mail from the server, it looks something like this:
: Brian
:
:
:
: brian@agilitygraphics.com
:
:
:
: ---
: ---
:
: Submit Form
So it is not showing the variables. It should and used to look like this:
first_name: Brian
last_name: Forstat
etc.
The actual form is here:
http://www.c21nicabeachfront.com/stage/ ... quest.html
Any ideas what could be causing this and how to fix it. I googled the issue and there are some articles, but I don't understand them, since my php knowledge is pretty minimal.
Any help would be greatly appreciated.
Thanks a lot!
B
MailForm variable problem?
Moderator: General Moderators
Re: MailForm variable problem?
The server probably has another default value set for the error reporting. The quick and dirty "fix" is to hide these notices again.brian914 wrote:Could it be that the server is running a version of php that is too old? Wrong platform?
Code: Select all
// Report all errors except E_NOTICE
error_reporting(E_ALL ^ E_NOTICE);Have a look at this article: http://www.digitalamit.com/article/initvar.phtml
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I think I am probably doing it wrong. Like I said, I don't speak much php. I just read through the tutorial you posted. I pasted the following at the top of my php document, but it did not take care of the issue. What that wrong?Code: Select all
/* initvar()
* Initialize variables
* © Amit Arora <digitalamit dot com>
* Permission give to use this code for Non-Commericial, Commericial use
* It would be appreciated if you could provide a link to the site
*/
function initvar()
{
foreach( func_get_args() as $v )
{
if( is_array( $v ) )
{
while( list( $key, $value ) = each( $v ) )
{
$GLOBALS[$key] = ( !isset($GLOBALS[$key]) ? $value : $GLOBALS[$key] );
}
}
else
{
$GLOBALS[$v] = ( !isset($GLOBALS[$v]) ? '' : $GLOBALS[$v] );
}
}
}feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]