SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Aug 2009
    Posts
    104
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Prob Displaying PHP Code in web page

    Hi

    I have a login screen that I have created and I have the random questions saved to a table.
    I read the data into an array :
    Then I wrote a function called GenerateRandomQuestion()

    I need to display the random question into my textbox named "Question".

    Can't figure out what I'm doing wrong - it's just not working for me.

    Code attached.
    Attached Files Attached Files

  2. #2
    Avid Logophile silver trophy
    ParkinT's Avatar
    Join Date
    May 2006
    Location
    Central Florida
    Posts
    2,329
    Mentioned
    191 Post(s)
    Tagged
    4 Thread(s)
    A quick glance at your code reveals the following mistake:
    Code:
    <input type="text" name="Question" readonly tabindex=-1 size="40" value="<? print('GenerateRandomQuestion();') ?>">
    Try this:
    Code:
    <input type="text" name="Question" readonly tabindex=-1 size="40" value="<? print GenerateRandomQuestion(); ?>">
    Don't be yourself. Be someone a little nicer. -Mignon McLaughlin, journalist and author (1913-1983)


    Git is for EVERYONE
    Literally, the best app for readers.
    Make Your P@ssw0rd Secure
    Leveraging SubDomains


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
  •