Jump to content
Larry Ullman's Book Forums

Recommended Posts

Here I use two php page with two forms. my first form is 'sign_up.php' and second is select_subject.php'. sign_up.php page has more categories and users can select up to 3 more categories there. So. after selecting and user click the continue bottom, page want to go to second form page its select_subject.php page.


If a user not select a category of who selected over 3 category I need to display a error message. like this "Please select atleast 1, not more than 3 categories."


I use this HTML my first page


<form method="post" action="select_subject.php"> <my select boxes> </form>




Then I process it in my second page and if user have made a mistake in first page I need to redirect to the first page again with relevant error message. So I use this code in my second page.


} else { // No valid ID, kill the script.

 $_SESSION['errors'] = "Please select atleast 1, not more than 3 categories.";
 $url = 'http://localhost/lanka_institute/tutorsignup/tutor_registration.php'; // Define the URL: 
 ob_end_clean(); // Delete the buffer.
 header("Location: $url");
 exit(); // Quit the script.



and my first page I use this


if (isset($_SESSION['errors'])) {

 echo '<p> ' . $_SESSION['errors'] . '</p>';




but it is not printing my error message in the first page that Im expecting. But it printing 'Array' instead of my message.


can you help me, what is the mistake that I have done???


thanks in advance.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...