Skip navigation
omunidades
Currently Being Moderated

error during execution

Mar 17, 2013 12:15 PM

Because this line is giving error:

 

Notice: Undefined index: pagina in E:\wamp\www\html\conteudo.php on line 11.

 

Line 11 switch ($_GET['pagina'])

 

And

 

SCREAM: Error suppression ignored for

 
Replies
  • Currently Being Moderated
    Mar 17, 2013 12:31 PM   in reply to omunidades

    I have the same problem...

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 17, 2013 1:07 PM   in reply to omunidades

    Your post looks truncated.  Can you try again, please?

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 17, 2013 2:44 PM   in reply to omunidades

    switch ($_GET['pagina'])

     

    Are you calling this page with a URL variable (for example <a href="page_name.php?pagina=12"...)?

     

    ERROR 2>        SCREAM: Error suppression ignored for,

     

    What is the rest of this error message?

     

    Have you tried reading the hits when you google this phrase - scream error suppression ignored for?

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 17, 2013 3:46 PM   in reply to omunidades

    Please give me a link to the page so I can see for myself what is happening.

     

    Also, this code is incorrect -

     

    case 'servicos';

              include "servicos.php";

              break;

     

              case 'contato';

              include "contato.php";

              break;

     

    It should be this -

     

    case 'servicos':

              include "servicos.php";

              break;

     

              case 'contato':

              include "contato.php";

              break;

     

    Finally, is this ACTUALLY in the page's code?

     

    ======================

              line 11    ==>        switch ($_GET['pagina'])  {

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

             Notice: Undefined index: pagina in E:\wamp\www\html\conteudo.php on line 11.

    ============================

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 17, 2013 4:51 PM   in reply to omunidades

    Thank you!

     

    How is this page being loaded? Some other page must link to it with a URL variable specified, e.g., <a href="conetudo.php?pagina=contato">Contato</a>. Please tell me what that code is for the link.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 17, 2013 9:39 PM   in reply to omunidades

    You've got the question mark on the wrong side:

     

    <a href = " conetudo.php pagina? = Contato "> Contato </ a>

     

    should be

     

    <a href = "conetudo.php?pagina=Contato"> Contato </ a>

     

    You should also be testing if the querystring value is set and if not, generate a friendly error message, rather than allowing a runtime error.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 18, 2013 5:27 AM   in reply to omunidades

    I wonder why you are doing it this way in the first place.  There's no benefit to you other than making things much more complicated.

     

    In addition, your CSS is improperly placed on the page -

     

    </head>

    <?php

    include "css.php";

    ?>

    <body>

     

    Nothing should go between the </head> and the <body> tags.

     

    Finally, your css.php file contains spurious HTML (it's as if you would want the css.php page to be a stand-alone HTML page) - that's not going to work at all. It should be only this -

     

    <link href="css/topo.css" rel="stylesheet" type="text/css" />

    <link href="css/conteudo.css" rel="stylesheet" type="text/css" />

    <link href="css/rodape.css" rel="stylesheet" type="text/css" />

     

    I'll say again, this scheme is grossly overcomplicated. There's no reason to have all of this redirection and all of these files, when simple flat files would work fine.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 18, 2013 5:50 PM   in reply to omunidades

    Let me speak candidly (frankly). This is an absurd way for someone who has 'very little knowledge of HTML and CSS' to build this site. It's like trying to go from Venice to Rome by way of Barcelona.

     

    Each page on your site should be a derivative of this 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=utf-8" />

    <title>JOSE FERREIRA DA SILVA</title>

    <link href="css/topo.css" rel="stylesheet" type="text/css" />

    <link href="css/conteudo.css" rel="stylesheet" type="text/css" />

    <link href="css/rodape.css" rel="stylesheet" type="text/css" />

    </head>

     

    <body>

    <div id="geral_conteudo">

              <div id="box_left">

        <ul>

                  <li><a href="home.html">Home</a></li>

                  <li><a href="servicos.html">Serviços</a></li>

                  <li><a href="contato.html">Contato</a></li>      

        </ul>

        </div>

        <div id="box_right">

        <h2>Box direito</h2>

        </div>

    </div>

    </body>

    </html>

     

    There are no tricky includes, no PHP, everything is straight forward and simple. There is no need and definitely no benefit to the contorted approach you have posted here, particularly for someone who is just learning!

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 19, 2013 5:05 AM   in reply to omunidades

    Sorry - I do not understand this post.

     
    |
    Mark as:
  • Currently Being Moderated
    Mar 19, 2013 7:58 AM   in reply to omunidades

    >I have very little knowledge of HTML and CSS.

     

    What is it you are trying to learn? What tutorial are you following?

     

    It generally a good idea to have a solid knowledge of HTML and CSS before learning PHP or other scripting language. I'd suggest learning to walk before you run.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)