Abhijith
Abhijith

Reputation: 411

Creating normal forms in Joomla 2.5

I want to create a simple registration form as one of the pages in my Joomla 2.5 website. Every where on the internet, I see people asking me to use an extension like proforms, ckforms etc.. Most of the have price tags on them and the free ones do not have database and I don't really want a lot of functionality.

I just want the following code to work. So that I can pull the POST variable and insert them in a db.

<form method="post" action="mycreatedpage.php"> 
<input  type="text"/>
<input type="submit">
</form>

Is this not possible in Joomla 2.5?

Upvotes: 1

Views: 350

Answers (2)

Abhijith
Abhijith

Reputation: 411

After a bit more searching, I realized that what I really needed was an ability to make PHP run inside the article. Thanks to a video.

Answer :

  1. Install Sourcerer to enable PHP inside joomla articles
  2. Create an article which take in the POST variable and insert into the database. This is the tricky part. What I did here was take the general PHP code which I would have written in register_do.php and insert it using the Sourcerer plugin.
  3. Now create an menu Item which points to the above article. Save the menu item and copy the alias. This alias will be the action for the form.

From here on on, everything must work fine. For more detailed instructions, watch the video

Upvotes: 1

Brent Friar
Brent Friar

Reputation: 10609

When you post a form, you have to have some code to handle the form input and what to do with it. So your options are to write a component to handle that form input or to use a form component that does it for you. If you write your own there is a lot to consider unless you want to open up gaping security holes in your website.

There are plenty of free forms components available. If you want free, I would recommend Chronoforms, if you don't mind paying small fee then RS Forms.

Upvotes: 0

Related Questions