PDA

View Full Version : Variables in passthru do not work


airoid
01-09-2007, 06:54 AM
I am trying to print the website statistics for certain websites to a PDF file using htmldoc. Here is the code that is working, kind of:

$pdf = passthru("/usr/bin/htmldoc -t pdf --quiet --jpeg --webpage http://$username:$pass@$domain:2082/awstats.pl?year=$year&output=main&config=$domain&lang=en&month=$month");

The issue is that none of the variables after $year work (the $domain and $month variable). The link is correct, because I've tested it manually, but for some reason it will not display the other variables after $year.

I've tried moving the variables in the different order but this does not work. Anyone have any ideas?

Fumigator
01-09-2007, 03:35 PM
My guess is the ampersands are wreaking havoc with the passthru as it tries to translate them to html codes. Try wrapping the entire string in the htmlentities() function and see if that helps.

airoid
01-10-2007, 05:50 AM
Thanks, I gave that a try, but it didn't solve the issue.

Hmmmmm...any other ideas?