简体   繁体   中英

Inserting PHP code in Drupal 7 basic page

I am new to Drupal, this may be a simple question. I have created a Basic Page in Drupal 7 Admin Panel with form as its content.

Now, I need to add some php code in form action field to process the form data. Below is my HTML code for your reference :

 <form class="small_indend" id="popup_form" name="popup_form">
 <div class="form-group"><label class="font_size" for="name">1. Name</label>
 <div class="col-md-12">
 <div class="col-md-8 width_device1"><input class="form-control"  id="name" name="name" onblur="if(value=='') value='Name'" onfocus="if(this.value=='Name') { this.value=''; }" onkeypress="return AllowAlphabetOnly(event)" placeholder="Name" type="text" value="Name" />
 </div>
 </div>
 </div>
 </form>

Is there any module to do this? Or the only way is to use js?

Here are the steps to use php code in your content,

  1. Enable "PHP filter" module. It will add "PHP Code" as one of the selectable options for "Text format" in Long Text fields.
  2. While creating the page, select "PHP Code" as the "Text format" for the field.

Note: It will work perfectly for Long Text fields.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM