tags:

views:

57

answers:

2

Hi ,

I have a page refresh if a user is not logged in using sessions which works fine.

But when I submit data with a form is goes to the link for a non-logged in user to tell them to login.

I need the form once submitted to go to a different link completely

How can I do this ?

The form code is :

<form enctype="multipart/form-data" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">

The Page Refresh is :

if(empty($_POST['username']) && empty($_POST['password']))

{
?>

<meta http-equiv="refresh" content="0;index.php">  

<?php
}

?>
A: 

change the action attribute on the form:

<form action="pagetogoto.html">
GSto
A: 

In <form name="myidentifier" action="submitform.php" method="POST">, it is the value of the 'action' attribute that determines the link where the form calls. It is the responsibility of that page to (a) process the form data, and (b) send a reply, which may be an HTTP redirect or it might be a full page of HTML.

See this PHP forms tutorial for guidance.

Note, you might consider leaving out the refresh altogether. It will erase the user's half filled form data.

Ewan Todd