Thread: Index.php

    #1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Location
    On planet earth
    Posts
    101
    Rep Power
    11

    Index.php


    During my sabbatical of php web development and because I couldn't get my head around php and css (unbelievable now), I got a "web designer" to design a page for me, at least that is what I thought...

    He sent me the design with an index.php which includes the following code, all I know by the looks of it, it determines if you are using ssl or not, if either it redirects to the appropriate page
    PHP Code:
    <?php        if (!empty($_SERVER['HTTPS']) && ('on' == $_SERVER['HTTPS'])) { 
              
    $uri 'https://';  
    } else {           
    $uri 'http://';                   }   
         
    $uri .= $_SERVER['HTTP_HOST'];    
        
    header('Location: '.$uri.'website address etc');   

         exit; 
    ?>    
     Something is wrong with the XAMPP installation :-(
    I can't get this to work on either localhost or remote where I am testing the designer's style
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2003
    Posts
    3,572
    Rep Power
    595
    I don't understand. Why do you not have the designer debug it?
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  4. #3
  5. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Location
    On planet earth
    Posts
    101
    Rep Power
    11
    Because his phone number isn't working etc..

    On another note: Can I use index.php without needing "redirecting"
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Expert (3500 - 3999 posts)

    Join Date
    Jul 2003
    Posts
    3,572
    Rep Power
    595
    You can but should you? There is no way to know without understanding what your objectives are or what kind of data you are using. It sounds like you are not yet sufficiently versed in PHP to really understand what this code is doing. Presumably you had to pay for this development so it is unlikely you will find someone here willing to debug it for you for free. Help you do it yourself, yes. I suggest you ask for help in the Hire a Programmer forum.
    There are 10 kinds of people in the world. Those that understand binary and those that don't.
  8. #5
  9. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Location
    On planet earth
    Posts
    101
    Rep Power
    11
    Correct, I'm not well versed but I don't want to hire a developer as all I want to do is to understand what index.php

    I have restarted to develop my own site because my main weakness was CSS, nothing else, by the looks of things I was well taught in my college on PHP but since it was only a six weeks course and a few hours per week. I do not intend to hire a programmer since the one I hired in the summer turned out to be a quack, and I'm in no way wanting to get burnt twice. Since I now have sufficient knowledge, but don't get this php code given in my first post
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2009
    Posts
    696
    Rep Power
    7
    Well, you state this is not working. In what manner is this not working? What IS it doing? To find such answer, I would start by commenting out there actions within the if/then's and simply put an echo in each one just to see if the one intended is the one being executed.

    Comments on this post

    • cssbonding agrees : you are a genius, now found out where I was going wrong
  12. #7
  13. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Location
    On planet earth
    Posts
    101
    Rep Power
    11
    Originally Posted by Triple_Nothing
    Well, you state this is not working. In what manner is this not working? What IS it doing? To find such answer, I would start by commenting out there actions within the if/then's and simply put an echo in each one just to see if the one intended is the one being executed.
    Good point, thanks for your help

IMN logo majestic logo threadwatch logo seochat tools logo