Hi all,
I'm a newbie to coding in general (barely know enough to be dangerous), but I've created a company and decided to handle the integration myself. Now I realize I'm a bit over my head and can use a little help! I need to pass user info from my Wordpress database into a URL, then place that URL into an external Javascript link. I may not be explaining this well, so let me attempt to show my dilemma.
Here's the PHP code to pull a users email address from my wordpress database:
This code calls the function and prints the email address:
Now this is where I'm stuck, how would I get this email address to populate after the 'clientid=' portion of the following JavaScript src field? Would I have to rewrite with $_GET and create a custom url, then pass it on some other way?
Any help would be GREATLY appreciated. I really need to populate these fields automatically or I can't tell which customer I'm chatting with or track their individual tickets. Thank you in advance!
I'm a newbie to coding in general (barely know enough to be dangerous), but I've created a company and decided to handle the integration myself. Now I realize I'm a bit over my head and can use a little help! I need to pass user info from my Wordpress database into a URL, then place that URL into an external Javascript link. I may not be explaining this well, so let me attempt to show my dilemma.
Here's the PHP code to pull a users email address from my wordpress database:
Code:
<?php function getemail() { $current_user = wp_get_current_user(); echo $current_user->user_email; } ?>
Code:
<?php $func = 'getemail'; $func(); ?>
Code:
<script language='JavaScript' src='[editedforsecurity]entrypoint.asp?p=1;email%40email.com;description;name;company&ref=name&clientid=company'> </script>
Comment