SOLVED IT
<?php $startPage = $_COOKIE["currentPage"];?>
<script type="text/javascript">
var startPageVal = <?php echo $startPage; ?>;
<?php echo base64_decode($pajinate_js); ?>
</script>
while $pajinate_js is the code below but instead startPage : startPageVal
I am having trouble figuring out how to add JavaScript from a form. Basically I have code such as this (ignore the script itself rather than one line (startPage):
$(function(){
/* initiate the plugin */
$("div.holder").jPages({
containerID : "content",
perPage : 2,
startPage : <?php echo $_COOKIE["currentPage"]; ?>,
startRange : 1,
midRange : 5,
endRange : 1,
}
});
if I place the code inside PHP page immediately I get startPage : 3 (or whatever value I get) but if I do it via Textarea dynamically in the browser source I get plain text:
startPage : <?php echo $_COOKIE["currentPage"]; ?>
which will, as a result, cause the whole thing not to work. I am using base64_decode and base64_encode to pass it through the database, otherwise mysql insert statement doesn't work.
Hope you understood what i meant. Does anybody know how to get around it?