473,401 Members | 2,127 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

$_post doesn't work on IIS 7

Hello,

I am very new to PHP.

However I am trying to deploy php website on IIS 7 (Windows Server 2008). But I am getting error :

PHP Notice: Undefined index: count <file name> on line 77

The problem is in $_POST['count'] array index, which found empty to IIS 7 or PHP (I don't know exactly)

But If use @$_POST['count'] instead of $_POST['count'], the error get suppressed.

I know in Apache we can define rules in httpd file, is there any way in IIS 7 / in PHP by which I don't have to change every page in whole website.

Regards,
Milind
Aug 6 '10 #1
3 3781
Atli
5,058 Expert 4TB
Hey.

When you get the "undefined index" warning, has there been any data sent via POST?

If your code is generating this warning, it is usually because you fail to validate the input data properly. You should always make sure the data is actually there before using it. E.g:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. if(isset($_POST['stuff'])) {
  3.     // Do things with $_POST['stuff']
  4. }
  5. ?>
Or, if you want to use a default value if it is not set:
Expand|Select|Wrap|Line Numbers
  1. <?php
  2. ($stuff = @$_POST['stuff']) or $stuff = "default value";
  3. ?>
You can of course just silence the warnings, but it doesn't fix anything. It just hides the problem from public view.

You can do this either by adding either of these lines to the top of our PHP codes:
Expand|Select|Wrap|Line Numbers
  1. // Hide notices, but display errors
  2. error_reporting(E_ALL ^ E_NOTICE);
  3. // Hide all errors
  4. ini_set('display_errors', false);
Or editing the following directives in your "php.ini" config file. (See the results of the phpinfo function for the location of that file.)
Expand|Select|Wrap|Line Numbers
  1. error_reporting = E_ALL ^ E_NOTICE
  2. display_errors = false
  3.  
Aug 6 '10 #2
Thanks Atli ... it works :)
Aug 6 '10 #3
Dormilich
8,658 Expert Mod 8TB
$_post doesn't work on IIS 7
because it’s called $_POST
Aug 6 '10 #4

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

Similar topics

7
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: {////<<head> <title>IIBO Submit Page</title>...
6
by: x muzuo | last post by:
Hi guys, I have got a prob of javascript form validation which just doesnt work with my ASP code. Can any one help me out please. Here is the code: ...
1
by: Station Media | last post by:
Hi, here my problem, i use stored procedure in ACCESS database(latest version), and i would like to use this procedure but it doesnt work, do you know why ? Procedure: PARAMETERS MyField Text...
3
by: Clouds | last post by:
Hi ! How do I add the dynamic event handler for a dropdownlist present in the itemtemplate of a datalist !! I am doing it in the itemdatabound event of the datalist but it doesnt work... I am...
2
by: effendi | last post by:
Hi I tested the following function in Safari and it doesnt work. This is tested fine in IE. function processOutcome(){ mainDatabase=document.forms.AssessDatabase.value var...
1
by: Arfeen | last post by:
Hi All, I need help again ..... I have an asp.net web page which I hit using the "HTTP POST" method. My ASP.NET page is a basic hello world example with the following code: private void...
0
by: Juna | last post by:
I have been working in vs2003, but now started to work in vs2005 but the problem, I have simple web application not website, which work i mean open in browser when we press F5 or run the...
3
by: jx2 | last post by:
hi guys i would appriciate your coments on this code - when i ran it for the very first time it doesnt see @last = LAST_INSERT_ID() but when i ran it next time it read it properly i need to know it...
1
by: Dany13 | last post by:
hi all. i using some text box for input value and some localvarible for passing this data to dataset . give instance for correct row of dataset and data in data table . use one gird view for...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.