I am using the amCharts javascript library to show some data charts in my website. I want to read the data that will be in the charts from a database.
I'm reading the data with and after that making a call to the javascript function like this:
<?php
echo '<script language="javascript">makeGraph(' . json_encode($data) . ')</script>';
?>
I am getting the results I want this way, but if a client look in the source code of the website, he will see all the data from the database instead of $data since you are not in the server anymore.
So the question is: how can I read and use all the data without exposing it publicly? Because I can not really figure out any other way to do it now.
Thank you very much
If you don't want users to see your data, then don't use JavaScript to process it. Create the charts in php on your server and display the results only.