---
title: "Discussion on \"Form Fields PHP - v1.2\" | Hashnode"
description: "Discussion on \"Form Fields PHP - v1.2\". How to check if form fields contains a value (!empty) with PHP ."
url: "https://hashnode.com/posts/form-fields-php-second-revision/6158604570a8165c11f63c91"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Form Fields PHP - v1.2](https://octagon.hashnode.dev/form-fields-php-second-revision?utm_source=hashnode&utm_medium=feed)

How to check if form fields contains a value (!empty) with PHP .

Oct 2, 2021 · 3 min read · octagon.hashnode.dev  
Read the article

-   [#php](https://hashnode.com/tag/php)
-   [#forms](https://hashnode.com/tag/forms)

## Written by

[Simon Ugorji](https://hashnode.com/@simon-ugorji)

@simon-ugorji · Nigeria

  
[View profile](https://hashnode.com/@simon-ugorji)

Full-stack web developer & Technical writer

My name is Simon Ugorji and I aspire to become a computer scientist. I officially started my web development journey in the year 2020 as a backend web Developer and I have enjoyed the experience so far. I spend my day coding, learning new topics, and figuring out the next article to share with the world.

## Responses 1

Markdown supported · ⌘↵ to post

[Simon Ugorji](https://hashnode.com/@simon-ugorji)

[Oct 7, 2021](https://hashnode.com/posts/form-fields-php-second-revision/6158604570a8165c11f63c91/comment/615ed536b945c81a907ce4f0)

I noticed yesterday that the PHP function works so well if you're using it directly and not as an API using Ajax.

If a form field is missing a value, it doesn't output the fields missing a value when building as an API with Ajax

You will see some error about an unexpected token

Well this is because it was built only to be used directly from your PHP script, not as an API.

I have taken notice of this bug and will issue a fix soon.

[Simon Ugorji](https://hashnode.com/@simon-ugorji)

[Oct 7, 2021](https://hashnode.com/posts/form-fields-php-second-revision/6158604570a8165c11f63c91/comment/615ed536b945c81a907ce4f0#reply-615ed5c48e8734462af5c73a)

If you want to know the exact location of the bug, check the block

CUSTOM USER ALERT
