Notice: Use of undefined constant

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

Notice: Use of undefined constant

Post by GeXus »

Ok, this is silly, but can anyone tell me what's wrong with this?

Code: Select all

 
<input type="text" class="inputBox" maxlength="100" id="quiz_name" name="result[<?=$count?>][title]" value="
 
<?php if(isset($_SESSION['submitResults'][$count]['title'])){echo stripslashes($_SESSION['submitResults'][$count]['title']);}?>
 
"/> 
 
(Note: $count is a number)

I'm getting the error: Notice: Use of undefined constant title - assumed \'title\' in
Mark Baker
Forum Regular
Posts: 710
Joined: Thu Oct 30, 2008 6:24 pm

Re: Notice: Use of undefined constant

Post by Mark Baker »

Possibly
<input type="text" class="inputBox" maxlength="100" id="quiz_name" name="result[<?php echo $count; ?>]['title']" value="
 
<?php if(isset($_SESSION['submitResults'][$count]['title'])){echo stripslashes($_SESSION['submitResults'][$count]['title']);}?>
GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

Re: Notice: Use of undefined constant

Post by GeXus »

Tried that, no luck... I've narrowed it down to this:

Code: Select all

 
<?php if(isset($_SESSION['submitResults'][$count]['title'])){echo stripslashes($_SESSION['submitResults'][$count]['title']);}?>
 
But I've tried with and without quotes.... not sure what the issue is
Post Reply