/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Please help non computer expert with php

Could someone PLEASE help me as my webhost support side just confuses me?

I am making a website for a friend but the contact page does not return to a thanks page when the submit button is pressed. The mail is sent correctly but it is just the redirection that is the problem.

I have a mail.php file and the code is:

<?
$to = ‘[email protected]‘;
$subject = ‘Request via website’;
$message = ‘From: ‘ . $_REQUEST[‘name’] . “nn” . $_REQUEST[‘data’]; $email = $_REQUEST[’email’]; $headers = ‘From: ‘ . $email . “rn” .
‘Reply-To: ‘ . $email . “rn” .
‘X-Mailer: PHP/’ . phpversion();

mail ($to, $subject, $message, $headers);
header(“Location: thanks.html”);
?>

The coding in my contact page is:
<form method=”post” action=”mail.php”>
<table>
<tr>
<td>Your Name:</td>
<td><input type=”text” name=”name” ></td>
</tr>
<tr>
<td>Your e-mail address:</td>
<td><input type=”text” name=”email” ></td>
</tr>

<tr>
<td> Your Message:</td>
<td><textarea name=”data” cols=40 rows=10></textarea></td>
</tr>
<tr>
<td colspan=”2″><div align=”center”>
<input type=”submit” >
</div></td>
</tr>
</table>
</form>

If anyone could help me I would be really grateful. Remember I am a simple soul.

Regards

Paul

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@CoyotelabAug 19.2008 — add the complete url to this line since they might not be in same root
header("Location:http://www.whatever.com/thanks.html");
Copy linkTweet thisAlerts:
@paullosebyauthorAug 19.2008 — Many thanks Coyotilab - it worked a treat and now I can keep the few remaining hairs that I have.

Thanks again - I do appreciate it

Regards

Paul
×

Success!

Help @paulloseby spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.28,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...