using php in HTML 
Author Message
 using php in HTML

Hai,
For a friend of mine I develop a simple counter. It uses MySql. However my
friends website does not support PHP. No problem I thought, however I can
not find a way to put my program on my site and put some code in his site to
get the info displayed on his site.
I'ved tried :
<script language="PHP" src="counter.php" type="text/php"></script>
which does not work.
counter.php displayes graphics but I also tried to display just text.
please help

--

Greetz
       from           ("`-''-/").___..--''"`-._
             Mick     `6_ 6  )   `-.  (     ).`-.__.`)
                        (_Y_.)'  ._   )  `._ `. ``-..-'
                      _..`--'_..-_/  /--'_.' ,'
                     (il),-''  (li),'  ((!.-'



Tue, 21 Jun 2005 00:58:35 GMT  
 using php in HTML


Quote:
> Hai,
> For a friend of mine I develop a simple counter. It uses MySql. However my
> friends website does not support PHP. No problem I thought, however I can
> not find a way to put my program on my site and put some code in his site to
> get the info displayed on his site.
> I'ved tried :
> <script language="PHP" src="counter.php" type="text/php"></script>
> which does not work.
> counter.php displayes graphics but I also tried to display just text.
> please help

> --

> Greetz
>        from           ("`-''-/").___..--''"`-._
>              Mick     `6_ 6  )   `-.  (     ).`-.__.`)
>                         (_Y_.)'  ._   )  `._ `. ``-..-'
>                       _..`--'_..-_/  /--'_.' ,'
>                      (il),-''  (li),'  ((!.-'

You need to make the PHP script output a valid javascript that will
write out what you want.  A web browser has no idea what language=PHP
means, and neither will his server, so nothing will happen.  You need to
do something like this:
<script type="text/javascript"
src="http://www.yoursite.com/counter.php"></script>

counter:php
<?php
//Get the value
header("Content-type: application/x-javascript");
echo "document.write('$CounterValue');";
?>



Mon, 20 Jun 2005 23:07:31 GMT  
 using php in HTML

Quote:
> For a friend of mine I develop a simple counter. It uses
> MySql. However my friends website does not support PHP.  get the
> info displayed on his site.  I'ved tried : ><script language="PHP"
> src="counter.php" type="text/php"></script> which does not work.

PHP scripts executes on the server.

Quote:
> counter.php displayes graphics but I also tried to display just
> text.  please help

If counter.php generates a image, then your friend should be able to
just do '<img src="http://your.site/counter.php">'. Other than that,
there may be some way to do server-side-include (<!-- #include ) on
his host which could be utilized


Tue, 21 Jun 2005 06:34:54 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. HTTP auth using PHP and HTML

2. Using HTML in a PHP page

3. Help: PHP works with .php but not .html

4. FW: [PHP Classes] MetaL - a XML based meta-programming language developed using PHP

5. HTML -PHP functions

6. HTML Buttons and PHP

7. php in html, under linux

8. HTML/CGI/PHP interface question...I think

9. HTML Hidden Values Passed to PHP

10. Simple Question - Run .php form an html directory

11. Python mixed with HTML like PHP

12. Auto-indenting / formatting mixed php/html

 

 
Powered by phpBB® Forum Software