A little help with PHP INCLUDE files
- RSMEDUDE
- Novice


- Joined: Jul 10, 2004
- Posts: 33
- Status: Offline
Hello everyone,
I am a long time member but I very rarely post on here. To that end I hope I am posting this issue in the right place.
Before I get into things I want to state that I am a novice with PHP. I am learning but a lot of the coding that I am using is either a free to use download with proper notation or coding I have figured out how to make work together off of different how to sites.
I am trying to work on my model railroad clubs website and what I am trying to accomplish is to make a header include file so that I have what we call the "hotbox" showing up on every page. The other benefits to this are that the header will ultimately look uniform across all pages and I will only have one page to edit for updates to the "hotbox". I have most of the pages working how I want but I have some that are being a little stubborn and I am not sure why.
Before I show you the code for what I want to accomplish here are some links.
This is how the site looks and functions now: Reading Society of Model Engineers Main Site
This is more or less what I want it to look like: Reading Society of Model Engineers BETA Site
In the BETA site you will see that some pages load the way they should with the "hotbox" at the top while others load without it. The ones without are my problem pages. The example code of what I am working with that is listed below is from the h.php page and the contact_us.php page.
FILE: h.php
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta name="resource-type" content="document">
<meta name="Generator" content="Microsoft FrontPage 4.0">
<meta name="revisit-after" content="10">
<meta name="keywords" content="live, steam, miniature, small, scale, ho , o, gauge, laurel, run, lite, rail, railroad, model, rsme, reading, society, engineers, club, livesteam, literail,">
<meta name="rating" content="Safe For Kids">
<title>Reading Society of Model Engineers</title>
<base target="main">
<LINK REL=stylesheet TYPE="text/css" HREF=rsme.css>
<style type="text/css">
/*Example CSS for the two demo scrollers*/
#pscroller2{
width: 490px;
height: 25px;
padding: 3px;
background-color: #C0C0C0;
}
#pscroller2 a{
text-decoration: none;
}
.someclass{ //class
}
</style>
<script type="text/javascript">
/*Example message arrays for the two demo scrollers*/
var pausecontent2=new Array()
pausecontent2[0]='<center><a href="http://www.rsme.org/calendar/2012/oct.php">RSME Run Day October 7, 2012 12pm - 5pm</a></center>'
pausecontent2[1]='<center><a href="http://www.rsme.org/pdf/RSME_2012_OPEN_HOUSE_FLYER.pdf" target="window">RSME Fall Open House October 20 and 21, 2012 12pm - 5pm</a></center>'
pausecontent2[2]='<center><a href="http://www.rsme.org/calendar/2012/nov.php">RSME Run Day November 4, 2012 12pm - 5pm</a></center>'
</script>
<script type="text/javascript">
/***********************************************
SaveCancel* Pausing up-down scroller- ? Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}
// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------
pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}
// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------
pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}
// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------
pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}
pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}
// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------
pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}
pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}
</script>
</head>
<body topmargin="5">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100">
<tr>
<td align="center" height="100" width="250" valign="top"><img src="http://www.rsme.org/images/rsmelogo.gif" width="178" height="88" align="center"></td>
<td align="center" height="100" width="840" valign="top"><FONT SIZE="5"><B>Reading Society of Model Engineers</font></b><p>Berks County, Pennsylvania, USA<BR>
<font size="2"><BR></font>
<!-- BEGIN NEWS FADER TEXT -->
<table width="139">
<tr>
<td align="centeR"><font color="red" size="4"><b><i>HOTBOX</i></b></font>
</td>
</tr>
<tr>
<td>
<script type="text/javascript">
new pausescroller(pausecontent2, "pscroller2", "someclass", 3600)
</script>
</td>
</tr>
</table>
<!-- END FADER -->
</p></td>
<td align="center" height="100" width="250" valign="top"><img border="0" src="http://www.rsme.org/images/LITERAIL.gif" width="216" height="112" align="center"></td>
</tr>
</table>
</center>
</p>
</body>
</html>
FILE: contact_us.php
<?php
ob_start('ob_gzhandler');
session_start();
include 'contact_us_inc.php';
// if submit
if (($_POST[x])&&(substr($_SESSION[igif], 17) === $_SESSION['afloat'])){
// posted
$x = $_POST[x];
// decode, strip string and round numbers
$a = base64_decode($_SESSION['afloat']);
$b = 0 + $a;
$a = explode(" ", $a);
$a = $a[3];
$bb = round($b);
$aa = round($a);
// x coords
$gc = explode(" ", '0 19 40 60 82 104 79 100 121 142 163 185');
// check if correct number has been clicked
$ac = $aa + 6;
if ($bb <= $aa){ $ac = $bb + 1; }
//wrong number clicked error message below
$mess = "ERROR: Sorry " . $_POST[yname] . " wrong number clicked";
// if correct number clicked success
if (($x >= $gc[$ac-1]) && ($x <= $gc[$ac])){
// submit your form
$to = $owner_email;
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'From:<' . $_POST[email] . '>' . $_POST[yname] . "\r\n";
$headers .= 'RSME General Contact Form Version 1.0' . "\r\n";
// Message content
$messages = '<br><br><b>Name:</b> ' . $_POST[yname] . '<p><B>E-mail:</b> ' . $_POST[email] . '<p><b>Comments:</b> <br>' . $_POST[message];
// Mail it
mail($to, "RSME MAIL: General Contact Form", $messages, $headers);
$yname = $_POST[yname];
?>
<script>
alert("Thank you <? echo $yname; ?> for your correspondance. We will be sure to get back to you soon!");
window.location = "<?=$redirect;?>";
</script>
<?
exit; }
//demo alert message below
?>
<script>
alert("<?=$mess;?>");
window.location = window.location;
</script>
<?
session_unset();
session_destroy();
ob_end_flush();
exit;
}
// afloat = base64_encoded random string
$afloat = base64_encode(" " . $num1 = rand(0,3) . "." . $num2 = rand(100,999) . "
Float " . $num3 = rand(1,4) . "." . $num4 = rand(100,999) . " ");
// rectangle x coord
$aler = "> 78";
if(round($num1 . "." . $num2) <= round($num3 . "." . $num4)) {$aler = "< 105";}
// create random image
$_SESSION[igif] = "create_gif.php?a=" . $afloat . "";
$_SESSION['afloat'] = $afloat;
?>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta name="resource-type" content="document">
<meta name="Generator" content="rsmeorga Tag Generator">
<meta name="revisit-after" content="10">
<meta name="keywords" content="live, steam, miniature, small, scale, ho , o, gauge, laurel, run, lite, rail, railroad, model, rsme, reading, society, engineers, club, livesteam, literail,">
<meta name="rating" content="Safe For Kids">
<title>Reading Society of Model Engineers</title>
<LINK REL=stylesheet TYPE="text/css" HREF=../rsme.css>
<style type="text/css">
/* click image */
.cd {
width: 185px;
height: 15px;
background-image: url(<?=$_SESSION[igif];?>);
background-repeat: no-repeat;
position: relative;
left:<?=rand(-100,100);?>px;
bottom:<?=rand(-5,20);?>px;
z-index: 2;
}
</style>
<script language="JavaScript">
// submit form func val i date
function submitform() {
if (document.xcoords.yname.value == "") {
alert("Please Enter Your Name.");
return false; }
if (document.xcoords.email.value == "" || document.xcoords.email.value.indexOf("@")<1|| document.xcoords.email.value.indexOf(".")<1) {
alert("Please Enter Valid E-mail");
return false;}
if (document.xcoords.message.value == "") {
alert("Please Enter Question/Message.");
return false; }
// if box coord submit else rectangle coord alert
// Do not edit javascript below this line. you can edit the alert message
if (document.xcoords.x.value <?=$aler;?>) {
document.xcoords.submit();
} else {
alert("Click number in square identicale to number in rectangle to submit.");
}
}
// image x value
function xcoord(event) {
image = event.offsetX?(event.offsetX):event.pageX-document.getElementById("coord").offsetLeft;
document.xcoords.x.value = image;
}
</script>
</head>
<body text="black" bgcolor="#C0C0C0" topmargin="5">
<?php include("../h.php"); ?>
<p align="left">The RSME is pleased to announce that we now have a general contact form setup on our website. You can now use this form to request general information about the RSME. We thank you for your patients while we created this section of the site. You can also click on the officers link to the left and select a specific officer or committee chairman to contact. We still have our traditional means of communication via the telephone or by writing us a letter and dropping it in the mail. No matter which route you choose to contact us we certainly look forward to hearing from you!</p>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="33%" align="center" valign="top"><b>United States Postal Service</b></td>
<td width="33%" align="center" valign="top"><b>Club House Phone<br>
(please leave a message)</b></td>
<td width="34%" align="center" valign="top"><b>Online contact form</b></td>
</tr>
<tr>
<td width="33%" align="center" valign="top"><br>Reading Society of Model Engineers<br>
P.O. Box 13011<br>
Reading, PA 19612</td>
<td width="33%" align="center" valign="top"><br>Phone Number: 610-929-5444</td>
<td width="34%" align="center">
<table summary="" border="0">
<form name="xcoords" action="<?=$_SERVER['PHP_SELF']; ?>" method="post">
<tr>
<td valign="top">Name: </td><td><input type="text" name="yname" size="40" maxlength="256" style="border: 1px solid <?=$bordercolor;?>"><br><br>
</td>
</tr>
<tr>
<td valign="top">E-Mail: </td><td><input type="text" name="email" size="40" maxlength="256" style="border: 1px solid <?=$bordercolor;?>"><br><br>
</td>
</tr>
<tr>
<td valign="top">Comments: </td><td><textarea name="message" cols="30" rows="7" style="border: 1px solid <?=$bordercolor;?>; background: #F5F5F5"></textarea>
<input type="hidden" name="x" /> </td>
</tr>
<tr><td colspan=2 style="font: 11px Arial; color: <?=$bordercolor;?>; border-color: <?=$bordercolor;?>; border-style: solid; border-width: 1px; background: #F8F8FF; height: 30px; width: 310px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; position: relative; font-weight: normal;">To submit this form to the Reading Society of Model Engineers. Please click the number that is presented to you on the right side of the word "click".</td>
</table></form><p><div id="coord" onClick="submitform(xcoord(event))" class="cd"></div></div><p></div>
</td>
</tr>
</table>
</body>
</html>
<?php ob_end_flush(); ?>
I would like to thank everyone for any and all help I can get on this in advance.
I am a long time member but I very rarely post on here. To that end I hope I am posting this issue in the right place.
Before I get into things I want to state that I am a novice with PHP. I am learning but a lot of the coding that I am using is either a free to use download with proper notation or coding I have figured out how to make work together off of different how to sites.
I am trying to work on my model railroad clubs website and what I am trying to accomplish is to make a header include file so that I have what we call the "hotbox" showing up on every page. The other benefits to this are that the header will ultimately look uniform across all pages and I will only have one page to edit for updates to the "hotbox". I have most of the pages working how I want but I have some that are being a little stubborn and I am not sure why.
Before I show you the code for what I want to accomplish here are some links.
This is how the site looks and functions now: Reading Society of Model Engineers Main Site
This is more or less what I want it to look like: Reading Society of Model Engineers BETA Site
In the BETA site you will see that some pages load the way they should with the "hotbox" at the top while others load without it. The ones without are my problem pages. The example code of what I am working with that is listed below is from the h.php page and the contact_us.php page.
FILE: h.php
Code: [ Select ]
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta name="resource-type" content="document">
<meta name="Generator" content="Microsoft FrontPage 4.0">
<meta name="revisit-after" content="10">
<meta name="keywords" content="live, steam, miniature, small, scale, ho , o, gauge, laurel, run, lite, rail, railroad, model, rsme, reading, society, engineers, club, livesteam, literail,">
<meta name="rating" content="Safe For Kids">
<title>Reading Society of Model Engineers</title>
<base target="main">
<LINK REL=stylesheet TYPE="text/css" HREF=rsme.css>
<style type="text/css">
/*Example CSS for the two demo scrollers*/
#pscroller2{
width: 490px;
height: 25px;
padding: 3px;
background-color: #C0C0C0;
}
#pscroller2 a{
text-decoration: none;
}
.someclass{ //class
}
</style>
<script type="text/javascript">
/*Example message arrays for the two demo scrollers*/
var pausecontent2=new Array()
pausecontent2[0]='<center><a href="http://www.rsme.org/calendar/2012/oct.php">RSME Run Day October 7, 2012 12pm - 5pm</a></center>'
pausecontent2[1]='<center><a href="http://www.rsme.org/pdf/RSME_2012_OPEN_HOUSE_FLYER.pdf" target="window">RSME Fall Open House October 20 and 21, 2012 12pm - 5pm</a></center>'
pausecontent2[2]='<center><a href="http://www.rsme.org/calendar/2012/nov.php">RSME Run Day November 4, 2012 12pm - 5pm</a></center>'
</script>
<script type="text/javascript">
/***********************************************
SaveCancel* Pausing up-down scroller- ? Dynamic Drive (www.dynamicdrive.com)
* This notice MUST stay intact for legal use
* Visit http://www.dynamicdrive.com/ for this script and 100s more.
***********************************************/
function pausescroller(content, divId, divClass, delay){
this.content=content //message array content
this.tickerid=divId //ID of ticker div to display information
this.delay=delay //Delay between msg change, in miliseconds.
this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
this.hiddendivpointer=1 //index of message array for hidden div
document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
var scrollerinstance=this
if (window.addEventListener) //run onload in DOM2 browsers
window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
else if (window.attachEvent) //run onload in IE5.5+
window.attachEvent("onload", function(){scrollerinstance.initialize()})
else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
setTimeout(function(){scrollerinstance.initialize()}, 500)
}
// -------------------------------------------------------------------
// initialize()- Initialize scroller method.
// -Get div objects, set initial positions, start up down animation
// -------------------------------------------------------------------
pausescroller.prototype.initialize=function(){
this.tickerdiv=document.getElementById(this.tickerid)
this.visiblediv=document.getElementById(this.tickerid+"1")
this.hiddendiv=document.getElementById(this.tickerid+"2")
this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
//set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
this.getinline(this.visiblediv, this.hiddendiv)
this.hiddendiv.style.visibility="visible"
var scrollerinstance=this
document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
if (window.attachEvent) //Clean up loose references in IE
window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
setTimeout(function(){scrollerinstance.animateup()}, this.delay)
}
// -------------------------------------------------------------------
// animateup()- Move the two inner divs of the scroller up and in sync
// -------------------------------------------------------------------
pausescroller.prototype.animateup=function(){
var scrollerinstance=this
if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
setTimeout(function(){scrollerinstance.animateup()}, 50)
}
else{
this.getinline(this.hiddendiv, this.visiblediv)
this.swapdivs()
setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
}
}
// -------------------------------------------------------------------
// swapdivs()- Swap between which is the visible and which is the hidden div
// -------------------------------------------------------------------
pausescroller.prototype.swapdivs=function(){
var tempcontainer=this.visiblediv
this.visiblediv=this.hiddendiv
this.hiddendiv=tempcontainer
}
pausescroller.prototype.getinline=function(div1, div2){
div1.style.top=this.visibledivtop+"px"
div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
}
// -------------------------------------------------------------------
// setmessage()- Populate the hidden div with the next message before it's visible
// -------------------------------------------------------------------
pausescroller.prototype.setmessage=function(){
var scrollerinstance=this
if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
setTimeout(function(){scrollerinstance.setmessage()}, 100)
else{
var i=this.hiddendivpointer
var ceiling=this.content.length
this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
this.animateup()
}
}
pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
if (tickerobj.currentStyle)
return tickerobj.currentStyle["paddingTop"]
else if (window.getComputedStyle) //if DOM2
return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
else
return 0
}
</script>
</head>
<body topmargin="5">
<table border="0" cellpadding="0" cellspacing="0" width="100%" height="100">
<tr>
<td align="center" height="100" width="250" valign="top"><img src="http://www.rsme.org/images/rsmelogo.gif" width="178" height="88" align="center"></td>
<td align="center" height="100" width="840" valign="top"><FONT SIZE="5"><B>Reading Society of Model Engineers</font></b><p>Berks County, Pennsylvania, USA<BR>
<font size="2"><BR></font>
<!-- BEGIN NEWS FADER TEXT -->
<table width="139">
<tr>
<td align="centeR"><font color="red" size="4"><b><i>HOTBOX</i></b></font>
</td>
</tr>
<tr>
<td>
<script type="text/javascript">
new pausescroller(pausecontent2, "pscroller2", "someclass", 3600)
</script>
</td>
</tr>
</table>
<!-- END FADER -->
</p></td>
<td align="center" height="100" width="250" valign="top"><img border="0" src="http://www.rsme.org/images/LITERAIL.gif" width="216" height="112" align="center"></td>
</tr>
</table>
</center>
</p>
</body>
</html>
- <html>
- <head>
- <meta http-equiv="Content-Language" content="en-us">
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
- <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
- <meta name="ProgId" content="FrontPage.Editor.Document">
- <meta name="resource-type" content="document">
- <meta name="Generator" content="Microsoft FrontPage 4.0">
- <meta name="revisit-after" content="10">
- <meta name="keywords" content="live, steam, miniature, small, scale, ho , o, gauge, laurel, run, lite, rail, railroad, model, rsme, reading, society, engineers, club, livesteam, literail,">
- <meta name="rating" content="Safe For Kids">
- <title>Reading Society of Model Engineers</title>
- <base target="main">
- <LINK REL=stylesheet TYPE="text/css" HREF=rsme.css>
- <style type="text/css">
- /*Example CSS for the two demo scrollers*/
- #pscroller2{
- width: 490px;
- height: 25px;
- padding: 3px;
- background-color: #C0C0C0;
- }
- #pscroller2 a{
- text-decoration: none;
- }
- .someclass{ //class
- }
- </style>
- <script type="text/javascript">
- /*Example message arrays for the two demo scrollers*/
- var pausecontent2=new Array()
- pausecontent2[0]='<center><a href="http://www.rsme.org/calendar/2012/oct.php">RSME Run Day October 7, 2012 12pm - 5pm</a></center>'
- pausecontent2[1]='<center><a href="http://www.rsme.org/pdf/RSME_2012_OPEN_HOUSE_FLYER.pdf" target="window">RSME Fall Open House October 20 and 21, 2012 12pm - 5pm</a></center>'
- pausecontent2[2]='<center><a href="http://www.rsme.org/calendar/2012/nov.php">RSME Run Day November 4, 2012 12pm - 5pm</a></center>'
- </script>
- <script type="text/javascript">
- /***********************************************
- SaveCancel* Pausing up-down scroller- ? Dynamic Drive (www.dynamicdrive.com)
- * This notice MUST stay intact for legal use
- * Visit http://www.dynamicdrive.com/ for this script and 100s more.
- ***********************************************/
- function pausescroller(content, divId, divClass, delay){
- this.content=content //message array content
- this.tickerid=divId //ID of ticker div to display information
- this.delay=delay //Delay between msg change, in miliseconds.
- this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
- this.hiddendivpointer=1 //index of message array for hidden div
- document.write('<div id="'+divId+'" class="'+divClass+'" style="position: relative; overflow: hidden"><div class="innerDiv" style="position: absolute; width: 100%" id="'+divId+'1">'+content[0]+'</div><div class="innerDiv" style="position: absolute; width: 100%; visibility: hidden" id="'+divId+'2">'+content[1]+'</div></div>')
- var scrollerinstance=this
- if (window.addEventListener) //run onload in DOM2 browsers
- window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
- else if (window.attachEvent) //run onload in IE5.5+
- window.attachEvent("onload", function(){scrollerinstance.initialize()})
- else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
- setTimeout(function(){scrollerinstance.initialize()}, 500)
- }
- // -------------------------------------------------------------------
- // initialize()- Initialize scroller method.
- // -Get div objects, set initial positions, start up down animation
- // -------------------------------------------------------------------
- pausescroller.prototype.initialize=function(){
- this.tickerdiv=document.getElementById(this.tickerid)
- this.visiblediv=document.getElementById(this.tickerid+"1")
- this.hiddendiv=document.getElementById(this.tickerid+"2")
- this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
- //set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
- this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
- this.getinline(this.visiblediv, this.hiddendiv)
- this.hiddendiv.style.visibility="visible"
- var scrollerinstance=this
- document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
- document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
- if (window.attachEvent) //Clean up loose references in IE
- window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
- setTimeout(function(){scrollerinstance.animateup()}, this.delay)
- }
- // -------------------------------------------------------------------
- // animateup()- Move the two inner divs of the scroller up and in sync
- // -------------------------------------------------------------------
- pausescroller.prototype.animateup=function(){
- var scrollerinstance=this
- if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
- this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
- this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
- setTimeout(function(){scrollerinstance.animateup()}, 50)
- }
- else{
- this.getinline(this.hiddendiv, this.visiblediv)
- this.swapdivs()
- setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
- }
- }
- // -------------------------------------------------------------------
- // swapdivs()- Swap between which is the visible and which is the hidden div
- // -------------------------------------------------------------------
- pausescroller.prototype.swapdivs=function(){
- var tempcontainer=this.visiblediv
- this.visiblediv=this.hiddendiv
- this.hiddendiv=tempcontainer
- }
- pausescroller.prototype.getinline=function(div1, div2){
- div1.style.top=this.visibledivtop+"px"
- div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
- }
- // -------------------------------------------------------------------
- // setmessage()- Populate the hidden div with the next message before it's visible
- // -------------------------------------------------------------------
- pausescroller.prototype.setmessage=function(){
- var scrollerinstance=this
- if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
- setTimeout(function(){scrollerinstance.setmessage()}, 100)
- else{
- var i=this.hiddendivpointer
- var ceiling=this.content.length
- this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
- this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
- this.animateup()
- }
- }
- pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
- if (tickerobj.currentStyle)
- return tickerobj.currentStyle["paddingTop"]
- else if (window.getComputedStyle) //if DOM2
- return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
- else
- return 0
- }
- </script>
- </head>
- <body topmargin="5">
- <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100">
- <tr>
- <td align="center" height="100" width="250" valign="top"><img src="http://www.rsme.org/images/rsmelogo.gif" width="178" height="88" align="center"></td>
- <td align="center" height="100" width="840" valign="top"><FONT SIZE="5"><B>Reading Society of Model Engineers</font></b><p>Berks County, Pennsylvania, USA<BR>
- <font size="2"><BR></font>
- <!-- BEGIN NEWS FADER TEXT -->
- <table width="139">
- <tr>
- <td align="centeR"><font color="red" size="4"><b><i>HOTBOX</i></b></font>
- </td>
- </tr>
- <tr>
- <td>
- <script type="text/javascript">
- new pausescroller(pausecontent2, "pscroller2", "someclass", 3600)
- </script>
- </td>
- </tr>
- </table>
- <!-- END FADER -->
- </p></td>
- <td align="center" height="100" width="250" valign="top"><img border="0" src="http://www.rsme.org/images/LITERAIL.gif" width="216" height="112" align="center"></td>
- </tr>
- </table>
- </center>
- </p>
- </body>
- </html>
FILE: contact_us.php
Code: [ Select ]
<?php
ob_start('ob_gzhandler');
session_start();
include 'contact_us_inc.php';
// if submit
if (($_POST[x])&&(substr($_SESSION[igif], 17) === $_SESSION['afloat'])){
// posted
$x = $_POST[x];
// decode, strip string and round numbers
$a = base64_decode($_SESSION['afloat']);
$b = 0 + $a;
$a = explode(" ", $a);
$a = $a[3];
$bb = round($b);
$aa = round($a);
// x coords
$gc = explode(" ", '0 19 40 60 82 104 79 100 121 142 163 185');
// check if correct number has been clicked
$ac = $aa + 6;
if ($bb <= $aa){ $ac = $bb + 1; }
//wrong number clicked error message below
$mess = "ERROR: Sorry " . $_POST[yname] . " wrong number clicked";
// if correct number clicked success
if (($x >= $gc[$ac-1]) && ($x <= $gc[$ac])){
// submit your form
$to = $owner_email;
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'From:<' . $_POST[email] . '>' . $_POST[yname] . "\r\n";
$headers .= 'RSME General Contact Form Version 1.0' . "\r\n";
// Message content
$messages = '<br><br><b>Name:</b> ' . $_POST[yname] . '<p><B>E-mail:</b> ' . $_POST[email] . '<p><b>Comments:</b> <br>' . $_POST[message];
// Mail it
mail($to, "RSME MAIL: General Contact Form", $messages, $headers);
$yname = $_POST[yname];
?>
<script>
alert("Thank you <? echo $yname; ?> for your correspondance. We will be sure to get back to you soon!");
window.location = "<?=$redirect;?>";
</script>
<?
exit; }
//demo alert message below
?>
<script>
alert("<?=$mess;?>");
window.location = window.location;
</script>
<?
session_unset();
session_destroy();
ob_end_flush();
exit;
}
// afloat = base64_encoded random string
$afloat = base64_encode(" " . $num1 = rand(0,3) . "." . $num2 = rand(100,999) . "
Float " . $num3 = rand(1,4) . "." . $num4 = rand(100,999) . " ");
// rectangle x coord
$aler = "> 78";
if(round($num1 . "." . $num2) <= round($num3 . "." . $num4)) {$aler = "< 105";}
// create random image
$_SESSION[igif] = "create_gif.php?a=" . $afloat . "";
$_SESSION['afloat'] = $afloat;
?>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<meta name="resource-type" content="document">
<meta name="Generator" content="rsmeorga Tag Generator">
<meta name="revisit-after" content="10">
<meta name="keywords" content="live, steam, miniature, small, scale, ho , o, gauge, laurel, run, lite, rail, railroad, model, rsme, reading, society, engineers, club, livesteam, literail,">
<meta name="rating" content="Safe For Kids">
<title>Reading Society of Model Engineers</title>
<LINK REL=stylesheet TYPE="text/css" HREF=../rsme.css>
<style type="text/css">
/* click image */
.cd {
width: 185px;
height: 15px;
background-image: url(<?=$_SESSION[igif];?>);
background-repeat: no-repeat;
position: relative;
left:<?=rand(-100,100);?>px;
bottom:<?=rand(-5,20);?>px;
z-index: 2;
}
</style>
<script language="JavaScript">
// submit form func val i date
function submitform() {
if (document.xcoords.yname.value == "") {
alert("Please Enter Your Name.");
return false; }
if (document.xcoords.email.value == "" || document.xcoords.email.value.indexOf("@")<1|| document.xcoords.email.value.indexOf(".")<1) {
alert("Please Enter Valid E-mail");
return false;}
if (document.xcoords.message.value == "") {
alert("Please Enter Question/Message.");
return false; }
// if box coord submit else rectangle coord alert
// Do not edit javascript below this line. you can edit the alert message
if (document.xcoords.x.value <?=$aler;?>) {
document.xcoords.submit();
} else {
alert("Click number in square identicale to number in rectangle to submit.");
}
}
// image x value
function xcoord(event) {
image = event.offsetX?(event.offsetX):event.pageX-document.getElementById("coord").offsetLeft;
document.xcoords.x.value = image;
}
</script>
</head>
<body text="black" bgcolor="#C0C0C0" topmargin="5">
<?php include("../h.php"); ?>
<p align="left">The RSME is pleased to announce that we now have a general contact form setup on our website. You can now use this form to request general information about the RSME. We thank you for your patients while we created this section of the site. You can also click on the officers link to the left and select a specific officer or committee chairman to contact. We still have our traditional means of communication via the telephone or by writing us a letter and dropping it in the mail. No matter which route you choose to contact us we certainly look forward to hearing from you!</p>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
<tr>
<td width="33%" align="center" valign="top"><b>United States Postal Service</b></td>
<td width="33%" align="center" valign="top"><b>Club House Phone<br>
(please leave a message)</b></td>
<td width="34%" align="center" valign="top"><b>Online contact form</b></td>
</tr>
<tr>
<td width="33%" align="center" valign="top"><br>Reading Society of Model Engineers<br>
P.O. Box 13011<br>
Reading, PA 19612</td>
<td width="33%" align="center" valign="top"><br>Phone Number: 610-929-5444</td>
<td width="34%" align="center">
<table summary="" border="0">
<form name="xcoords" action="<?=$_SERVER['PHP_SELF']; ?>" method="post">
<tr>
<td valign="top">Name: </td><td><input type="text" name="yname" size="40" maxlength="256" style="border: 1px solid <?=$bordercolor;?>"><br><br>
</td>
</tr>
<tr>
<td valign="top">E-Mail: </td><td><input type="text" name="email" size="40" maxlength="256" style="border: 1px solid <?=$bordercolor;?>"><br><br>
</td>
</tr>
<tr>
<td valign="top">Comments: </td><td><textarea name="message" cols="30" rows="7" style="border: 1px solid <?=$bordercolor;?>; background: #F5F5F5"></textarea>
<input type="hidden" name="x" /> </td>
</tr>
<tr><td colspan=2 style="font: 11px Arial; color: <?=$bordercolor;?>; border-color: <?=$bordercolor;?>; border-style: solid; border-width: 1px; background: #F8F8FF; height: 30px; width: 310px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; position: relative; font-weight: normal;">To submit this form to the Reading Society of Model Engineers. Please click the number that is presented to you on the right side of the word "click".</td>
</table></form><p><div id="coord" onClick="submitform(xcoord(event))" class="cd"></div></div><p></div>
</td>
</tr>
</table>
</body>
</html>
<?php ob_end_flush(); ?>
- <?php
- ob_start('ob_gzhandler');
- session_start();
- include 'contact_us_inc.php';
- // if submit
- if (($_POST[x])&&(substr($_SESSION[igif], 17) === $_SESSION['afloat'])){
- // posted
- $x = $_POST[x];
- // decode, strip string and round numbers
- $a = base64_decode($_SESSION['afloat']);
- $b = 0 + $a;
- $a = explode(" ", $a);
- $a = $a[3];
- $bb = round($b);
- $aa = round($a);
- // x coords
- $gc = explode(" ", '0 19 40 60 82 104 79 100 121 142 163 185');
- // check if correct number has been clicked
- $ac = $aa + 6;
- if ($bb <= $aa){ $ac = $bb + 1; }
- //wrong number clicked error message below
- $mess = "ERROR: Sorry " . $_POST[yname] . " wrong number clicked";
- // if correct number clicked success
- if (($x >= $gc[$ac-1]) && ($x <= $gc[$ac])){
- // submit your form
- $to = $owner_email;
- $headers = 'MIME-Version: 1.0' . "\r\n";
- $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
- // Additional headers
- $headers .= 'From:<' . $_POST[email] . '>' . $_POST[yname] . "\r\n";
- $headers .= 'RSME General Contact Form Version 1.0' . "\r\n";
- // Message content
- $messages = '<br><br><b>Name:</b> ' . $_POST[yname] . '<p><B>E-mail:</b> ' . $_POST[email] . '<p><b>Comments:</b> <br>' . $_POST[message];
- // Mail it
- mail($to, "RSME MAIL: General Contact Form", $messages, $headers);
- $yname = $_POST[yname];
- ?>
- <script>
- alert("Thank you <? echo $yname; ?> for your correspondance. We will be sure to get back to you soon!");
- window.location = "<?=$redirect;?>";
- </script>
- <?
- exit; }
- //demo alert message below
- ?>
- <script>
- alert("<?=$mess;?>");
- window.location = window.location;
- </script>
- <?
- session_unset();
- session_destroy();
- ob_end_flush();
- exit;
- }
- // afloat = base64_encoded random string
- $afloat = base64_encode(" " . $num1 = rand(0,3) . "." . $num2 = rand(100,999) . "
- Float " . $num3 = rand(1,4) . "." . $num4 = rand(100,999) . " ");
- // rectangle x coord
- $aler = "> 78";
- if(round($num1 . "." . $num2) <= round($num3 . "." . $num4)) {$aler = "< 105";}
- // create random image
- $_SESSION[igif] = "create_gif.php?a=" . $afloat . "";
- $_SESSION['afloat'] = $afloat;
- ?>
- <html>
- <head>
- <meta http-equiv="Content-Language" content="en-us">
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
- <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
- <meta name="ProgId" content="FrontPage.Editor.Document">
- <meta name="resource-type" content="document">
- <meta name="Generator" content="rsmeorga Tag Generator">
- <meta name="revisit-after" content="10">
- <meta name="keywords" content="live, steam, miniature, small, scale, ho , o, gauge, laurel, run, lite, rail, railroad, model, rsme, reading, society, engineers, club, livesteam, literail,">
- <meta name="rating" content="Safe For Kids">
- <title>Reading Society of Model Engineers</title>
- <LINK REL=stylesheet TYPE="text/css" HREF=../rsme.css>
- <style type="text/css">
- /* click image */
- .cd {
- width: 185px;
- height: 15px;
- background-image: url(<?=$_SESSION[igif];?>);
- background-repeat: no-repeat;
- position: relative;
- left:<?=rand(-100,100);?>px;
- bottom:<?=rand(-5,20);?>px;
- z-index: 2;
- }
- </style>
- <script language="JavaScript">
- // submit form func val i date
- function submitform() {
- if (document.xcoords.yname.value == "") {
- alert("Please Enter Your Name.");
- return false; }
- if (document.xcoords.email.value == "" || document.xcoords.email.value.indexOf("@")<1|| document.xcoords.email.value.indexOf(".")<1) {
- alert("Please Enter Valid E-mail");
- return false;}
- if (document.xcoords.message.value == "") {
- alert("Please Enter Question/Message.");
- return false; }
- // if box coord submit else rectangle coord alert
- // Do not edit javascript below this line. you can edit the alert message
- if (document.xcoords.x.value <?=$aler;?>) {
- document.xcoords.submit();
- } else {
- alert("Click number in square identicale to number in rectangle to submit.");
- }
- }
- // image x value
- function xcoord(event) {
- image = event.offsetX?(event.offsetX):event.pageX-document.getElementById("coord").offsetLeft;
- document.xcoords.x.value = image;
- }
- </script>
- </head>
- <body text="black" bgcolor="#C0C0C0" topmargin="5">
- <?php include("../h.php"); ?>
- <p align="left">The RSME is pleased to announce that we now have a general contact form setup on our website. You can now use this form to request general information about the RSME. We thank you for your patients while we created this section of the site. You can also click on the officers link to the left and select a specific officer or committee chairman to contact. We still have our traditional means of communication via the telephone or by writing us a letter and dropping it in the mail. No matter which route you choose to contact us we certainly look forward to hearing from you!</p>
- <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
- <tr>
- <td width="33%" align="center" valign="top"><b>United States Postal Service</b></td>
- <td width="33%" align="center" valign="top"><b>Club House Phone<br>
- (please leave a message)</b></td>
- <td width="34%" align="center" valign="top"><b>Online contact form</b></td>
- </tr>
- <tr>
- <td width="33%" align="center" valign="top"><br>Reading Society of Model Engineers<br>
- P.O. Box 13011<br>
- Reading, PA 19612</td>
- <td width="33%" align="center" valign="top"><br>Phone Number: 610-929-5444</td>
- <td width="34%" align="center">
- <table summary="" border="0">
- <form name="xcoords" action="<?=$_SERVER['PHP_SELF']; ?>" method="post">
- <tr>
- <td valign="top">Name: </td><td><input type="text" name="yname" size="40" maxlength="256" style="border: 1px solid <?=$bordercolor;?>"><br><br>
- </td>
- </tr>
- <tr>
- <td valign="top">E-Mail: </td><td><input type="text" name="email" size="40" maxlength="256" style="border: 1px solid <?=$bordercolor;?>"><br><br>
- </td>
- </tr>
- <tr>
- <td valign="top">Comments: </td><td><textarea name="message" cols="30" rows="7" style="border: 1px solid <?=$bordercolor;?>; background: #F5F5F5"></textarea>
- <input type="hidden" name="x" /> </td>
- </tr>
- <tr><td colspan=2 style="font: 11px Arial; color: <?=$bordercolor;?>; border-color: <?=$bordercolor;?>; border-style: solid; border-width: 1px; background: #F8F8FF; height: 30px; width: 310px; padding-top: 5px; padding-right: 5px; padding-bottom: 5px; padding-left: 5px; position: relative; font-weight: normal;">To submit this form to the Reading Society of Model Engineers. Please click the number that is presented to you on the right side of the word "click".</td>
- </table></form><p><div id="coord" onClick="submitform(xcoord(event))" class="cd"></div></div><p></div>
- </td>
- </tr>
- </table>
- </body>
- </html>
- <?php ob_end_flush(); ?>
I would like to thank everyone for any and all help I can get on this in advance.
- Anonymous
- Bot


- Joined: 25 Feb 2008
- Posts: ?
- Loc: Ozzuland
- Status: Online
January 22nd, 2013, 4:05 am
- ScottG
- Proficient


- Joined: Jul 06, 2010
- Posts: 266
- Status: Offline
OK so I see a couple things one thing is with include files you don't need to make it like its own separate page. Only include what is needed.
Bad example (what your currently doing)
h.php
contact_us.php
Output (what gets built)
Good example
h.php
contact_us.php
Output (what gets built)
and the other is that your looking for h.php here http://rsme.org/h.php where it doesn't exists the file sits here http://rsme.org/beta3/h.php so the correct include statement would be
Bad example (what your currently doing)
h.php
HTML Code: [ Select ]
<html>
<head>
<title>Hotbox</title>
<head>
<body>
Some content
</body>
</html>
<head>
<title>Hotbox</title>
<head>
<body>
Some content
</body>
</html>
- <html>
- <head>
- <title>Hotbox</title>
- <head>
- <body>
- Some content
- </body>
- </html>
contact_us.php
HTML Code: [ Select ]
<html>
<head>
<title>Contact Us</title>
<head>
<body>
<?php include("../h.php"); ?>
Some content For the contact page
</body>
</html>
<head>
<title>Contact Us</title>
<head>
<body>
<?php include("../h.php"); ?>
Some content For the contact page
</body>
</html>
- <html>
- <head>
- <title>Contact Us</title>
- <head>
- <body>
- <?php include("../h.php"); ?>
- Some content For the contact page
- </body>
- </html>
Output (what gets built)
HTML Code: [ Select ]
<html>
<head>
<title>Contact Us</title>
<head>
<body>
<html>
<head>
<title>Hotbox</title>
<head>
<body>
Some content
</body>
</html>
Some content For the contact page
</body>
</html>
<head>
<title>Contact Us</title>
<head>
<body>
<html>
<head>
<title>Hotbox</title>
<head>
<body>
Some content
</body>
</html>
Some content For the contact page
</body>
</html>
- <html>
- <head>
- <title>Contact Us</title>
- <head>
- <body>
- <html>
- <head>
- <title>Hotbox</title>
- <head>
- <body>
- Some content
- </body>
- </html>
- Some content For the contact page
- </body>
- </html>
Good example
h.php
HTML Code: [ Select ]
Some Content
- Some Content
contact_us.php
HTML Code: [ Select ]
<html>
<head>
<title>Contact Us</title>
<head>
<body>
<?php include("../h.php"); ?>
Some content For the contact page
</body>
</html>
<head>
<title>Contact Us</title>
<head>
<body>
<?php include("../h.php"); ?>
Some content For the contact page
</body>
</html>
- <html>
- <head>
- <title>Contact Us</title>
- <head>
- <body>
- <?php include("../h.php"); ?>
- Some content For the contact page
- </body>
- </html>
Output (what gets built)
HTML Code: [ Select ]
<html>
<head>
<title>Contact Us</title>
<head>
<body>
Some Content
Some content For the contact page
</body>
</html>
<head>
<title>Contact Us</title>
<head>
<body>
Some Content
Some content For the contact page
</body>
</html>
- <html>
- <head>
- <title>Contact Us</title>
- <head>
- <body>
- Some Content
- Some content For the contact page
- </body>
- </html>
and the other is that your looking for h.php here http://rsme.org/h.php where it doesn't exists the file sits here http://rsme.org/beta3/h.php so the correct include statement would be
PHP Code: [ Select ]
<?php include("h.php"); ?>
- <?php include("h.php"); ?>
- RSMEDUDE
- Novice


- Joined: Jul 10, 2004
- Posts: 33
- Status: Offline
Hi ScottG,
Thanks for the reply. I see what you mean by having too much information out in the include file (h.php). This was my first attempt at doing this and since I did not run into any issues on the initial files I did not think this would cause an issue. With that being said what you are showing me here makes sense to me.
I did make the change to the include file so that only the code necessary to make the information work is there. I then uploaded the file again and made sure it still worked on the pages that it was previously working on. This checked out as good.
I then looked at making the change to the content file (contact_us.php). The only thing that holds me up from changing that is the fact that I have this file in a subfolder. I am trying to write everything in the sense that the beta3 folder is the root directory. With that being said the contact_us.php file is actually located in a folder called forms. The directory structure looks like this (%root%/beta3/forms). The h.php file is held in the beta3 directory which is supposed to be acting like the root directory for testing purposes. There for as I understand things I need to tell the coding to look back one directory to find h.php. Does this make sense? So I made sure once again that the include line looked right on contact_us.php but I am still getting the same stuff. I did purge my cache and all that happy jazz. I do not see how by typing ../h.php would make it go all the way back to the "real" root directory (http://www.rsme.org) where the active website is running. Am I missing something there?
I can post new coding if actually needed!
Thanks for the reply. I see what you mean by having too much information out in the include file (h.php). This was my first attempt at doing this and since I did not run into any issues on the initial files I did not think this would cause an issue. With that being said what you are showing me here makes sense to me.
I did make the change to the include file so that only the code necessary to make the information work is there. I then uploaded the file again and made sure it still worked on the pages that it was previously working on. This checked out as good.
I then looked at making the change to the content file (contact_us.php). The only thing that holds me up from changing that is the fact that I have this file in a subfolder. I am trying to write everything in the sense that the beta3 folder is the root directory. With that being said the contact_us.php file is actually located in a folder called forms. The directory structure looks like this (%root%/beta3/forms). The h.php file is held in the beta3 directory which is supposed to be acting like the root directory for testing purposes. There for as I understand things I need to tell the coding to look back one directory to find h.php. Does this make sense? So I made sure once again that the include line looked right on contact_us.php but I am still getting the same stuff. I did purge my cache and all that happy jazz. I do not see how by typing ../h.php would make it go all the way back to the "real" root directory (http://www.rsme.org) where the active website is running. Am I missing something there?
I can post new coding if actually needed!
- ScottG
- Proficient


- Joined: Jul 06, 2010
- Posts: 266
- Status: Offline
The reason this seems odd is your use of frames i used the information i had at hand to come to the conclusion where the file was sitting and it appeared to be sitting in the beta3 folder that is why i stated that ../ would take you up one level or to your root. with that being said the link for the contact us page is http://rsme.org/forms/contact_us.php and not http://rsme.org/beta3/forms/contact_us.php since I stay away from the use of frames having ../ on the contact page would take you to the the beta3 folder if you directly went to http://rsme.org/beta3/forms/contact_us.php
I haven't used frames, Oh in about 10+ years so i don't know if there would be a scope issue with out testing for it which i could do when i get to work tomorrow or should i say today
I haven't used frames, Oh in about 10+ years so i don't know if there would be a scope issue with out testing for it which i could do when i get to work tomorrow or should i say today
- ScottG
- Proficient


- Joined: Jul 06, 2010
- Posts: 266
- Status: Offline
- ScottG
- Proficient


- Joined: Jul 06, 2010
- Posts: 266
- Status: Offline
I also couldn't help but notice the rest of the site also has multiple head and body tags not sure if on all pages or not but something to look in to.
I have seen a lot of broken and deprecated tags being used just in the main page.
I'm going to include my test project. I also threw together a quick mockup of your site with out using frames based on the file structure I use in all of my projects.
I put the most work in to the index page getting rid of all of the deprecated tags and broken tags. I made place holder pages for most the other pages except for the guess book, photo gallery, calendar and the whats new pages due to the folder structure you have set up. You can use the frame less setup if you want or continue using frames its your call.
This didn't take me long to make so if you continue to use the frames it is completely fine.
I have seen a lot of broken and deprecated tags being used just in the main page.
I'm going to include my test project. I also threw together a quick mockup of your site with out using frames based on the file structure I use in all of my projects.
I put the most work in to the index page getting rid of all of the deprecated tags and broken tags. I made place holder pages for most the other pages except for the guess book, photo gallery, calendar and the whats new pages due to the folder structure you have set up. You can use the frame less setup if you want or continue using frames its your call.
This didn't take me long to make so if you continue to use the frames it is completely fine.
Attachments:
Attachments:
Page 1 of 1
To Reply to this topic you need to LOGIN or REGISTER. It is free.
Post Information
- Total Posts in this topic: 6 posts
- Users browsing this forum: No registered users and 118 guests
- You cannot post new topics in this forum
- You cannot reply to topics in this forum
- You cannot edit your posts in this forum
- You cannot delete your posts in this forum
- You cannot post attachments in this forum
