Jump to content

Recommended Posts

i use javascript like this :

 

if login conditions are ok then : 

<script language="javascript">
parent.location.replace  ('index.php'); /* or document.location.replace ('index.php')
document.refresh();
</script>

Thanks, but what I'm looking for is some way of redirecting only when the contents of the form have been emailed using

<form action="mailto:[b]email address[/b]" method="post" name="query">

<?php 

// If form was submitted
if ( isset($_POST['submit'])) {

   ... validate form and send email to you.



}
// Form not submited
else {
?>
<form action="<?php echo"$_SERVER['PHP_SELF']"; ?>"  method="post">

... form crap
<input type="submit" name="submit" value="Submit" />

</form> 
<?php
}
?>

 

 

then you can use the javascript code as a javascript function and control it in onSubmit() event of <form> tag.

 

<form onSubmit="redirect()"....>

 

i don't know that is an exact solve. just a way...

 

 

 

You don't need to use javascript. Find a tutorial online to see how php would redirect. But in the example I gave, it is not needed since it would show up different results depending on if the form was or wasn't submitted.

Thanks, but what I'm looking for is some way of redirecting only when the contents of the form have been emailed using

<form action="mailto:[b]email address[/b]" method="post" name="query">

 

That is a horrible way to mail..

 

I suggest use the php mail() function.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  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...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.