This damn code wont work......
Moderator: General Moderators
This damn code wont work......
Hello PHP friends, I am new to this forum. I am having great problems with my code. I can't figure for the life of me what the heck is going on. I have the form set up correctly and I think that php is correct too. So I try to fill out the form by myself and decide I don't want to fill in a few things. The next page pops up telling me that I forgot to fill in a few things. But in the comments field you can see that code. I have checked for errors and I don't see anything. So I don't know whats going on. Visit my web site at http://www.new-era-designs.com/contact2.html and fill out the application. You see that when you fill it out and actually fill in the comments box everything works correctly. But if you remove the current text in the box and leave it blank and continue on you see on the next page that the code is there. What is up with that? Can somebody help me?
**Thanks in advance**
**Thanks in advance**
when a php page is requested from the server, the server executes the script and displays the output, so you can't see the php source code by doing a view source.
however when I left the comments field blank, this is what I got.
the textarea isn't closed.
*note* just tried again, and it worked fine /shrug you fix it?
however when I left the comments field blank, this is what I got.
Code: Select all
<form name=form method=post action=\contact_thanks.php><p class=bodymd>All of the fields are required in this field.
<p class=bodymd>Fill in the ones you missed, they are listed
below.<input type=hidden name=first1 value=Jon><input type=hidden name=last1 value=Smith><input type=hidden name=address1 value=2451>
<input type=hidden name=city1 value=Duluth><input type=hidden name=state1 value=Mn><input type=hidden name=zip1 value=55812>
<input type=hidden name=email
value=asdlk@asldkj.com><input type=hidden name=homephone1 value=555-555-5555>
<input type=hidden name=work value=555-555-5555><p class=bodymd>Comment<br><textarea cols='60' rows='6'
name=comment><form>
<input type=submit value=Submit><input type=reset value=Clear>
</form></h4>*note* just tried again, and it worked fine /shrug you fix it?
Last edited by nathus on Sat Dec 14, 2002 12:00 am, edited 1 time in total.
Check this out. If you fill it out and leave the comments blank, it works. You get to the next page and fill in something into the comments box and hit submit, then it takes you to another page and asks for your home number again, now that I don't get.
****I found the problem****
Must be late in the night or something
****I found the problem****
Must be late in the night or something
you could use a regular expression to match patterns in the input strings.
is a pretty decent article on writing regular expressions at
http://www.phpbuilder.com/columns/dario19990616.php3
for example, to match an email address thats in the form of name@domain.com you would use something like
if (ereg("^[^@ ]+@[^@ ]+\.[^@ \.]+$", $email))
echo "is a valid email";
of course not all email addresses are formatted like that. is just an example.
is a pretty decent article on writing regular expressions at
http://www.phpbuilder.com/columns/dario19990616.php3
for example, to match an email address thats in the form of name@domain.com you would use something like
if (ereg("^[^@ ]+@[^@ ]+\.[^@ \.]+$", $email))
echo "is a valid email";
of course not all email addresses are formatted like that. is just an example.