Simple project for those who know php to js..
THIS WORKS ....................
var parameters = {
serveraddress: '[login to view URL]', // Manual manipulation works
username: 'testuser', // Manual manipulation works
password: '00e2ac36b356df4616b6ecb6', // Manual manipulation works
loglevel: 5
};
THIS Fails ....................I need this to be dynamic and get the username from the php session variable...
var parameters = {
var sesstest = "<?php echo $_SESSION['username']; ?>"; // This is a Session variable
-- I can see username and echo it in php.
serveraddress: '[login to view URL]',
username: sesstest, // This fails. If I place it in single quotes = fail.
Double quotes = fail. And + var + fails.
password: '00e2ac36b356df4616b6ecb6',
loglevel: 5
};
In my php I have:
<script type="text/javascript">
var sesstest='<?php echo $_SESSION['username'];?>';
</script>
before the scrip source of the js loads.
How do I get session variables into js and what is the proper format for js colon :
Nice to meet you.
I've read the project description and can develop definitely.
I'll provide you with the highly skilled & professional HTML/CSS, PHP/WordPress/CodeIgniter, JavaScript, MySQL, front & back-end web development services and complete the site in time.
Please contact with me.
Thank you very much.
Hello
I'm the full stack developer.
I understood all about your job.
so there is no problem for me to complete your project with my skill.
I can do work your job perfectly.
Hope to work with you as soon as possible.
Best regards
Good
I will solve the problem from now in here.
you have saved the username as session variable.
you can enter the session variable into <input type="hidden"... value="...">
That's all.
You can get the username in javascript using "hidden" above.
Hello Sir,
I have gone through your requirements and will be able to fix your issue asap. I have 5+ years of experience in PHP and all it's supportive languages like JS, HTML, CSS, Bootstrap etc. Let discuss on chat for more details..
Thanks