PDA

View Full Version : why cannot use php commands?


seidel
07-25-2004, 12:23 PM
Hello!

I have a php template for access a data from database...

but any php command is not working...


commands example:

<?php
$dbh=mysql_connect ("localhost"...

?>

OR

<?php
$myvar = "Hola Mundo. Este es mi primer script en PHP";
//Esto es un comentario
echo $myvar;
?>

is not working...

please helpme!!!

Zachery
07-25-2004, 04:33 PM
Where are you trying these? you CANNOT use php in templates.

Our Sponsors
 

apokalupsis
07-25-2004, 04:40 PM
You'll have to create a new module (http://www.vbadvanced.com/membersarea.php?do=viewmanual&productid=4&pageid=5) (to work w/ vb CMPS) or wrap the php files in a header/footer like I've been working on here: www.myfamilycorner.net/chess (but if you go this route, you won't be using vb CMPS).

seidel
07-25-2004, 09:45 PM
Many thanks!

I´m working on module form downloads tracker... so is not possible use php in module?

Our Sponsors
 

Brian
07-26-2004, 12:09 PM
You can inlcude a php file in the module, and then have the variables printed out in that module. ;)

seidel
07-29-2004, 09:57 AM
Hello!

If possible get an example?

Many thanks!

dep
08-02-2004, 12:31 PM
look here
http://www.vbadvanced.com/forum/showthread.php?t=1082

but for part 1 where he say
1) Create a template for use in adv portal cmps with a single line: $output
As example i named a template called adv_portal_test:
$output

put this instead then you will have your layout

<table align="center" border="0" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" class="tborder" width="100%">

<tr>
<td class="tcat">
<span class="smallfont">
<strong>$vba_options[portal_blockbullet] $mods[title]<strong>
</span>
</td>
</tr>

<tr><td class="$getbgrow" width="100%">
$output
</td></tr>
</table>
<br />