473,804 Members | 3,588 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Email handler problem

Hi folks,

I'm having problems with my PHP form handler. It used to work correctly, but
now for some reason its not. I'm hoping someone here could take a look and
tell me where I might have gone wrong.

Just for background info, when I click submit the form sends okay, but when
the email arrives in my inbox the $name value is non-existent - like nothing
had been entered in the box on the web page form.

Also, I'm not sure if this is relevant: The server uses PHP version 4.4.4
The form handler: (scripts/ct_em.php)

<?
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;

mail( "ME@MYDOMAIN.CO M", "SUBJECT OF THE EMAIL",
"NAME: $name \n\n
EMAIL ADDRESS: $email \n\n
MESSAGE FOLLOWS BELOW: \n
$message",
"From: $email" );
header( "Location: THANK-YOU PAGE" );
?>
The form: (03_contact.htm l) - it should be noted that I've got a Javascript
validation script that checks the length of the value of the email address
field to ensure that it's not left blank - it's had no impact on the form
working or not working - when the form did work this Javascript was always
present.

<form enctype="multip art/form-data" method="post" action="scripts/ct_em.php"
name="form1">

<table width=288 cellpadding=0 cellspacing=0>
<tr valign=center>
<td class="body_mid " width=288>Name: <br><input name="name"
style="font-size: 12px; width: 288px; height: 19px;"></td>
</tr>
<tr valign=center>
<td width=288 height=5></td>
</tr>
<tr valign=center>
<td class="body_mid " width=288>Email address:<br><in put name="email"
style="font-size: 12px; width: 288px; height: 19px;"></td>
</tr>
<tr valign=center>
<td width=288 height=5></td>
</tr>
<tr valign=top>
<td class="body_mid " width=288>Your message:<br><te xtarea name="message"
style="font-family: Arial; font-size: 12px; width: 288px; height:
50px;"></textarea></td>
</tr>
<tr valign=center>
<td width=288 height=10></td>
</tr>
<tr valign=center>
<td width=288><a href="javascrip t:document.form 1.submit()"
OnMouseOver="se .src='images/bu_se_lt.gif'"
OnMouseOut="se. src='images/bu_se_dk.gif'" onClick="return validate();"><i mg
name="se" id="se" src="images/bu_se_dk.gif" alt="Send" border="0"></a></td>
</tr>
</table>

</form>

Thanks for your time folks!

Regards,

Danny.
Nov 20 '06 #1
2 1278
Am Mon, 20 Nov 2006 21:59:18 GMT schrieb Danny Smith:
<?
$email = $_REQUEST['email'] ;
$message = $_REQUEST['message'] ;

mail( "ME@MYDOMAIN.CO M", "SUBJECT OF THE EMAIL",
"NAME: $name \n\n
Just try to set your $name variable before you use it :)
$name = $_REQUEST['name'] ;

Best Regards,
Fabian Fuchs
Nov 20 '06 #2
Danny Smith wrote:
... It used to work correctly ...
register_global s
http://www.php.net/manual/en/security.globals.php

Add these two lines at the very top of your script, right after the
first <?php tag

error_reporting (E_ALL);
ini_set('displa y_errors', '1');

With this configuration, PHP will let you know when you try to use an
inexistent variable.

--
I (almost) never check the dodgeit address.
If you *really* need to mail me, use the address in the Reply-To
header with a message in *plain* *text* *without* *attachments*.
Nov 20 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
49587
by: Pavils Jurjans | last post by:
Hallo, I have been programming for restricted environments where Internet Explorer is a standard, so I haven't stumbled upon this problem until now, when I need to write a DOM-compatible code. The question is about best practices for passing parameters to an event function. I have, say, the following HTML:
2
2384
by: Steve Richfield | last post by:
My error handler works GREAT. However, VBA seems to have some bugs/features that are causing it fits. The little snippet that I put at the end of each routine looks like this: Error_Handler: If Error_Handler("<routine name>", Err) = acDataErrDisplay Then On Error GoTo 0 Stop: Resume ' Press twice to view the problem.
10
3882
by: Wylbur via DotNetMonster.com | last post by:
Hello to all of you geniuses, I'm having a problem trying to get an Init handler to fire for a Placeholder control at the initialization phase. I’ve posted this problem to 3 other ASP.NET forums, and noone wants to touch it. I tried to attach a literal control to a placeholder: <>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>-<>
10
2518
by: Sean Dockery | last post by:
I have the following HTML file that I've been using for testing... <html> <head> <script type="text/javascript"> <!-- function handleWindowLoad() { var items = ; for (var i = 0; i < 11; i++) { items = "item" + (i + 1);
6
8782
by: Joseph Geretz | last post by:
I'm porting a C# Outlook Addin originally engineered as a COM Addin over to use VSTO. I've gotten this to the point where my VSTO Addin installs its Menu items and Toolbar buttons when Outlook launches. I've wired up my event handler to each Menu item and toolbar button. (I use the same Event handler and I use the Tag property which is different for every Menu Item and Toolbar buton to determine which menu or button is being clicked and to...
2
3636
by: alwaysintune | last post by:
I'm using the McFedries email form, and I can't seem to get an upload form to work. Instead of it saving to my server, I want it to send the information and the picture to my email. Here is the html for my form. If anyone could help, that'd be greatly appreciated. <form action="http://www.mcfedries.com/mailform/mailform.asp" method="POST"> <input type=hidden name="MFAddress" value="My email address"> <input type=hidden name="MFCode"...
6
2841
by: =?Utf-8?B?cHJhZGVlcF9UUA==?= | last post by:
I am trying to create a simple HTTP handler in ASP.net 2.0. I am using VS 2005. I am trying to handle a custom extension file givein in the URL. I have also created the following entry in the web.config file <httpHandlers> <add verb="*" path="*.imgw" type="Customhandler.Handler,Handler" /> </httpHandlers> following is the code in Handler.ashx file
4
3453
Odisey
by: Odisey | last post by:
Hello, I am attempting to send an error_log() message to my email. I don't see any mistakes - yet it is not sending the email.... Any ideas? <?php #Script 6.2 //Flag variable for site status: $live = TRUE; // Test output switching status from TRUE; to FALSE;
16
3258
by: Peter Oliphant | last post by:
Note that although this involves SAPI, it is more a question about Timers and event handlers. I wrote a Speech Recognize handler (SAPI), and put some code in it to enable a Timer. It would not do it. If I bring this same code outside this event handler, it works just fine. Is this normal?
0
9579
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10575
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10330
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10319
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6851
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5520
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4297
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3816
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.