Jump to content


Photo

Double dot files names


  • Please log in to reply
6 replies to this topic

#1 tomharto

tomharto

    Newbie

  • Member
  • Pip
  • 4 posts
  • Main OS: Windows Vista

Posted 18 September 2011 - 11:15 AM

I have a site using a few files with the filenames in ths format "_inc.somename.php" and for some reason when i try and use them on Uniserver the just show up as blank. Is this a known issue / is there a fix or work around for this?

#2 Coral

Coral

    Junior Member

  • Member
  • Pip
  • 40 posts
  • Main OS: Windows XP

Posted 18 September 2011 - 01:13 PM

If your pages work on other servers and fail on Uniserver they probably use short open tags <? ?> use the long form <?php ?>

#3 tomharto

tomharto

    Newbie

  • Member
  • Pip
  • 4 posts
  • Main OS: Windows Vista

Posted 18 September 2011 - 01:26 PM

If your pages work on other servers and fail on Uniserver they probably use short open tags <? ?> use the long form <?php ?>


They use the long ones

This is the opening part of my index page

<?php
session_start();
error_reporting (E_ALL ^ E_NOTICE);

$styleSheet = "stylee.css";
include ("include/config.php");
include ("include/function.php");
include ("include/function_homepage.php");

$hpInfo = "";
getHomepageInfo($hpInfo);
require_once ("_inc.header.php");
$userID = $_SESSION['userID'];

?>

if i go directly to _inc.header.php it shows blank too and that uses full <?php tags too

#4 Coral

Coral

    Junior Member

  • Member
  • Pip
  • 40 posts
  • Main OS: Windows XP

Posted 18 September 2011 - 02:43 PM

Stop the servers.
From the tray menu switch php.ini to development
Restart server

Try this code:
Save both files to folder UniServer\www
File index.php
<?php
  //Main test file index.php
  echo "<h1>Test 1</h1>";
  require_once ("_inc.header.php");
?>

File _inc.header.php
<?php
//Include file _inc.header.php
  echo "<h1>Hello World!</h1>";
?>

Start servers
Type following into browser address bar
http://localhost/index.php

What errors are reported?

#5 tomharto

tomharto

    Newbie

  • Member
  • Pip
  • 4 posts
  • Main OS: Windows Vista

Posted 19 September 2011 - 04:01 AM

Stop the servers.
From the tray menu switch php.ini to development
Restart server

Try this code:
Save both files to folder UniServer\www
File index.php

<?php
  //Main test file index.php
  echo "<h1>Test 1</h1>";
  require_once ("_inc.header.php");
?>

File _inc.header.php
<?php
//Include file _inc.header.php
  echo "<h1>Hello World!</h1>";
?>

Start servers
Type following into browser address bar
http://localhost/index.php

What errors are reported?



That works okay, must be a problem in my files coding then, i thought since it worked on my web server and not uniserver it was something to do with that. Ill check it all over and report back if i still have problems, thanks :)

#6 tomharto

tomharto

    Newbie

  • Member
  • Pip
  • 4 posts
  • Main OS: Windows Vista

Posted 19 September 2011 - 08:52 AM

That works okay, must be a problem in my files coding then, i thought since it worked on my web server and not uniserver it was something to do with that. Ill check it all over and report back if i still have problems, thanks :)


It was a <? in my _inc.header.php. Was an include at the bottom of it what i missed, thanks for your help :(

#7 BobS

BobS

    Project Helper

  • Super Moderator
  • PipPipPip
  • 334 posts
  • Location:Santiago Chile
  • Interests:Retiring, computer systems, system design, model railroads....
  • Wiki ID: BobS
  • Main OS: Windows 7

Posted 19 September 2011 - 05:11 PM

So Coral called it right to begin with :)
Coral: 1, bad php code: 0

Regards,
BobS




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users