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
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of Needy11
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
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Needy11
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
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

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.
SOLUTION
Avatar of Derek Jensen
Derek Jensen
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of Needy11
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
PHP
PHP

PHP is a widely-used server-side scripting language especially suited for web development, powering tens of millions of sites from Facebook to personal WordPress blogs. PHP is often paired with the MySQL relational database, but includes support for most other mainstream databases. By utilizing different Server APIs, PHP can work on many different web servers as a server-side scripting language.

125K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo