Un peu d'aide avec les fichiers PHP INCLUDE

  • RSMEDUDE
  • Novice
  • Novice
  • Avatar de l’utilisateur
  • Inscription: Juil 10, 2004
  • Messages: 33
  • Status: Offline

Message Janvier 22nd, 2013, 4:05 am

Bonjour à tous,

Je suis un membre de longue date, mais très rarement, je poste ici. À cette fin, j'espère que je poste ce sujet au bon endroit.

Avant d'entrer dans les choses, je tiens à préciser que je suis un novice avec PHP. J'apprends mais beaucoup du codage que j'utilise est soit un libre d'utiliser le téléchargement avec la notation correcte ou codage j'ai figuré dehors comment faire travailler ensemble de façon différente de sites.

Je suis en train de travailler sur mon site de clubs de chemin de fer de modèle et de ce que j'essaie de faire est de prendre un en-tête à inclure le fichier de sorte que j'ai ce qu'on appelle le « réfrigérateur » apparaître sur chaque page. Les autres avantages à cela sont que l'en-tête en bout de ligne apparaisse de manière uniforme sur toutes les pages et je n'aurai seulement une seule page pour modifier les mises à jour pour le « réfrigérateur ». J'ai la plupart des pages fonctionne comment je le veux, mais j'ai certains qui sont un peu têtu et je ne sais pas pourquoi.

Avant de vous montrer le code pour ce que je veux accomplir ici sont des liens.

Voilà comment le site ressemble et fonctionne maintenant : lecture société d'ingénieurs principaux Site de modèles

Il s'agit plus ou moins ce que je veux qu'il ressemble : Site de la société de lecture du modèle ingénieurs BETA

Dans le site bêta, vous verrez que certaines pages chargement comme elles le devraient avec le « réfrigérateur » en haut tandis que d'autres chargement sans elle. Ceux sans est des pages de mon problème. L'exemple de code de ce que je travaille avec c'est-à-dire énumérés ci-dessous est de la page h.php et la page contact_us.php.

