Solved

How can I wrap the template around my mailto form?

Posted on 2011-03-23
3
403 Views
Last Modified: 2012-05-11
Hello Experts!

I created a custom form in a Joomla 1.5.x article and it works great! However the action="/custom/myform.php" page is not "branded". How can I brand (i.e. make it look like the template) this page? I am open to rewriting myform.php if need be. The functions performed by myform.php are:

1) Display a "thank you" message to the user.
2) PHP mail to send the data to the user and designated recipient.
3) Conditionally call fsockopen to send the data to another server.

Can I put myform.php in another Joomla article and somehow call it? Can I display a "thank you" message using Javascript and then call a PHP file to send email and call fsockopen?

Thank you!
0
Comment
Question by:timburkart
  • 2
3 Comments
 
LVL 17

Accepted Solution

by:
psimation earned 500 total points
ID: 35204467
Probably the easiest way is to submit the form to itself, and then include your code in a conditional structure on the same form ( that checks whether the form was submitted or not before executing the code).
0
 

Author Comment

by:timburkart
ID: 35204535
Hi psimation!

Thank for your suggestion. Would it be possible to give me a code snippet for checking whether the form was submitted? I suspect that I should use action="<?php echo $_SERVER['PHP_SELF']; ?>" and method="post" but am unsure as to how to check for self submission.

Thank you!
Tim
0
 
LVL 17

Assisted Solution

by:psimation
psimation earned 500 total points
ID: 35204576
You can check for any of the form values you submit.

For instance, if you have a "submit" button, that has a name "submit" and value "submit", then the act of submitting the form to itself will create a variable called "$submit" that has "submit" as it's value.

You could simply use an :

if (isset($submit)){
do your code here
} else {
echo the form
}
0

Featured Post

Netscaler Common Configuration How To guides

If you use NetScaler you will want to see these guides. The NetScaler How To Guides show administrators how to get NetScaler up and configured by providing instructions for common scenarios and some not so common ones.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
age from date of birth 4 42
jquery datepciker end date add 6 days 6 36
does post require a form or curl to be post 4 32
How can i  prevent default  Submision? 6 27
This article discusses four methods for overlaying images in a container on a web page
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question