473,788 Members | 2,735 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Notice: Undefined Index on remote server but not in local testing.

1 New Member
Notice: Undefined index: send in D:\Domains\work ingdata.co.uk\w wwroot\contact_ text.php on line 7

Hi,

I've started getting this error in the contact page form of my website. The web hosting company did an upgrade and it seems to coincide with that.

The Notice is at the top of the page, but the rest of the page displays normally and form still works. I don't get the Notice when I test the page on the local Apache server in the XAMPP installation.

I've checked that the variable is spelled the same throughout the code. I tried using 'submit' as the variable in the IF statement instead of 'send' and got the same Notice.

I'm still new to PHP. I don't understand which element of the code is causing the error, so I'm afraid I've pasted the lot in. It's an IF statement which asks if the send variable is there or not. If it is there, then the form's already been filled in and it displays a "thanks for your question" message, otherwise, if it's not there, it displays the form.

Thanks,

Franc.

[code]
<?php
// if the "submit" variable does not exit, the form has not been submitted, display initial page.

if (!$_POST['send'])
{
?>

<style type="text/css">
<!--
.style1 {color: #000000}
-->
</style>
<table width="620" align="center" cellpadding="0" cellspacing="0" >

<tr>
<td width="620">
<h1 class="heading" align="left">We look forward to hearing from you
<img src="images/yellow dot.gif" height="1" width="330"></h1>
</td>
</tr>
<tr>
<td width="620" class="text">
You can contact us directly by filling out the contact form below.
Simply fill out your name, email address and your query, then click on submit.
We promise to get back to you within 24 working hours.
Alternatively, our contact details are listed at the foot of the page.
</td>
</tr>
<tr><td colspan="1" height="10"></td></tr>
<tr>
<td width="620">
<form class="products _table"action=" contact.php" method="post">
<p class="body_tex t">Your name: <br><input type="text" name="user_name "></p>
<p class="body_tex t">Your email address: <br><input type="text" name="user_emai l"></p>
<p class="body_tex t">Your enquiry: <br><textarea name="user_enqu iry" cols="60" rows="10"></textarea></p>
<p class="body_tex t"><input type="submit" value="submit" name="send"></p>
</form>
</td>
</tr>
<tr>
<td class="text" height="20">
</td>
</tr>
<tr><td height="10"><sp an class="text"><s trong>If you would prefer </strong>, please contact us by one of the methods outlined below. </span></td>
</tr>
<tr><td>
<table width="620" cellpadding="0" cellspacing="0" >
<tr><td height="20" colspan="2"></td></tr>
<tr>
<td width="70" colspan="1" valign="top" class="text style1">Post: </td>
<td class="text" colspan="1" width="548"><di v align="left">
Working Data. <br>
24 Villiers Street, <br>
Leamington Spa, <br>
Warwickshire, <br>
United Kingdom. <br>
CV32 5YH.</div></td>
</tr>
<tr><td height="10" colspan="2"></td></tr>
<tr>
<td width="70" colspan="1" class="text style1">Tel/Fax: </td>
<td class="text" colspan="1" width="548">+44 (0) 1926 335 772</td>
</tr>
<tr><td height="10" colspan="2"></td></tr>
<tr>
<td width="70" colspan="1" class="text style1">Email: </td>
<td class="text" colspan="1" width="548"><a href="mailto:in fo@workingdata. co.uk">info@wor kingdata.co.uk</a></td>
</tr>
<tr><td height="10" colspan="2"></td></tr>
</table>
</td></tr>

</table>

<?php
}
else
{
// if the submit variable exists, the form has been submitted.
// look for and process form data, display result.

$query_name=tri m($_POST['user_name']);
$query_address= trim($_POST['user_email']);
$query_text=tri m($_POST['user_enquiry']);

//echo "<p>Dear $query_name. Many thanks for your enquiry (detailed below). We will reply to $query_address with all haste</p>";
//echo "<p>$query_text </p>";
mail ("info@workingd ata.co.uk","Con tact Form Question",$quer y_text,"From: $query_address" );
/*mail (query_address, "Working Data Enquiry Confirmation"," Dear $query_name, This is an automated confirmation for the
enquiry you submitted. We will reply as soon as possible.","Fro m: info@workingdat a.co.uk");
*/
?>

<table width="620" align="center" cellpadding="0" cellspacing="0" >
<tr><td>&nbsp ;</td></tr>
<tr>
<td width="620">
<h1 class="heading" align="left"><u >Thank you very much indeed for your enquiry.</u></h1>
</td>
</tr>
<tr>
<td width="620">
<?php
echo "<p>Dear $query_name. Many thanks for your enquiry (detailed below). We will reply to $query_address within 24
working hours.</p><br>";
?>

</td>
</tr>
<tr><td><hr></td></tr>
<tr>
<td width="620">
<?php
echo "<p>$query_text </p>";
?>
</td>
</tr>
</table>
<?php
}
?>
[code]
Feb 4 '08 #1
1 2745
eragon
431 Contributor
Welcome to TSDN. May i suggest changing your line

[PHP]if(!$_POST['send'])[/PHP]

to

[PHP]if(empty($_POST['send']))[/PHP]

The empty command is a more effective command that determines if a string is missing or does not exist.
Feb 4 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

11
3718
by: juglesh | last post by:
at one centraldomain.com, I have central.php, which consists of this: <?php function square($num) { return $num * $num; } ?> at outerdomain.com, I have test.php, which consists of this: <?php include "http://www.centraldomain.com/central.php";
10
3693
by: Andrew Dalke | last post by:
Is there an author index for the new version of the Python cookbook? As a contributor I got my comp version delivered today and my ego wanted some gratification. I couldn't find my entries. Andrew dalke@dalkescientific.com
1
400
by: enrique | last post by:
Hello everyone, I'm looking for a "directory path" solution that will allows me to test my app locally and then test on remote web server without having to update my web.config file each time I modify the file. In other words I'm storing the paths (for centralizing purposes) as custom <appSettings> in the web.config. expample (for local testing): <add key="imagePath" value="http://localhost/app_folder/10_media/images/" />
3
5504
by: number1yan | last post by:
Can anyone help me, i am creating a website and am using a php script that recomends the website to other people. I keep getting the same error and can not work out why. The error is: Notice: Undefined index: FriendName in D:\Yan\Over_8\SendEmail.php on line 4, Notice: Undefined index: FriendEmail in D:\Yan\Over_8\SendEmail.php on line 5, Notice: Undefined index: Name in D:\Yan\Over_8\SendEmail.php on line 6, Notice: Undefined index: Email...
3
3876
by: sickboy | last post by:
$channels=$_GET; if (empty($channels)) { $channels='blank'; } changechannels($channels); $theatre=$_GET; if (empty($theatre)) { $theatre='splash'; } changetheatre($theatre); $info=$_GET; if (empty($info)) { $info='noinfo'; } changeinfo($info); Hey everyone, I keep getting an error regarding the above code. These are the errors: Notice: Undefined index: channels in /home/forcefed/public_html/index.php on line 5
5
7366
by: Pseudonyme | last post by:
Dear All : Ever had an httpd error_log bigger than the httpd access log ? We are using Linux-Apache-Fedora-Httpd 2006 configuration. The PHP lines code that lead too tons of errors are : $http_ref= $HTTP_REFERER; $prog = $_COOKIE;
7
5945
by: RN1 | last post by:
Is it possible to connect to my local SQL Server 2005 database from a remote web server? If yes, what ConnectionString do I use? Thanks, Ron
4
8424
hemantbasva
by: hemantbasva | last post by:
We have designed an aspx page having five ajax tab in it. the data of first four are designed on page whereas for the fifth tab it renders a user control named MYDOMAIN. in the tab container's even onactivetabindexchanged we have called a method loadtabpanel() which is defined in javascript in same page.the problem is it sometime give the message load tab panel undefined. this error does not come regularly. it comes in usercontrol rendering . i...
2
4588
by: Smellydog | last post by:
I'm having a strange issue with PHP version 5.2.8 running on Windows Vista with Lighttpd. I receive a Notice that says the following: Notice</b>: Undefined index: name in <b>E:\LightTPD\htdocs\go\go\form.php</b> on line <b>160</b> Here is the odd part. No matter what I do, no matter how many times I change the script, add lines, remove lines, the notice keeps referencing the same file and line number. Even when I comment out the line,...
0
10373
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
10177
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
10118
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
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
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
5403
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...
1
4074
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
3677
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.