Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

using require


lucilue2003

Recommended Posts

Hello,

For my osc cart, i'm providing some live feeed. I was having trouble with this.

 

 

if($_POST['pageName']=='hotSearch')

{

$html = preg_replace("'<table[^>]*?>.*?</table>'si","",$html,'1');

$html = preg_replace ("'<html>.*?<body[^>]*?>'si",require('../design/includes/header2.html'),$html);

}

else

{

$html = preg_replace("'<table[^>]*?>.*?</table>'si","",$html,'1');

$header = require ('header.html');

$header .= require ('../design/includes/header2.html');

$html = preg_replace ("'<html>.*?<body[^>]*?>'si",$header,$html);

}

echo $html;

In the IF conditoin, the require statement causes a 1 to be printed onto the screen and then the contents of html.

However, if i copied everything and just placed it inside with "myinformatoinhere" then it prints just fine without the 1 .

 

How do i get rid of those 1 and 11 ?

 

 

I know that

require returns TRUE(1) on success and FALSE(0) on failure. since I am echoing the output to the browser I'm seeing 1's for each succesful require().

 

but How do i remove that 1 ? can you give me an example please.

Thanks.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...