View Full Version : Resolved Code or Script Help
Learning PHP
02-12-2009, 10:43 AM
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
< >
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*
How about this?:
<xmp style="border: 1px solid #000"><b>Hello</b></xmp>
(edit the styles a bit)
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 (http://www.php.net/htmlspecialchars)() to safely and automatically escape the HTML.
Learning PHP
02-12-2009, 05:05 PM
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 (http://www.php.net/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>
Give it some CSS, overflow attribute (http://www.w3schools.com/Css/pr_pos_overflow.asp).
As of including HTML pages(if I know what you mean):
<?php
include('location_of_html_pagel.html');
?>
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.