FICHIER : 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>
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Language" content="en-us">
  4. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  5. <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
  6. <meta name="ProgId" content="FrontPage.Editor.Document">
  7. <meta name="resource-type" content="document">
  8. <meta name="Generator" content="Microsoft FrontPage 4.0">
  9. <meta name="revisit-after" content="10">
  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,">
  11. <meta name="rating" content="Safe For Kids">
  12. <title>Reading Society of Model Engineers</title>
  13. <base target="main">
  14. <LINK REL=stylesheet TYPE="text/css" HREF=rsme.css>
  15. <style type="text/css">
  16. /*Example CSS for the two demo scrollers*/
  17. #pscroller2{
  18. width: 490px;
  19. height: 25px;
  20. padding: 3px;
  21. background-color: #C0C0C0;
  22. }
  23. #pscroller2 a{
  24. text-decoration: none;
  25. }
  26. .someclass{ //class
  27. }
  28. </style>
  29. <script type="text/javascript">
  30. /*Example message arrays for the two demo scrollers*/
  31. var pausecontent2=new Array()
  32. pausecontent2[0]='<center><a href="http://www.rsme.org/calendar/2012/oct.php">RSME Run Day October 7, 2012 12pm - 5pm</a></center>'
  33. 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>'
  34. pausecontent2[2]='<center><a href="http://www.rsme.org/calendar/2012/nov.php">RSME Run Day November 4, 2012 12pm - 5pm</a></center>'
  35. </script>
  36. <script type="text/javascript">
  37. /***********************************************
  38. SaveCancel* Pausing up-down scroller- ? Dynamic Drive (www.dynamicdrive.com)
  39. * This notice MUST stay intact for legal use
  40. * Visit http://www.dynamicdrive.com/ for this script and 100s more.
  41. ***********************************************/
  42. function pausescroller(content, divId, divClass, delay){
  43. this.content=content //message array content
  44. this.tickerid=divId //ID of ticker div to display information
  45. this.delay=delay //Delay between msg change, in miliseconds.
  46. this.mouseoverBol=0 //Boolean to indicate whether mouse is currently over scroller (and pause it if it is)
  47. this.hiddendivpointer=1 //index of message array for hidden div
  48. 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>')
  49. var scrollerinstance=this
  50. if (window.addEventListener) //run onload in DOM2 browsers
  51. window.addEventListener("load", function(){scrollerinstance.initialize()}, false)
  52. else if (window.attachEvent) //run onload in IE5.5+
  53. window.attachEvent("onload", function(){scrollerinstance.initialize()})
  54. else if (document.getElementById) //if legacy DOM browsers, just start scroller after 0.5 sec
  55. setTimeout(function(){scrollerinstance.initialize()}, 500)
  56. }
  57. // -------------------------------------------------------------------
  58. // initialize()- Initialize scroller method.
  59. // -Get div objects, set initial positions, start up down animation
  60. // -------------------------------------------------------------------
  61. pausescroller.prototype.initialize=function(){
  62. this.tickerdiv=document.getElementById(this.tickerid)
  63. this.visiblediv=document.getElementById(this.tickerid+"1")
  64. this.hiddendiv=document.getElementById(this.tickerid+"2")
  65. this.visibledivtop=parseInt(pausescroller.getCSSpadding(this.tickerdiv))
  66. //set width of inner DIVs to outer DIV's width minus padding (padding assumed to be top padding x 2)
  67. this.visiblediv.style.width=this.hiddendiv.style.width=this.tickerdiv.offsetWidth-(this.visibledivtop*2)+"px"
  68. this.getinline(this.visiblediv, this.hiddendiv)
  69. this.hiddendiv.style.visibility="visible"
  70. var scrollerinstance=this
  71. document.getElementById(this.tickerid).onmouseover=function(){scrollerinstance.mouseoverBol=1}
  72. document.getElementById(this.tickerid).onmouseout=function(){scrollerinstance.mouseoverBol=0}
  73. if (window.attachEvent) //Clean up loose references in IE
  74. window.attachEvent("onunload", function(){scrollerinstance.tickerdiv.onmouseover=scrollerinstance.tickerdiv.onmouseout=null})
  75. setTimeout(function(){scrollerinstance.animateup()}, this.delay)
  76. }
  77. // -------------------------------------------------------------------
  78. // animateup()- Move the two inner divs of the scroller up and in sync
  79. // -------------------------------------------------------------------
  80. pausescroller.prototype.animateup=function(){
  81. var scrollerinstance=this
  82. if (parseInt(this.hiddendiv.style.top)>(this.visibledivtop+5)){
  83. this.visiblediv.style.top=parseInt(this.visiblediv.style.top)-5+"px"
  84. this.hiddendiv.style.top=parseInt(this.hiddendiv.style.top)-5+"px"
  85. setTimeout(function(){scrollerinstance.animateup()}, 50)
  86. }
  87. else{
  88. this.getinline(this.hiddendiv, this.visiblediv)
  89. this.swapdivs()
  90. setTimeout(function(){scrollerinstance.setmessage()}, this.delay)
  91. }
  92. }
  93. // -------------------------------------------------------------------
  94. // swapdivs()- Swap between which is the visible and which is the hidden div
  95. // -------------------------------------------------------------------
  96. pausescroller.prototype.swapdivs=function(){
  97. var tempcontainer=this.visiblediv
  98. this.visiblediv=this.hiddendiv
  99. this.hiddendiv=tempcontainer
  100. }
  101. pausescroller.prototype.getinline=function(div1, div2){
  102. div1.style.top=this.visibledivtop+"px"
  103. div2.style.top=Math.max(div1.parentNode.offsetHeight, div1.offsetHeight)+"px"
  104. }
  105. // -------------------------------------------------------------------
  106. // setmessage()- Populate the hidden div with the next message before it's visible
  107. // -------------------------------------------------------------------
  108. pausescroller.prototype.setmessage=function(){
  109. var scrollerinstance=this
  110. if (this.mouseoverBol==1) //if mouse is currently over scoller, do nothing (pause it)
  111. setTimeout(function(){scrollerinstance.setmessage()}, 100)
  112. else{
  113. var i=this.hiddendivpointer
  114. var ceiling=this.content.length
  115. this.hiddendivpointer=(i+1>ceiling-1)? 0 : i+1
  116. this.hiddendiv.innerHTML=this.content[this.hiddendivpointer]
  117. this.animateup()
  118. }
  119. }
  120. pausescroller.getCSSpadding=function(tickerobj){ //get CSS padding value, if any
  121. if (tickerobj.currentStyle)
  122. return tickerobj.currentStyle["paddingTop"]
  123. else if (window.getComputedStyle) //if DOM2
  124. return window.getComputedStyle(tickerobj, "").getPropertyValue("padding-top")
  125. else
  126. return 0
  127. }
  128. </script>
  129. </head>
  130. <body topmargin="5">
  131. <table border="0" cellpadding="0" cellspacing="0" width="100%" height="100">
  132.  <tr>
  133.    <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>
  134.    <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>
  135.    <font size="2"><BR></font>
  136. <!-- BEGIN NEWS FADER TEXT -->
  137. <table width="139">
  138.     <tr>
  139.         <td align="centeR"><font color="red" size="4"><b><i>HOTBOX</i></b></font>
  140.         </td>
  141.     </tr>
  142.     <tr>
  143.         <td>
  144. <script type="text/javascript">
  145. new pausescroller(pausecontent2, "pscroller2", "someclass", 3600)
  146. </script>
  147.         </td>
  148.     </tr>
  149. </table>
  150. <!-- END FADER -->
  151. </p></td>
  152.    <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>
  153.  </tr>
  154. </table>
  155. </center>
  156. </p>
  157. </body>
  158. </html>


