Ask a Question related to PHP Development, Design and Development.
-
Hamish McCracken #1
Undefined index: orderBy
Hi,
I have the following code to determine how I want my results (pulled from a
database) ordered.
if (!$_GET['orderBy']) {
$orderBy = "startDate";
} else {
$orderBy = $_GET['orderBy'];
if ($orderBy=="") {
$orderBy = "startDate";
}
}
I can't remember (been a while since I've used php) how to determine whether
or not a query string variable is present and if it isn't return a value for
the defined variable. At the moment, when no query string is present I get
the error: Notice: Undefined index: orderBy
When there is a query string, obviously there is no error.
Many thanks in advance.
Cheers
Hamish
Hamish McCracken Guest
-
Undefined index: REQUEST_METHOD
Hi there, I have installed a search engine on one of my websites - it had a few bugs in it, I got all but one out of the script. The results... -
Undefined index in form with checkbox
I had a form working with a couple of checkboxes using the mail() function that takes the user to a simple "thanks for your input" page using the... -
#25968 [Opn->Bgs]: $_SERVER['REQUEST_URI'] - Undefined index
ID: 25968 Updated by: sniper@php.net Reported By: bob at rsi dot com -Status: Open +Status: Bogus... -
What is an undefined offset? An undefined index?
I just switched error_reporting to ALL so I could debug my site. I got a huge page full of errors. One of the most common was that in my arrays I'm... -
Undefined index
i have two file with jobapp.html calling jobapp_action.php <HTML> <!-- jobapp.html --> <BODY> <H1>Phop's Bicycles Job Application</H1> <P>Are... -
Janwillem Borleffs #2
Re: Undefined index: orderBy
Hamish McCracken wrote:
[url]www.php.net/isset[/url]> I can't remember (been a while since I've used php) how to determine
> whether or not a query string variable is present and if it isn't
> return a value for the defined variable. At the moment, when no query
> string is present I get the error: Notice: Undefined index: orderBy
>
JW
Janwillem Borleffs Guest
-
Lāʻie Techie #3
Re: Undefined index: orderBy
On Sat, 25 Sep 2004 01:00:56 +0200, Janwillem Borleffs wrote:
how about array_key_exists?> Hamish McCracken wrote:> [url]www.php.net/isset[/url]>> I can't remember (been a while since I've used php) how to determine
>> whether or not a query string variable is present and if it isn't return
>> a value for the defined variable. At the moment, when no query string is
>> present I get the error: Notice: Undefined index: orderBy
>>
>>
HTH,
La'ie Techie
Lāʻie Techie Guest



Reply With Quote

