DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 6 of 6

Thread: php echoing an html form

  1. #1
    Join Date
    Apr 2004
    Location
    Pennsylvania
    Posts
    72

    php echoing an html form

    I'm using the code:

    echo htmlspecialchars("<form name=&quot;chat&quot;action=&quot;chat_new.php&quot;method=&quot;GET&quot;>");
    echo htmlspecialchars("<input type=&quot;text&quot; name=&quot;tosay&quot;>");
    echo htmlspecialchars("<input type=&quot;submit&quot;value=&quot;Submit&quot; >"));
    echo htmlspecialchars("<textarea cols=&quot;23&quot; rows=&quot;1&quot;name=&quot;name1&quot;>" . $un ."</textarea>");
    echo htmlspecialchars("</form>");

    to print an html form. when i run the page, it is blank, including all the rest of the code on the page
    Daniel Borgman
    Founder, MAD Programming( MADtek )
    www.MadProgramming.biz.ly
    www.MadProgramming.byethost2.com
    Founder, Old Baby Pictures Skate( BP )
    www.obpskate.byethost12.com

  2. #2
    Join Date
    Apr 2004
    Location
    Pennsylvania
    Posts
    72
    does anybody have any ideas?
    Daniel Borgman
    Founder, MAD Programming( MADtek )
    www.MadProgramming.biz.ly
    www.MadProgramming.byethost2.com
    Founder, Old Baby Pictures Skate( BP )
    www.obpskate.byethost12.com

  3. #3
    Join Date
    Apr 2004
    Location
    Pennsylvania
    Posts
    72
    please any help here on this specific method or another method to put the contents of a php variable into a texbox would be greatly appreciated.
    Daniel Borgman
    Founder, MAD Programming( MADtek )
    www.MadProgramming.biz.ly
    www.MadProgramming.byethost2.com
    Founder, Old Baby Pictures Skate( BP )
    www.obpskate.byethost12.com

  4. #4
    Join Date
    Feb 2007
    Posts
    12
    Why are you using htmlspecialchars? Maybe I have no clue what I am doing, but what are all the '&quot's for too.

    I havent ever used htmlspecialchars, but is is possible that you need to escape the ; characters ?

    please any help here on this specific method or another method to put the contents of a php variable into a texbox would be greatly appreciated.
    You don't need a special method to put text in a text box. When you load the page, just have your php code echo its variable value into the value variable of a text box.

    So it would look like this
    PHP Code:
    $variable "whatever you want it to";
    echo 
    '<input type=text value=' $variable ' >'
    I use single quotes around the html so I dont have to mess with escaping the special characters.

    Hope this helps

  5. #5
    Join Date
    Apr 2004
    Location
    Pennsylvania
    Posts
    72
    That looks good but then how do i make that textbox part of a form?
    Daniel Borgman
    Founder, MAD Programming( MADtek )
    www.MadProgramming.biz.ly
    www.MadProgramming.byethost2.com
    Founder, Old Baby Pictures Skate( BP )
    www.obpskate.byethost12.com

  6. #6
    Join Date
    Apr 2004
    Location
    Pennsylvania
    Posts
    72
    nvm I got it. tyvm. i don't have any idea what i was doin with the htmlspecialchars and '&quot;' s. lol anyway ty.
    Daniel Borgman
    Founder, MAD Programming( MADtek )
    www.MadProgramming.biz.ly
    www.MadProgramming.byethost2.com
    Founder, Old Baby Pictures Skate( BP )
    www.obpskate.byethost12.com

Similar Threads

  1. Create unique name html from web form
    By blah_59 in forum Web
    Replies: 0
    Last Post: 01-05-2006, 12:57 PM
  2. Form Authentication on HTML Pages
    By kashif_82 in forum ASP.NET
    Replies: 3
    Last Post: 06-10-2005, 12:52 PM
  3. ASP entry form - output to html??
    By Simon Jessop in forum ASP.NET
    Replies: 0
    Last Post: 01-13-2002, 01:11 PM
  4. Replies: 3
    Last Post: 11-23-2001, 05:59 PM
  5. Losing control on SetParented form.
    By Mark Alexander Bertenshaw in forum VB Classic
    Replies: 0
    Last Post: 03-16-2000, 01:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center