473,386 Members | 1,712 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,386 software developers and data experts.

Undefined index: inputValue

These are the first 4 lines of my page:
[php]
<?php
//Receive passed value from self - if null must be first visit so reset to 0

$PassedID = $_GET['inputValue'];
[/php]
The fourth line causes the problem of an undefined index for inputValue.

The first time the page is open nothing is passed in the address line.

Could someone help.

Thanks.
Oct 19 '07 #1
4 1313
ronverdonk
4,258 Expert 4TB
Welcome Ribster to TSDN!

Problem is that entry inputValue does not exist in the $_GET array.
Maybe you misspelled the entry name or it is in nthe $_POST array.

If none of this is the case, maybe you should show your code so we can look at the cause of this.

Next time enclose any code within the proper code tags. See the Posting Guidelines on how to do that.

Ronald
Oct 19 '07 #2
Thank you for that.

This is the problem:

Problem is that entry inputValue does not exist in the $_GET array.

What code can I use to in an If statement to check for this?

Thanks,
Oct 19 '07 #3
I've found the answer

Expand|Select|Wrap|Line Numbers
  1. if (! isset($_GET['inputValue'])){
  2. $PassedID = 0;
  3. }
  4. else {
  5. $PassedID = $_GET['inputValue'];
  6. }
Oct 19 '07 #4
ronverdonk
4,258 Expert 4TB
I've found the answer

Expand|Select|Wrap|Line Numbers
  1. if (! isset($_GET['inputValue'])){
  2. $PassedID = 0;
  3. }
  4. else {
  5. $PassedID = $_GET['inputValue'];
  6. }
Good you found the solution to that yourself.

Rnald
Oct 19 '07 #5

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

Similar topics

9
by: petermichaux | last post by:
Hi, I am curious about how php deals with the following situation where I use an undefined index into an array. PHP seems to be behaving exactly how I want it to but I want to make sure that it...
4
by: John Oliver | last post by:
PHP Notice: Undefined index: name in /home/www/reformcagunlaws.com/new.php on line 6 PHP Notice: Undefined index: address in /home/www/reformcagunlaws.com/new.php on line 7 PHP Notice: ...
9
by: Alan Schroeder | last post by:
The following code produces the expected results on a PC using gcc, but I need to port it (or least something similar) to a different platform/compiler. I don't think I've introduced any undefined...
7
by: deepak | last post by:
Using 'char' as an array index is an undefined behavior?
3
cassbiz
by: cassbiz | last post by:
Here are the errors that are coming up in my error_log Notice: Undefined index: andatum in /zipcode.php on line 11 Notice: Undefined index: andatum in /zipcode.php on line 12 Notice: Undefined...
3
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:...
15
by: bill | last post by:
I am trying to write clean code but keep having trouble deciding when to quote an array index and when not to. sometimes when I quote an array index inside of double quotes I get an error about...
5
by: siyaverma | last post by:
Hi, I am new to php, i was doing some small chnages in a project developed by my collegue who left the job and i got the responsibility for that, After doing some changes when i run it on my...
3
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.