Jump to content
Fórum Script Brasil
  • 0

Tipos De Php Incluido ?


Guest --Flavio --
 Share

Question

Guest --Flavio --

Qual são os tipos de php incluidos melhor pra usar em uma pagina ??

existe um php incluido assim: ele abre qualquer pagina tipo um Iframe, mais sendo PHPIncluido

Obrigado.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0
Guest Visitante

eu tenho um sistema de gerenciamento de downloads ele e assim : www.meusite.com.br/down/gerenciador_de_downloads/index.php.

e eu quero coloca ele no meio do meu site, eu tentei pelo php incluido mais deu um erro. Eu acho que a pagina ta blockiado pra abri por esse php incluido.

Pod me ajuda a coloca o gerenciador no meio ?

Link to comment
Share on other sites

  • 0

Dê mais detalhes. O que seria esse "PHP Incluído"? Você está usando a função include()? É isso?

Qual erro aparece?

Para fazer aparecer no meio da página, basta colocar o include no local adequado. Poste o código, para entendermos melhor.

Link to comment
Share on other sites

  • 0
Guest Visitante

Vo dar o maximo de delalhes.

Eu instalei o programa de Gerenciador de Downloads, o pafiledb, ele abre assim

http://meusite.com.br/privado/pafiledb/pafiledb.php, ele abre eu uma tela so pra ele.

eu queria que ele abrice, no meio do meu site, com o php incluido, eu fiz assim:

php includo:

<?php if(isset($page)) { include ("$page.php");} else{ include ("news.html"); } ?>

index.php?page=privado/pafiledb/pafiledb

---------------------------------- e da um erro assim, quando eu abro:

Warning: session_start() [function.session-start]: open(./sessions/sess_58084bba6f20f67423c8877c3e7b8aa6, O_RDWR) failed: No such file or directory (2) in /home/baixabr2/public_html/privado/pafiledb/pafiledb.php on line 43

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/baixabr2/public_html/index.php:16) in /home/baixabr2/public_html/privado/pafiledb/pafiledb.php on line 43

Warning: main(./includes/mysql.php) [function.main]: failed to open stream: No such file or directory in /home/baixabr2/public_html/privado/pafiledb/pafiledb.php on line 55

Warning: main(./includes/mysql.php) [function.main]: failed to open stream: No such file or directory in /home/baixabr2/public_html/privado/pafiledb/pafiledb.php on line 55

Fatal error: main() [function.require]: Failed opening required './includes/mysql.php' (include_path='.:/usr/local/lib/php') in /home/baixabr2/public_html/privado/pafiledb/pafiledb.php on line 55

Warning: Unknown(): open(./sessions/sess_58084bba6f20f67423c8877c3e7b8aa6, O_RDWR) failed: No such file or directory (2) in Unknown on line 0

Warning: Unknown(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (./sessions) in Unknown on line 0

------------------------------------------------------------------

o que deve esta impedindo eu coloca a pagina dos downloads no meio do meu site ??

Link to comment
Share on other sites

  • 0

Nunca usei esse gerenciador que você falou, mas ele deve estar usando sessions, e a função session_start() deve ser chamada sempre antes de qualuqer saída HTML, no início do script PHP. Você terá que dar uma analisada nos códigos e colocar essas funcções no local adequado.

Nota: Se você está usando sessões baseadas em cookie, você deve chamar session_start() antes de qualquer coisa ser exibida para o navegador.

Fonte: http://www.php.net/session_start

Antes de usar a variável $page, crie-a desta forma:

$page = i$_GET['page'];

$page só existirá automaticamente se register_globals estiver ativado. ;)

Abraços,

Beraldo

Link to comment
Share on other sites

  • 0
Guest Visitante

Ola,

Na index consta as session sim la esta assim:

session_save_path("./sessions");
session_start();
E tem uma pasta dentro do script que chama sessions e eu presisei da CHMOD 777. E o codigo que você disse logo acima, e esse ?
<?php 
$page = $_GET['page'];
if(isset($_GET['page'])) { include ("$page.php");} else{ include ("news.html"); } ?>

Pelo o que deu pra eu entender, eu tenho que colocar os codigos e as funcções no local adequado. Mais como eu faço isso ?

Aguardo Respostas

Obrigado.

Flavio

Link to comment
Share on other sites

  • 0
Guest Visitante

a index seria essa aqui:

<?php
/*
  paFileDB 3.0
  ©2001 PHP Arena
  Written by Todd
  [email protected]
  http://www.phparena.uni.cc
  Keep all copyright links on the script visible
  Please read the license included with this script for more information.
*/
if (file_exists("./install.php")) { die("Error: The file install.php (paFileDB installer) still exists on the server! This is a security risk! Please delete the file to continue using paFileDB."); }
/* this section is for Global Vars should they get turned off 
 $action = $_GET['action']; 
 if (empty($action)) {$action = $_POST['action'];}  
 $file = $_GET['file']; 
 if (empty($file)) {$file = $_POST['file'];}  
 $id = $_GET['id']; 
 if (empty($id)) {$id = $_POST['id'];}  
 $login = $_GET['login']; 
 if (empty($login)) {$login = $_POST['login'];}  
 $ad = $_GET['ad']; 
 if (empty($ad)) {$ad = $_POST['ad'];}  
 $edit = $_GET['edit']; 
 if (empty($edit)) {$edit = $_POST['edit'];}  
 $logged = $_POST['logged']; 
 $formpass = $_POST['formpass']; 
 $formname = $_POST['formname']; 
 $delete = $_GET['delete']; 
 if (empty($delete)) {$delete = $_POST['delete'];}  
 $upload = $_POST['upload']; 
 $add = $_POST['add']; 
 $select = $_GET['select']; 
 if (empty($select)) {$select = $_POST['select'];}  
 $category = $_GET['category']; 
 if (empty($category)) {$category = $_POST['category'];}  
 $rate = $_POST['rate']; 
 $rating = $_POST['rating']; 
 end of global vars */
