Is it possible to "call" a JavaScript function though php, like if I were to do somthing like this:
<?php
//Skip to code that calls javascript
$thisvariable = 1;
if($thisvariable == 1){
?>
<script language="javascript">
auto();
function auto(){
document.form.submit();
}
</script>
<?php
}
//Continue php code...
Would that be the best way, and does it work correctly?