close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Saving address details (not credit card) into a cookie

Thread began 2/17/2011 4:29 am by dallySP | Last modified 2/17/2011 1:17 pm by Jason Byrnes | 2293 views | 5 replies |

dallySP

Saving address details (not credit card) into a cookie

Hiya,

My customer wants to avoid using customer logins on their website but wants to give the user the option to save their address details for next time. I've used the storing the login details tutorial to try and achieve this. So I obviously have the form fields and then a remember me checkbox.

Code for setting cookies is as follows:
<?php
if ((((isset($_POST["remember"]))?$_POST["remember"]:"") != "")) {
setcookie("remember", "1", time()+(60*60*24*60), "/", "", 0);
}
?>
<?php
if ((((isset($_POST["remember"]))?$_POST["remember"]:"") != "")) {
setcookie("firstname", "".((isset($_POST["firstname"]))?$_POST["firstname"]:"") ."", time()+(60*60*24*60), "/", "", 0);
}
?>

etc for each form field.

and the individual form fields look like this:
<input name="firstname" type="text" id="firstname" value="<?php echo((isset($_COOKIE["firstname"]))?$_COOKIE["firstname"]:"") ?>" size="40" />

and remember me button like this:
<input name="firstname" type="text" id="firstname" value="<?php echo((isset($_COOKIE["firstname"]))?$_COOKIE["firstname"]:"") ?>" size="40" />

However it doesn't seem to be working. Can you tell me what I might be doing wrong, or alternatively is there a better way of doing this?

Thanks.

Sign in to reply to this post

Jason ByrnesWebAssist

if this is on an eCart checkout page, the checkout page posts to the confirm page. The code to set the cookies will need to be applied to the confirm page, not to the checkout page.

Sign in to reply to this post

dallySP

Oh OK and is it correct to set an invidual cookie for each form element - they'll be 20 in all?

Sign in to reply to this post

Jason ByrnesWebAssist

Yes, each form element will need a separate cookie in this case.

Sign in to reply to this post

dallySP

can I just ask one other quick question before signing off - I seem to have lost the form elements that used to appear in the bindings panel. I've been googling to try and figure out why and am told it might be to do with my extensions - any ideas?

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

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...