Running PHP inside a javascript function?
Discussion
I have the following code which executes when a user prints a page (It's set as the background in a CSS Style Sheet in the @print section).
What that does is insert a record into my MySQL database logging the fact that a record has been printed.
Is there a way to get JS, a client side app to tell PHP, a server side app to launch a php script?
I need logit.php to fire off inside the print()function rather than during an onload fucntion.
Any help or pointers greatly appreciated.
$BGImage = background-image:url(logit.php?RectNo=$RectNo&DBForLogit=db04)";
What that does is insert a record into my MySQL database logging the fact that a record has been printed.
Is there a way to get JS, a client side app to tell PHP, a server side app to launch a php script?
I need logit.php to fire off inside the print()function rather than during an onload fucntion.
Any help or pointers greatly appreciated.
I can't take all the credit but it works very well Unfortunately I'm moving over to PDF creation on the fly and the class that I use doesn't currently support the background-image css command
I only use PHP and JS, I don't really have time to go learn another language for one task, I just need to get JS to tell my script to run. I can pass it PHP variables but I don't know how to say the following
{{{
function printMe() {
print ()
./logit.php?RectNo=$RectNo&DBForLogit=db04
}
}}}
Can't be that difficult, surely I'm only calling a url effectively??
I only use PHP and JS, I don't really have time to go learn another language for one task, I just need to get JS to tell my script to run. I can pass it PHP variables but I don't know how to say the following
{{{
function printMe() {
print ()
./logit.php?RectNo=$RectNo&DBForLogit=db04
}
}}}
Can't be that difficult, surely I'm only calling a url effectively??
Gassing Station | Computers, Gadgets & Stuff | Top of Page | What's New | My Stuff