vForums Support > vForums :: Support :: > php

php - Posted By infestor1 (infestor1) on 12th Dec 07 at 5:56am
is php allowed in headers/footers?

Re: php - Posted By Ross (admin) on 12th Dec 07 at 9:27am
Allowing PHP in the headers/footers would be a major security risk. So no, it's not allowed {Smile}

Re: php - Posted By infestor1 (infestor1) on 13th Dec 07 at 12:46am
awww.....

{Tongue Out}

could you sort of add "tags" so we could use like an ip. like <IP> or <BROWSER>?

Re: php - Posted By Jason (frufru) on 13th Dec 07 at 12:56am
 
awww.....

{Tongue Out}

could you sort of add "tags" so we could use like an ip. like <IP> or <BROWSER>?


pffft... be creative {Tongue Out} Just make a PHP script that grabs the user's IP and browser's information, outputs that in the form of JavaScript variables, upload that to your PHP host, then stick something like <script src="http://myhost.com/getbrowserandipinfo.php"></script> at the top of your headers or whatever {Tongue Out} . Then you can refer to those variables in scripts you use later on {Smile}

Re: php - Posted By Marc (cr0w) on 13th Dec 07 at 3:31am
 
 
awww.....

{Tongue Out}

could you sort of add "tags" so we could use like an ip. like <IP> or <BROWSER>?


pffft... be creative {Tongue Out} Just make a PHP script that grabs the user's IP and browser's information, outputs that in the form of JavaScript variables, upload that to your PHP host, then stick something like <script src="http://myhost.com/getbrowserandipinfo.php"></script> at the top of your headers or whatever {Tongue Out} . Then you can refer to those variables in scripts you use later on {Smile}


Exact same as PB. {Smile}

Re: php - Posted By Ross (admin) on 13th Dec 07 at 9:38am
 
awww.....

{Tongue Out}

could you sort of add "tags" so we could use like an ip. like <IP> or <BROWSER>?


Javascript can be used on it's own to work out a users browser.

Re: php - Posted By infestor1 (infestor1) on 14th Dec 07 at 4:38am
 
 
awww.....

{Tongue Out}

could you sort of add "tags" so we could use like an ip. like <IP> or <BROWSER>?


pffft... be creative {Tongue Out} Just make a PHP script that grabs the user's IP and browser's information, outputs that in the form of JavaScript variables, upload that to your PHP host, then stick something like <script src="http://myhost.com/getbrowserandipinfo.php"></script> at the top of your headers or whatever {Tongue Out} . Then you can refer to those variables in
scripts you use later on {Smile}


pffttt...

how do i do that?

i only know how to do $blah = kaboom; in a php script, not var blah = kaboom;


is it possible to do js style variables in php, then use those js variables?

like this:

<?php

var ip=$_SERVER['REMOTE_ADDR'];

?>

then upload that as script.php then:

<script src="script.php"></script>

then use:

<script type="text/javascript">

document.write(ip);

</script>

would that work?

or something else?


Re: php - Posted By Marc (cr0w) on 14th Dec 07 at 4:48am
Your site:
Code: PHP
 
  1. <?php
  2. echo "var userIP = &#39;".&#36;_SERVER[&#39;REMOTE_ADDR&#39;]."&#39;";
  3. ?>
 


Your forum:
Code: JavaScript
 
  1. <script type="text/javascript">
  2. <!--
  3. var nScript = document.createElement("script");
  4. nScript.type = "text/javascript";
  5. nScript.src = "http://yoursite.com/ip.php";
  6. document.body.appendChild(nScript);
  7. //-->
  8. </script>