Wrox Programmer Forums
Go Back   Wrox Programmer Forums > PHP/MySQL > PHP How-To
|
PHP How-To Post your "How do I do this with PHP?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 23rd, 2005, 11:57 AM
cli cli is offline
Authorized User
 
Join Date: May 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default Problem with include or require

Problem with include or require...

Hi to all i've a problem with variables and include or require function...

I have a page index.php:
Code:
<?php 

require_once('Connections/feeling.php');
require('index1.htm');
?>
the code for the page index.htm:
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link href="css/stile.css" rel="stylesheet" type="text/css" />
<?php $sez = 1; ?> 
</head>

<body>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
                              <tr>
                                <td height="350"><? require('menu2.php');?></td>
                              </tr>
                          </table></td>
                        <td class="td-10px">&nbsp;</td>
                        <td><? include('central_bound.php');?>&nbsp;</td>
                        <td class="td-10px">&nbsp;</td>
                        <td class="td-300px"><? require('visual_menu.php');?></td>
                      </tr>
                  </table</body>
</html>
as you see i've included another time <? include('central_bound.php');?> into the page index1.htm

the page central_bound.php as code:
Code:
<?php if ( $sez === 1){
echo'
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td class="testo-di-navigazione">--Community News </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td><iframe src="news.php" width="440" height="350" frameborder="0">&nbsp;</iframe>
    </td>
  </tr>
</table>';
}else{
echo "HI TO ALL";
}

?>
i have a problem to see the variable $size it check the condition but he show only HI TO ALL instead of the i frame with the page news.php....



 
Old May 24th, 2005, 05:25 AM
Friend of Wrox
 
Join Date: Mar 2004
Posts: 357
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to anshul
Default

If your problem is >> Problem with include or require...
use set_include_path('/~path~to~directory')
If using Windows start from drive letter like:
set_include_path('c:/~path~to~directory')

This is a way of setting include_path per script basis.
You can also set this per directory basis, if using .htaccess/Apache.
Quote:
quote:php_value include_path c:/Inetpub/wwwroot/me
php_value include_path /me
php_value include_path ./

 
Old May 24th, 2005, 11:15 AM
cli cli is offline
Authorized User
 
Join Date: May 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Done, perfect anshul as always thanks :D






Similar Threads
Thread Thread Starter Forum Replies Last Post
Associating RegularExpressionValidator and Require belete ASP.NET 2.0 Basics 0 October 20th, 2007 10:26 AM
require attribute - all but... kfir XML 2 May 28th, 2006 09:45 AM
difference between include file & include virtual crmpicco Classic ASP Basics 2 January 23rd, 2006 11:50 AM
Problem with #Include Virtual vinod_pawar1 ASP.NET 1.0 and 1.1 Professional 1 December 22nd, 2005 12:59 PM
include() vs require() kc5f Beginning PHP 2 May 23rd, 2004 10:04 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.