Someone help me out with my form...

Discussion in 'HTML & Website Design' started by AdvancedNoob, Jul 22, 2010.

  1. #1
    I have created this form below... its supposed to give you the whole code... but it doesnt work.. whats wrong =\?

    HTML Form:
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Episode Code Generator</title>
    </head>
    <body>
    <form action="getcode.php" method="post">
      <p>Episode Number:
      <input type="text" name="episodenumber" /><br />
        Episode ID: <input type="text" name="eid" /><br />
        Episode Title: <input type="text" name="episodetitle" /><br />
        ExtraVite Tag {extravote #episode|number#}: <input type="text" name="extravotetag" /><br />
        Description: <br/>
        <textarea name="fdesc"></textarea>
        <br />
      HTML Code (embed code):<br/>
      <textarea name="htmlc"></textarea><br/>
    <input type="submit" value="Get Code" />
    </form>
    </body>
    </html>
    
    HTML:
    getcode.php:
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Get Code</title>
    </head>
    
    <body>
    
    <h4 id="<?php echo $_POST["eid"]; ?>" style="text-align: left;"><?php echo $_POST["episodenumber"]; ?></h4>
    <h3 style="text-align: left;"><?php echo $_POST["episodetitle"]; ?></h3>
    <p><?php echo $_POST["extravotetag"]; ?></p>
    <p><?php echo $_POST["fdesc"]; ?></p>
    <p> </p>
    <div id="<?php echo $_POST["eid"]; ?>" style="display: none;"><?php echo $_POST["htmlc"]; ?></div>
    <p><a href="#TB_inline?height=350amp;width=430&amp;inlineId=<?php echo $_POST["eid"]; ?>" title="<?php echo $_POST["episodenumber"]; ?>" rel="sexylightbox"><p style="text-align: center;"><img src="images/stories/watch.png" border="0" /></p> <p style="text-align: center;"> </p></a></p>
    
    </body>
    </html>
    PHP:
    This is the output i want:
    
    <h4 id="eid" style="text-align: left;">episodenumber</h4>
    <h3 style="text-align: left;">episodetitle</h3>
    <p>extravotetag</p>
    <p>Desc.</p>
    <p> </p>
    <div id="eid" style="display: none;">htmlc</div>
    <p><a href="#TB_inline?height=350amp;width=430&amp;inlineId=eid" title="episodenumber" rel="sexylightbox"><p style="text-align: center;"><img src="images/stories/watch.png" border="0" /></p> <p style="text-align: center;"> </p></a></p>
    Code (markup):

     
    AdvancedNoob, Jul 22, 2010 IP
  2. WhyButUs

    WhyButUs Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    i don't know, is that a problem, but you missed & symbol after 350 / before amp:
    #TB_inline?height=350amp
    Code (markup):
     
    WhyButUs, Jul 22, 2010 IP
  3. aquilax

    aquilax Member

    Messages:
    126
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    33
    #3
    I tried it and it looks like it's working.
    What exactly is wrong?
    Are you executing this on web server?
     
    aquilax, Jul 22, 2010 IP
  4. atxsurf

    atxsurf Peon

    Messages:
    2,394
    Likes Received:
    21
    Best Answers:
    1
    Trophy Points:
    0
    #4
    but it is not in "This is the output i want" either
     
    atxsurf, Jul 22, 2010 IP
  5. WhyButUs

    WhyButUs Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    But he is outputing an URL, which, i think, should be #TB_inline?height=350&width=430&inlineId=eid and maybe that's why he is not getting what he wants. It's only my guess, i may be wrong
     
    WhyButUs, Jul 22, 2010 IP
  6. AdvancedNoob

    AdvancedNoob Guest

    Messages:
    101
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I want the output AS HTML...
    like in the code boxes here... i tried <pre> tags but its still processing the html thats in the output... i need it raw so my staff can just copy and paste it...
     
    AdvancedNoob, Jul 22, 2010 IP
  7. AdvancedNoob

    AdvancedNoob Guest

    Messages:
    101
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    This is the output i want:
    <h4 id="eid" style="text-align: left;">episodenumber</h4>
    <h3 style="text-align: left;">episodetitle</h3>
    <p>extravotetag</p>
    <p>Desc.</p>
    <p> </p>
    <div id="eid" style="display: none;">htmlc</div>
    <p><a href="#TB_inline?height=350amp;width=430&amp;inlineId=eid" title="episodenumber" rel="sexylightbox"><p style="text-align: center;"><img src="images/stories/watch.png" border="0" /></p> <p style="text-align: center;"> </p></a></p>



    ~the things in red are the INPUT
     
    AdvancedNoob, Jul 22, 2010 IP
  8. WhyButUs

    WhyButUs Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    Yes yes, now i get it, just at first i didn't understood. You should use htmlentities() function i think, it converts < into &lt; but browser still shows < (same for other symbols).
     
    WhyButUs, Jul 22, 2010 IP
  9. AdvancedNoob

    AdvancedNoob Guest

    Messages:
    101
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    how do i implement it? :D
    sorry to lazy too google :p
     
    AdvancedNoob, Jul 22, 2010 IP
  10. WhyButUs

    WhyButUs Peon

    Messages:
    27
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I'm also to lazy :p I.e.
    $s1 = '<h4 id="eid" style="text-align: left;">episodenumber</h4>';
    $s2 = htmlentities($s1);
    Code (markup):
    And it will replace qoutes, < and > with html entities. Just test it :p
     
    WhyButUs, Jul 22, 2010 IP
  11. AdvancedNoob

    AdvancedNoob Guest

    Messages:
    101
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #11
    this becomes too complicated.. repacing > & < with their entites itself will be faster for this code... :)
    btw thanks YbutUs :p, aquiaax and atxsurf for helping :)
     
    AdvancedNoob, Jul 22, 2010 IP
  12. samuelthomson

    samuelthomson Peon

    Messages:
    62
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Do not make it complicated.
    Do one thing.
    Create a form in HTML properly with text box names, values etc.
    Use PHP Form Wizard to convert it into PHP file.
    This will make your work easier
     
    samuelthomson, Jul 25, 2010 IP