FICHIER : 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(); ?>
  1. <?php
  2. ob_start('ob_gzhandler');
  3. session_start();
  4. include 'contact_us_inc.php';
  5. // if submit
  6. if (($_POST[x])&&(substr($_SESSION[igif], 17) === $_SESSION['afloat'])){
  7. // posted
  8. $x = $_POST[x];
  9. // decode, strip string and round numbers
  10. $a = base64_decode($_SESSION['afloat']);
  11. $b = 0 + $a;
  12. $a = explode(" ", $a);
  13. $a = $a[3];
  14. $bb = round($b);
  15. $aa = round($a);
  16. // x coords
  17. $gc = explode(" ", '0 19 40 60 82 104 79 100 121 142 163 185');
  18. // check if correct number has been clicked
  19. $ac = $aa + 6;
  20. if ($bb <= $aa){ $ac = $bb + 1; }
  21. //wrong number clicked error message below
  22. $mess = "ERROR: Sorry " . $_POST[yname] . " wrong number clicked";
  23. // if correct number clicked success
  24. if (($x >= $gc[$ac-1]) && ($x <= $gc[$ac])){
  25. // submit your form
  26. $to = $owner_email;
  27. $headers = 'MIME-Version: 1.0' . "\r\n";
  28. $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
  29. // Additional headers
  30. $headers .= 'From:<' . $_POST[email] . '>' . $_POST[yname] . "\r\n";
  31. $headers .= 'RSME General Contact Form Version 1.0' . "\r\n";
  32. // Message content
  33. $messages = '<br><br><b>Name:</b> ' . $_POST[yname] . '<p><B>E-mail:</b> ' . $_POST[email] . '<p><b>Comments:</b> <br>' . $_POST[message];
  34. // Mail it    
  35. mail($to, "RSME MAIL: General Contact Form", $messages, $headers);
  36. $yname = $_POST[yname];
  37. ?>
  38. <script>    
  39. alert("Thank you <? echo $yname; ?> for your correspondance. We will be sure to get back to you soon!");
  40. window.location = "<?=$redirect;?>";
  41. </script> 
  42. <? 
  43. exit; }
  44. //demo alert message below
  45. ?>
  46. <script>    
  47. alert("<?=$mess;?>");
  48. window.location = window.location;
  49. </script>
  50. <?
  51. session_unset();
  52. session_destroy();
  53. ob_end_flush();
  54. exit;
  55. }
  56. // afloat = base64_encoded random string
  57. $afloat = base64_encode(" " . $num1 = rand(0,3) . "." . $num2 = rand(100,999) . "
  58. Float " . $num3 = rand(1,4) . "." . $num4 = rand(100,999) . " ");
  59. // rectangle x coord
  60. $aler = "> 78";
  61. if(round($num1 . "." . $num2) <= round($num3 . "." . $num4)) {$aler = "< 105";}
  62. // create random image
  63. $_SESSION[igif] = "create_gif.php?a=" . $afloat . "";
  64. $_SESSION['afloat'] = $afloat;
  65. ?>
  66. <html>
  67. <head>
  68. <meta http-equiv="Content-Language" content="en-us">
  69. <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
  70. <meta name="GENERATOR" content="Microsoft FrontPage 6.0">
  71. <meta name="ProgId" content="FrontPage.Editor.Document">
  72. <meta name="resource-type" content="document">
  73. <meta name="Generator" content="rsmeorga Tag Generator">
  74. <meta name="revisit-after" content="10">
  75. <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,">
  76. <meta name="rating" content="Safe For Kids">
  77. <title>Reading Society of Model Engineers</title>
  78. <LINK REL=stylesheet TYPE="text/css" HREF=../rsme.css>
  79. <style type="text/css">
  80. /* click image */
  81. .cd {
  82. width: 185px;
  83. height: 15px;
  84. background-image: url(<?=$_SESSION[igif];?>);
  85. background-repeat: no-repeat;
  86. position: relative;
  87. left:<?=rand(-100,100);?>px;
  88. bottom:<?=rand(-5,20);?>px;
  89. z-index: 2;
  90. }
  91. </style>
  92. <script language="JavaScript">
  93. // submit form func val i date
  94. function submitform() {
  95. if (document.xcoords.yname.value == "") {
  96. alert("Please Enter Your Name.");
  97. return false; }
  98. if (document.xcoords.email.value == "" || document.xcoords.email.value.indexOf("@")<1|| document.xcoords.email.value.indexOf(".")<1) {
  99. alert("Please Enter Valid E-mail");
  100. return false;}
  101. if (document.xcoords.message.value == "") {
  102. alert("Please Enter Question/Message.");
  103. return false; } 
  104. // if box coord submit else rectangle coord alert
  105. // Do not edit javascript below this line. you can edit the alert message
  106. if (document.xcoords.x.value <?=$aler;?>) {
  107. document.xcoords.submit();
  108. } else {
  109. alert("Click number in square identicale to number in rectangle to submit.");
  110. }
  111. }
  112. // image x value
  113. function xcoord(event) {
  114. image = event.offsetX?(event.offsetX):event.pageX-document.getElementById("coord").offsetLeft;
  115. document.xcoords.x.value = image;
  116. }
  117. </script>
  118. </head>
  119. <body text="black" bgcolor="#C0C0C0" topmargin="5">
  120. <?php include("../h.php"); ?>
  121. <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>
  122. <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%">
  123.  <tr>
  124.   <td width="33%" align="center" valign="top"><b>United States Postal Service</b></td>
  125.   <td width="33%" align="center" valign="top"><b>Club House Phone<br>
  126.   (please leave a message)</b></td>
  127.   <td width="34%" align="center" valign="top"><b>Online contact form</b></td>
  128.  </tr>
  129.  <tr>
  130.   <td width="33%" align="center" valign="top"><br>Reading Society of Model Engineers<br>
  131.   P.O. Box 13011<br>
  132.   Reading, PA 19612</td>
  133.   <td width="33%" align="center" valign="top"><br>Phone Number: 610-929-5444</td>
  134.   <td width="34%" align="center">
  135.   
  136.   <table summary="" border="0">
  137. <form name="xcoords" action="<?=$_SERVER['PHP_SELF']; ?>" method="post">
  138.     <tr>
  139.         <td valign="top">Name: </td><td><input type="text" name="yname" size="40" maxlength="256" style="border: 1px solid <?=$bordercolor;?>"><br><br>
  140.         </td>
  141.     </tr>
  142.     <tr>
  143.         <td valign="top">E-Mail: </td><td><input type="text" name="email" size="40" maxlength="256" style="border: 1px solid <?=$bordercolor;?>"><br><br>
  144.         </td>
  145.     </tr>
  146.     <tr>
  147.         <td valign="top">Comments: </td><td><textarea name="message" cols="30" rows="7" style="border: 1px solid <?=$bordercolor;?>; background: #F5F5F5"></textarea>
  148. <input type="hidden" name="x" /> </td>
  149.     </tr>
  150. <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>
  151. </table></form><p><div id="coord" onClick="submitform(xcoord(event))" class="cd"></div></div><p></div>
  152.   
  153.   </td>
  154.  </tr>
  155. </table>
  156. </body>
  157. </html>
  158. <?php ob_end_flush(); ?>


Je tiens à remercier toutes les personnes pour toute aide, que je peux obtenir là-dessus à l'avance.
  • Anonymous
  • Bot
  • No Avatar
  • Inscription: 25 Feb 2008
  • Messages: ?
  • Loc: Ozzuland
  • Status: Online

Message Janvier 22nd, 2013, 4:05 am

  • ScottG
  • Proficient
  • Proficient
  • No Avatar
  • Inscription: Juil 06, 2010
  • Messages: 260
  • Status: Offline

Message Janvier 22nd, 2013, 9:19 am

OK, donc je vois quelques choses, une chose est avec les fichiers include, que vous n'avez pas besoin de faire comme son propre page séparée. N'inclure que ce qui est nécessaire.

Mauvais exemple (ce que votre train de faire)
h.php
HTML Code: [ Select ]
<html>
    <head>
        <title>Hotbox</title>
    <head>
    <body>
    Some content
    </body>
</html>
 
  1. <html>
  2.     <head>
  3.         <title>Hotbox</title>
  4.     <head>
  5.     <body>
  6.     Some content
  7.     </body>
  8. </html>
  9.  


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>
 
  1. <html>
  2.     <head>
  3.         <title>Contact Us</title>
  4.     <head>
  5.     <body>
  6.     <?php include("../h.php"); ?>
  7.     Some content For the contact page
  8.     </body>
  9. </html>
  10.  


Sortie (ce qui obtient construit)
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>
 
  1. <html>
  2.     <head>
  3.         <title>Contact Us</title>
  4.     <head>
  5.     <body>
  6.     <html>
  7.         <head>
  8.             <title>Hotbox</title>
  9.         <head>
  10.         <body>
  11.         Some content
  12.         </body>
  13.     </html>
  14.     Some content For the contact page
  15.     </body>
  16. </html>
  17.  



Bon exemple
h.php
HTML Code: [ Select ]
Some Content
 
  1. Some Content
  2.  


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>
 
  1. <html>
  2.     <head>
  3.         <title>Contact Us</title>
  4.     <head>
  5.     <body>
  6.     <?php include("../h.php"); ?>
  7.     Some content For the contact page
  8.     </body>
  9. </html>
  10.  


Sortie (ce qui obtient construit)
HTML Code: [ Select ]
<html>
    <head>
        <title>Contact Us</title>
    <head>
    <body>
    Some Content
    Some content For the contact page
    </body>
</html>
 
  1. <html>
  2.     <head>
  3.         <title>Contact Us</title>
  4.     <head>
  5.     <body>
  6.     Some Content
  7.     Some content For the contact page
  8.     </body>
  9. </html>
  10.  


et l'autre est que vous cherchez ici h.php http://rsme.org/h.php où il n'existe pas le fichier se trouve ici http://rsme.org/beta3/h.php donc inclure la bonne déclaration serait
PHP Code: [ Select ]
<?php include("h.php"); ?>
 
  1. <?php include("h.php"); ?>
  2.  
  • RSMEDUDE
  • Novice
  • Novice
  • Avatar de l’utilisateur
  • Inscription: Juil 10, 2004
  • Messages: 33
  • Status: Offline

Message Janvier 22nd, 2013, 11:12 pm

Salut ScottG,

Merci pour la réponse. Je vois ce que vous entendez par avoir trop d'informations dans le fichier include (h.php). Il s'agissait de ma première tentative à faire cela, et étant donné que je n'ai pas couru aucun problèmes sur les fichiers initiaux, je ne pense pas que cela causerait un problème. Cela dit ce que vous êtes montrant moi ici fait sens pour moi.

J'ai fait le changement dans le fichier include afin que seuls le code nécessaire pour rendre l'information travail est là. J'ai alors téléchargé le fichier à nouveau et fait en sorte que cela a fonctionné encore sur les pages qu'il a précédemment travaillé sur. Il extrait aussi bon.

J'ai regardé puis effectuer les modifications au fichier de contenu (contact_us.php). La seule chose qui me tient vers le haut de changer cela est le fait que j'ai ce fichier dans un sous-dossier. Je suis en train d'écrire tout en ce sens que le dossier beta3 est le répertoire racine. Ceci étant dit que le fichier contact_us.php est en fait situé dans un dossier appelé des formes. La structure de répertoire ressemble à cette (root%/beta3/forms %). Le fichier h.php se tient dans le répertoire beta3 qui est censé pour agir comme répertoire racine pour des fins de test. Là, car si je comprends bien les choses, j'ai besoin de dire le codage pour regarder en arrière un répertoire pour trouver h.php. Cela a-t-il un sens ? Donc je me suis assuré une fois de plus que la ligne include regardé sur contact_us.php mais je reçois toujours la même chose. J'ai vider mon cache et heureux tout ce jazz. Je ne vois pas comment le faire en tapant.../h.php rendrait aller tout le chemin du retour vers le répertoire racine « réel » ( http://www.rsme.org ) où le site actif est en cours d'exécution. Ai-je raté quelque chose ?

Je peux poster nouveau codage si nécessaire !
  • ScottG
  • Proficient
  • Proficient
  • No Avatar
  • Inscription: Juil 06, 2010
  • Messages: 260
  • Status: Offline

Message Janvier 23rd, 2013, 1:33 am

La raison pour laquelle que cela semble étrange est l'utilisation d'images que j'ai utilisé les informations que j'avais sous la main pour arriver à la conclusion, où le fichier a été assis et il a semblé être assis dans le dossier beta3 c'est pourquoi j'ai dit que.../ vous faudrait remonter d'un niveau ou à vos racines. Ceci étant dit le lien pour le contact nous page http://rsme.org/forms/contact_us.php et pas http://rsme.org/beta3/forms/contact_us.php car je reste loin de l'utilisation de cadres ayant.../ sur la page contact vous prendrait le le dossier beta3 si vous êtes allé directement àhttp://rsme.org/beta3/forms/contact_us.php

Je n'ai pas utilisé des images, Oh dans environ 10++ ans donc je ne sais pas si il y aurait un problème de portée avec des essais que je pouvais faire lorsque j'arrive à travailler demain ou devrais-je dire aujourd'hui
  • ScottG
  • Proficient
  • Proficient
  • No Avatar
  • Inscription: Juil 06, 2010
  • Messages: 260
  • Status: Offline

Message Janvier 23rd, 2013, 7:35 am

Si Ive a construit mon test et il semble fonctionner comme il se doit et allez dans le dossier de formulaires dans le dossier beta3 de trouver h.php. S'il vous plaît poste votre code actuel alors davantage de tests peut être fait.
  • ScottG
  • Proficient
  • Proficient
  • No Avatar
  • Inscription: Juil 06, 2010
  • Messages: 260
  • Status: Offline

Message Janvier 23rd, 2013, 11:34 am

J'ai aussi ne pouvais m'empêcher remarquer que le reste du site a également plusieurs balises de tête et le corps ne sais pas si il est sur toutes les pages ou non, mais quelque chose à regarder.

J'ai vu beaucoup de cassé et désapprouvées tags utilisés dans la page d'accueil.

Im va inclure mon projet de test. J'ai aussi jeté ainsi une maquette rapide de votre site avec l'aide d'images basés sur la structure de fichiers que j'utilise dans tous mes projets.

J'ai mis le plus de travail à se débarrasser de toutes les balises dépréciées et tags cassés sur l'index. J'ai fait place titulaire pages pour plus les autres pages à l'exception de la livre de guess, galerie photo, calendrier et whats nouvelles pages en raison de la structure de dossiers que vous avez configuré. Vous pouvez utiliser le cadre moins d'installation si vous voulez continuez à utiliser les cadres son votre appel.

Cela n'a pas fallu me tarde de faire si vous continuez à utiliser les cadres n'est complètement amende.
Attachments:
no_frame.zip

(226.47 Kio) Téléchargé 17 fois

Attachments:
frame_test.zip

(2.1 Kio) Téléchargé 14 fois

Afficher de l'information

  • Total des messages de ce sujet: 6 messages
  • Utilisateurs parcourant ce forum: Aucun utilisateur enregistré et 142 invités
  • Vous ne pouvez pas poster de nouveaux sujets
  • Vous ne pouvez pas répondre aux sujets
  • Vous ne pouvez pas éditer vos messages
  • Vous ne pouvez pas supprimer vos messages
  • Vous ne pouvez pas joindre des fichiers
 
 

© 2011 Unmelted, LLC. Ozzu® est une marque déposée de Unmelted, LLC