Php to $

Source: Internet
Author: User
When debugging a program, it is very strange to find that the post value is null in some places. first look at the following code 1? Php2if ($ _ POST [submit] Add) {3if ($ _ POST [type] movie $ _ POST [movie_type]) {4 header (Location: form4.php ); 5} 6} 7? 8 h

When debugging a program, it is very strange to find that the post value is null in some places. first look at the following code 1? Php 2 if ($ _ POST ['submit '] = 'add ') {3 if ($ _ POST ['type'] = 'movie '$ _ POST ['movie _ type'] = '') {4 header ('location: form4.php '); 5} 6} 7? 8 h

When debugging a program, it is very strange. The value passed by post is null in some places. first look at the following code.

 1 
  8  9      10     Multipurpose Form11     12     13         
 18         56         
 Searching for '.$_POST["name"].'...

';61 }62 63 if(isset($_POST['debug'])){64 echo '
';65             print_r($_POST);66             echo '
';67 }68 ?>69 70

In row 3, the information is output based on the value passed on the previous page. However, even if the passed value is movie, the desired value is not output, I have added echo ($ _ POST ['type']) in many places. This statement can output movie at the top of the Code, the output in the second row is still available, that is, there is no value under the third row. Here you may also find an error. if ($ _ POST ['type'] = 'movi ', this sentence was originally a judgment statement, and the result was written with an equal sign instead of a value assignment statement. A Beginner's mistake !!!!!!

The correct statement should be if ($ _ POST ['type'] = 'movi' & $ _ POST ['movie _ type'] = '')



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.