Jump to content

PHP Include


Rúben Periquito Developer

Recommended Posts

onde está aqui o erro?

ando há horas com isto:

 

index.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<?php include('allsection.php'); ?>

<?php echo $head_section; ?>

<body>

<?php echo $body; ?>

<?php echo $content; ?>

<?php echo $footer; ?>

</body>

</html>"

 

allsections.php:

<?php

$head_section = '<head>
    <title>Sample</title>    
    <link rel="stylesheet" href="style.css" type="text/css" />
</head>';

$body =    "<div id="header">
        <h1>My Website</h1>
    </div>
    <div id="navigation">
        <ul>
            <li><a href="section1.php">Section 1</a></li>
            <li><a href="section2.php">Section 2</a></li>
            <li><a href="section3.php">Section 3</a></li>
            <li><a href="section4.php">Section 4</a></li>
            <li><a href="coming.php">Coming Soon</a></li>
        </ul>
    </div>";

$content = '<div id="content">
        Welcome! Choose a section on the menu...
    </div>'

$footer = '<div id="footer">
        <p>Copyright © <a href="#">My company</a> 2014 | Designed by Myself | Sponsored by my friends | Valid <a href="http://jigsaw.w3.org/css-validator/">CSS</a> & <a href="http://validator.w3.org/">XHTML</a></p>
    </div>'

?>

Rúben Periquito 

Link to comment
Share on other sites

Em 12/05/2020 às 21:00, tiago.f disse:

E que erro te dá?

...e, para começar, põe lá


;

no final de cada instrução, que tens aí umas sem ele...

e decide se será "allsections.php" ou "allsection.php"...

já consegui avançar nessa parte mas agora estou "encalhado" em um login.php....

aparece-me este erro: 

pode ajudar?

Citação

 

Acesso Proibido!

Você não tem permissão para acessar o objeto requisitado. Ele pode estar protegido contra leitura ou não ser legível pelo servidor.

Se você acredita ter encontrado um problema no servidor, por favor entre em contato com o webmaster.

Error 403

localhost
Apache/2.4.43 (Win64) OpenSSL/1.1.1g PHP/7.4.5

Rúben Periquito 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.