Echo in the php page framework cannot output text or txt files on the hard disk.

Source: Internet
Author: User
Tags php define
Echo in the php page framework cannot output text, nor can it output text to the txt file on the hard disk. echo in the php page framework cannot output text, nor can it output text to the txt file on the hard disk, why?


Reply to discussion (solution)

First, what is the framework, and then paste the code for a look

It is the ecshop background after the major transformation. the top menu is a horizontal menu. the left menu is shown below, and the right menu is the framework I mentioned below.

  

Thanks for your help!

Confirm that the atxt () function is executed.
After confirmation, echo ('OK'); is this sentence executed? if there is a jump to the page, you can add an exit breakpoint.

Thank you, bamboo. I do not know whether the statements have been executed yet. the following statements have been executed. The two statements should have been executed too. The page has not been redirected.

It should have been executed. the subsequent statements are executed, and the results are returned. These two statements are certainly executed, and the page is not redirected.

It's hard to understand. The entire directory is completely controlled by everyone. why not?

Why?

1st certificate is guaranteed to have a.txt and permissions under atxt().
2. ensure that the parameters are correct.
According to what you said, echo always comes in. The probability of parameter errors is high.
You can try echo 'OK' in the if ($ _ REQUEST ['act '] = 'operate') {} and all other tests ';
It is estimated that it has not entered the if internal

Thank you, upstairs. now I find that every time I add this function to the program, the program is a bit abnormal. please help me to see what is wrong with this program? If the parameter is correct, a string is uploaded. The root directory of the entire website is also set to EVERYONE. I don't know what's going on! The page is blank.

function atxt($txt='')    {             $filename = 'a.txt';        $somecontent = $txt;         if (is_writable($filename)) {            if (!$handle = fopen($filename, 'w')) {                 exit;            }                    if (fwrite($handle, $somecontent) === FALSE) {                exit;            }                       fclose($handle);                } }

A blank space may be caused by a fatal error in the code.
You can enable the error message to check whether there are any errors.

The upstairs problem is solved.

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.