Jump to content

Help with $_SERVER['SCRIPT_FILENAME'] not working I think??!!


surfthenet

Recommended Posts

Hi,

 

I'm very very new to php coding and I'm try to get this existing code to work below but it does not seem to work on the new host. This codes presently works on 1and1 and I'm in the process of moving it to a new web host. But for some reason it won’t work on the new web host (Vidahost) but does work on the existing (1and1).

Basically what it should do is give me the absolute path of the script that im executing but it can’t be as the If statement below should show the other href links, but does not when the page loads.

 

I should see something like this on the page

• Jobs

    • Add Job

    • Archives

 

But I only get this

• Jobs

 

I hope this makes sense and I hope someone can help me please. Many thanks.

 

Many thanks in advance

 

 

CODE.....

 

$location=substr_replace($_SERVER['SCRIPT_FILENAME'], "", 0, strlen(CMS_FILEPATH));

//print CMS_FILEPATH;

//print $location;

?>

                    <!-- start section -->

                    <tr>

                      <td><font color="#FFFFFF">&#149;</font> <a href="job_list.php">Jobs</a></td>

                    </tr>

                    <?

                    if (($location=="job_list.php") || ($location=="job_edit.php") || ($location=="job_add.php") ||              ($location=="job_list_archive.php"))

{

?>

                    <tr align="right">

                      <td> <table width="90%" border="0">

                          <tr>

                            <td height="15"><font color="#FFFFFF">&#149;</font>

                              <a href="job_add.php">Add Job</a> </td>

                          </tr>

                          <tr>

                            <td height="15"><font color="#FFFFFF">&#149;</font>

                              <a href="job_list_archive.php">Archives</a> </td>

                          </tr>

                        </table></td>

                    </tr>

                    <?

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.