Jump to content

some weird problems having something to do with the include i guess


Quaze

Recommended Posts

Hey and hello,

I'm quite new to php so im still learning alot. atm im busy writing a site for a company im also involved in.

 

now for the problem:

I have 2 pages atm, index.php and enquete.php

THose pages both include header.php (at the top) and footer.php(at the bottom)

in between is content ( as is usual i guess)

both pages use the same style sheet as this is included in header.php.

 

What ive encountered is the following, the index.php page behaves totally different then the enquete.php page considering markup. The enquete.php page (which i made first should i add) is niceley attached to the top of the viewport in the browser, the index.php however shows the correct layout and images and everything, but it's not attached to the top of the viewport (which i find quite strange since both pages have the same stylesheet). This happens for me in firefox. in internet explorer however the index.php page looks totally fucked up, and the enquete.php page looks perfect.

 

I'm really trapped on this one atm. i could really use some help.  if it turns out im at the wrong place (should it be a css error or something) please let me know.

In action: http://www.festivalneeds.com/index.php http://www.festivalneeds.com/enquete.php

 

header.php

<?php
include("class.StringBuilder.php");//zorgt ervoor dat de StringBuilder klasse gebruikt kan worden

/*Deze klasse zorgt voor de vertaling van de site*/
Class php_meertalig
{
private $m_pXML;

public function __construct($pagina, $taal)
{
	$this->m_pXML = simplexml_load_file(sprintf('./lang/%s/%s.xml', $taal, $pagina));
}

public function getWoord($woord)
{
	$aItem = $this->m_pXML->xpath(sprintf("//woord[@id='%s']", $woord));
	$woord = empty($aItem[0]) ? null : (string) $aItem[0];

	return $woord;
}
}
//functie voor het verkrijgen van de huidige pagina naam
function curPageName() {
$result = substr($_SERVER["SCRIPT_NAME"],strrpos($_SERVER["SCRIPT_NAME"],"/")+1);
return substr($result,0,-4);
}

//versimpelde functie voor gebruik binnen document
function p($woord)
{
global $pLang;
echo $pLang->getWoord($woord);
}
if(isset($_REQUEST["lang"]))
{
$pLang = new php_meertalig(curPageName(),$_REQUEST["lang"]);
}
else
{
$pLang = new php_meertalig(curPageName(),"nlNL");
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Festivalneeds - <?php echo curPageName(); ?> </title>
<link rel="Stylesheet" href="css/css.css" type="text/css" />
<script type="text/javascript" src="javascript/jquery/jquery-1.3.2.min.js"></script>
<script type="text/javascript" src="javascript/jquery/formToWizard.js"></script>
<script type="text/javascript" src="javascript/jquery/jquery.validate.js"></script>
<?php
if(curPageName()=="enquete")
{
echo "<script type='text/javascript'>$(document).ready(function() {
		$('#formEnquete').formToWizard({ submitButton: 'submitForm' });
		});</script>";
}
?> 
</head>
<body>
<div class="container">
<div class="logo"><h1>Festivalneeds.com</h1><a href="http://www.festivalneeds.com/"><img src="images/logo_red_small.png" alt="Festivalneeds.com" /></a></div>
<div class="banner"></div>
<div class="spacer"></div>
<div class="bar_left">
<?php
$pageName = (string)curPageName();
$sb = new StringBuilder();
$sb->Append('<a href="'.$pageName.'.php?lang=nlNL">');
$sb->Append("<img src='images/nl.png' alt='nlNL' /></a>");
$sb->Append(" ");
$sb->Append("<a href='".$pageName.".php?lang=enGB'>");
$sb->Append("<img src='images/gb.png' alt='enGB' /></a>");
echo $sb->ToString();
?>
</div>
<div class="content">

 

footer.php

</div>
</div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-11563402-3");
pageTracker._setDomainName("none");
pageTracker._setAllowLinker(true);
pageTracker._trackPageview();
} catch(err) {}</script>
</body>
</html>

 

index.php

<?php include("header.php"); ?>
<div class="info center">
<p><h2><?php p("intro_1"); ?></h2></p>
<p><?php p("intro_2"); ?></p>
<p><?php p("intro_3"); ?></p>
<p><?php p("intro_4"); ?></p>
</div>
<?php include("footer.php"); ?>

 

enquete.php

(quite large, if you need it to figure it out pm me)

 

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.