PHP Template

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • KevinM2k

    #1

    PHP Template

    Hi,

    I am trying to have 1 template site and have an unlimited number of
    websites
    using this template site to call there own information.

    The sites are exactly the same except for the database, each of the
    sites
    also needs there own URL, for example one of these urls may be
    www.example1.com and the other www.example2.com. These sites are
    identical
    apart from the database they call to, one will call to a database
    called
    example1 and the other example2. I want another site (for example
    www.solution.com) to read what url has been entered and to pull in the
    database for that site (either example1 or example2) and show that
    information. I have tried using the CURL library without success (not
    sure
    how to use it fully) and have tried using frames but had loads of
    problems
    regarding losing session data. can anyone help?

    Thanks
    Kev

  • Erwin Moller

    #2
    Re: PHP Template

    KevinM2k wrote:
    Hi,
    >
    I am trying to have 1 template site and have an unlimited number of
    websites
    using this template site to call there own information.
    >
    The sites are exactly the same except for the database, each of the
    sites
    also needs there own URL, for example one of these urls may be
    www.example1.com and the other www.example2.com. These sites are
    identical
    apart from the database they call to, one will call to a database
    called
    example1 and the other example2. I want another site (for example
    www.solution.com) to read what url has been entered and to pull in the
    database for that site (either example1 or example2) and show that
    information. I have tried using the CURL library without success (not
    sure
    how to use it fully) and have tried using frames but had loads of
    problems
    regarding losing session data. can anyone help?
    Hi,

    The reason you loose your sessiondata is simple: The sessionid is stored in
    a cookie together with the domain it belongs to.
    Every request to a certain domain send along the cookie, and the possible
    ppsessid, and so the server can see if it has a session belonging to that
    user.
    Imagine what happens if this was not implemented like this (as in early
    versions of Netscape): You have 2 windows open, one on
    www.wehackforfun.com, and one to your companies intranet. If both sites
    receive all cookies, the former one can easily 'steal your session' to your
    company's intranetsite, simply by reading the name and value of the
    cookie...

    If you have 2 different domains, they cannot share a session. (Well, they
    can, but that is less straightforward .)

    Bottomline, don't try to share sessions across different domains.

    If this is really a requirement, you can set this up only if you own both
    sites, and let them use a common session storageplace (database eg), AND
    let both sites explicitely send the sessionid around via GET, because the
    cookie will not work.
    I am not sure if that is wise, but it can be done.


    Regards,
    Erwin Moller
    >
    Thanks
    Kev

    Comment

    • KevinM2k

      #3
      Re: PHP Template


      Erwin Moller wrote:
      KevinM2k wrote:
      >
      Hi,

      I am trying to have 1 template site and have an unlimited number of
      websites
      using this template site to call there own information.

      The sites are exactly the same except for the database, each of the
      sites
      also needs there own URL, for example one of these urls may be
      www.example1.com and the other www.example2.com. These sites are
      identical
      apart from the database they call to, one will call to a database
      called
      example1 and the other example2. I want another site (for example
      www.solution.com) to read what url has been entered and to pull in the
      database for that site (either example1 or example2) and show that
      information. I have tried using the CURL library without success (not
      sure
      how to use it fully) and have tried using frames but had loads of
      problems
      regarding losing session data. can anyone help?
      >
      Hi,
      >
      The reason you loose your sessiondata is simple: The sessionid is stored in
      a cookie together with the domain it belongs to.
      Every request to a certain domain send along the cookie, and the possible
      ppsessid, and so the server can see if it has a session belonging to that
      user.
      Imagine what happens if this was not implemented like this (as in early
      versions of Netscape): You have 2 windows open, one on
      www.wehackforfun.com, and one to your companies intranet. If both sites
      receive all cookies, the former one can easily 'steal your session' to your
      company's intranetsite, simply by reading the name and value of the
      cookie...
      >
      If you have 2 different domains, they cannot share a session. (Well, they
      can, but that is less straightforward .)
      >
      Bottomline, don't try to share sessions across different domains.
      >
      If this is really a requirement, you can set this up only if you own both
      sites, and let them use a common session storageplace (database eg), AND
      let both sites explicitely send the sessionid around via GET, because the
      cookie will not work.
      I am not sure if that is wise, but it can be done.
      >
      >
      Regards,
      Erwin Moller
      >

      Thanks
      Kev
      Do you have any suggestions on any other way to do this then because I
      am completely stuck for ideas.

      Thanks

      Comment

      • KevinM2k

        #4
        Re: PHP Template


        Michael Vilain wrote:
        In article <1161769951.874 091.200460@e3g2 000cwe.googlegr oups.com>,
        "KevinM2k" <kevinm2k@yahoo .co.ukwrote:
        >
        Erwin Moller wrote:
        KevinM2k wrote:
        >
        Hi,

        I am trying to have 1 template site and have an unlimited number of
        websites
        using this template site to call there own information.

        The sites are exactly the same except for the database, each of the
        sites
        also needs there own URL, for example one of these urls may be
        www.example1.com and the other www.example2.com. These sites are
        identical
        apart from the database they call to, one will call to a database
        called
        example1 and the other example2. I want another site (for example
        www.solution.com) to read what url has been entered and to pull in the
        database for that site (either example1 or example2) and show that
        information. I have tried using the CURL library without success (not
        sure
        how to use it fully) and have tried using frames but had loads of
        problems
        regarding losing session data. can anyone help?
        >
        Hi,
        >
        The reason you loose your sessiondata is simple: The sessionid is stored in
        a cookie together with the domain it belongs to.
        Every request to a certain domain send along the cookie, and the possible
        ppsessid, and so the server can see if it has a session belonging to that
        user.
        Imagine what happens if this was not implemented like this (as in early
        versions of Netscape): You have 2 windows open, one on
        www.wehackforfun.com, and one to your companies intranet. If both sites
        receive all cookies, the former one can easily 'steal your session' to your
        company's intranetsite, simply by reading the name and value of the
        cookie...
        >
        If you have 2 different domains, they cannot share a session. (Well, they
        can, but that is less straightforward .)
        >
        Bottomline, don't try to share sessions across different domains.
        >
        If this is really a requirement, you can set this up only if you own both
        sites, and let them use a common session storageplace (database eg), AND
        let both sites explicitely send the sessionid around via GET, because the
        cookie will not work.
        I am not sure if that is wise, but it can be done.
        >
        >
        Regards,
        Erwin Moller
        >

        Thanks
        Kev
        Do you have any suggestions on any other way to do this then because I
        am completely stuck for ideas.

        Thanks
        >
        Uhm. The first fix was free kid. Now we gotta start charging you.
        >
        If you can't figure this out, hire a consultant or buy a php book.
        There are lots out there. Browse the O'Reilley and Sitepoint sites.
        >
        --
        DeeDee, don't press that button! DeeDee! NO! Dee...
        I am posting on these groups to get this help, not to be told to read
        books which aren't going to help in this situation anyway.

        I have it so that if you manually set the site id it works, however i
        need it to pick this id up depending on what domain you select.

        K

        Comment

        • Erwin Moller

          #5
          Re: PHP Template

          KevinM2k wrote:
          >Uhm. The first fix was free kid. Now we gotta start charging you.
          >>
          >If you can't figure this out, hire a consultant or buy a php book.
          >There are lots out there. Browse the O'Reilley and Sitepoint sites.
          >>
          >--
          >DeeDee, don't press that button! DeeDee! NO! Dee...
          >
          I am posting on these groups to get this help, not to be told to read
          books which aren't going to help in this situation anyway.
          >
          I have it so that if you manually set the site id it works, however i
          need it to pick this id up depending on what domain you select.
          >
          K
          Hi,

          Let's get the situation clear. I am still a bit confused.
          And I am not charging yet. ;-)

          This is what you asked, I putted my questions in:
          The sites are exactly the same except for the database, each of the
          sites
          also needs there own URL, for example one of these urls may be
          www.example1.com and the other www.example2.com. These sites are
          identical
          apart from the database they call to, one will call to a database
          called
          example1 and the other example2.
          Ok, So you have 2 domains.
          (The fact that they are similar is not relevant for the problem you have at
          hand, I think)

          I want another site (for example
          www.solution.com) to read what url has been entered
          Entered Where?
          One the first site, the second, or the www.solution.com?
          I think the third, but I am unsure.
          Can you explain very clear what you mean here? I am kinda slow today.

          If the third, why not send the visitor to the first or second, and start
          your session from there?

          Or do you want to transmit your sessiondata MADE in the solution.com to one
          of the others? (That can be done, and if this is your problem I can explain
          how.)
          and to pull in the
          database for that site (either example1 or example2) and show that
          information.

          Regards,
          Erwin Moller

          Comment

          • Jerry Stuckle

            #6
            Re: PHP Template

            KevinM2k wrote:
            Michael Vilain wrote:
            >
            >>In article <1161769951.874 091.200460@e3g2 000cwe.googlegr oups.com>,
            >"KevinM2k" <kevinm2k@yahoo .co.ukwrote:
            >>
            >>
            >>>Erwin Moller wrote:
            >>>
            >>>>KevinM2k wrote:
            >>>>
            >>>>
            >>>>>Hi,
            >>>>>
            >>>>>I am trying to have 1 template site and have an unlimited number of
            >>>>>websites
            >>>>>using this template site to call there own information.
            >>>>>
            >>>>>The sites are exactly the same except for the database, each of the
            >>>>>sites
            >>>>>also needs there own URL, for example one of these urls may be
            >>>>>www.example1.com and the other www.example2.com. These sites are
            >>>>>identica l
            >>>>>apart from the database they call to, one will call to a database
            >>>>>called
            >>>>>example1 and the other example2. I want another site (for example
            >>>>>www.solution.com) to read what url has been entered and to pull in the
            >>>>>database for that site (either example1 or example2) and show that
            >>>>>informatio n. I have tried using the CURL library without success (not
            >>>>>sure
            >>>>>how to use it fully) and have tried using frames but had loads of
            >>>>>problems
            >>>>>regardin g losing session data. can anyone help?
            >>>>
            >>>>Hi,
            >>>>
            >>>>The reason you loose your sessiondata is simple: The sessionid is stored in
            >>>>a cookie together with the domain it belongs to.
            >>>>Every request to a certain domain send along the cookie, and the possible
            >>>>ppsessid, and so the server can see if it has a session belonging to that
            >>>>user.
            >>>>Imagine what happens if this was not implemented like this (as in early
            >>>>versions of Netscape): You have 2 windows open, one on
            >>>>www.wehackforfun.com, and one to your companies intranet. If both sites
            >>>>receive all cookies, the former one can easily 'steal your session' to your
            >>>>company's intranetsite, simply by reading the name and value of the
            >>>>cookie...
            >>>>
            >>>>If you have 2 different domains, they cannot share a session. (Well, they
            >>>>can, but that is less straightforward .)
            >>>>
            >>>>Bottomlin e, don't try to share sessions across different domains.
            >>>>
            >>>>If this is really a requirement, you can set this up only if you own both
            >>>>sites, and let them use a common session storageplace (database eg), AND
            >>>>let both sites explicitely send the sessionid around via GET, because the
            >>>>cookie will not work.
            >>>>I am not sure if that is wise, but it can be done.
            >>>>
            >>>>
            >>>>Regards,
            >>>>Erwin Moller
            >>>>
            >>>>
            >>>>>Thanks
            >>>>>Kev
            >>>
            >>>Do you have any suggestions on any other way to do this then because I
            >>>am completely stuck for ideas.
            >>>
            >>>Thanks
            >>
            >>Uhm. The first fix was free kid. Now we gotta start charging you.
            >>
            >>If you can't figure this out, hire a consultant or buy a php book.
            >>There are lots out there. Browse the O'Reilley and Sitepoint sites.
            >>
            >>--
            >>DeeDee, don't press that button! DeeDee! NO! Dee...
            >
            >
            I am posting on these groups to get this help, not to be told to read
            books which aren't going to help in this situation anyway.
            >
            I have it so that if you manually set the site id it works, however i
            need it to pick this id up depending on what domain you select.
            >
            K
            >
            Erwin is correct. These groups are to help people learn how to do
            things, not to do your work for you. You got a very workable solution -
            probably the only way to do it within the limits of security set by the
            browsers and protocol. Don't like it? Figure out how to do it
            yourself, or pay someone else to do it.

            Sound crass? You bet it is. But many of us make our livings off of
            writing PHP code. We help here because we like to help others learn how
            to do things. But we won't do your job for you for free. We like to
            eat, also.

            --
            =============== ===
            Remove the "x" from my email address
            Jerry Stuckle
            JDS Computer Training Corp.
            jstucklex@attgl obal.net
            =============== ===

            Comment

            • Captain Paralytic

              #7
              Re: PHP Template


              KevinM2k wrote:
              I am posting on these groups to get this help, not to be told to read
              books which aren't going to help in this situation anyway.
              How do you know that the books aren't going to help in this situation
              if you haven't read them!

              Comment

              Working...