Jump to content

Functions


tcorbeil

Recommended Posts

interpim, if I showed you this function of variable declaration, is there something that catches your eye??

 

<?php

 

function getvariables(){

$servername = $_SERVER['SERVER_NAME'];

$documentroot = $_SERVER['DOCUMENT_ROOT'];

$pagepath = $_SERVER['SCRIPT_NAME'];

$pi = pathinfo($_SERVER['SCRIPT_NAME']);

$slash = "/";

$pageroot = $pi['dirname']."/";

$global = $documentroot."/Global/";

$addgif = "http://www.xxxxxxx.com/Global/add.gif";

//setup for Metag Tag

$filename = basename($pagepath, ".php");   //get the filename

$formatname = str_replace("_", " ", $filename);   //get the underscores out of it.

$metatag = "xxxxxxx.com: ".$formatname;    //add the site name in front.

 

echo $servername."**";

echo $documentroot."**";

echo $pagepath."**";

echo $pi."**";

echo $slash."**";

echo $pageroot."**";

echo $global."**";

echo $addgif."**";

echo $filename."**";

echo $formatname."**";

echo $metatag."**";

}

?>

 

this function seems to get caled twice during HTML load and nowhere have I got the function called...

Link to comment
https://forums.phpfreaks.com/topic/44737-functions/#findComment-217231
Share on other sites

Here's a few ideas to try:

 

1.  Temporarily change the name of the function.  Do you get any errors coming up where it was being called from before?

2.  Try changing the output of the function.  Does the output of your script change?  If no, then your function isn't being called.. it's another function which looks the same.

Link to comment
https://forums.phpfreaks.com/topic/44737-functions/#findComment-217249
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.