inserting php in non-php pages (dynamic banner)
Moderator: General Moderators
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
inserting php in non-php pages (dynamic banner)
Hi,
sorry but couldnt really think of an appropriate name for the question....
I have created a banner script that randomly displays images from a database...
the script is to be called with a variaiable parameter and then echoes a img tag with the information...
How do you guys get this to work on non-php pages... reason for this is that i want to be able to have ppl display my banners by merely calling the script
here my theory of function
php script
<?php
i get the type of banner to display true $_GET['type'];
get the random banner from database using mysql_query();
echo banner using <img src=PATH.mysql_result>
?>
but how do i call the script from a non php stand point?
Kendall
sorry but couldnt really think of an appropriate name for the question....
I have created a banner script that randomly displays images from a database...
the script is to be called with a variaiable parameter and then echoes a img tag with the information...
How do you guys get this to work on non-php pages... reason for this is that i want to be able to have ppl display my banners by merely calling the script
here my theory of function
php script
<?php
i get the type of banner to display true $_GET['type'];
get the random banner from database using mysql_query();
echo banner using <img src=PATH.mysql_result>
?>
but how do i call the script from a non php stand point?
Kendall
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
inserting php in non-php pages (dynamic banner)
m3rajk,

i did use a
but it didnt work...i got no output 
what is the cgi-module...i think you need to use the cgi-module
i did use a
Code: Select all
<script language = php src = file.php></script>Re: inserting php in non-php pages (dynamic banner)
what aboutkendall wrote:m3rajk,
what is the cgi-module...i think you need to use the cgi-module
i did use a
but it didnt work...i got no outputCode: Select all
<script language = php src = file.php></script>
Code: Select all
<script language="php" src="file.php"></script>- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
just to update...there's a attribute to the <script> tag...
found it in dreamweaver but not on W3C documentation
wat is it?
Kendall
Code: Select all
<script runat='server'>wat is it?
Kendall
does that work?kendall wrote:just to update...there's a attribute to the <script> tag...
found it in dreamweaver but not on W3C documentationCode: Select all
<script runat='server'>
wat is it?
Kendall
and also, my name is victor - nickname is vigge, not vigger, veggo or something
cgi: common gateway interface - standard for running external programs from a web server. CGI specifies how to pass arguments to the program as part of the request.
module: An independent piece of software which forms part of one or more larger programs. Modules are usually compiled seperately (in compiled languages) and provide an abstraction or information hiding mechanism so that a module's implementation can be changed without requiring any change to other modules.
module: An independent piece of software which forms part of one or more larger programs. Modules are usually compiled seperately (in compiled languages) and provide an abstraction or information hiding mechanism so that a module's implementation can be changed without requiring any change to other modules.
I belive that...
...should do the trick. If you have the correct header()'s in the file on the php driven server, you should get an image. by using $_GET you can choose what image.
I cant see any other problems.
Code: Select all
<img src="http://www.phpdrivenserver.net/image.php?name=foo" />I cant see any other problems.
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
evilMind,
I kinda know what CGI and MODULE's are i just wanted to know what was meant by it in relation to PHP
m3rajk,
AH....thanks i think you made it a bit clearer for me....
so your saying that all i need to do is insert
then how come...
doesn't work??? further more...WTF is the attribute 'runat' ??? i dont see it in the 3WC documentation. this is something that 'popped' up in dreamweaver coding hints.
JAM,
ma man Jamm....believe it or not seeing that all else failed i was attempting this method because all i want people to do is just insert one small tag that will link the banners to there pages and not have to insert a large bunch of code with <script><?php ?></script> method...i'm having a bit of a time understanding how it actually works but im still trying to figure it out myself...
Kendall
I kinda know what CGI and MODULE's are i just wanted to know what was meant by it in relation to PHP
m3rajk,
AH....thanks i think you made it a bit clearer for me....
so your saying that all i need to do is insert
Code: Select all
<script language="php">
<?php
php code here
?>
</script>Code: Select all
<script language="php" runat="www.onlinetnt.com" src='file.php'></script>JAM,
ma man Jamm....believe it or not seeing that all else failed i was attempting this method because all i want people to do is just insert one small tag that will link the banners to there pages and not have to insert a large bunch of code with <script><?php ?></script> method...i'm having a bit of a time understanding how it actually works but im still trying to figure it out myself...
Kendall
- kendall
- Forum Regular
- Posts: 852
- Joined: Tue Jul 30, 2002 10:21 am
- Location: Trinidad, West Indies
- Contact:
JAM...
I can't seem to get this thing to work
heres my php code
here's what i do to retieve the script
what else do i need to do??
Kendall
I can't seem to get this thing to work
heres my php code
Code: Select all
// after getting the results
$Image = mysql_fetch_assoc($IMG);
// display image
// get content type
echo 'http://www.onlinetnt.com/images/advertisements/'.$Image['file'];Code: Select all
<img src="http//onlinetnt.com/ad_system.php?type=B">Kendall