www.webdeveloper.com
Results 1 to 3 of 3

Thread: Really new to PHP and need some basic guidance

  1. #1
    Join Date
    Feb 2014
    Posts
    1

    Really new to PHP and need some basic guidance

    Hi all,
    Im very new to php I'm working on my header.php file.
    Ive added title tags but i'm unsure how to add meta description for each unique page (in the header.php).
    what ive done so far is:

    Code:
    <?
    $page = $_SERVER['REQUEST_URI'];
    $pageClass = 'zero';
    //default:
    $pageTitle = "example, example, example";
    
    $pos = strrpos($page, "test");
    if ($pos !== false) {
        $pageClass = "one";
    	$pageTitle = "example, example, example";
    }
    $pos = strrpos($page, "test2");
    if ($pos !== false) {
        $pageClass = "two";
    	$pageTitle = "example, example, example";
    }
    $pos = strrpos($page, "test3");
    if ($pos !== false) {
        $pageClass = "three";
      $pageTitle = "example, example, example";
    }
    $pos = strrpos($page, "test4");
    if ($pos !== false) {
        $pageClass = "four";
    	$pageTitle = "example, example, example";
    }
    $pos = strrpos($page, "test5");
    if ($pos !== false) {
        $pageClass = "five";
    	$pageTitle = "example, example, example";
    }
    $pos = strrpos($page, "test6");
    if ($pos !== false) {
        $pageClass = "six";
    	$pageTitle = "example, example, example";
    }
    $pos = strrpos($page, "test7");
    if ($pos !== false) {
        $pageClass = "seven";
    	$pageTitle = "example, example, example";
    }
    $pos = strrpos($page, "test8");
    if ($pos !== false) {
        $pageClass = "eight";
    	$pageTitle = "example, example, example";
    }
    
    
    ?>
    Any help would be very appreciated,

    Thanks, Nick

  2. #2
    Join Date
    Jul 2013
    Location
    Voorheesville NY USA
    Posts
    868
    I have no idea what you are trying to do here. What is this block of code supposed to accomplish for you?

  3. #3
    Join Date
    Feb 2014
    Location
    Canada
    Posts
    155
    You haven't added any title tags unless they're elsewhere in that file. What is it that you're trying to do and that your piece of code is meant to do?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles