Page 1 of 1
Code not parsing
Posted: Wed Dec 23, 2009 5:15 pm
by Vegan
I wonder if I have made a mistake with Apache, I have some code to show an ad, but PHP is not parsing the PHP code to generate the ad.
Thoughts, I using Linux Server for the record.
Re: Code not parsing
Posted: Wed Dec 23, 2009 6:36 pm
by daedalus__
what's your config look like?
what distro?
Re: Code not parsing
Posted: Wed Dec 23, 2009 8:32 pm
by Vegan
I have checked everything, the include works, so I am wondering what am I doing wrong?
For example:
Code: Select all
<?php include $_SERVER["DOCUMENT_ROOT"] . "/google.php"; ?>
And I see the code for Google Analytics fine, so my ad tool has some PHP code:
Code: Select all
// Tower Ads intended for display below the navigation block
$ads = array(
// Microsoft has the best selection of advertisements
array(
'http://click.linksynergy.com/fs-bin/click?id=jaxflTaXP3Y&offerid=166833.10000242&subid=0&type=4',
'Microsoft Store',
'http://ad.linksynergy.com/fs-bin/show?id=jaxflTaXP3Y&bids=166833.10000242&subid=0&type=4&gridnum=9'
),
array(
'http://click.linksynergy.com/fs-bin/click?id=jaxflTaXP3Y&offerid=166833.10000292&subid=0&type=4',
'Microsoft Store',
'http://ad.linksynergy.com/fs-bin/show?id=jaxflTaXP3Y&bids=166833.10000292&subid=0&type=4&gridnum=9'
)
);
$ad = $ads[array_rand($ads)];
echo "<a href='{$ad[0]}'><img alt='{$ad[1]}' src='{$ad[2]}'/></a><br />";
This simply comes up as included text (not the ad desired), thoughts?
Re: Code not parsing
Posted: Wed Dec 23, 2009 8:48 pm
by manohoo
It sounds like the code you displayed is an .html file. Change the extension to .php and let me know what happens.
And don't forget to close your php code with the "?>" tag.
Re: Code not parsing
Posted: Thu Dec 24, 2009 12:36 am
by daedalus__
does it output the html tags and all that? are they being parsed? im confused >.<