Hello,
I have a web page that needs to fetch the current users email address from the database and put it in a form.
How can I do this?
Hello,
I have a web page that needs to fetch the current users email address from the database and put it in a form.
How can I do this?
I was thinking that since the users login name is his email address I could just capture that login name, set it as a cookie
something like setcookie( "username", $this->customer['email_address']); and then retrieve the cookie into the form on the static page.
Cant figure out how to capture the login name though.
Im not sure how zen cart stores current logged in user status. Does it have the user login in a global variable of some sort i can access it from?
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Shouldnt I be able to do something like:
<INPUT name="useremail" type= "hidden" value="<?=$_SESSION['customers_email_address']?>">
While I wouldn't recommend using short-tags, yes the concept is correct, as long as you're in a Zen Cart page.
Or, rather than using some 3rd-party tool for collecting form data, why not use Zen Cart's own forms? Or maybe an addon such as the one discussed here: http://www.zen-cart.com/forum/showthread.php?t=4855
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
Tried putting this in tpl_header_default.php and at the top of the static page where it should be loaded (first page after user logs in)
Doesnt appear to do anything.
I am checking the cookies by entering javascript:alert(document.cookie); in my browser address bar.
What zen cart file would you recommend putting it in?
<?php
if ($_SESSION['customer_id'])
{
$var = $_SESSION['customer_id']);
setcookie( "useremail", $var);
}
?>