/    Sign up×
Community /Pin to ProfileBookmark

$_post && $_get

I am trying to make an emailer for my teacher so if he needs to send an email to all the students he can from a web page. I don’t want to use a database for this or a text file. I am using a couple of if statements and trying to use the post and get.

Right now it doesn’t work. Another question I have is I am using the mail() function and in the quotation is who will recieve the email can you put a bunch of email address’s in there like

mail(“[email protected],[email protected],[email protected]“, “$subject”, “$message”);

here is one of the if statements and my form.

<?php

if ($_POST[‘submit’] && $_GET[‘alliwt’]) {
mail(“[email protected]“, “$subject”, “$message”);

echo “<div align=center>You emailed all the IWT students!</div>”;
echo “<hr color=black width=45%>”;

echo “</body></html>”;}

?>

<form method=”post” id=”emailstudents” action=”iwtemailer.php”>

Name:<br />
<input type=”text” name=”name” size=”25″ /> <br />

Email to:<br />
<input type=”checkbox” name=”alliwt”>All IWT Students &nbsp; <input type=”checkbox” name=”2ndiwt”>Second Year Students &nbsp; <input type=”checkbox” name=”1stiwt”>First Year Students
<br />

Subject:<br />
<input type=”text” name=”subject”><br />

Message:<br />
<textarea name=”message”></textarea>

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

If someone could point me in the right direction I would be very grateful.

to post a comment
PHP

2 Comments(s)

Copy linkTweet thisAlerts:
@NogDogAug 24.2004 — Try changing the [b][color=teal]$_GET['alliwt'][/color][/b] to [b][color=teal]$_POST['alliwt'][/color][/b].
Copy linkTweet thisAlerts:
@madddidleyauthorAug 24.2004 — Thanks. Do you know how to go about attaching a file. Like a word document or maybe a html document.
×

Success!

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