/    Sign up×
Community /Pin to ProfileBookmark

Need help with Echo on Contact Form

Hello everyone, I apologize for my lack of PHP knowledge. I put up a contact page, and I am needing the php to give a link back to the homepage after the submit button has been hit(you know – it would say thanks for submitting, click here to return). The trouble is, if I put in a link, it just gives me an error. Here is what the PHP looks like:

[CODE]<?php
$to = “mailto:——-“;

$headers = “From: ” . $from . “rn”;
$headers .= “Reply-To: ” . $from . “rn”;
$headers .= “Return-Path: ” . $from . “rn”;
$from = $_POST[‘sender’]; if ( ereg(“r”,$from) || ereg(“n”,$from) || ereg(“%”,$from) ) die(“Why ?? “);

if ( mail($to,$subject,$message,$headers) ) {
echo “The email has been sent!”;
}else{
echo “The email has failed!”;
}

?>[/CODE]

Can anyone tell me what to try? I tried

[CODE]echo “The email has been sent!<br> <a href=”gohere.htm”>Go Here</a>”;
}[/CODE]

, but I get nothing but an error when I try that.

Any help would be greatly appreciated!

Thanks,

Ryan

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@chazzyApr 04.2006 — the to should just be an email address, you don't need the mailto:.... what error do you get though?
Copy linkTweet thisAlerts:
@NogDogApr 04.2006 — Either escape the quotes within the string, or use single quotes:
[code=php]
echo "The email has been sent!<br> <a href="gohere.htm">Go Here</a>";
// or //
echo "The email has been sent!<br> <a href='gohere.htm'>Go Here</a>";
[/code]
Copy linkTweet thisAlerts:
@rharris07authorApr 04.2006 — Thanks for all your help! Nogdog got it right, all I had to do was change the quotes inside the string.

Thanks again,

Ryan
×

Success!

Help @rharris07 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 4.29,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...