php print in a forum

Discussion in 'Web Design and Development' started by Cabbit, Jun 23, 2007.

  1. Cabbit macrumors 68020

    Cabbit

    Joined:
    Jan 30, 2006
    Location:
    Scotland
    #1
    hi just got a little problem

    Code:
    <input type="text" name="poster" value='<?php print ("$usrname") ?>' disabled="disabled" />
    ok so what it dose is takes the username of the person posting a comment and adds it to the forum in a uneditable way. However when it goes to upload.php it just dosnt take this, if i change it to
    Code:
    value="hello"
    then it uploads that just fine into the database but not if i use php print. The username dose show up on the forum it just dosnt get uploaded to the database and causes a error.
     
  2. Super Macho Man macrumors 6502a

    Super Macho Man

    Joined:
    Jul 24, 2006
    Location:
    Hollywood, CA
    #2
    Probably because you are using single quotes around the "value" HTML string. Try this instead:

    Code:
    <input type="text" name="poster" value="<?php print $usrname ?>" disabled="disabled" />
     
  3. Cabbit thread starter macrumors 68020

    Cabbit

    Joined:
    Jan 30, 2006
    Location:
    Scotland
    #3
    i get the following error

    Code:
    Notice: Undefined index: poster in /home/fhlinux168/d/dev.cossycomforts.com/user/htdocs/includes-functions/uploader.php on line 11
    uploaded
     
  4. Cabbit thread starter macrumors 68020

    Cabbit

    Joined:
    Jan 30, 2006
    Location:
    Scotland

Share This Page