How to add validation to a form
I would like to validate a form so that it checks if the user is logged in...


I have got a form with method and action given below:

    <form method=get action="index.php">
 
What I would like to do is that when I click on proceed to checkout, this form should validate if user is logged in. If not it will redirect to login page. I am hoping to put my php code inn the form so that user do not proceed to checkout unless he is logged in.

I tried to use onclick() property but it did not work
    





How to add validation to a form
===

I would like to validate a form so that it checks if the user is logged in...


I have got a form with method and action given below:

    <form method=get action="index.php">
 
What I would like to do is that when I click on proceed to checkout, this form should validate if user is logged in. If not it will redirect to login page. I am hoping to put my php code inn the form so that user do not proceed to checkout unless he is logged in.

I tried to use onclick() property but it did not work
    




