I got pulled off of PHP for a while and had to write some EXCEL Automation programs. Lucky me!
Okay, I am trying to get back on track with this. I just noticed, while using Firefox's Firebug that the session variable, $_SESSION['user_email'], is already holding the user's Email Address. For example, I see in single quotes my own email address, since I am the user who logged in. So, this is what I needed. I just need to figure out how to do two things:
(1) Display that value for the email address inside the Email textbox when the form is initialized and,
(2) Have that value set in the variable for that textbox already.
How do I do the two things listed above?
Remember, I am a novice to writing PHP code. Most of my code is written in Visual FoxPro which is a database language.
What exists right now is the following code, prior to my changing it:
Code: Select all
echo '<input type="checkbox" name="btnUpdate" value="SendEmailToMe" checked > Send email to self?<br>';
// $_SESSION['user_email'] // I might need this soon.
echo '<input type="submit" name="btnUpdate" value="Email" size="20">';
echo '<input type="text" size=60 name="EmailList" id="EmailList" value="' . htmlspecialchars($lcEmailAddress, ENT_QUOTES, 'UTF-8') . '"/><strong>--Email List (sep by commas)</strong><br/><br/><br/><hr/>';
Okay, what I did to make this work was this: I only changed the third input type textbox to use $_SESSION['user_email'], instead of $lcEmailAddress. Now, a further complication. The person requesting this is now asking that I do not show/display the user's email address in the textbox, but that we do everything behind the scenes so that the user never sees their own user email address. The memory variable for the text box is EmailList. Would I "pass" the value from the Session memory variable for the email address to the EmailList? Somehow, I think you will say not to do that.
This worked, but as I said above, now the user doesn't want to see their email address in the box.
echo '<input type="text" size=60 name="EmailList" id="EmailList" value="' . htmlspecialchars($_SESSION['user_email'], ENT_QUOTES, 'UTF-8') . '"/><strong>--Email List (sep by commas)</strong><br/><br/><br/><hr/>';