Hi Eric,
our hosting company have just advised that there was an error in the servers .htaccess file which has now been rectified so I can confirm that all those stupid things that just didn't make sense no longer exist. We would probably never have got to the bottom of it without your providing the test files you had created so thanks for that.
The position now is that we are almost there.
I can get the session variable to populate the form using the following;
<input name="email_address2" id="item14_text_1" type="text" maxlength="254"
placeholder="" value="<?php echo $_SESSION['send-to'];?>" autocomplete="off" data-hint="" />
Unfortunately there is still an issue somewhere, in form.cfg.php I have added the code below to display at the bottom of the confirm page and in that area the variable value once again does not display.
<p>Your form was successfully submitted to <?php echo $_SESSION['send-to'];?></p>
At the head of form.cfg.php I have;
<?php session_start(); ?>
<?php exit(0); ?>
so the session is being started although I dont know what effect the second line exit(0) may be having on things.
When the form is submitted the person filling in the form gets their email response but an email is not sent to the email value in the session variable. I have tried coding that section in two ways
"from" : "booking-enquiries@bridlington.net",
"is_present" : true,
"replyto" : "[email]",
"to" : "[email_address2]"
which is the form variable that we echoed the session variable into
and also
"from" : "booking-enquiries@bridlington.net",
"is_present" : true,
"replyto" : "[email]",
"to" : "<?php echo $_SESSION['send-to'];?>"
which is the session variable itself
neither of which work for me.
The strange thing is that the email the form filler receives does include the value of the session variable within the "your enquiry was sent to.." section.
In case I havent been clear, I want the notification email to be sent to the value in the session variable. I believe it should work logically but perhaps there is another file somewhere that needs the session start code adding or maybe its bad syntax.
I appreciate the invaluable help you have given so far and understand if you have had more than enough of this problem but any help you can provide to get me over this last hurdle would be appreciated.
I have uploaded a zip copy of the files used which you can download from the link below in case it helps, you would just need to create a page to set an initial session variable
https://www.bridlington.net/eric.zip
Thanks again for all your help.
Steve