Results 1 to 5 of 5

Thread: Code or Script Help

  1. #1
    Join Date
    Nov 2008
    Location
    Missouri
    Posts
    13
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default Code or Script Help

    I have been trying to find the right code to make a box to insert my html code into. I have seen many of these floating around on the world wide web but cant seem to find the right code to insert a form code I'm trying to share on my website. I have tried everything and cant seem to get the form code inserted without the submit button ending up outside of the scroll box?

    So far I have tried many codes to use and have not found anything that works. Here are some of the codes I have used.

    < textarea > < /textarea >
    < pre > < /pre >
    < xmp > < /xmp>
    Replacing the greater
    &lt; &gt;

    And even more!

    The problem I'm having is I can get the whole html form into all of these codes i have tried except the submit button?

    What am I doing wrong? This is driving me batty.


    On another note...
    I need suggestions to a good website that can help to explain how-to set up my website/cgi bin to accept forms/data.

    All suggestions are Welcomed.

    Thanks Much

    ********************************************************

    Thank You 2 Bunches! I appreciate all the help! *smiles*
    Last edited by Learning PHP; 02-12-2009 at 11:43 PM. Reason: Resolved

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    How about this?:
    Code:
    <xmp style="border: 1px solid #000"><b>Hello</b></xmp>
    (edit the styles a bit)
    Jeremy | jfein.net

  3. The Following User Says Thank You to Nile For This Useful Post:

    Learning PHP (02-12-2009)

  4. #3
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    The <xmp> element is not part of the HTML standard. Use <pre>. The fact that your submit button is not ending up properly inside the element would seem to indicate that you are not escaping it properly. If you are using PHP for this site, you can use the PHP function htmlspecialchars() to safely and automatically escape the HTML.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends franšais | entiendo espa˝ol | t˘i Ýt hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. The Following User Says Thank You to Twey For This Useful Post:

    Learning PHP (02-12-2009)

  6. #4
    Join Date
    Nov 2008
    Location
    Missouri
    Posts
    13
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Twey View Post
    fact that your submit button is not ending up properly inside the element would seem to indicate that you are not escaping it properly. If you are using PHP for this site, you can use the PHP function htmlspecialchars() to safely and automatically escape the HTML.
    Can I add a PHP page with all of my HTML coded web pages?

    Such as I have...

    index.html
    about.html
    contact.html

    then add a page in there called

    forms.php?

    Is this possiable?


    I'm more of an html, notepad user because it is what I'm more familiar with, but it does get frustrating when something this simple happens and I end up spending hours on trying to fix it.

    *********************************************************************************************************

    Nile, Thanks for the code. It works but I need to put the code into a smaller box suxh as a scroll box or like the boxes I see all over the web with HTML copy and paste code.

    Here is the code I'm trying to put inside of a small copy and paste box.



    <form action="" name="Submit Form" ><p style="font-family:corbel;font-size:80%;color:black"><body bgcolor="#FFFFFF">
    <table cellspacing="2" cellpadding="2" border="0">
    <tr>
    <td align="right">Name</td>
    <td><input type="text" name="Name"></td>
    </tr>
    <tr>
    <td align="right">Company Name</td>
    <td><input type="text" name="CompanyName"></td>
    </tr>
    <tr>
    <td align="right">Email</td>
    <td><input type="text" name="Email"></td>
    </tr>
    <tr>
    <td align="right">Phone</td>
    <td><input type="text" name="Phone"></td>
    </tr>
    <tr>
    <td align="right">Web Site Address</td>
    <td><input type="text" name="Address"></td>
    </tr>
    <tr>
    <td align="right">Insert message here</td>
    <td><textarea cols="25" rows="10" name="Message"></textarea></td>
    </tr>
    <tr>
    <td align="right"></td>
    <td><input type="submit" value="Submit"></td>
    </tr>
    </table>
    </form>
    <script language="JavaScript" type="text/javascript">
    var frmvalidator = new Validator("myform");
    frmvalidator.addValidation("FirstName","req","Please enter your First Name");
    frmvalidator.addValidation("FirstName","maxlen=20",
    "Max length for FirstName is 20");
    frmvalidator.addValidation("FirstName","alpha");

    frmvalidator.addValidation("LastName","req");
    frmvalidator.addValidation("LastName","maxlen=20");

    frmvalidator.addValidation("Email","maxlen=50");
    frmvalidator.addValidation("Email","req");
    frmvalidator.addValidation("Email","email");

    frmvalidator.addValidation("Phone","maxlen=50");
    frmvalidator.addValidation("Phone","numeric");

    frmvalidator.addValidation("Address","maxlen=50");
    frmvalidator.addValidation("Country","dontselect=0");
    </script>
    Last edited by Learning PHP; 02-12-2009 at 05:19 PM. Reason: added code

  7. #5
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Give it some CSS, overflow attribute.

    As of including HTML pages(if I know what you mean):
    Code:
    <?php
    include('location_of_html_pagel.html');
    ?>
    Last edited by Nile; 02-15-2009 at 01:28 PM.
    Jeremy | jfein.net

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
  •