close ad
Install the LAtest Updates to Work with CC 2017 and CC 2018
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

session variables don't send using UE

Thread began 8/30/2010 5:20 pm by tmcbinc99963 | Last modified 8/31/2010 4:53 pm by Jason Byrnes | 1034 views | 9 replies |

tmcbinc99963

session variables don't send using UE

The only way I can get the session variables to send to formresults.php is delete the UE code, put $session info on second page, and set the form action to formresults.php

Have tried multiple workarounds and configurations; nothing works.

Files attached.

Attached Files
webassist.zip
Sign in to reply to this post

Jason ByrnesWebAssist

few things to try for debugging this:

1) move the error reporting code:

php:
<?php 
error_reporting
(E_ALL); 
ini_set('display_errors','on'); 
?>



to line 1 and have it on both pages.



2) change the session code so it only triggers when the form posts:

php:
<?php
if(!session_id()) session_start();
if (
$_SERVER["REQUEST_METHOD"] == "POST") {
$_SESSION['customeremail']=$_POST['customeremail']; 
$_SESSION['customeraddress']=$_POST['customeraddress']; 
$_SESSION['Income']=$_POST['Income']; 
$_SESSION['Age']=$_POST['Age']; 
$_SESSION['NWDallas']=$_POST['NWDallas']; 
$_SESSION['NDallas']=$_POST['NDallas']; 
$_SESSION['SDallas']=$_POST['SDallas']; 
$_SESSION['Listmenustate']=$_POST['Listmenustate']; 
}
?>




3) on the form results page, add var_dump after the body tag:
<?php var_dump($_SESSION); ?>

You reported this in another thread:
showthread.php?t=15531

I had you download a copy of the session test file, can you send the link to that file and your form page so I can test it?

Sign in to reply to this post

tmcbinc99963

debugging efforts

These pages have the debugging code with the session test file. Does the dump eliminate the variables? I need to use them on other pages as well.

Files attached.

Attached Files
webassist.zip
Sign in to reply to this post

Jason ByrnesWebAssist

no, the dump will not clear the sessions.

What is the results of these tests, can you post a link where I can see this in the browser?

Sign in to reply to this post

tmcbinc99963

link

nerdyrat.com
nerdyrat.com/sessionTest.php
nerdyrat.com/form.php

Sign in to reply to this post

Jason ByrnesWebAssist

OK, I tested the form, and got the following error:

Notice: Undefined index: NDallas in /var/www/vhosts/nerdyrat.com/httpdocs/form.php on line 13

Notice: Undefined index: SDallas in /var/www/vhosts/nerdyrat.com/httpdocs/form.php on line 14

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/nerdyrat.com/httpdocs/form.php:13) in /var/www/vhosts/nerdyrat.com/httpdocs/form.php on line 28


this is because i didn't check either the NDallas or SDalas check boxes

when setting the session, you should use isset() to see if the form elements are set or not:
for example:

php:
$_SESSION['NDallas']=isset($_POST['NDallas'])?$_POST['NDallas']:"";




i then when to the results page, and saw the information I had entered was displayed meaning the sessions are being set.


the vardump code at the bottom of the page should be:

php:
<?php var_dump($_SESSION); ?>




but it seams to be working in my test.

Sign in to reply to this post

tmcbinc99963

sessions are set; with multiple error messages

The sessions are setting ok, but form page doesn't redirect to results page. On submit, the form page shows up again with the following messages.

Notice: Undefined offset: 0 in /var/www/vhosts/nerdyrat.com/httpdocs/WA_Universal_Email/Mail_for_Linux_PHP.php on line 113

Notice: Undefined offset: 0 in /var/www/vhosts/nerdyrat.com/httpdocs/WA_Universal_Email/Mail_for_Linux_PHP.php on line 115

Notice: Undefined offset: 0 in /var/www/vhosts/nerdyrat.com/httpdocs/WA_Universal_Email/Mail_for_Linux_PHP.php on line 165

Notice: Undefined offset: 0 in /var/www/vhosts/nerdyrat.com/httpdocs/WA_Universal_Email/Mail_for_Linux_PHP.php on line 113

Notice: Undefined offset: 0 in /var/www/vhosts/nerdyrat.com/httpdocs/WA_Universal_Email/Mail_for_Linux_PHP.php on line 115

Notice: Undefined offset: 0 in /var/www/vhosts/nerdyrat.com/httpdocs/WA_Universal_Email/Mail_for_Linux_PHP.php on line 165

Warning: Cannot modify header information - headers already sent by (output started at /var/www/vhosts/nerdyrat.com/httpdocs/WA_Universal_Email/Mail_for_Linux_PHP.php:113) in /var/www/vhosts/nerdyrat.com/httpdocs/form.php on line 29

Also, when manually going to formresults.php the following error shows up under the form, though the session info is there. When I submit the formresults.php page to the checkout.php page, the session info is there as well, with no errors.

array(8) { ["customeremail"]=> string(6) "acbvav" ["customeraddress"]=> string(6) "acbadb" ["Income"]=> string(8) "$100,000" ["Age"]=> string(8) "Under 50" ["NWDallas"]=> string(3) "Yes" ["NDallas"]=> string(0) "" ["SDallas"]=> string(0) "" ["Listmenustate"]=> string(10) "Fort Worth" }


Files are attached.

Attached Files
webassist.zip
Sign in to reply to this post

Jason ByrnesWebAssist

those errors will occur if you don't enter a valid email address in the email address form element.



This at the bottom of the results page:
array(8) { ["customeremail"]=> string(6) "acbvav" ["customeraddress"]=> string(6) "acbadb" ["Income"]=> string(8) "$100,000" ["Age"]=> string(8) "Under 50" ["NWDallas"]=> string(3) "Yes" ["NDallas"]=> string(0) "" ["SDallas"]=> string(0) "" ["Listmenustate"]=> string(10) "Fort Worth" }

is not an error, it is the var_dump of the session.

you can remove this, I only had you add it for debugging.

Sign in to reply to this post

tmcbinc99963

Valid form info creates session errors

Typed in valid entries for each form selection and got the following errors (see image) on results page. Didn't bother deleting 'dump' yet.

Attached Files
form_image.jpg.zip
Sign in to reply to this post

Jason ByrnesWebAssist

I have created a support ticket so we can look into this issue further.

To view and edit your support ticket, please log into your support history:
supporthistory.php

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...