# \[php\] Validate - done, but how do i send!

**URL:** <https://forum.kirupa.com/t/php-validate-done-but-how-do-i-send/221105>\
**Category:** programming\
**Created:** [April 1, 2007, 3:04pm UTC](https://forum.kirupa.com/t/php-validate-done-but-how-do-i-send/221105 "2007-04-01T15:04:09Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chrisclick](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/chrisclick/32/1991_2.png) [@chrisclick](https://forum.kirupa.com/u/chrisclick)\
**Post date:** [April 1, 2007, 3:04pm UTC](https://forum.kirupa.com/t/php-validate-done-but-how-do-i-send/221105/1 "2007-04-01T15:04:09Z")

</div>

ok… On the HTMLcentre they have this code for error.php (validation page)

```php

<?php
extract($_POST);
/* Validation */

function check_field1($field_name_1)
{
  if(!preg_match("/[^a-zA-Z0-9\.\-\Ä\ä\Ö\ö\Ü\ü\
   ]+$/s",$field_name_1))
    return TRUE;
  else
    return FALSE;
}

function check_field2($field_name_2)
{
  if(!preg_match("/[^0-9\]+$/",$field_name_2))
    return TRUE;
  else
    return FALSE;
}

function check_field3($field_name_3)
{
  if(!preg_match("/[^0-9]+$/ ",$field_name_3))
    return TRUE;
  else
    return FALSE;
}

/* Validation */

$error=0; // check up variable

/* get it checking */

if(!check_field1($your_name))
{
  echo "Illegal input $your_name in 'your_name'";
  $error++; // $error=$error+1;
}
if(!check_field2($your_phone))
{
  echo "Illegal input $your_phone in 'your_phone'";
  $error++;
}
if(!check_field3($your_zip))
{
  echo "Illegal input $your_zip in 'your_zip'";
  $error++;
}

if($error == 0)
{
  echo
  "
  The data you entred was correct, thank you!<p>
  Your data:<br>
  Your name: $your_name<br>
  Your phone: $your_phone<br>
  ZIP code: $your_zip
  ";
}else{
  echo "Number of errors: $error";
}

```

?\>

What code shall I use to send the from?

Wait, Tell me if what I am going to do is correct.  
In the “if ($error = 0” part shall I put the send function there?
