Avatar of Needy11
Needy11
 asked on

Capture form values

We have an online register and pay form that unfortunately has alot of steps. I am working to make it simpler but in the first instance I want to make sure to capture and email details on the first step to an internal email address so if they drop out before finishing all steps we can at least make contact with them.

here is the page we are using....

https://www.icepe.ie/index.php?option=com_enrolcourses&view=enrolcourses&courseid=22&Itemid=18&countrytabs=0

and in code I have placed the following...

<?php
            $from             = "icep.europe@gmail.com";
            $sender            = "ICEP support";
            $subject    = 'Enrol starter details';
            $message = ?????;
            JUtility::sendMail($from, $sender, "support@icepe.eu", $subject, $message,1);
?>


but I do not know how to refer to elements captured on the first step of the form e.g.email is referred as

    <td class="labl">Email:<font color='red'>*</font></td>
    <td><input type="text" name='email' value=''  id='email' /></td>

but $email if assigned to $message does  not output the value of the email selection\input in the email that gets issued.

Many thanks for any assistance.
PHPApache Web Server

Avatar of undefined
Last Comment
Needy11

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Ray Paseur

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Needy11

ASKER
Thank you, does the post and\or get happen only at the end of the form or on each step through it. I haven't been able to locate where it occurs on each step.

Also if I want to assigne teh contens fo the variables to $message for teh email what would the format be

$message = $get(email);   // perhaps

Thanks
SOLUTION
Ray Paseur

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
Needy11

ASKER
Thanks for that. From a local conversation here I have been told that it might also be possible to use AJAX to capture values that the browser holds rather than having to wait or read var dumps which for me might be long and wieldy. Unfortunately I am the extent of the PHP resource available here.

let me know if you think that would work and how I would go about it.

Thanks
Ray Paseur

I would not try to capture the values with AJAX.  That process will introduce another (unnecessary) level of complication.  I think you're better off using the PHP functions.  

If you want, make a test and post the output of var_dump() here in the code snippet.  I can probably help you read it and follow the information from the HTML form into the PHP scripts.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
SOLUTION
Log in to continue reading
Log In
Sign up - Free for 7 days
Get an unlimited membership to EE for less than $4 a week.
Unlimited question asking, solutions, articles and more.
Needy11

ASKER
I managed to get a friend to do the ajax route for me. It worked well and quick as there was already ajax involved. Thanks for the insights into how to approach this