SitePoint Sponsor

User Tag List

Results 1 to 3 of 3

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Location
    Kuching, Sarawak
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Notice of Undefined Variable

    Hi there,

    I am designing a drop down list of the status of 'Active', 'Study Leave' and 'Unpaid Leave' using select. But I am having the notice of Undefined Variable although I have defined the variable earlier.

    Here's the code
    PHP Code:
    <select style="color: #009; font-family: Verdana, Geneva, sans-serif; font-size: 11px;" name="lect_status" id="lect_status">
    <option value="Active" <?php if (!(strcmp("Active"$lect_status))) {echo "selected=\"selected\"";} ?>>Active</option>
    <option value="Study Leave" <?php if (!(strcmp("Study Leave"$lect_status))) {echo "selected=\"selected\"";} ?>>Study Leave</option>
    <option value="Unpaid Leave" <?php if (!(strcmp("Unpaid Leave"$lect_status))) {echo "selected=\"selected\"";} ?>>Unpaid Leave</option>
    </select>
    How to solve this? Thanks in advance.

  2. #2
    From Italy with love silver trophybronze trophy
    guido2004's Avatar
    Join Date
    Sep 2004
    Posts
    9,491
    Mentioned
    161 Post(s)
    Tagged
    4 Thread(s)
    Where do you define the variable?

  3. #3
    SitePoint Enthusiast
    Join Date
    Nov 2011
    Location
    Kuching, Sarawak
    Posts
    75
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by guido2004 View Post
    Where do you define the variable?
    ops, sorry guido2004. I just realize where I make my careless mistake, I manage to get the code working fine by now. Anyway, thanks for the attention and reply.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •