phpAdsNew and PHP Code

They have: 4 posts

Joined: Dec 2005

Anyone know how I can include php code into an HTML banner in phpAdsNew... I know its probably not the place but I was thinking if it was possible using javascript...

the code I need to use to display the banner is not pretty but here is it:

<?php
include(\"configfile\");

<link href=\"http://www.thespothq.com/adcode.css\" rel=\"stylesheet\" type=\"text/css\">
<table width=\"728\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#003371\">
<tr>
   <td height=\"18\" align=\"center\" bgcolor=\"#003371\" class=\"whitetableheads\"><div align=\"center\">Bored? Play Games Online Now at TheSpotHQ.com</div></td>
</tr>
<tr>
   <td align=\"center\" bgcolor=\"#FFFFFF\"><table border=\"0\" cellpadding=\"2\" cellspacing=\"2\">
                            
  // catlist query
 
$make2 = mysql_query(\"SELECT * FROM **REMOVED** ORDER BY RAND() LIMIT 5\")
  or die(mysql_error());
                             
$i=1; while($randg = mysql_fetch_array($make2)) {
if(
$i == 1) echo \"<tr>\n\";
                           <td width=\"130\" valign=\"top\" bgcolor=\"#003371\"><table width=\"130\" height=\"96\" border=\"0\" cellpadding=\"0\" cellspacing=\"2\" bgcolor=\"#FFFFFF\">
                             <tr>
                               <td height=\"94\" valign=\"top\"><table width=\"125\" height=\"92\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\">
                                 <tr>
                                   <td height=\"28\" align=\"center\" background=\"http://www.thespothq.com/images/tbbac.gif\" class=\"whitetableheads\"><div align=\"center\">
                                     <span class=\"indexwhitehead\"><a href=\"http://www.thespothq.com/playnow.php?gameid==
$randg['id'];\" class=\"indexwhitehead\">
                                     =
$randg['name'];
                                     </a></span></div></td>
                                 </tr>
                                 <tr>
                                   <td height=\"61\" align=\"center\">
$gamid = $randg['id'];
$thumbs = mysql_query(\"SELECT * FROM `thumbnails` WHERE `gameid` = '$gamid'\");
$thumb = mysql_fetch_array($thumbs);

                       <a href=\"http://www.thespothq.com/playnow.php?gameid==
$randg['id'];\" class=\"playnowlink\"><img src=\"http://www.thespothq.com/thumbs/= $thumb['thumbnail']; \" width=\"70\" height=\"57\" border=\"0\"/></a></td>
                                 </tr>
                               </table></td>
                             </tr>
                           </table></td>
         
$i++; if($i == 6) { echo \"</tr>\n\"; $i=1; } }
</table></td>
</tr>
</table>
?>

Free Forum Hosting www.spotbb.com
Bored?? Play Games www.thespothq.com

dk01's picture

He has: 516 posts

Joined: Mar 2002

I looked on page 37 of the manual and found this:

Quote:
Embedding PHP code
In certain cases you may want to embed PHP code inside an HTML banner.
You can do this in the same way as you would normally embed PHP code inside an
HTML document. PHP code starts with

<?php
and ends with
?>
. All code between these
two tags will be executed just as it would if it were embedded inside a normal HTML
document.
<a href=’http://www.mybanner.com/click’>
<?php
echo “The current time is: ;
echo
date (“H:i:s”);
?>

</a>
'
There are some exceptions: It is not possible to define functions or classes and include or
require other files. The print(), echo and printf() functions will still work and can be used to
print strings to the HTML banner. It is also not possible to mix variables and PHP code,
so the following example will definitely not work: {targeturl:http://www.phpadsnew.com/
page.html?id=
<?php
$id
?>
}

I tried doing an echo statement like this:

<?php
echo("Hi");
?>

in my phpAdsNew but it didn't work for some reason. Maybe they don't have all the bugs worked out. Anyhow your code won't work because as stated in the manual "It is not possible to define functions or classes and include or
require other files".

I dunno what else there is left to do!

They have: 4 posts

Joined: Dec 2005

ahhh... aint gonna work then... cheers for looking tho...

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.