/    Sign up×
Community /Pin to ProfileBookmark

emailing with a form

hey all

ive been reading this forum non stop for the past little while trying to figure out how to make this work.

what happened was that my page had a mailing list form that people fill out their name, email, etc. and it just emails the info to someone and then that someone just takes those emails and sticks them in a mailing list. pretty straight forward.
well i must be an idiot because we’re launching our new site and i was cleaning up the server of all the old files and i mustve deleted a php file or something because the form ceases to work now.
aka, i have to make a new one.

i’ve been reading and educating myself on php as i’m pretty new to it. i’ve been designing and junk with html for a long time but havent had the server to support php so there was no real reason to get to know it i guess.

anyway, i did find some real useful stuff on here and i think i’ve researched here enough to make it work but its not and i have no clue.

i used this code for my .php page

[code=php]
<?PHP

#######################################################
# This script is Copyright 2003, Infinity Web Design #
# Written by Ryan Brill – [email][email protected][/email] #
# All Rights Reserved – Do not remove this notice #
#######################################################

## The lines below need to be edited…

###################### Set up the following variables ######################
# #
$to = “[email protected]”; #set addres to send for to
$subject = “Sign my ass up”; #set the subject line
$headers = “From: Mailing List”; #set the from address
$forward = “1”; # redirect? 1 : yes || 0 : no
$location = “news.htm”; #set page to redirect to, if 1 is above
# #
##################### No need to edit below this line ######################

## set up the time ##

$date = date (“l, F jS, Y”);
$time = date (“h:i A”);

## mail the message ##

$msg = “Below is the result of your feedback form. It was submitted on $date at $time.nn”;

foreach ($_POST as $key => $value) {
$msg .= ucfirst ($key) .” : “. $value . “n”;
}

mail($to, $subject, $msg, $headers);
if ($forward == 1) {
header (“Location:$location”);
}
else {
echo (“Thank you for submitting our form. We will get back to you as soon as possible.”);
}

?>
[/code]

i dont really understand the bottom part but i think i’ve deleted enough stuff to know that if its not hurting anything to leave it alone.

here is my page that i’m trying to make work.
[url]http://www.acantha.ca/new/mailing2.htm[/url]
dont click on any of the other links and expect to get back to that page by clicking again as that is just a test page.

anywho, just wondering what i’m doing wrong. whenever i click submit, it just brings me to a “cant find the page” page. i’ve uploaded all those files in the same directory so it should work, but i’m pretty stumped.

if anyone could shed some light on the matter as to what i’m doing or not doing that’d be sweet

thanks dudes.

devon

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@SheldonOct 16.2006 — your form is pointing to mailform.php, it should be in the same directory.

<i>
</i>&lt;FORM ACTION="mailform.php" METHOD="POST"&gt;


Now one point, the PHP script you have posted is not a mailing list sign-up script. This will just email you their details. Is this what you want?

Make sure your php script aboce is in a PHP file and that your form is pointing to that file.
Copy linkTweet thisAlerts:
@devonauthorOct 16.2006 — they are definately in the same directory.

i saved the php file in dreamweaver as a .php file and it also (as you can see) comes up as one.

http://i100.photobucket.com/albums/m16/f*ckyadevon/dir.jpg

(just replace the *
with a u. aka complete the word. aka the forum won't allow swears.)

and yes that is what i want.

we just send out an email ourselves with all the info we get from this form.

?
Copy linkTweet thisAlerts:
@SheldonOct 16.2006 — ok, Are you allowed PHP files on your server? By the looks of it you have a windows server? Does your plan support PHP?
Copy linkTweet thisAlerts:
@devonauthorOct 16.2006 — i want to get a new server because i'm not the one in charge of it and it doesn't seem like anyone knows anything about it.

i'm pretty sure we do have php capabilities because that same kind of thing i'm trying to do was working before, but i'm starting to doubt that now.
Copy linkTweet thisAlerts:
@LiLcRaZyFuZzYOct 16.2006 — that is extremely weird, are you sure the file is still present?

in order to test php, create a new file "phpinfo.php" and write:
[code=php]
<?php
phpinfo();
?>
[/code]
Copy linkTweet thisAlerts:
@devonauthorOct 16.2006 — yeah weird weird weird...

definately sure the file is present. that new php test there doesnt work either.

a little while back i remember trying to install one of those php bulletin boards on that server too and i did everything right, but i had to go on their board like this to ask why its not working. no one could really tell why but (and now i forget what they were) there were certain things that happened that showed that sometimes it recognized that there was php but when it came time to actually call a script the thing just ****ed off.

well maybe i'll try to get a hold of whatever place is hosting and see whats going on or get a new server.... crap.

thanks for all your help guys
×

Success!

Help @devon 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,
)...