Is this doable?

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

    #1

    Is this doable?

    My customer has a login form on their site that goes to a remote database.
    The remote database creates its own login errors if the user (say) types in
    the password incorrectly. The customer wants customized messages.
    My thinking is to have a form go first to a php form handling page on the
    customer's server, check for errors. If there are errors then custom
    messages can be echoed back to the login page. The issue is how can the, now
    accurate, ID and PW get passed to the remote database automatically?
    I am guessing that the initial error checking page would not encrypt the
    password as that gets done on the remote database of which I have no
    control.

    My php skills are very basic. Any help would be appreciated. Is this at
    least doable?
    Thanks
    Christopher


  • konsu

    #2
    Re: Is this doable?

    Hello, are you connecting to the database from your PHP script and issue
    queries to check user credentials? if so, why does it matter whether the
    database is remote or not? please clarify. Or by "remote database" you mean
    a different web application? then how does your application communicates
    with the other one?

    "Christophe r Richards" <crNOTANYSPAM@c hristopherNOSPA Mrichards.com> wrote in
    message news:ALFwd.18$Q F7.7@newssvr14. news.prodigy.co m...[color=blue]
    > My customer has a login form on their site that goes to a remote database.
    > The remote database creates its own login errors if the user (say) types
    > in the password incorrectly. The customer wants customized messages.
    > My thinking is to have a form go first to a php form handling page on the
    > customer's server, check for errors. If there are errors then custom
    > messages can be echoed back to the login page. The issue is how can the,
    > now accurate, ID and PW get passed to the remote database automatically?
    > I am guessing that the initial error checking page would not encrypt the
    > password as that gets done on the remote database of which I have no
    > control.
    >
    > My php skills are very basic. Any help would be appreciated. Is this at
    > least doable?
    > Thanks
    > Christopher
    >[/color]


    Comment

    • lig

      #3
      Re: Is this doable?

      if you are connecting to the DB remotely you can have the page make the
      connection and verify it then save it in a session variable.

      Something like:
      page 1 - login form sends input to ->
      page 2 - verify form input and try to connect (ex: mysql_connect,
      mysql_select_DB ). If a valid connection is made you can then save the
      input into a session variable ($_SESSION) and use it whenever and where
      ever you need to interact with the DB. If there is no valid connection
      you send back an error message (Ex: The database will not allow you to
      connect with that information. Please check your data and try again.)

      Make sense or did I lose you at the last left. :)


      Christopher Richards wrote:[color=blue]
      > My customer has a login form on their site that goes to a remote[/color]
      database.[color=blue]
      > The remote database creates its own login errors if the user (say)[/color]
      types in[color=blue]
      > the password incorrectly. The customer wants customized messages.
      > My thinking is to have a form go first to a php form handling page on[/color]
      the[color=blue]
      > customer's server, check for errors. If there are errors then custom
      > messages can be echoed back to the login page. The issue is how can[/color]
      the, now[color=blue]
      > accurate, ID and PW get passed to the remote database automatically?
      > I am guessing that the initial error checking page would not encrypt[/color]
      the[color=blue]
      > password as that gets done on the remote database of which I have no
      > control.
      >
      > My php skills are very basic. Any help would be appreciated. Is this[/color]
      at[color=blue]
      > least doable?
      > Thanks
      > Christopher[/color]

      Comment

      • Christopher Richards

        #4
        Re: Is this doable?


        "konsu" <konsu@hotmail. com> wrote in message
        news:WpqdnaDPls Jf1F7cRVn-iA@kallback.com ...[color=blue]
        > Hello, are you connecting to the database from your PHP script and issue
        > queries to check user credentials? if so, why does it matter whether the
        > database is remote or not? please clarify. Or by "remote database" you
        > mean a different web application? then how does your application
        > communicates with the other one?
        >[/color]
        Sorry if I am not clear. When I say remote db it is one that I have no
        access to other than as a user via the login form on a web page.
        That db has a script that issues its own error message. I have no control
        over that script and I don't even know what language it is written in. I
        know it doesn't make much logical sense, but the cutomer wants their own
        text echoed back to the login screen if a user screws up. My suggestion may
        not be the most elegant solution. But I thought I could hide the original
        login form, create my own which would go to another db that I do have access
        to in order to generate error messages of the type acceptable. But then my
        question is how does the PHP handling page pass the correct login id and pw
        to the primary db (the one I have no control over). I guess it boils down to
        how do I get the PHP script to pass values into fields on a login form I
        have no control over? It seem to me that I should be able to grab the code
        (which accepts the input on the orginial form) and put that in a PHP script
        which would log into the original db. Does this make sense and it is likely
        to work? I am probably missing something obvious to those that know their
        stuff. I only wish I did. Thanks.
        Hope this claifies.


        Comment

        • Christopher Richards

          #5
          Re: Is this doable?


          "lig" <lig@mgpt.com > wrote in message
          news:1103318963 .216318.16640@z 14g2000cwz.goog legroups.com...[color=blue]
          > if you are connecting to the DB remotely you can have the page make the
          > connection and verify it then save it in a session variable.
          >
          > Something like:
          > page 1 - login form sends input to ->
          > page 2 - verify form input and try to connect (ex: mysql_connect,
          > mysql_select_DB ). If a valid connection is made you can then save the
          > input into a session variable ($_SESSION) and use it whenever and where
          > ever you need to interact with the DB. If there is no valid connection
          > you send back an error message (Ex: The database will not allow you to
          > connect with that information. Please check your data and try again.)
          >
          > Make sense or did I lose you at the last left. :)[/color]

          Maybe a slight swerve.

          There are two databases. (1)Primary db(don't know what language scripts are
          written in that interact with it and I have no access to it only as a user)
          (2)My (proposed) substitute db PHP and mySQL on my server.

          page 1 My substitute login input form goes to mySQL DB (on my server) to
          check if ID and PW valid. If no, then send whatever messages back to the
          login page.

          If there are no errors and the ID and PW are correct then:

          I want to pass the ID and PW into the ID and PW fields of the original
          login form which will go to the db I have no control over. How about using
          the code from the original login form (the one that I substituted my own
          for) in the PHP script so that now logs into the primary db number one I
          have no control over? That script wont generate errors because I have
          already checked for errors in my substitute script. I don't (yet) know
          enough about how the $_SESSION constant would work here. Is this more clear?
          Thanks for your help.


          Comment

          • konsu

            #6
            Re: Is this doable?

            it looks like your PHP code needs to submit another http request to the
            other server and to parse its html response.

            forms are usually submitted using the HTTP POST verb with the form data in
            the body of the message. usually you specify content-encoding header with
            "applicatio n/x-form-urlencoded" value and put the data in to the body in the
            form similar to that for url query strings for GET requests:

            variable0=value 0&variable1=val ue2

            so all you need to do is to send this request to your other web server and
            get its response in the form of html and parse it.

            [color=blue]
            > Sorry if I am not clear. When I say remote db it is one that I have no
            > access to other than as a user via the login form on a web page.
            > That db has a script that issues its own error message. I have no control
            > over that script and I don't even know what language it is written in. I
            > know it doesn't make much logical sense, but the cutomer wants their own
            > text echoed back to the login screen if a user screws up. My suggestion
            > may not be the most elegant solution. But I thought I could hide the
            > original login form, create my own which would go to another db that I do
            > have access to in order to generate error messages of the type acceptable.
            > But then my question is how does the PHP handling page pass the correct
            > login id and pw to the primary db (the one I have no control over). I
            > guess it boils down to how do I get the PHP script to pass values into
            > fields on a login form I have no control over? It seem to me that I should
            > be able to grab the code (which accepts the input on the orginial form)
            > and put that in a PHP script which would log into the original db. Does
            > this make sense and it is likely to work? I am probably missing something
            > obvious to those that know their stuff. I only wish I did. Thanks.
            > Hope this claifies.
            >[/color]


            Comment

            Working...