Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Sep 2008
    Posts
    718
    Tokens
    0

    Default Application [HELP]

    Ok, first off, I'm new to PHP. I am sure this is all horribly wrong so don't yell at me or say something like 'FAIL GTFO'

    Can someone just look this over and tell me if it will work and how to fix it?

    BTW, I'm sure the $to variable is wrong

    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
    <title>Job Application</title>
    <style type="text/css">
      <!--
        body {
          font-family: tahoma;
          font-size: 11px;
          font-weight: bold;
      -->
    </style>
    </head>
    <body>
    <?php

        
    if( ! $_POST'submit' ] ) { 
            echo 
    '<form action="" method="post">
            Real Name:<br /><input type="text" name="name" /><br />
            Age:<br /><input type="text" name="age" /><br />
            Habbo Name:<br /><input type="text" name="habbo" /><br />
            Job Applying For:<br /><input type="text" name="job" /><br />
            Experience:<br /><textarea rows="2" cols="20" name="experience"></textarea><br />
            Message:<br /><textarea rows="2" cols="20" name="message"></textarea><br />
            <input type="submit" name="button" id="button" value="Submit" />
            
            </form>'
    ;
            
        } else { 
        
            
    $headers .= 'To: Me <[email protected]>' "\r\n";
            
    $headers .= 'From: <[email protected]>' "\r\n";
            
            
    $subject '$_POST[ 'habbo' ] - Job Application';
            
            
    $to $_POST'email' ];
            
    $message $_POST'name' ] <br /> $_POST'age' ] <br /> $_POST'habbo' ] <br /> $_POST'job' ] <br /> $_POST'experience' ] <br /> $_POST'message' ];    
            
            
    mail($to$subject$message$headers);
        
        }
    ?> 
    </body>
    </html>
    Thanks.

    PS - I got the original script from another thread so credit to whoever posted it

    EDIT:
    tested it and it says this:

    Parse error: syntax error, unexpected T_STRING in /homepages/34/d237406810/htdocs/wsb4850525601/form_test.php on line 34

    Line 34:
    $subject = '$_POST[ 'habbo' ] - Job Application';
    Last edited by HabbDance; 25-11-2008 at 12:02 AM.
    +.net - omg it's coming o_o

  2. #2
    Join Date
    Jan 2006
    Location
    Kent
    Posts
    987
    Tokens
    0

    Default

    Try this
    PHP Code:
    <?php

        
    if( ! $_POST'submit' ] ) { 
            echo 
    '<form action="" method="post">
            Real Name:<br /><input type="text" name="name" /><br />
            Age:<br /><input type="text" name="age" /><br />
            Habbo Name:<br /><input type="text" name="habbo" /><br />
            Job Applying For:<br /><input type="text" name="job" /><br />
            Experience:<br /><textarea rows="2" cols="20" name="experience"></textarea><br />
            Message:<br /><textarea rows="2" cols="20" name="message"></textarea><br />
            <input type="submit" name="button" id="button" value="Submit" />
            
            </form>'
    ;
            
        } else { 
        
            
    $headers .= 'To: Me <[email protected]>' "\r\n";
            
    $headers .= 'From: <[email protected]>' "\r\n";
            
            
    $subject "".$_POST'habbo' ]." - Job Application";
            
            
    $to $_POST'email' ];
            
    $message "".$_POST'name' ]." <br /> ".$_POST'age' ]." <br /> ".$_POST'habbo' ]." <br /> ".$_POST'job' ]." <br /> ".$_POST'experience' ]." <br /> ".$_POST'message' ]."";    
            
            
    mail($to$subject$message$headers);
        
        }

    ?>
    This is our situation and we're happy to be here,
    I wouldn't change this place for anything.


  3. #3
    Join Date
    Sep 2008
    Location
    UK
    Posts
    3,670
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
    <head>
    <title>Job Application</title>
    <style type="text/css">
      <!--
        body {
          font-family: tahoma;
          font-size: 11px;
          font-weight: bold;
      -->
    </style>
    </head>
    <body>
    <?php

        
    if( ! $_POST'submit' ] ) { 
            echo 
    '<form action="" method="post">
            Real Name:<br /><input type="text" name="name" /><br />
            Age:<br /><input type="text" name="age" /><br />
            Habbo Name:<br /><input type="text" name="habbo" /><br />
            Job Applying For:<br /><input type="text" name="job" /><br />
            Experience:<br /><textarea rows="2" cols="20" name="experience"></textarea><br />
            Message:<br /><textarea rows="2" cols="20" name="message"></textarea><br />
            <input type="submit" name="button" id="button" value="Submit" />
            
            </form>'
    ;
            
        } else { 
        
            
    $headers .= 'To: Me <[email protected]>' "\r\n";
            
    $headers .= 'From: <[email protected]>' "\r\n";
            
            
    $subject "$_POST[ 'habbo' ] - Job Application";
            
            
    $to $_POST'email' ];
            
    $message $_POST'name' ] <br /> $_POST'age' ] <br /> $_POST'habbo' ] <br /> $_POST'job' ] <br /> $_POST'experience' ] <br /> $_POST'message' ];    
            
            
    mail($to$subject$message$headers);
        
        }
    ?> 
    </body>
    </html>
    Should work.
    Back for a while.

  4. #4
    Join Date
    Sep 2008
    Posts
    718
    Tokens
    0

    Default

    Quote Originally Posted by Joe! View Post
    Try this
    PHP Code:
    <?php

        
    if( ! $_POST'submit' ] ) { 
            echo 
    '<form action="" method="post">
            Real Name:<br /><input type="text" name="name" /><br />
            Age:<br /><input type="text" name="age" /><br />
            Habbo Name:<br /><input type="text" name="habbo" /><br />
            Job Applying For:<br /><input type="text" name="job" /><br />
            Experience:<br /><textarea rows="2" cols="20" name="experience"></textarea><br />
            Message:<br /><textarea rows="2" cols="20" name="message"></textarea><br />
            <input type="submit" name="button" id="button" value="Submit" />
            
            </form>'
    ;
            
        } else { 
        
            
    $headers .= 'To: Me <[email protected]>' "\r\n";
            
    $headers .= 'From: <[email protected]>' "\r\n";
            
            
    $subject "".$_POST'habbo' ]." - Job Application";
            
            
    $to $_POST'email' ];
            
    $message "".$_POST'name' ]." <br /> ".$_POST'age' ]." <br /> ".$_POST'habbo' ]." <br /> ".$_POST'job' ]." <br /> ".$_POST'experience' ]." <br /> ".$_POST'message' ]."";    
            
            
    mail($to$subject$message$headers);
        
        }

    ?>
    Thanks, that made the form appear +rep

    But it doesnt send to me and I think I know why.

    PHP Code:
    $to $_POST'email' ]; 
    I have no 'email' field
    +.net - omg it's coming o_o

  5. #5
    Join Date
    Jan 2006
    Location
    Kent
    Posts
    987
    Tokens
    0

    Default

    just change to
    PHP Code:
    $to "[email protected]
    i guess thats where you want the email sent to?
    This is our situation and we're happy to be here,
    I wouldn't change this place for anything.


  6. #6
    Join Date
    Sep 2008
    Posts
    718
    Tokens
    0

    Default

    Quote Originally Posted by Joe! View Post
    just change to
    PHP Code:
    $to "[email protected]
    i guess thats where you want the email sent to?
    no, didn't work.
    +.net - omg it's coming o_o

  7. #7
    Join Date
    Jan 2006
    Location
    Kent
    Posts
    987
    Tokens
    0

    Default

    hmm try this:
    PHP Code:
    <?php

        
    if( ! $_POST'submit' ] ) { 
            echo 
    '<form action="" method="post">
            Real Name:<br /><input type="text" name="name" /><br />
            Age:<br /><input type="text" name="age" /><br />
            Habbo Name:<br /><input type="text" name="habbo" /><br />
            Job Applying For:<br /><input type="text" name="job" /><br />
            Experience:<br /><textarea rows="2" cols="20" name="experience"></textarea><br />
            Message:<br /><textarea rows="2" cols="20" name="message"></textarea><br />
            <input type="submit" name="submit" id="submit" value="Submit" />
            
            </form>'
    ;
            
        } else { 
            
            
    $subject "".$_POST'habbo' ]." - Job Application";
            
            
    $to "[email protected]";
            
    $message "".$_POST'name' ]." <br /> ".$_POST'age' ]." <br /> ".$_POST'habbo' ]." <br /> ".$_POST'job' ]." <br /> ".$_POST'experience' ]." <br /> ".$_POST'message' ]."";    
            
            
    mail($to$subject$message);
        
        }

    ?>
    Put the headers back in if you like, I just realised I got rid of them lol. Bed is calling.
    This is our situation and we're happy to be here,
    I wouldn't change this place for anything.


  8. #8
    Join Date
    Sep 2008
    Posts
    718
    Tokens
    0

    Default

    Quote Originally Posted by Joe! View Post
    hmm try this:
    PHP Code:
    <?php

        
    if( ! $_POST'submit' ] ) { 
            echo 
    '<form action="" method="post">
            Real Name:<br /><input type="text" name="name" /><br />
            Age:<br /><input type="text" name="age" /><br />
            Habbo Name:<br /><input type="text" name="habbo" /><br />
            Job Applying For:<br /><input type="text" name="job" /><br />
            Experience:<br /><textarea rows="2" cols="20" name="experience"></textarea><br />
            Message:<br /><textarea rows="2" cols="20" name="message"></textarea><br />
            <input type="submit" name="submit" id="submit" value="Submit" />
            
            </form>'
    ;
            
        } else { 
            
            
    $subject "".$_POST'habbo' ]." - Job Application";
            
            
    $to "[email protected]";
            
    $message "".$_POST'name' ]." <br /> ".$_POST'age' ]." <br /> ".$_POST'habbo' ]." <br /> ".$_POST'job' ]." <br /> ".$_POST'experience' ]." <br /> ".$_POST'message' ]."";    
            
            
    mail($to$subject$message);
        
        }

    ?>
    Put the headers back in if you like, I just realised I got rid of them lol. Bed is calling.
    AHA YOUR A LIFE SAVER !!!!@! THANKS SO MUCH.
    +repped


    Also, how would I recieve a file (<input type="file"></input>)
    Last edited by HabbDance; 25-11-2008 at 01:01 AM.
    +.net - omg it's coming o_o

  9. #9
    Join Date
    Sep 2006
    Location
    Evanston, Illinois.
    Posts
    2,361
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    <?php

        
    if( ! $_POST'submit' ] ) { 
            
    ?>
            <form action="" method="post">
            Real Name:<br /><input type="text" name="name" /><br />
            Age:<br /><input type="text" name="age" /><br />
            Habbo Name:<br /><input type="text" name="habbo" /><br />
            Job Applying For:<br /><input type="text" name="job" /><br />
            Experience:<br /><textarea rows="2" cols="20" name="experience"></textarea><br />
            Message:<br /><textarea rows="2" cols="20" name="message"></textarea><br />
            <input type="submit" name="submit" id="submit" value="Submit" />
            
            </form>
            <?php
        
    } else { 
            
            
    $subject "".$_POST'habbo' ]." - Job Application";
            
            
    $to "[email protected]";
            
    $message "".$_POST'name' ]." <br /> ".$_POST'age' ]." <br /> ".$_POST'habbo' ]." <br /> ".$_POST'job' ]." <br /> ".$_POST'experience' ]." <br /> ".$_POST'message' ]."";    
            
            
    mail($to$subject$message);
        
        }

    ?>
    How could this hapen to meeeeeeeeeeeeeee?lol.

  10. #10
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    if hypertexts dont work it'll be summin to do with the form.

    action = "" could be changed to action = "$PHP_SELF"

    Dunno if it'll make a dif

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •