close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Software works great...but I need some help.

Thread began 10/20/2009 11:26 am by john384495 | Last modified 10/23/2009 10:16 am by Jason Byrnes | 3211 views | 11 replies |

john384495

Software works great...but I need some help.

I was able to set up a css form builders with a simple contact. Went ahead and applied Universal email and to my surprise got it right. Ok here is the loop.


I have several pages in different folders that I want to be able to use this form to send an email to. These pages are different store info and each has its own email address.

I can write the code on the fly that would be able to set each page in each folder with a set variable session.

<?php
if (!session_id()) session_start();
if("" == "") {
$_SESSION["StoreEmail"] = "yo@blah.com";
}?>

and it works as I do see it when I bind it to a table cell on that page. But, on that page I have a contact link that opens the original form page called User_Contact which has the form by form builder and Universal email. So when I run the Universal email wizard I click on the TO: field and then click on the "StoreEmail" session. It does not work...also added a quick table on this page and binded a cell like on the other page and nothing shows. I have come to the conclusion after millions of dollars spent and 3 years of my time...that the session is not carrying over. Any suggestions.

Thanks in advance for any help.

One thing that needs to be known is that these are regular users who come to the page. There is no server behaviors on the store page besides the set session. The email page has WA Server Validations with other validation behaviors and Universal Email.

Sign in to reply to this post

Jason ByrnesWebAssist

add the following to the page with universal email on it at line 1:
[php]<?php if (!session_id()) session_start(); ?>


if it is still not working, to line 2 add:

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



This will write the session contents to the page so you can see if the session is being set.


If the session is being set, send a copy of the page so I can look at the code.

Sign in to reply to this post

john384495

Ok, I used the dump code on both pages. The original store page did show the email address so the session is being set there. But the User_Contact_Page (which has form builder and Universal email) only showed...

array(2) { ["captcha_Contact_me_group_Security_code"]=> string(5) "zD2KL" ["random_answer"]=> int(35) }

So we know it is not carried over, so it is not a universal email problem. I have two thoughts that might affect the session not being brought over but cut me some slack...I have only been using php for a month or so. First, if I have the link "contact store" (AKA User_Contact_Page) open up in a new window maybe the session is lost? I don't know what the limits our on session as this is the first time dealing with them. Or...maybe since I have the User_Contact_Page in the root folder of the domain and the store folders are in subdomain folders...maybe that could that affect it. I do know that I have to use absolute links when doing stuff in subdomain folders.

Thanks in advance...

John

Sign in to reply to this post

john384495

Ok, I am pretty sure it has to do with the subdomain as I have google it and see that it is a problem. Being very new to php they all mention using session across subdomains and I am not sure if their code will work in my case.

The store page is located in a subdomain.

www.storename.website.com

so the file is storename.website.com/index.php but in dreamweaver of course it shows it under the folder for the storename.
Ther are no behaviors on this page except setting the session which does work.

Now the User_Contact_Page which has the validation and Universal email is located in the root so it is not located in any folders so it is just User_Contact_Store.php.

I see different code for init set but I think my situation is backwards where the session is set in the subdoman and I am trying to bring it back to the root or the main domain. I am pretty sure this is the problem. I am sorry it is not a software problem and my lack of knowledge so any help is appreciated.

John

Sign in to reply to this post

john384495

WOW!!! I didn't mean to make links...didn't think about it. But what is funny is they actually work...

Sorry to the owners of them...didn't mean to use them in my example.

John

Sign in to reply to this post

Jason ByrnesWebAssist

Yes, sessions variables are domain specific, so if you are moving between domain, you wont be able to use a session variable for the email.

You could pass the email address in a form from the subdomain to the main domain.


create a form like:

php:
<form id="form1" name="form1" method="post"  action="http://www.mydomain.com/contact.php">

        <input type="hidden" name="email" id="email" value="<?php echo(isset($_SESSION['email'])?$_SESSION['email']:""); ?>"/>
        <input type="submit" name="button" id="button" value="Submit" />
</form>





Then in the contact form on the contact page, create a new hidden form element named "email" to capture the value from the form:

php:
<input name="email" type="hidden" id="email" value="<?php echo((isset($_POST["email"]))?$_POST["email"]:""?>"/>





and in univerwsal email, use the email form element.

Sign in to reply to this post

john384495

Jason...I am so close and I spent all day trying to figure it out myself and I can't. I used your code and it does work in that now it does bring the value over to the new page. I did some research on it and I understand how it works. I know it works since I change the code on the User_Contact_Page (one that has form builder & Universal emails) from hidden to text and the email address shows. I also added a table and pasted
<?php echo((isset($_POST["email"]))?$_POST["email"]:"") ?>
and it shows up in the table. I created a new text field and it show up in that also.

BUT...although I see it in universal email it won't bring it in. I tried to put it in the email section and then I stuck it in just the title area to see if anything come in and when I received the email, it said no subject.

I just don't get it since I know it is there. I then tried to store it as a session on the page but could not. The reason I thought about the session was that when the person who is filling out the form makes a mistake the field goes blank (I kept the type as text instead of hidden so I could see the value). So my thinking was if I could set it as a session maybe universal email would accept it and if the contact page was refreshed it would remember the value.

So close...

John

Sign in to reply to this post

Jason ByrnesWebAssist

is there another form element on the page named email?

can you send a copy of the page with universal Email on it so I can look at the code.

Sign in to reply to this post

john384495

This post has been deleted.

john384495

I thought the same thing so I made another text field to make sure I was grabbing the right one and it still did not work. I have also move the code from body to header and back again. I moved the output from the email field up to the subject field of the email and put in a static email at it worked in that the email was sent correctly but the subject was blank. I moved stuffed around so much that the form stop working so I wrote you and redid the form from scratch again. You won't be able to see it but the email address does come to this page as I changed your hidden field to a text field and it shows the correct email in the box.

I was wondering whether it would be better to grab the info from the email field and save it as a session. The reason I say this is because if the person answers the question wrong the post action that brought the value is lost.

Maybe my thinking is wrong. Pretty much what I am trying to do is like what they have on classifieds, where a potential buyers emails the classified owner through a link that does not display the owners email that is from a database. Instead of classifieds I am using store owners.

John

Attached Files
code.txt
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...