Solved

How can I wrap the template around my mailto form?

Posted on 2011-03-23
3
405 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Things That Drive Us Nuts Have you noticed the use of the reCaptcha feature at EE and other web sites?  It wants you to read and retype something that looks like this. Insanity!  It's not EE's fault - that's just the way reCaptcha works.  But it i…
Part of the Global Positioning System A geocode (https://developers.google.com/maps/documentation/geocoding/) is the major subset of a GPS coordinate (http://en.wikipedia.org/wiki/Global_Positioning_System), the other parts being the altitude and t…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
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)

752 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