3 Replies - 825 Views - Last Post: 26 April 2013 - 01:33 AM Rate Topic: -----

#1 dimdim80  Icon User is offline

  • D.I.C Head

Reputation: -2
  • View blog
  • Posts: 77
  • Joined: 28-December 08

How to include a php file in joomla

Posted 25 April 2013 - 05:02 PM

Hi everyone.
i am new in php and joomla.i have one question,regarding how to include a php file.for example,i am using the joomla editor sourcerer.i have created an html form which is displayed correctly.the problem is that in the action is referred to a php file which does all thhe work,takes the data and sends email and i do not know how to refer to it.if i run them dierctly and not from inside joomla,the code executes normally.
any suggestions?thanks in advance

This post has been edited by dimdim80: 25 April 2013 - 05:04 PM


Is This A Good Question/Topic? 0
  • +

Replies To: How to include a php file in joomla

#2 olimoli123  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 35
  • Joined: 01-February 09

Re: How to include a php file in joomla

Posted 26 April 2013 - 12:51 AM

Hey there, I'm not 100% sure about what you want but i'm guessing its something along these lines:

You have 3 choices
1. Use a post method.
2. Use a get method.
3. Use jQuery to post/get it (this method wont require form redirection)

This is the simple way (html post form):
On the PHP file, to refer to the files you are sending you would use

HTML File:
Refer to it as so:
<form action="form.php" method="post"> 
<input type="text" id="textboxid"
</form>


PHP Form:
$var = $_POST['textboxid'];
echo $var;


This will allow the PHP code to refer to your other.

I strongly recommend you to use jQuery.post to resolve this issue as it is the most effective / advanced way to do it.
Method here: http://api.jquery.com/jQuery.post/

First learn Javascript :)/>

Good luck!

This post has been edited by olimoli123: 26 April 2013 - 12:51 AM

Was This Post Helpful? 0
  • +
  • -

#3 andrewsw  Icon User is offline

  • It's just been revoked!
  • member icon

Reputation: 3806
  • View blog
  • Posts: 13,488
  • Joined: 12-December 12

Re: How to include a php file in joomla

Posted 26 April 2013 - 01:23 AM

$var = $_POST['textboxid'];
echo $var;


Post-data is based on the name of the elements, not their id.
Was This Post Helpful? 0
  • +
  • -

#4 olimoli123  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 35
  • Joined: 01-February 09

Re: How to include a php file in joomla

Posted 26 April 2013 - 01:33 AM

View Postandrewsw, on 26 April 2013 - 02:23 AM, said:

$var = $_POST['textboxid'];
echo $var;


Post-data is based on the name of the elements, not their id.


My bad.. This is what jQuery does to a man like me.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1