Solved

How can I wrap the template around my mailto form?

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Developers of all skill levels should learn to use current best practices when developing websites. However many developers, new and old, fall into the trap of using deprecated features because this is what so many tutorials and books tell them to u…
These days socially coordinated efforts have turned into a critical requirement for enterprises.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

910 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

16 Experts available now in Live!

Get 1:1 Help Now