Home › Forums › Quform WordPress › session variable missing
- This topic has 14 replies, 2 voices, and was last updated 5 years, 10 months ago by Ally.
- AuthorPosts
- May 23, 2018 at 1:27 pm #25775grainesParticipant
using quform 2.3.
following use of an earlier version – we were using this syntax.
“post_title” => $_SESSION[“iphorm_2”][“.iphorm_2_3”]However with the update it looks like we need to change the references to our field names, can someone confirm if this following new syntax is correct and if not what should it be.
“post_title” => $_SESSION[“quform_2”][“.quform-field-2_3”]
Thanks
May 23, 2018 at 8:44 pm #25783AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 6, 2018 at 10:46 am #25969grainesParticipantHi Ally
Apologies for the delay in coming back to you. We’ve tried your suggestion and this doesn’t seem to work.
We’ve changed all references in the bespoke code from iphorm to quform.
Your manuals seem to suggest using .quform-field-1_1.
Any ideas. I’ve attached a code snippet to show you how it’s applied.
Thanks
Attachments:
You must be logged in to view attached files.June 8, 2018 at 4:47 pm #25990AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 12, 2018 at 4:21 pm #26040grainesParticipantHi again Ally
Thanks for your email.
We have some bespoke code below that references the file upload procedure but i’m unable to see a reference to the text keys that you mention.
Would we be correct in assuming that changing the references to “fullPath” to “path” would be partly correct?
Regarding the text key references – what would we need to change in order to replace the keys with “name”?
Or do we need to simply have both [path] & [name] together in order to build up the map to the image file?Here is our current live code fragment (this is repeated a number of times for each image) – could you take a look and advise please?
Thanks for your help.
Regards
Gavin// if gallery image 1 (logo) uploaded
if(isset($_SESSION[“quform_2”][“quform_2_32”][0][“fullPath”]) && !empty($_SESSION[“quform_2”][“quform_2_32″][0][” fullPath “])) {
$filename = $_SESSION[“quform_2”][“quform_2_32″][0][” fullPath “];
$parent_post_id = $_SESSION[“entryid”];
switch(pathinfo($filename, PATHINFO_EXTENSION)) {
case ‘jpg’:
case ‘jpeg’:
$filetype = ‘image/jpeg’;
break;
case ‘png’:
$filetype = ‘image/png’;
break;
}
$attachment = array(
‘guid’ => $_SESSION[“quform_2”][“quform_2_32″][0][” fullPath “],
‘post_mime_type’ => $filetype,
‘post_title’ => preg_replace(‘/\.[^.]+$/’, ”, $_SESSION[“quform_2”][“quform_2_32”][0][“text”]),
‘post_content’ => ”,
‘post_status’ => ‘inherit’
);
$attach_id = wp_insert_attachment($attachment, $filename, $parent_post_id);
require_once(ABSPATH . ‘wp-admin/includes/image.php’);
$attach_data = wp_generate_attachment_metadata($attach_id, $filename);
wp_update_attachment_metadata($attach_id, $attach_data);
set_post_thumbnail($parent_post_id, $attach_id);
$image1id = $attach_id;
$attach_id = ”;
}June 12, 2018 at 5:17 pm #26046AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 13, 2018 at 11:22 am #26051grainesParticipantHi Ally – thanks again for your continued support.
I’ve added in your suggestions and still cannot get the code to function correctly.
I’ve attached the php file for you to look at if that helps.
Thanks
June 13, 2018 at 11:23 am #26052June 18, 2018 at 12:34 pm #26083grainesParticipantHi Ally
I just wondered if you had any further suggestions on this please?
Thanks
June 19, 2018 at 12:16 pm #26090AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 19, 2018 at 4:06 pm #26104grainesParticipantHi Ally
We’re really struggling with this one. I think that the code we sent you is the only code that is required? The only other references I can see are in the functions.php file (attached). I’ve changed the Iphorm to quform in here and it’s still not working.
Appreciate your help with this.
Attachments:
You must be logged in to view attached files.June 19, 2018 at 4:15 pm #26107AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
June 19, 2018 at 4:21 pm #26108grainesParticipantYou’re a star! Thank you so much. That seemed to have worked.
Just one other thing, is there a way to add a ‘Please wait’ message once the form is submitted. We’re finding people are closing the window before the confirmation page is loaded and information submitted.
Thanks so much again.
June 21, 2018 at 3:23 pm #26134grainesParticipantHi Ally
Following on from my previous question regarding adding a ‘Please wait’ message to the form to prevent people closing the window too early. I found this in your support forum – however it doesn’t seem to work. Is there any updated version required for the new form release please?
<script>
jQuery(document).ready(function ($) {
$(‘.iphorm-loading’).text(‘Please wait while your files are uploaded. Do not refresh or click submit again’).css({
‘background-position’: ’10px center’,
‘text-indent’: 0,
‘padding-left’: ’40px’
});
});
</script>Thanks – I’ve already tried changing .iphorm-loading to .quform-loading
June 25, 2018 at 10:18 am #26152AllySupport StaffYou don't have permission to view this content. Please log in or register and then verify your purchases to gain access.
- AuthorPosts
- You must be logged in to reply to this topic.