please help, I can't go further in php...

Discussion in 'PHP' started by php-beginner, Dec 31, 2007.

  1. #1
    Hello, I have started php learning for a week and I've been blocked just at the begining.
    I have installed the latest version of Wamp on my windows, installed outlook express (it works properly with my gmail adress), modified the mail function in the php.ini ("SMTP", etc), restarted many times the program and pc, but still can't send an email with the information gathered from a simple form I have made. When I click the submit button on the down bar of the page you see the "waiting for localhost..." notice, but it lasts so long and at last there comes the famous errror message:

    Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp.gmail.com" port 465, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\wamp\www\my first php\form_response.php on line 34
    Fatal error: Maximum execution time of 30 seconds exceeded in C:\wamp\www\my first php\form_response.php on line 39

    I am getting sick...:confused:

    here is the code:

    <?php

    $_POST['name_first'];
    $_POST['email'];
    $_POST['rate'];
    $_POST['comments'];

    $first_name= $_POST['name_first'];
    $email= $_POST['email'];
    $rate= $_POST['rate'];
    $comments= $_POST['comments'];

    print "Thank you $first_name!";

    $email_message= "First name: $first_name Email: $email Rate: $rate Comments: $comments";

    ini_set("sendmail_from","myname@gmail.com");
    ini_set("SMTP","smtp.gmail.com");
    mail('myname@gmail.com','Form Response',$email_message);

    ?>
     
    php-beginner, Dec 31, 2007 IP
  2. selling vcc

    selling vcc Peon

    Messages:
    361
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I never tried that, but I think that you have a problem on your mail server:

    - You have to set some paramaters on your gmail account to be able to use gmail servers from outsite you email account ...
     
    selling vcc, Dec 31, 2007 IP
  3. selling vcc

    selling vcc Peon

    Messages:
    361
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
  4. php-beginner

    php-beginner Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
     
    php-beginner, Dec 31, 2007 IP
  5. olddocks

    olddocks Notable Member

    Messages:
    3,275
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    215
    #5
    just download XAMPP similar like WAMP.

    To test local email, run mercury mail (which comes with it) which is mail server.
    Next download, Pegasus as email client and then login using admin@localhost account.
     
    olddocks, Dec 31, 2007 IP
    php-beginner likes this.
  6. selling vcc

    selling vcc Peon

    Messages:
    361
    Likes Received:
    18
    Best Answers:
    0
    Trophy Points:
    0
    #6
    I guess that you entered your gmail password while setting up servers on outlook!

    (setting up or setupping !!!... lol)
     
    selling vcc, Dec 31, 2007 IP
    php-beginner likes this.
  7. php-beginner

    php-beginner Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Thank you very much for your suggestion, I'm going to try it, but can I have WAMP and XAMP together on my windows? I mean if installing XAMP while WAMP has just been installed would cause any problem.
     
    php-beginner, Dec 31, 2007 IP
  8. deltrumweb

    deltrumweb Banned

    Messages:
    502
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #8
    As SMTP is outgoing, have you checked to make sure that the authentication settings are correct for gmail in OE ? Just a thought !
     
    deltrumweb, Dec 31, 2007 IP
  9. php-beginner

    php-beginner Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #9
    Thank you for the thought.
    Well, I have followed the gmail guide for configuration of OE. Don't know what else should be done for the authentication settings.:confused:
     
    php-beginner, Dec 31, 2007 IP
  10. phpl33t

    phpl33t Banned

    Messages:
    456
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #10
    I will some up your first error in six words:

    "use linux for server related tasks"
     
    phpl33t, Jan 1, 2008 IP
  11. phpl33t

    phpl33t Banned

    Messages:
    456
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #11
    mail('myname@gmail.com','Form Response',$email_message);

    try:

     
    phpl33t, Jan 1, 2008 IP
  12. php-beginner

    php-beginner Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #12
    Thank you very much for taking the time to help me.
    Unfortunately I have never worked with linux, and I don't know anything about it.
    I have changed the last code as you'd suggested, the only thing that has changes is the time it took for the error message to appear has increased to almost 5 minutes!
    I want to install XAMPP as was suggested to use the mercury mail, maybe it solves the problem, but I wanted to get sure if it's harmless to install it while WAMP has already been installed on my windows. I don't have much information on this area, am just a very beginner!
    Thanks again.
     
    php-beginner, Jan 2, 2008 IP
  13. omerta

    omerta Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #13
    Hi I'm a new member and beginner in php, too.

    I have a form in html sth like this:

    <form id="form1" name="eggrafi" method="post" action="signup.php">
    <label>
    <input type="text" name="name" id="textfield" />
    </label>
    <label>
    <input name="password" type="password" id="textfield2" value="" />
    </label>
    <label>
    <input type="submit" name="submit" id="button" value="Εγγραφή" />
    </label>
    </form>

    the user press the submit button and the signup.php opens.
    in case someone do not write sth in the field "name" of the form i have the php code:

    if($_POST["name"]==NULL)
    {
    include("arxeio.html");
    }

    At last in file arxeio.html i have sth like this:

    <label>
    <input type="text" name="name" id="textfield" />
    </label>
    <input name="password" type="password" id="textfield2" value="<?php echo $_POST["password"]; ?>" />

    I do that because someone who give the password but not the username will have the opportunity to file arxeio.html to give only username and not the password again.

    it works fine BUT if someone go to view->page source of the file arxeio.html he can see the password.

    My question is how i can hide the password?
     
    omerta, Jan 2, 2008 IP
  14. phpl33t

    phpl33t Banned

    Messages:
    456
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    0
    #14
    sorry mate, i stay away from windows. that tid bit only good with linux, my bad.
     
    phpl33t, Jan 2, 2008 IP
  15. omerta

    omerta Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #15
    is there any problem ,generally, with that?

    if in the page source the password appears?

    it appears only in this page... (arxeio.html):confused:
     
    omerta, Jan 2, 2008 IP
  16. Brewster

    Brewster Active Member

    Messages:
    489
    Likes Received:
    13
    Best Answers:
    0
    Trophy Points:
    60
    #16
    omerta - it's best to start your own threads rather than hijack someone else's. That way no one gets confused

    Brew
     
    Brewster, Jan 2, 2008 IP
  17. omerta

    omerta Peon

    Messages:
    19
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #17
    i thought it would be better to write in an opening thread.
    look how much threads are open!!!!!!!!!!!!!

    sorry anyway
     
    omerta, Jan 2, 2008 IP
  18. olddocks

    olddocks Notable Member

    Messages:
    3,275
    Likes Received:
    165
    Best Answers:
    0
    Trophy Points:
    215
    #18
    no, it wont! just uninstall wamp and install xampp.
     
    olddocks, Jan 2, 2008 IP
  19. php-beginner

    php-beginner Peon

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #19
    So I can't have both installed. Thank you very much for your help.:)
     
    php-beginner, Jan 2, 2008 IP