/    Sign up×
Community /Pin to ProfileBookmark

php notices

Hi Guys

I am receiving notice errors, probably due to errors in my code when I upload to netregistry’s servers which have a shared php.ini.

I figure I could just do an ini set to get php to ignore notices but i’d actually like to know what I may of done wrong instead

Error msgs

Notice: Undefined index: section in /clientdata/clients/t/h/thepropertyschool.com.au/www/includes/nav.php on line 16
Notice: Undefined index: newsletter in /clientdata/clients/t/h/thepropertyschool.com.au/www/includes/rightnav.php on line 12

Lines of code

rightnav.php lines 10-16

<?php if ($_GET[‘newsletter’]==”open”)

echo “<div id=”newsletter” style=”display:block”>”;
else if ($_
GET[‘newsletter’]==”closed”)

echo “<div id=”newsletter” style=”display:none”>”;
else
echo “<div id=”newsletter” style=”display:none”>”;
?>

nav.php line 16

<li id=”courses”><a <?php if ($_GET[‘section’]==”1″) echo ” id=”currentpage”” ?> class=”header” href=”/ps/courses.php?section=1″>Our Courses</a>

url
[url]http://thth8366.staging-zeus.netregistry.net/index.php[/url]

Cheers,
Andrew

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@NogDogNov 01.2007 — If you check a $_GET value for a URL variable that was not sent, then there is no such element in the $_GET array to check, thus the notice. You can avoid it by first checking to see if it is, in fact, set:
[code=php]
if(isset($_GET['newsletter']) and $_GET['newsletter'] == "open")
{
[/code]
×

Success!

Help @DREW spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.18,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...