Jump to content
Ghost Recon.net Forums

Recommended Posts

Are you asking whether the code is correct or once the email has been sent how to do a redirect to the homepage?

I would just put a link like this after "your message has been sent".

echo "<a href='/'>Ok</a>";

You could also do an automatic redirect so that after a couple seconds it goes to the homepage. I'm not sure on the specifics of that though.

Hope this helps. :)

Edited by firefly2442
Link to post
Share on other sites
Are you asking whether the code is correct or once the email has been sent how to do a redirect to the homepage?

I would just put a link like this after "your message has been sent".

echo "<a href='/'>Ok</a>";

You could also do an automatic redirect so that after a couple seconds it goes to the homepage.  I'm not sure on the specifics of that though.

Hope this helps. :)

a bit of both actually.

the problem is when you press the submit button it keeps sending me to a blank page, even after i inserted the code you suggested.

to have a closer look at the contact page and the problem, go here: http://www.swartsz.com/contact.html

so i am kinda lost with this one.

Edited by swartsz
Link to post
Share on other sites
Hmm, I think the contact page is ok.  Can you post the code to "verwerk.php"?  All that I get when I look at that source is...

<a href=\http://www.swartsz.com/index.html\></a>

here is the code of the form:

<form name="form1" method="post" action="verwerk.php">

        <table width="466" height="274" border="0">

          <tr>

            <td width="123" valign="top"><font color="#CCCCCC" size="1" face="Verdana">Name:</font></td>

            <td width="238" valign="top"><input name="naam" type="text" size="30"></td>

          </tr>

          <tr>

            <td valign="top"><font color="#CCCCCC" size="1" face="Verdana">Email

              address:</font></td>

            <td valign="top"><input name="email" type="text" size="30"></td>

          </tr>

          <tr>

            <td valign="top"><font color="#CCCCCC" size="1" face="Verdana">Message:</font></td>

            <td valign="top"><textarea name="bericht" cols="30" rows="10"></textarea></td>

          </tr>

        </table>

        <p align="center">

          <input type="submit" name="Submit" value="Submit">

        </p>

</form>

Link to post
Share on other sites

Here is what I just setup for my website. It's kind of rough right at the moment but it should give you a basis for what to do. Hope this will help ya. :)

------------

email.php

-----------

<br>

<center><big><p>Have a question, comment, or suggestion?  Send RivetCode an email!</p></big></center>

<br>

<br>

<FORM method=POST ACTION="../php/php_email/send.php">

Your Name:

<br>

<input type="text" size="60" name="f_name"></input>

<br>

Your Email Address:

<br>

<input type="text" size="60" name="f_emailaddress"></input>

<br>

Subject:

<br>

<select name="f_subject">

<option value="RivetCode Question" selected>Question

<option value="RivetCode Comment">Comment

<option value="RivetCode Suggestion">Suggestion

<option value="RivetCode Support">Support

<option value="RivetCode Bug Report">Bug Report

<option value="RivetCode Other">Other

</select>

<br>

Message:

<br>

<textarea name="f_message" rows="20" COLS="90"></textarea>

<br>

<br>

<input type="submit" value="Send Email">

</form>

-------

send.php

-------

<html>

<title>Sending Email...</title>

<body>

<?php

$name = $_POST['f_name'];

$emailaddress = $_POST['f_emailaddress'];

$subject = $_POST['f_subject'];

$message = $_POST['f_message'];

$mailto = "username@domain-name.com";

$email_body = "From: ";

$email_body .= $name . "\n";

$email_body .= "Email: ";

$email_body .= $emailaddress . "\n";

$email_body .= "\n" . $message;

if(mail($mailto, $subject, $email_body))

echo "Thank you for the email, " . $name . ".";

else

echo "Error sending email, please try again later.";

?>

<br>

<br>

<center><a href="/"><big><big>Ok</big></big></a></center>

</body>

</html>

Link to post
Share on other sites

why not just toss in a small javascript to redirect the site in a few seconds while giving the option of manual?

<script type="text/javascript"> 
setTimeout('countdown()', 3000)  

function countdown()
{
 top.location = 'index.php'
}
</script>[/code]

just stick that after the </head> tag and before the <body>

Edited by DonMiguel
Link to post
Share on other sites

thanks guys for your help.

I think i have it sorted now with the help of a new script and form. Now it sends the user back to the homepage when the message was sent succesfully and to a error page when something went wrong.

again thanks a lot for your help!

Link to post
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.

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