Stops execution after include statement

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Stops execution after include statement

Postby Xismy99pal! » 20. September 2020 20:21

Hi to all (wonderful!) moderators/experts...Running my scripts for my eventual (sometime soon???) website; xampp has been my friend! But, have now a problem: xampp stops execution of the remainder of the script, apparently AFTER an " include '(correct path to file)' ; " statement. (This statement is exactly written: include 'C:\xampp\htdocs\temp_dev\xxx.php'; )
And, the execution of the include is also flawed - not the desired result.
This is the situation...I correctly ran a script "one" with the indicated include statement (script for a header with specific colors and font)- it executed perfectly - the header was perfect, and the remainder of the page was complete with text - all expected results.
But, in running script "two", with the same exact include statement: The RESULT is a header with an incorrect font (but all other details OK), AND nothing else on the page...ie, execution was stopped or interrupted, seemingly after the include statement was (incorrectly) executed.

I've run separately, the header script, script one WITH the include, and script two WITHOUT the include - all run perfectly, as I've just specified. But, once I ADD the include statement into ANY OTHER SCRIPT - I've tried other scripts, with and without the include - EXCEPT script one, the result is a flawed header, and nothing else, on that page. I've scrutinized the code (mostly php) before the include, and in most scripts, this preceding code is exactly what is in script one (again, runs perfectly), so this is not a probable culprit. In most scripts, the code that follows the include is mostly html, for text and images.

Can anyone PLEASE assist? Pls reply if you need additional info. --- Thankyouthankyouthankyou for reading this plea, and for assistance! ("tearing my hair out" in frustration)
LL in pgh
Xismy99pal!
 
Posts: 4
Joined: 20. September 2020 19:20
XAMPP version: 3.2.4
Operating System: win7

Re: Stops execution after include statement

Postby Altrea » 21. September 2020 15:26

Hi,

can you give a full example with code to reproduce this issue on my development machine?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11952
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Stops execution after include statement

Postby Nobbie » 21. September 2020 22:19

We need the full code and the full environment. There is no other option for debugging foreign scripts.
Nobbie
 
Posts: 13214
Joined: 09. March 2008 13:04

Re: Stops execution after include statement

Postby Xismy99pal! » 22. September 2020 18:36

