Solved

How can I wrap the template around my mailto form?

Posted on 2011-03-23
3
404 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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 …

821 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