how do i show error on same page after post

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • realin
    Contributor
    • Feb 2007
    • 254

    how do i show error on same page after post

    hi guys,

    may be a simple solution for this.. but i have been messing up..
    i want to display the error on the page after i submit the page..

    In other words

    i am making a registration form with username and password. i am checking it with js/ajax but i also want to check it at server side in php. Now i want the errors should appear exactly on the same page.. is it possible with php ?

    caise in JS we can do it using <div. (correct me if i am wrong).

    Please help me

    thanks for ur time :)
  • kovik
    Recognized Expert Top Contributor
    • Jun 2007
    • 1044

    #2
    You just check if it was successful and, if it wasn't, display an error message... Where are you having difficulties? What have you done so far?

    Comment

    • realin
      Contributor
      • Feb 2007
      • 254

      #3
      Originally posted by volectricity
      You just check if it was successful and, if it wasn't, display an error message... Where are you having difficulties? What have you done so far?
      i guess i was not clear cause i was almost dead sleep when i started the discussion.. ANyways take a look..

      i want to insert the error message just above the input text boxes, when i hit submit,it gets validated, if error, then it comes back to the page but this time, the errors are displayed just above the text boxes where the user input his username and/or pass/email. see the pic, i have marked the error with red circle .. a div is introduced automatically to display the error. i want to know how do they append it ..



      much of thanks guys :)
      Last edited by ak1dnar; Aug 6 '07, 03:59 AM. Reason: Unknown problem with the image link.

      Comment

      • ak1dnar
        Recognized Expert Top Contributor
        • Jan 2007
        • 1584

        #4
        Hi guys,
        When I am reading the the above post, I didn't see the attached image link on it. and just made some changes to the post. I think now its working. Thanks!

        Comment

        • gnawz
          New Member
          • Nov 2006
          • 64

          #5
          You can create a function for the error.

          It will be the same login page but with an error message on top.

          You then call this function when ever there is a login error!

          Comment

          • kovik
            Recognized Expert Top Contributor
            • Jun 2007
            • 1044

            #6
            Originally posted by realin
            a div is introduced automatically to display the error. i want to know how do they append it ..
            You just echo into it. Unless you are still not being clear, it's still a simple solution.

            Comment

            • realin
              Contributor
              • Feb 2007
              • 254

              #7
              Originally posted by gnawz
              You can create a function for the error.

              It will be the same login page but with an error message on top.

              You then call this function when ever there is a login error!

              yup yup yup

              how can i be such a stupid to not think of tha .. damn me !!

              i have been thinking about js ajax and shit like that .. but why not a simple funtion with reads the error array and displays it when array has something to display :D

              thanks a lot buddy :)

              Comment

              Working...