$starttime = microtime();    
$starttime = explode(" ",$starttime);
$starttime = $starttime[1] + $starttime[0];
session_save_path("./sessions");
session_start();

$logged = "";
if ($action == "download") {
    ob_start();
    require "./includes/mysql.php";
    $pafiledb_sql->connect($db);
        $config = $pafiledb_sql->query($db,"SELECT * FROM $db[prefix]_settings",1);
    include "./includes/download.php";
    ob_end_clean();
    exit();
}
require "./includes/mysql.php";
require "./includes/functions.php";
$pafiledb_sql->connect($db);
$config = $pafiledb_sql->query($db,"SELECT * FROM $db[prefix]_settings",1);
require "./lang/$config[13].php";
include "./includes/admin/auth.php";
if ($logged == 1 && $ad == "backupdb") {
    include "includes/admin/backupdb.php";
    exit();
}
?>
<html>
<head>
<!--If you're actually reading these comments, then you need a life....................-->
<title>paFileDB 3.0</title>
<style type="text/css">
<?php include "./styles/$config[11]/style.css"; ?>
</style>
&lt;script language="JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
</script>
</head>
<body>
<center>
<!--Begin main table-->
<table width="100%" height="99%" border="0" cellpadding="2" cellspacing="0" bgcolor="#FFFFFF" class="table">
<tr>
<td width="100%" height="100%" valign="top">
<!--Begin header table-->
<table width="100%" height="100" border="0" cellpadding="2" cellspacing="0" class="table">
<tr>
<td width="25%" valign="center" align="center">
<a href="pafiledb.php"><img src="styles/<?php echo $config[11]; ?>/images/logo.gif" border="0"></a>
</td><td width="75%" valign="center" align="right">
<a href="pafiledb.php?action=search"><img src="styles/<?php echo $config[11]; ?>/images/search.gif" border="0"></a>  <a href="pafiledb.php?action=stats"><img src="styles/<?php echo $config[11]; ?>/images/stats.gif" border="0"></a>  <a href="<?php echo $config[5]; ?>"><img src="styles/<?php echo $config[11]; ?>/images/homepage.gif" border="0"></a>
</td></tr></table>
<!--End header table-->
<!--Begin page table-->
<?php
if ($logged == 1 && $ad != "logout") {
    $width = 100;
} else {
    $width = 80;
}
?>
<table width="<?php echo $width; ?>%" height="30" border="0" cellpadding="2" cellspacing="0" class="table" align="center">
<tr>
<td width="100%" valign="top" align="left" colspan="2">
<?php
switch ($action) {
    case category:
        include "./includes/category.php";
    break;
    case file:
        include "./includes/file.php";
    break;
    case viewall:
        include "./includes/viewall.php";
    break;
    case search:
        include "./includes/search.php";
    break;
    case license:
        include "./includes/license.php";
    break;
    case rate:
        include "./includes/rate.php";
    break;
    case admin:
        include "./includes/admin.php";
    break;
    case email:
        include "./includes/email.php";
    break;
    case stats:
        include "./includes/stats.php";
    break;
    default:
        include "./includes/main.php";
    break;
}
?>
</td></tr>
<tr>
<td width="50%" align="left">
<?php jumpmenu($db,$HTTP_SERVER_VARS['REQUEST_URI'],$pafiledb_sql,$str); ?>
</td><td width="50%" align="right"><?php echo "$str[time] $config[8]"; ?></td></tr></table>
<!--End page table-->
<!--Begin footer table-->
<table width="100%" height="30" border="0" cellpadding="2" cellspacing="0" class="footer">
<tr>
<td width="100%" valign="center" align="center">
<?php echo $str[power]; ?> <br> <a href="" class="small" target=""></a>
</td></tr>
<tr><td width="100%" valign="center" align="center">
<?php
$endtime = microtime();
$endtime = explode(" ",$endtime);
$endtime = $endtime[1] + $endtime[0];
$stime = $endtime - $starttime;
if ($config[12] == 1) {
?>
<table width="30%" border="1" cellpadding="2" class="stats" bordercolor="#000000">
<tr><td width="50%" align="left"><?php echo $str[exectime]; ?>:</td><td width="50%" align="right"><?php echo round($stime,4); ?> Seconds</td></tr>
<tr><td width="50%" align="left"><?php echo $str[numqueries]; ?>:</td><td width="50%" align="right"><?php echo $query_count; ?> Queries</td></tr>
</table>
<?php
if ($showqueries == 1) {
    ?>
    <p>
    <table width="100%" border="1" cellpadding="2" class="headertable" bordercolor="#000000">
    <tr><td width="100%" class="headercell" align="center"><b>Queries Used</b></td></tr>
    <?php echo $queries_used; ?>
    </table>
<?php
}
}
?>
</table>
<!--End footer table-->
<!--End main table-->
</td></tr></table>

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Forum Statistics

    • Total Topics
      149.8k
    • Total Posts
      646.7k
×
×
  • Create New...