Thử nhanh PHP code

Thường nếu để thử PHP code, bạn phải tạo một file mới, rồi viết code, rồi chạy file thông qua trình duyệt. Ở Drupal bạn có thể thử PHP nhanh chóng hơn nhờ 'PHP code' input format.

Cấu hình để thực hiện(nếu chưa thay đổi thiết lập mặc định thì khỏi phải để ý):
- Input format có bật 'PHP code'.
- Content type có bật 'page'.

Thực hiện:
- Mở trang http://webcủabạn.com/?q=node/add/page.
- Nhập vào các chi tiết cần thiết, nội dung là phần php code muốn chạy. Thí dụ, tôi nhập vào

<?php
echo 'Thử nghiệm PHP code trong.';
?>

- Chọn input format là 'PHP code'

Các bạn mới sử dụng drupal, chức năng này sẽ giúp các bạn tiết kiệm được khá nhiều thời gian.

:-)

Thế Hồng,

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <sup> <br> <p> <h3>
  • Lines and paragraphs break automatically.
  • Link to content with [[some text]], where "some text" is the title of existing content or the title of a new piece of content to create. You can also link text to a different title by using [[link to this title|show this text]]. Link to outside URLs with [[http://www.example.com|some text]], or even [[http://www.example.com]].
  • You can enable syntax highlighting of source code with the following tags: <code>, <blockcode>. The supported tag styles are: <foo>, [foo]. PHP source code can also be enclosed in <?php ... ?> or <% ... %>.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.