Jump to content

PHP Forms


Daney11

Recommended Posts

Hey guys.

 

Im using forms to enter information into my website and im doing all the security measures needed. However when i enter

 

<script type="text/javascript">window.location = "http://www.google.com/"</script>

 

To say

<input class="forminput" name="news_title" type="text" value="<?php if (isset($_POST['news_title'])) echo $_POST['news_title']; ?>" />

 

I get a broken field when the error comes up

Error im using is

 

if (eregi ('^[[:alpha:][:digit:][:blank:]-]{2,60}$', stripslashes(trim($_POST['news_title'])))) {
   $news_title = escape_data($_POST['news_title']);
} else {
   $news_title = FALSE;
   $errors[] = 'Please Enter A News Title';
       }

 

The break of the form field looks like

 

FORM[ <script type=\ ]window.location = \"http://www.google.com/\"" />

 

The [   ] represents the form area. So its breaking it up.

 

Any ideas on how to solve this?

 

Image

error.gif

 

 

 

 

 

Link to comment
https://forums.phpfreaks.com/topic/91285-php-forms/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.