I have this file1.php:
<?php
// Start the session
session_start();
?>
<?php
$path_to_check = '';
$needle = $_POST['query'];
foreach(glob($path_to_check . '*.xml') as $filename)
{
foreach(file($filename) as $fli=>$fl)
{
if(strpos($fl, $needle)!==false)
{
echo $filename . ' on line ' . ($fli+1) . ': ' . $fl;
}
}
}
$_SESSION["hit"] = $fli;
header('Location: file2.php');
?>
It gets a searchword from a form and searchs for it among all XML-files in the current directory. The XML-files in this directory are only two; 1.xml and 2.xml.
Say I search for a word occuring in 2.xml, then I would like to save "2.xml" as the variable $_SESSION["hit"] and use it in file2.php:
<?php
// Start the session
session_start();
?>
<?php
echo $_SESSION["hit"];
// Load XML file
$xml = new DOMDocument;
$xml->load($_SESSION["hit"]);
// Load XSL file
$xsl = new DOMDocument;
$xsl->load('stylesheet.xsl');
// Configure the transformer
$proc = new XSLTProcessor;
// Attach the xsl rules
$proc->importStyleSheet($xsl);
echo $proc->transformToXML($xml);
?>
Unfortunately,
echo $_SESSION["hit"];
returns just "2" and not "2.xml", so then
$xml->load($_SESSION["hit"]);
will not load the XML-file 2.xml (since the variable just returns 2).
What am I doing wrong here?
Many thanks in advance:-)
/Paul
<?php
// Start the session
session_start();
?>
<?php
$path_to_check = '';
$needle = $_POST['query'];
foreach(glob($path_to_check . '*.xml') as $filename)
{
foreach(file($filename) as $fli=>$fl)
{
if(strpos($fl, $needle)!==false)
{
echo $filename . ' on line ' . ($fli+1) . ': ' . $fl;
$_SESSION["hit"] = $filename;
}
}
}
header('Location: file2.php');
?>
you need to save the file name in session variable not the line number
Related
How can I get the file content from preg_replace?
<?php
function get($it) {
$r = array("~<script src='(.*?)'></script>~");
$w = array("<script type='text/javascript'>' . file_get_contents($1) . '</script>");
$it = preg_replace($r, $w, $it);
return $it;
}
$it = "<script src='/script.js'></script>";
echo get($it);
?>
It returns <script type='text/javascript'>' . file_get_contents(/script.js) . '</script>
If the path is relative as in your example the file_get_contents won't work but this should get you closer:
function get($it) {
return preg_replace_callback("~<script src='(.*?)'></script>~", function($match){
return "<script type='text/javascript'>" . file_get_contents($match[1]) . '</script>';
}, $it);
}
$it = "<script src='/script.js'></script>";
echo get($it);
The purpose of this code is to identify all the image files from the folder in which the code is being invoked in order to create an image gallery. The images are listed in alphanumeric order but I require a specific order so reordering with a standard PHP array sorting function doesn't meet my needs.
I am using an if statement to place image collections into different arrays then merging the arrays into my required order.
When I run the code as part of my foreach loop it works fine. I want to put the if conditional into a function to reuse the code but I just get a blank page when I copy and paste the code into the function:
// echo statements are just for testing.
foreach(glob(IMAGEPATH."*.{jpg,png,gif,JPG,PNG,GIF}", GLOB_BRACE) as $var03){
$img_src03 = basename($var03);
$img_label03 = pathinfo($var03, PATHINFO_FILENAME);
// Assign specific values to the arrays as you cycle through $img_src03 values:
if (substr($img_src03, 0, 5) == 'ext_f'){
if (!isset($array33)) {
$array33 = array();
}
$array33[] = $img_src03;
echo $img_src03 . ' : Image label = ' . img_label($img_label03) . '<br>';
} elseif (substr($img_src03, 0, 5) == 'ext_r'){
if (!isset($array33)) {
$array33 = array();
}
$array33[] = $img_src03;
echo $img_src03 . ' : Image label = ' . img_label($img_label03) . '<br>';
} elseif (substr($img_src03, 0, 6) == 'ext_po'){
if (!isset($array34)) {
$array34 = array();
}
$array34[] = $img_src03;
echo $img_src03 . ' : Image label = ' . img_label($img_label03) . '<br>';
} elseif (substr($img_src03, 0, 3) == 'bed'){
if (!isset($array35)) {
$array35 = array();
}
$array35[] = $img_src03;
echo $img_src03 . ' : Image label = ' . img_label($img_label03) . '<br>';
} elseif (substr($img_src03, 0, 3) == 'bth'){
if (!isset($array36)) {
$array36 = array();
}
$array36[] = $img_src03;
echo $img_src03 . ' : Image label = ' . img_label($img_label03) . '<br>';
}
}
$arrayFinal = array_merge($array33, $array34, $array35, $array36);
echo 'This is $arrayFinal:<br><pre>'; print_r($arrayFinal); echo '</pre><br>';
When the exact same if conditional is placed inside function findImage03($img_src03, $img_label03), which is located outside the foreach loop, then called from inside the foreach loop the code fails to work.
foreach(glob(IMAGEPATH."*.{jpg,png,gif,JPG,PNG,GIF}", GLOB_BRACE) as $var03){
$img_src03 = basename($var03);
$img_label03 = pathinfo($var03, PATHINFO_FILENAME);
// Trying to use a function call to run the if conditional. Function is outside the foreach loop. Nothing returned.
findImage03($img_src03, $img_label03);
}
function findImage03($img_src03, $img_label03){
// Assign specific values to the arrays as you cycle through $img_src03 values:
if (substr($img_src03, 0, 5) == 'ext_f'){
if (!isset($array33)) {
$array33 = array();
}
$array33[] = $img_src03;
echo $img_src03 . ' : Image label = ' . img_label($img_label03) . '<br>';
} elseif (substr($img_src03, 0, 5) == 'ext_r'){
if (!isset($array33)) {
$array33 = array();
}
$array33[] = $img_src03;
echo $img_src03 . ' : Image label = ' . img_label($img_label03) . '<br>';
} elseif (substr($img_src03, 0, 6) == 'ext_po'){
if (!isset($array34)) {
$array34 = array();
}
$array34[] = $img_src03;
echo $img_src03 . ' : Image label = ' . img_label($img_label03) . '<br>';
} elseif (substr($img_src03, 0, 3) == 'bed'){
if (!isset($array35)) {
$array35 = array();
}
$array35[] = $img_src03;
echo $img_src03 . ' : Image label = ' . img_label($img_label03) . '<br>';
} elseif (substr($img_src03, 0, 3) == 'bth'){
if (!isset($array36)) {
$array36 = array();
}
$array36[] = $img_src03;
echo $img_src03 . ' : Image label = ' . img_label($img_label03) . '<br>';
}
}
$arrayFinal = array_merge($array33, $array34, $array35, $array36);
echo 'This is $arrayFinal:<br><pre>'; print_r($arrayFinal); echo '</pre><br>';
In researching this I think I have found a couple of issues so I'm not sure if this is down to not being a programmer or not.
I found a solution running foreach() in a function() rather than a function() within a foreach(). The new array is then created using the result of the function call.
array_merge() works only if all the arrays being merged hold values otherwise it fails. Not sure if that could be resolved with !isset.
So this is the code running the foreach() in a function() which can be located in an included file for reuse efficiency plus a single source to maintain/update:
// Define the function to get all the images in the current folder:
function getImages(){
foreach(glob(IMAGEPATH."*.{jpg,png,gif,JPG,PNG,GIF}", GLOB_BRACE) as $var){
$img_src = basename($var);
// Assign specific values to the array as you cycle through the collection. Order here will not affect final array order.
if (substr($img_src, 0, 5) == 'bed_1'){
if (!isset($arrayBed_1)) {
$arrayBed_1 = array();
}
$arrayBed_1[] = $img_src;
} elseif (substr($img_src, 0, 5) == 'bed_2'){
if (!isset($arrayBed_2)) {
$arrayBed_2 = array();
}
$arrayBed_2[] = $img_src;
} elseif (substr($img_src, 0, 5) == 'bed_3'){
if (!isset($arrayBed_3)) {
$arrayBed_3 = array();
}
$arrayBed_3[] = $img_src;
// continue for each type required.
} }
} //End of foreach().
// Create the pre final array for other arrays to push to which defines the sort order:
$arrayPreFinal = array();
if (isset($arrayExt_f)){ // ext_f = exterior front
foreach ($arrayExt_f as $val){
array_push($arrayPreFinal, $val);
}
}
if (isset($arrayExt_r)){ // ext_r = exterior rear
foreach ($arrayExt_r as $val){
array_push($arrayPreFinal, $val);
}
}
if (isset($arrayBed_1)){ // bed_1 = bedroom 1
foreach ($arrayBed_1 as $val){
array_push($arrayPreFinal, $val);
}
}
if (isset($arrayBed_2)){ // bed_2 = bedroom 2
foreach ($arrayBed_2 as $val){
array_push($arrayPreFinal, $val);
}
}
// continue for as many variances as require.
return $arrayPreFinal;
} // End of function()
The code run from the folder where the images are located:
// Set $iwd Image Working Directory:
// Required before gallery_ctrl_body.php inlcude as $iwd is needed before include.
// class IWD changes outside the class.
class IWD {
// Properties
public $iwd;
}
$var = new IWD();
$var->name = getcwd();
$iwd = $var->name;
// Script include needs to be run before function pid_text().
include_once ('../gallery_ctrl_body.php');
# Function to identify the property sub-division from directory path characters using preg_match()
# and define a Property ID Text:
function pid_text($sub_div) { //Need parameter/s in function():
$sub_div_abb = sub_div_abb($sub_div); //20200220 code
$psc = 'ORL'; // Start of Property System Code.
$str = getcwd();
if(preg_match("/{$sub_div}/i", $str)) {
$psc = $psc . $sub_div_abb . strtoupper(basename(__DIR__)); //sub_div_abb may already defined in UPPERCASE.
$pid_textname = constant("PROPERTY_TEXT") . $psc; //strtoupper($psc);
}
return $pid_textname; //Return value AFTER IF statement. REQUIRED!
}
$pid_text = pid_text($sub_div = 'test_200828');
// Define the imagepath and variables:
define('IMAGEPATH', dirname(__FILE__).'/'); // '/' is required.
$img_height = 'height: 400px'; // default image height for gallery.
$img_width = 'width: 600px'; // default image width for gallery.
$img_counter = 0;
$img_style = 'style="' . $img_width . '"'; // only needs to be set once here.
$img_total = 0;
// Create the final array with function call to get images:
$arrayFinal = getImages();
// Calculate total number of images before displaying <div>
// If calculated inside a foreach() $img_counter always equals $img_total.
$img_total = count($arrayFinal);
echo '<div class="property_text-container">';
echo 'Gallery for ' . $pid_text;
echo '</div>';
//<!-- Slideshow container -->
echo '<div class="slideshow-container">';
// foreach ($array1 as $value){
foreach ($arrayFinal as $value){
$img_counter ++; // Set before function() when using function call.
// Call the function located in gallery_ctrl_body:
createGallery($img_width, $img_style, $filename, $img_name, $img_src, $img_counter, $img_total, $value, $pid_text);
}
// <!-- Next and previous buttons -->
echo '<a class="prev" onclick="plusSlides(-1)">❮</a>';
echo '<a class="next" onclick="plusSlides(1)">❯</a> ';
echo '</div>';
// <!-- END: div class="slideshow-container"-->
echo '<br>';
// <!-- Dot container -->
echo '<div class="dot-container">';
// <!-- The dots/circles -->
echo '<div style="text-align:center">';
$slide_counter = 0;
while ($slide_counter < $img_total) {
$slide_counter ++;
echo '<span class="dot" onclick="currentSlide(' . $slide_counter . ')"></span> ';
}
echo '</div>';
echo '</div>';
// Script include needs to be run at end of page including it.
include_once ('../gallery_ctrl_script.php');
So, this code works but I'm not sure if it's the correct way or approach. If works for me as I have a set image naming convention and my galleries can be controlled from a single source file. It will work for any number of images, if they exist, in the folder where the function is being called from although my properties generally will have less than 50.
so I am making a web site that allows user to read from a xlsx file sheet and download all the data each in a separate pdf here is the code
<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', true);
// Load Composer's autoloader
require 'vendor/autoload.php';
$file_name="";
//index.php
$message = '';
require_once __DIR__.'/../src/SimpleXLSX.php';
echo '<h1>XLSX to HTML</h1>';
if (isset($_FILES['file'])) {
if ( $xlsx = SimpleXLSX::parse( $_FILES['file']['tmp_name'] ) ) {
$filen=$_FILES['file']['tmp_name'];
echo '<h2>'.$xlsx->sheetName($_POST['sh']-1).'</h2>';
echo '<table border=1>';
$dim = $xlsx->dimension();
$num_cols = $dim[0];
$num_rows = $dim[1];
foreach ( $xlsx->rows($_POST['sh']-1) as $k => $r ) {
// if ($k == 0) continue; // skip first row
echo '<tr>';
if ($k == 0) echo '<td>' .$r[ 0 ]. '</td>';
else
echo '<td>' .substr_replace($r[ 0 ],"",strripos($r[ 0 ]," ")). '</td>';
echo '<td>' .$r[ 1 ]. '</td>';
echo '<td>' .$r[ 2 ]. '</td>';
echo '<td>' .$r[ 4 ]. '</td>';
echo'<td>' . $r[ 5 ]. '</td>';
echo'<td>' . $r[ 7 ]. '</td>';
echo'<td>' .$r[ 8 ] . '</td>';
echo '</tr>';
if ($k != 0) // skip first row
{$date = substr_replace($r[0], "", strripos($r[0], " "));
$factname = $r[1];
$name = $r[2];
$email = $r[4];
$phone = $r[5];
$post = $r[7];
$pack = $r[8];
echo $name;
if ($pack == '90') $garanti = '30 jours';
else if ($pack == '190') $garanti = '6 mois';
else if ($pack == '290') $garanti = '12 mois';
else if ($pack == '390') $garanti = '2 ans';
else if ($pack == '490') $garanti = '3 ans';
else if ($pack == '590') $garanti = '5 ans';
sendmail();
echo'<td>telecharger</td>';}
// echo "telecharger";
}
echo '</table>';
echo '</tr>';
}
echo '</table>';
}
else {
echo SimpleXLSX::parseError();
}
if(isset($_POST['charge'])) {
if (isset($_FILES['file'])) {
if ($xlsx = SimpleXLSX::parse($_FILES['file']['tmp_name'])) {
foreach ($xlsx->rows($_POST['sh']-1) as $k => $r) {
if ($k == 0) continue; // skip first row
$date = substr_replace($r[0], "", strripos($r[0], " "));
$factname = $r[1];
$name = $r[2];
$email = $r[4];
$phone = $r[5];
$post = $r[7];
$pack = $r[8];
if ($pack == '90') $garanti = '30 jours';
else if ($pack == '190') $garanti = '6 mois';
else if ($pack == '290') $garanti = '12 mois';
else if ($pack == '390') $garanti = '2 ans';
else if ($pack == '490') $garanti = '3 ans';
else if ($pack == '590') $garanti = '5 ans';
sendmail();
echo "telecharger";
}
}
echo "telecharger";
}
}
echo '<h2>Upload form</h2>
<form method="post" enctype="multipart/form-data">
*.XLSX <input type="file" name="file" />
<input placeholder="sheet number" name="sh" type="number" required>
<input type="submit" value="Parse" />
</form>';
function sendmail()
{
global $name;
global $file_name;
$file_name="";
echo $file_name;
include('pdf.php');
$pdf = new Pdf();
$file_name = "ORDER-".$name . '.pdf';
$html_code = '<link rel="stylesheet" href="bootstrap.min.css">';
$html_code .= fetch_customer_data();
$pdf->load_html($html_code);
$pdf->render();
$file = $pdf->output();
file_put_contents($file_name, $file);
// $pdf->stream($file_name) ->
}
and this is the pdf.php file
<?php
//pdf.php
require_once 'dompdf/autoload.inc.php';
use Dompdf\Dompdf;
class Pdf extends Dompdf{
public function __construct(){
parent::__construct();
}
}
?>
I want to download all the pdfs at the same time but it only downloads the first one and shows me this error
( ! ) Fatal error: Cannot declare class Pdf, because the name is already in use in C:\wamp64\www\vucrm\xl\simplexlsx-master\examples\pdf.php on line 0
I tried to add exit() at the end of sendmail function but this only download the first and shows no other data or errors
can anyone help thanks in advance
You need to use require_once at the top of your script, don't use include inside the function.
// Require this at the top of your file
require_once('pdf.php');
The issue is each time you call the function, it includes the PDF class again and it can only be declared once.
Downloadable PDF files in html link!
To Download PDF from HTML link using PHP with the help of header() function in php.
The header() function is used to send a raw HTTP header.
Sometimes it wants the user to be prompted to save the data such as generated PDF.
Syntax:
http response headers to download any application
header("Content-Type: application/octet-stream");
http response headers to set composition and file to download
header('Content-Disposition: attachment; filename="downloaded.pdf"');
The length of the requested file need to download
header("Content-Length: " . filesize("download.pdf"));
Reads a file and writes it to the output buffer.
readfile('original.pdf');
PHP codes
$file = $_GET["file"] .".pdf";
// We will be outputting a PDF
header('Content-Type: application/pdf');
// It will be called downloaded.pdf
header('Content-Disposition: attachment; filename="gfgpdf.pdf"');
$imagpdf = file_put_contents($image, file_get_contents($file));
echo $imagepdf;
HTML codes
<!DOCTYPE html>
<html>
<head>
<title>Download PDF using PHP from HTML Link</title>
</head>
<body>
<center>
<h2 style="color:green;">Welcome To GFG</h2>
<p><b>Click below to download PDF</b>
</p>
Download PDF Now</center>
</body>
</html>
Note: Remember that HTTP header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file or from PHP.
Example 1: Save below HTML file as htmllinkpdf.html and save PHP file as downloadpdf.php
Above example to illustrate concept of downloading PDF file using HTML link.
Downloading file appears to be PDF format but without any content which shows error on opening in any application.
See more here
Here is another simple solution in for loop
I am working on a custom Joomla module that returns an LDAP directory with the ability to change sort options on the front end using AJAX.
The getAjax function returns the directory just fine if I call it as a string in the default.php template file (bypassing AJAX):
echo $directoryList;
The problem is when I try to return the variable "$content" through ajax, the directory does not show when changing the selector. However, in the helper.php if I change "return $content" to "return $sortOption", AJAX works and returns the selected option for the sort. So I know AJAX is working. Also note that if I change to "return $content.$sortOption", the select option variable is shown but no directory. I think it has something to do with the LDAP not loading properly through AJAX.
Mod_nu_directory.php
// no direct access
defined('_JEXEC') or die;
// Include the syndicate functions only once
require_once( dirname(__FILE__) . '/helper.php' );
// Instantiate global document object
$doc = JFactory::getDocument();
$js = <<<JS
(function ($) {
$(document).on('change', '#sortDir select', function () {
var value = $('#sortDir option:selected').val(),
request = {
'option' : 'com_ajax',
'module' : 'nu_directory',
'data' : value,
'format' : 'raw'
};
$.ajax({
type : 'POST',
data : request,
success: function (response) {
$('.status').html(response);
}
});
return false;
});
})(jQuery)
JS;
$doc->addScriptDeclaration($js);
$dirDepts = $params->get('dirDepts', 'All');
$dirOptions = $params->get('dirOptions');
$directoryList = modNuDirectoryHelper::getAjax($dirDepts);
require( JModuleHelper::getLayoutPath('mod_nu_directory'));
helper.php
class modNuDirectoryHelper {
public static function getAjax($dirDepts) {
//get the sort variable from the select field using ajax:
$input = JFactory::getApplication()->input;
$sortOption = $input->get('data');
//Set our variables
$baseDN = 'CN=Users,DC=site,DC=local';
$adminDN = "admin";
$adminPswd = "P#55WorD";
$ldap_conn = ldap_connect('ldaps://ad.site.local');
$dirFilter = strtolower('(|(department=*' . implode('*)(department=*', $dirDepts) . '*))');
//if "All" categories are selected, dont add a filter, else add a directory filter
(strpos($dirFilter, 'all directory') !== false) ?
$filter = '(&(objectClass=user)(|(memberof=CN=Faculty,CN=Users,DC=site,DC=local)(memberof=CN=Staff,CN=Users,DC=site,DC=local)))' : $filter = '(&(objectClass=user)(|(memberof=CN=Faculty,CN=Users,DC=site,DC=local)(memberof=CN=Staff,CN=Users,DC=site,DC=local))' . $dirFilter . ')';
ldap_set_option($ldap_conn, LDAP_OPT_PROTOCOL_VERSION, 3);
$ldap_bind = ldap_bind($ldap_conn, $adminDN, $adminPswd);
if (!$ldap_bind) {
return 'Oh no! Unable to connect to the directory :(';
} else {
$attributes = array('displayname', 'mail', 'telephonenumber', 'title', 'department', 'physicalDelivery', 'OfficeName', 'samaccountname', 'wwwhomepage', 'sn', 'givenname');
$result = ldap_search($ldap_conn, $baseDN, $filter, $attributes);
//sort the entries by last name
ldap_sort($ldap_conn, $result, $sortOption);
$entries = ldap_get_entries($ldap_conn, $result);
// let's loop throught the directory
for ($i = 0; $i < $entries["count"]; $i++) {
// define the variables for each iteration within the loop
$userName = $entries[$i]['displayname'][0];
$userTitle = $entries[$i]['title'][0];
$userDept = $entries[$i]['department'][0];
$userPhone = '888-888-8888, ext. ' . $entries[$i]['telephonenumber'][0];
$userOffice = 'Office: ' . $entries[$i]['physicaldeliveryofficename'][0];
//person must have a name, title, and department
if ((!empty($userName)) || (!empty($userTitle)) || (!empty($userDept))) {
$content .= $userName . '<br />'
. $userTitle . '<br />'
. $userDept . '<br />'
. (!empty($userPhone) ? $userPhone : '') . '<br />'
. (!empty($userOffice) ? $userOffice : '') . '<br />'
. '<br />';
}
}
}
return $content;
}
}
default.php
<?php
// No direct access
defined('_JEXEC') or die;
?>
<p>Displaying the following departments:<br />
<?php
foreach ($dirDepts as $dirDept) {
echo '[' . $dirDept . '] ';
}
?>
</p>
<p class="dirOptions">Displaying the following Options:<br />
<?php
foreach ($dirOptions as $dirOption) {
echo '[' . $dirOption . '] ';
}
?>
</p>
<?php
if (in_array('showSort', $dirOptions)) {
?>
<form method="post" id="sortDir">
<select name="sortDir" >
<option value="displayname" selected="selected">First name</option>
<option value="sn">Last name</option>
<option value="department">Department</option>
</select>
</form>
<?php } ?>
<div class="status"></div>
The problem was the $entries array was not being treated as an actual array. I've tested this by substituting the $entry array with a static array and the AJAX callback behaved properly. I since removed the ajax functionality and just echoed the function and works fine. This is not solve why AJAX can't pull the array though.
Here's my piece of code(full body code):
<body>
<script type='text/javascript'>
function AddEvent(Syear, Smonth, Sday, Eyear, Emonth, Eday, hallNumber){
...
}
</script>
<?php
function GetMonthByCoding($first , $second , $third) {
...
}
function GetDateByCoding($coding){
...
}
function GetDateFromLine($line){
...
}
$userid = '...';
$magicCookie = 'cookie';
$feedURL = "...";
$sxml = simplexml_load_file($feedURL);
foreach ($sxml->entry as $entry) {
$title = stripslashes($entry->title);
if ($title == "HALL") {
$summary = stripslashes($entry->summary);
$date = GetDateFromLine($summary);
echo ("<script type='text/javascript' language='JavaScript'> AddEvent(" . $date['start']['year'] . ", " . $date['start']['month'] . ", " . $date['start']['day'] . ", " . $date['end']['year'] . ", " . $date['end']['month'] . ", " . $date['end']['day'] . "); </script>");
}
}
?>
</body>
AddEvent() is JavaScript function defined earlier.
What I get in my browser is:
entry as $entry) { $title = stripslashes($entry->title); if ($title == "HALL") { $summary = stripslashes($entry->summary); $date = GetDateFromLine($summary); echo (""); } } ?>
Looks like it was an echo but as you can see there is no echo right in the middle of foreach.
Can anyone say what I am doing wrong?
PHP is not installed, or it is not enabled, or the file is not a .php file or the server has not been told to recognise it as a file to parse.
Try View Source and you should see all your PHP code. The only reason part of it shows up is because everything from <?php to the first > is considered by the browser to be an invalid tag.
I found the problem, it was in the name of variable sxml. I renamed it and the problem escaped.