programmierfrage.com
Ask a question    Sign Up Sign In
  • Train typing speed
  • About/Contact
  • Privacy Policy
  1. Home
  2. php - Fatal error: Cannot use isset, use null expression instead

315 votes
1 answers

php - Fatal error: Cannot use isset, use null expression instead

Get the solution ↓↓↓
This question already has answers here:

Undefined asked
2021-11-29
Write your answer



30
votes

Answer

Solution:

if(isset($userEmail = $_POST["email"]) && $userEmail = $_POST["email"] != ""){

Here, you are assigning it to a variable and then checkingisset all in a single call. Split it up into separate calls:

  • check if it is set
  • check if it is not an empty string
  • validate it against the built-in email validator
  • assign it to a variable

Likely should be

if(isset($_POST["email"]) && $_POST["email"] != "") {
    if(filter_var($_POST["email"], FILTER_VALIDATE_EMAIL)) {   
        ...
        $userEmail = $_POST["email"];
        ...
Write your answer




Share solution ↓

Additional Information:

Date the issue was resolved:
2021-11-29
Link To Source
Link To Answer People are also looking for solutions of the problem: filter_sanitize_string

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Similar questions

Find the answer in similar questions on our website.

421 jquery - ajax receives response from php but can not use with ajax
551 php - Passing second user model data to a controller in Laravel
948 php - i have same column name of first_name in database and have different user_type how to separated show in the two different column of site
825 php - How to effectively delete a user as an admin
523 php - Unrecognized field: user_name, while querying Via Doctrine using ZF2
413 How to use php str_word_count to count words in a textarea
835 php - What is used to code this site?
477 php - Use of undefined constant message - assumed 'message'
772 php - What way is better to use date with timzone for clients
732 php - Use different different shipping prices based on cart subtotal in Woocommerce

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.






About the technologies asked in this question

PHP

PHP (from the English Hypertext Preprocessor - hypertext preprocessor) is a scripting programming language for developing web applications. Supported by most hosting providers, it is one of the most popular tools for creating dynamic websites. The PHP scripting language has gained wide popularity due to its processing speed, simplicity, cross-platform, functionality and distribution of source codes under its own license.
https://www.php.net/



Welcome to programmierfrage.com

programmierfrage.com is a question and answer site for professional web developers, programming enthusiasts and website builders. Site created and operated by the community. Together with you, we create a free library of detailed answers to any question on programming, web development, website creation and website administration.

Get answers to specific questions

Ask about the real problem you are facing. Describe in detail what you are doing and what you want to achieve.

Help Others Solve Their Issues

Our goal is to create a strong community in which everyone will support each other. If you find a question and know the answer to it, help others with your knowledge.

Yacht Magazine



Latest questions:

339 php - Multiple require_once of a file

875 php - JQuery $.post not working on web server

669 php - MySQL Query to get rank based on the most voted photos of an user

392 php - MySQL find top x% across a given time period

164 php - How to output correct database row

88 php - Almost the same code, but different output, why?

225 PHP callback in browser window

910 php - How to render asset URLs without a Request scope

129 php - How do i get Module, Controller, action and request params of a Yii based url without using Yii

975 php - Member filter in Twig

Users questions:

NEW

mysql

NEW

Warning: Undefined array key "program" in E:\xampp\htdocs\pi\alumni.php on line 27 Warning: Undefined array key "enter_course" in E:\xampp\htdocs\pi\alumni.php on line 31 Warning: Undefined array key "enter_address" in E:\xampp\htdocs\pi\alumni.php on line 32

NEW

Rename existing images with keyword in WordPress PHP

NEW

codeigniter

NEW

Class "web_profiler.controller.profiler" does not exist after upgrading symfony 3.4 to 4.4 version




PHP x 410847
Laravel x 36785
Yii x 3846
CodeIgniter x 9997
Symfony x 7793
CakePHP x 3085
Zend Framework x 1235
Phalcon x 300
FuelPHP x 47
Slim x 570
JavaScript x 36883
React x 550
Angular x 1121
Vue.js x 181
JQuery x 11108
Backbone.js x 21
Node.js x 463
Ember.js x 10
Meteor x 7
Polymer x 20
Aurelia x 1
MySQL x 39074
CSS x 2497
Bootstrap x 1603
Foundation x 84
UIkit x 4
Semantic UI x 2
Bulma x 2
Animate.css x 1
HTML x 20978




© 2021-2023 Programming problem solving site for beginners and advanced. Answers to questions related to coding.

E-mail: [email protected]

This site uses cookies. We use them to improve the performance of our website and your interaction with it. Confirm your consent by clicking OK


OK