Solved

How can I wrap the template around my mailto form?

Posted on 2011-03-23
3
400 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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

771 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now