Hi guys...just appreciate that you'd even attempt assistance, with "foreign code"!
- sorry for delay; I had to down 2 large chocolate bars before replying as coding always gets my tummy in a twist :( .

Attached are 3 scripts (simplified for test purposes): #1 (WELCOME) is the only one that works* as it should; header is perfect, and page contents follow, as I wanted.
#2 (GALLERY), and #3 (ABOUT) are examples of ALL OTHER scripts that don't work: Once the include statement is added: a distorted header results, and there are no page contents after the header. I've even commented-out preceding PHP code that I thought was the culprit, BUT NO: no difference in execution.

* ON MY system as follows: Firefox -- Win7 -- xampp installer: x64-7.1.30-3-VC14 -- XAMPP control panel v3.2.4 .

Code: Select all
<?php
 session_start();
//MODULE: HOMEPAGE, incs enter store key (to Gallery)
//   

 include 'C:\xampp\htdocs\temp_dev\HEADER.php';
 
//
//         
 ?>
 
<!DOCTYPE html>
<html>
<head>
  <meta name name="description" content="Natural, untreated JADE & precious-stone jewelry; pre-owned.
  Private family collection, Hong Kong/China/US mfg." />
  <link href="https://fonts.googleapis.com/css?family=Limelight" rel="stylesheet"/>     
  <link href="https://fonts.googleapis.com/css?family=Righteous" rel="stylesheet"/>     
  <link href="https://fonts.googleapis.com/css?family=Great+Vibes" rel="stylesheet"/>
  <title>Welcome to jdj.com, natural JADE jewelry, pre-owned</title>
  <style type="text/css"> 
  #page {width:940px; margin:0 auto;}
  h2 {font-family:"Great Vibes"; font-weight:bold; font-size:60px; color:#00b300;
          margin:80px auto 50px auto; text-align:center;}
  h5 {font-family:"Great Vibes"; font-size:36px; color:#00b300; margin:50px auto 0 auto; text-align:center;}
  h6 {font-family:Arial, Verdana, sans-serif; font-weight:bold; font-size:14px;}
  p {font-family:Arial,Verdana, sans-serif; font-size:16px; line-height:1.4em; text-align:center;}
   .blankline_third {margin-top:0.3em; display:block;} 
   .blankline_half {margin-top:0.5em; display:block;} 
   .blanklines1{margin-top:1em; display:block;} 
   .blanklines2{margin-top:2em; display:block;} 
 
   .nav_Home {font-family:Righteous; font-size:24px; margin:20px auto 50px auto; text-align:center; padding-top:50px;}
   a {text-decoration:none; color:#e60000;}
   a:hover {color:#00b300; text-decoration:underline;}
   a:active {color:#00b300; text-decoration:underline;}   
       
   .welcome {width:900px; height:600px; padding:0 10px 0 10px;}
   
   .footer {text-align:left; margin:40px 0 0 20px;}
</style>
</head>
<body>
 <div id="page">   
   <div class="nav_Home">
        <a href="https://www.jadedragonjewels.com/gallery.php">Enter Store</a>
   </div>
    <div class="welcome">
           <h2>Welcome !</h2>   
           <p>To our site featuring <b>pre-owned, quality </b>
           GREEN JADE, 14K and 18K gold jewelry, including vintage jade pieces.
         <p><b>All jade are GENUINE - natural/untreated - </b>as all stones have been mined prior to 1970 - 
         our jade jewelry were all purchased before, and owned since, 1970. Presently, we are also offering several
         precious-stone pieces, made in the US. Our jewelry originates from a (single)
         family collection; we are not a jewelry broker. </p>   
                               
    </div>
 </div>
</body>
</html>


Code: Select all
<?php
 session_start();
//MODULE for: GALLERY, initialize all vars here!
//
//de-activate history caching (prevent form re-submission)

// header ("Cache-Control: no-cache, no-store, must-revalidate");
//   header ("Expires: 0");
// header ("Pragma: no-cache");
 //the following clears duplicate session cookies (so, prevents server break), restores 1 copy of ea cookie
 //   $cookies = array ( );
 //   foreach (headers_list( ) as $header)
 //        {if (strpos($header, 'Set-Cookie:') == 0)
 //                {$cookies[ ] = $header;}
 //        }
 //    header_remove ('Set-Cookie');
 //    foreach (array_unique($cookies) as $cookie)
 //         {header($cookie, false);}
//
// 
 include 'C:\xampp\htdocs\temp_dev\HEADER.php';

?>
<!DOCTYPE HTML>
<html>
<head>
   <meta name="robots" content="noindex,nofollow" />
   <link href="https://fonts.googleapis.com/css?family=Righteous" rel="stylesheet"/>
   <link href="https://fonts.googleapis.com/css?family=Oleo Script Swash Caps" rel="stylesheet"/>
   <link href="https://fonts.googleapis.com/css?family=Limelight" rel="stylesheet"/>
   <title>jdJ.com Gallery</title>
   <style type="text/css">
     #page {width:940px; margin:0 auto;}     
     h1 {font-family:Oleo Script Swash Caps; font-size:44px; margin:70px auto 0 auto; text-align:center;}   
    h3 {font-family:Arial,Verdana,sans-serif; font-size:15px; text-align:center; line-height:1.2em;}   
     h4 {font-family:Arial,Verdana,sans-serif; font-size:16px; color:#00b300; text-align:center; padding-top:7px;}     
     h6 {font-family:Arial,Verdana,sans-serif; font-style:bold; font-size:14px; text-align:center;}
     p {font-family:Arial,Verdana,sans-serif; font-weight:bold; font-size:16px; text-align:center;} 
     .blanklines3 {margin-top:3em; display:block;}
     .blanklines2 {margin-top:2em; display:block;}
    .blanklines1 {margin-top:1em; display:block;}
    #input_instrucs {width:900px; height:40px; margin:50px auto 0 auto; text-align:center;}
   
     .foto_matrix {width:940px; margin:0 auto 0 auto;} 
   
     .frame4 {width:220px; height:260px; float:left; margin:40px 6px 70px 6px;}                   
     .foto4 {position:relative; width:220px; height:220px; float:left; margin:50px 6px 30px 6px; text-align:center;}         
     .spaces20 {margin-left:20px;}
     .spaces5 {margin-right:5px;}
     .spaces50 {margin-left:50px;}
     .nav_G {font-family:Righteous; font-size:22px; text-align:center; margin:20px auto 30px auto; padding-top:20px;}
      h5 {font-family:"Limelight"; font-size:20px; padding-left:5px; margin-top:5px;}
     .jdj_banner1 {position:absolute;
                            transform:skewY(20deg);
                           -ms-transform:skewY(20deg);
                           -webkit:transform:skewY(20deg);
                           -moz-transform:skewY(20deg);
                           -o-transform:skewY(20deg);
                           width:220px; height:55px;
                           top:125px;
                           background-color:#D8D8D8; opacity:0.3;
                           }
                     
     a.link00 {text-decoration:none; color:black;}               
    a.link00:hover {text-decoration:none; color:black;}
    a.link00:active {text-decoration:none; color:black;}
   
     a {text-decoration:none; color:#e60000;}
     a:hover {color:#00b300; text-decoration:underline;}
     a:active {color:#00b300; text-decoration:underline;}   
   
</style>
</head>
<body>
    <div style="overflow:auto">   
 <!--   <div id="page">
         <div class="nav_G">
         <a href='C:\xampp\htdocs\temp_dev\cartFORM.php'><span class="spaces50"></span>Cart</a> 
          <a href='C:\xampp\htdocs\temp_dev\TS_n_C.php'><span class="spaces50"></span>Terms of Sale</a>
          <a href='C:\xampp\htdocs\temp_dev\TS_n_C.php'><span class="spaces50"></span>Contact</a>
          <a href='C:\xampp\htdocs\temp_dev\about.php'><span class="spaces50"></span>About</a>
          <a href='C:\xampp\htdocs\temp_dev\welcome.php'><span class="spaces50"></span>Welcome!</a>
      </div>   
      -->
    <span class="blanklines3"></span>
    <h1>For Your Consideration</h1>
    <span class="blanklines2"></span>
   <div id="input_instrucs">
        <h3>~ Please read TERMS OF SALE, including that All Sales are Final - No Refund/Return,
        and for Payment Instructions ~</h3>      
   </div>
</div>
</body>
</html>


Code: Select all
<?php
session_start();
//MODULE: "About"
//
//the following clears duplicate session cookies (so, prevents server break), restores 1 copy of ea cookie
    $cookies = array ( );
    foreach (headers_list( ) as $header)
         { if (strpos($header, 'Set-Cookie:') == 0)
                 {$cookies[ ] = $header; }
         }
     header_remove ('Set-Cookie');
     foreach (array_unique($cookies) as $cookie)
          {header($cookie, false);}
//
 // include 'C:\xampp\htdocs\temp_dev\initializeALL.php';
//
//
?>
<!DOCTYPE html>
<html>
<head>
  <meta name="robots" content="noindex,nofollow" />
  <link href="https://fonts.googleapis.com/css?family=Poller+One" rel="stylesheet"/>   
  <link href="https://fonts.googleapis.com/css?family=Righteous" rel="stylesheet"/>     
  <link href="https://fonts.googleapis.com/css?family=Great+Vibes" rel="stylesheet"/>     
<title>jdJ.com About Our Jewelry</title>
<style type"text/css">
   #page {width:960px; margin:0 auto;}
   h1 {font-family:Poller One; font-size:30px; padding:50px 20px 15px 0;}
   h5 {font-family:"Great Vibes"; font-size:36px; color:#00b300;}
   p {font-family:Arial,Verdana,sans-serif; font-size:16px; line-height:1.5em; text-align:left;}
   .blankline_third {margin-top:0.3em; display:block;}
   .blankline_half {margin-top:0.5em; display:block;}
   .blanklines1 {margin-top:1em; display:block;}
   .blanklines2 {margin-top:2em; display:block;}
   .blanklines3 {margin-top:3em; display:block;}
   .spaces25 {margin-left:25px;}   
   .spaces50 {margin-left:50px;} 
   .spaces80 {margin-left:80px;} 
   .nav_A {font-family:Righteous; font-size:22px; margin:50px auto 50px auto; text-align:center;}
   a {text-decoration:none; color:#e60000;}
   a:hover {color:#00b300; text-decoration:underline;}
   a:active {color:#00b300; text-decoration:underline;}   
</style>
</head>
<body>
   <div style="overflow:auto">   
   <div id="page">
            <div class="nav_A">
                    <a href="gallery.php">Gallery</a>
                    <a href="cartFORM.php"><span class="spaces80"></span>Cart</a>     
                    <a href="TS_n_C.html"><span class="spaces80"></span>Terms of Sale</a>         
                    <a href="TS_n_C.html"><span class="spaces80"></span>Contact</a>         
            </div>
            <h1>About Our Jewelry</h1>
           
     <p><b> ~~~ Our jewelry are PRE-OWNED, <i>NOT new jewelry ~~~</i></b> </p>      
         <span class="blanklines2"></span>
        <p><b>All disclosures, and photos, are truthful, and accurate as possible.</b>
         All photos were taken indoors, with sunlight present, and have not been modified.</p>         
           <span class="blanklines1"></span>
       <p>As previously stated, <b>our jade are GENUINE - natural/untreated - as the stones have been
       mined prior to 1970.</b>
      Specifically, all jade jewelry were purchased prior to 1970, and have remained in a (single) family collection.
      Presently, our inventory also includes quality jewelry made in the USA. </p>
          <span class="blanklines1"></span> 
</div> </div>
</body>
</html>


If you could possibly determine what I'm doing incorrectly, or may I dare say; is it xampp ???

--- INFINITE THANKS for your time! (--- returning to another batch of choc bars (writing scripts is just so much fun)...)
kindest regards, LL
Xismy99pal!
 
Posts: 4
Joined: 20. September 2020 19:20
XAMPP version: 3.2.4
Operating System: win7

Re: Stops execution after include statement

Postby Nobbie » 22. September 2020 18:48

Your posting is heavily destroyed, will you please correct it? I cannot read that. We cannot see, where one script/file end and where another starts. Which parts are belonging together, which are included?
Nobbie
 
Posts: 13214
Joined: 09. March 2008 13:04

Re: Stops execution after include statement

Postby Altrea » 22. September 2020 21:51

Nobbie wrote:Your posting is heavily destroyed, will you please correct it? I cannot read that. We cannot see, where one script/file end and where another starts. Which parts are belonging together, which are included?

I have corrected the BBTags for the code.
Should now be much more readable.
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11952
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Stops execution after include statement

Postby Altrea » 22. September 2020 23:53

Okay, so i have tested your three scripts on my development machine and all of them are looking okay.
What is the contents of your HEADER.php?
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11952
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Stops execution after include statement

Postby Xismy99pal! » 23. September 2020 17:33

Hi ALTREA...infinite THX for your quik reply :)))) !
(and thanks to Nobbie for his attempt at viewing my code; apologies for my ineptitude)

Apologies for the incorrect transfer of code; is it not correct to first select the key "code", and then paste into the window?
SO, double-thanks for your efforts to regain usable code!

Double-apologies for omission of HEADER.php, as you suggested; it is attached, and you may have to "clean it up" since I'm doing something in error in the cut & paste procedure...

When (I hope) this snippet also successfully runs, can you kindly describe the results for all pages? I'm assuming there were no run-time errors, and you actually viewed my pages...
Can you confirm, for each page: 1) Red header with my site name in a vertically-aligned font (correct, and intended result), or a font that is slanted (incorrect result)? 2) There is text/material BELOW the header? Immediately below, there should be a navigation row in red letters, and then a page title in a large font.

If these are indeed your results, then can I assume my scripts are OK (yay!), so can you KINDLY ADVISE on what is "wrong"? is my xampp corrupted? (but - EXCEPT for this bizarre, singular situation, runs of all my scripts have gone well (many,many months of work with xampp), and results are as expected!)

I've rerun additional scripts during this period of our discussions, and the results are the same with the inclusion of the "include" statement: a distorted header, and no other material below the header.

Infiniteinfinite thanks for your most kind assistance :))) !
LL

Code: Select all
<!DOCTYPE html>
<html>
<head>
   <meta name="robots" content="noindex,nofollow" />
 
   <title>jdJ.com Header2</title>
   <style>           
      body {width:940px; margin:0 auto; padding:10px;}
      h1 {font-family:"Poller One";font-size:36px;
          text-align:right; padding-right:20px;}   
      .dragon {float:left; width:202px; height:228px; padding-left:10px;}
      .redbox {float:right; width:718px; height:228px; padding-right:10px;
             background-image:linear-gradient(#ff0000, #660000);
             background-image:-o-linear-gradient(#ff0000, #660000);
             background-image:-ms-linear-gradient(#ff0000, #660000);
             background-image:-moz-linear-gradient(#ff0000, #660000);
             background-image:-webkit-linear-gradient(#ff0000, #660000);}             
      mark.green {color:#006600; background:none;}
</style>             
</head>
<body>
    <div class="dragon">
      <img src="https://www.jadedragonjewels.com/dragon_header228.png" alt="small dragon"/>
    </div>
    <div class="redbox">
      <link href="https://fonts.googleapis.com/css?family=Poller+One" rel="stylesheet"/>
      <h1><mark class="green">jade</mark>dragonJewels.com</h1>         
    </div>     
</body>
</html>             

Xismy99pal!
 
Posts: 4
Joined: 20. September 2020 19:20
XAMPP version: 3.2.4
Operating System: win7

Re: Stops execution after include statement

Postby Altrea » 23. September 2020 17:49

So your HEADER.php file contains a full HTML5 boilerplate template?
This cannot produce expected results because you will always get invalid HTML5 code.

The code of your header.php file will get copied and pasted exactly at the place your include line is written.
You cannot use two DOCTYPE tags in the same document, you cannot capsule <html> tags inside another <html> tag, etc.

The included file should only contain the code lines you want to add to your main file(s)
We don't provide any support via personal channels like PM, email, Skype, TeamViewer!

It's like porn for programmers 8)
User avatar
Altrea
AF Moderator
 
Posts: 11952
Joined: 17. August 2009 13:05
XAMPP version: several
Operating System: Windows 11 Pro x64

Re: Stops execution after include statement

Postby Xismy99pal! » 25. September 2020 16:39

HI Altrea...

Truly, INFINITE THANX (!!!) for your diagnosis and CODING advice!
- I know it's not within the "use-of-xampp" directive of which your group (very kindly!) services! I'm at a crucial juncture of my site development, so your kindness is sooo appreciated! thankyouthankyouthankyou!!!

Can you pls reply with your/AF's "coffee fund" info, for a couple of well-earned cups?
--- it's the least I can do, besides sending chocolate bars (of which I'm presently clutching..."a good day is one when no fatal errors are encountered, and/or, less than 1 bottle of pepto-bismol per coding session is necessary" )

LL still thrashing about with scripts, to infinity
Xismy99pal!
 
Posts: 4
Joined: 20. September 2020 19:20
XAMPP version: 3.2.4
Operating System: win7


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 141 guests