Originally posted by mrhappiness
the meta tags reside in header.php?

Than why don't you evaluate $_GET['id'] in header.php?

ofcourse the meta tags r in the header is there another option
and what is $_GET['id']
please give me an example

    Originally posted by rigid
    ofcourse the meta tags r in the header is there another option

    meta tags have to be in the head of the html file generated

    if you generate the html head (<head>...</head>) inside header.php than you have to generate the meta tags there as well

    and what is $_GET['id']

    i don't know but you should.
    you already use it in your index.php owner...

      well can some one help me with the ($_GET['id']) thing
      this mayb write an example of how can i use it
      and of how can i use it for my problem here

        in header.php

        switch ($_GET['id']) {
          case 'login':
            echo '<meta name="description" content="my login page" />';
            break;
          case 'profile':
            echo '<meta name="description" content="my profile page" />';
            break;
          case 'contact':
            echo '<meta name="description" content="you can contact me using the form on this very page" />';
            break;
          default:
            echo '<meta name="description" content="you\\'re visiting a page i don\\'t have a meta tag for" />';
        }
          15 days later

          yo guys
          i wrote this lil scripty

          <?php 
          $page = $_GET[id];
          function meta($id)
          {
          switch ($id) {
          case 'home':
          echo '<title> test12 </title>';
          break;
          default:
          echo '<title> test1 </title>';
          }
          }
          print $meta;
          ?>
          

          and it dosnt seem to work
          i call a page this way: index.php?id=home
          and anyway
          this way unless i can use the wildcard "*" (which i think i can
          t)
          is too long and not good enough because some pages i call in the old way of just naming the php file

          can`t i put a variable in the main pages and it will read it in the header and put in the according meta tags and title
          can some 1 write m a example like this
          (sry i am pro at Visual Basic Pascal & Assembler but php is not my strong side)

            Originally posted by rigid
            yo guys
            i wrote this lil scripty

            <?php 
            $page = $_GET[id];
            function meta($id)
            {
            switch ($id) {
            case 'home':
            echo '<title> test12 </title>';
            break;
            default:
            echo '<title> test1 </title>';
            }
            }
            print $meta;
            ?>
            

            and it dosn`t seem to work[/b]

            $meta is a variable, meta() is a function. It's a good idea to remember the difference.

            <?php 
            $page = $_GET[id];
            function meta($id)
            {
            switch ($id) {
            case 'home':
            echo '<title> test12 </title>';
            break;
            default:
            echo '<title> test1 </title>';
            }
            }
            
            meta();
            ?>
            

              well i guess it fixed some of it
              but now it gives m error

              Warning: Missing argument 1 for meta() in /home/.calpurnia/vadimku/_website/header.php on line 104
              line 104 contains

              function meta($id)
              

              and it seem to show default only

                Originally posted by rigid
                well i guess it fixed some of it
                but now it gives m error

                Warning: Missing argument 1 for meta() in /home/.calpurnia/vadimku/_website/header.php on line 104
                line 104 contains

                function meta($id)
                

                and it seem to show default only [/B]

                meta($page);

                instead of

                meta();

                Recognising problems like this yourself and fixing them will become a lot easier once you get a bit more programming experience behind you. Meantime, I'll just direct you to http://www.php.net/functions.

                  Originally posted by rigid

                  this way is very long and not good enough because some pages i call in the old way of just naming the php file
                  and ofcourse i have a huge load of pages i cant make a case for every one of them
                  and like i understand whiledcard '*' dosn
                  t work (or am i wrong about this how can i use wildcard here )

                  can`t i do this some other waylike put a variable in the main pages and it will read it in the header and put in the according meta tags and title
                  can some 1 write m a example like this
                  (sry i am pro at Visual Basic Pascal & Assembler but php is not my strong side)

                    (You can read a directory, load all its filenames into an array, and then see if the requested page is in the array).

                    Can't help with example code. I don't know what your '*' wildcard is supposed to do.

                    I didn't know there were still professional Assembler programmers out there. How quaint.

                      Originally posted by Weedpacket
                      (You can read a directory, load all its filenames into an array, and then see if the requested page is in the array).

                      Can't help with example code. I don't know what your '*' wildcard is supposed to do.

                      I didn't know there were still professional Assembler programmers out there. How quaint.

                      yea i will think of thisand find a way
                      but the problem is still there
                      cause most of my site isnt called the $_GET[id]
                      it is called the normal way
                      so it means i can
                      t put in the custom title in there and it uses the defult 1
                      what should i do

                        Originally posted by rikmoncur
                        tutorial

                        omfg y couldn`t ya all tell m this simple thing before
                        did no 1 here knew this
                        lol

                          Write a Reply...