August 06, 2020, 01:36:47 pm
News: If your question is answered please put [RESOLVED] in the subject of the initial message.
Pages: [1]   Go Down
Author Topic: Lost Topic Title  (Read 570 times)
Jason Reed
Administrator
*

Stars: +4/-0
Offline Offline

Gender: Male
Posts: 4538


Pure Evil Administrator


WWW
« on: January 23, 2005, 08:04:11 pm »

I've noticed when attempting a Dynamic URL that if I put an empty variable in the URL then I get a Database Error for example:

www.somesite.com/index.php?area=1

would bring my site to the first article area. What I want to do is catch if for some reason someone enters

www.somesite.com/index.php?area=

I've tried is_null() and isset I've also tried checking if it is =='' but it seems to continue to get through.

How do I catch it so I can send it to a default page?
Logged

-- signature --

CornedBee
Ancient Poster
*

Stars: +0/-0
Offline Offline

Gender: Male
Posts: 5258


WWW
« Reply #1 on: January 23, 2005, 09:39:08 pm »

For starters, you output the value of area if it's mentioned but unset, plus the results from isset and is_null.
Logged

All the buzzt
CornedBee

"Writing specifications is like writing a novel. Writing code is like writing poetry."
- Anonymous, published by Raymond

"This is how Liberty dies - with thunderous applause."
Senator Padmé Amidala - Revenge of the Sith

Pc_Madness
Ancient Poster
*

Stars: +0/-0
Offline Offline

Posts: 5349



WWW
« Reply #2 on: January 24, 2005, 01:27:39 am »

if(!is_numeric($area)) $area = 0;

unsure
« Last Edit: January 24, 2005, 01:27:55 am by Pc_Madness » Logged


Jason Reed
Administrator
*

Stars: +4/-0
Offline Offline

Gender: Male
Posts: 4538


Pure Evil Administrator


WWW
« Reply #3 on: January 24, 2005, 06:33:02 am »

@CB blink dunno :lost:

@PC I haven't tried that yet I'll give it a go.

EDIT yep that caught it thanks PC
« Last Edit: January 24, 2005, 06:54:44 am by JRSofty » Logged

-- signature --

Pages: [1]   Go Up
Print
 
Jump to: