Page 1 of 2 12 LastLast
Results 1 to 10 of 16

Thread: PHP Form Help!

  1. #1
    Join Date
    Jun 2005
    Posts
    4,795
    Tokens
    0

    Latest Awards:

    Default PHP Form Help!

    Hi,

    I am doing email form but when i submit it i get this error:

    Parse error: parse error, unexpected T_VARIABLE in /home2/pixelme/public_html/form/formprossess.php on line 10

    Here sorce for form.php:

    HTML Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>
    
    <body>
    <form name="form1" method="get" action="formprossess.php">
      <p>Job:
        <select name="job" id="job">
          <option value="Pixel Artist" selected>Pixel Artist</option>
          <option value="Programmer">Programmer</option>
          <option value="Chat mod">Chat mod</option>
        </select>
      </p>
      <p>Habbo Name:
        <input name="habbo" type="text" id="habbo">
      </p>
      <p>Forum Name:
        <input name="forum" type="text" id="forum">
    </p>
      <p>Email: 
        <input name="email" type="text" id="email">
      </p>
      <p>Why you should get this job:  </p>
      <p>
        <textarea name="why" cols="50" rows="10" id="why"></textarea>
      </p>
      <p>Samples of your work (url):</p>
      <p>
        <textarea name="sample" id="sample"></textarea>
    </p>
      <p>
        <input name="subject" type="hidden" id="subject" value="Job Application - Auto Form Mailer">
        <input name="ip" type="hidden" id="ip" value="<?php echo $_SERVER['REMOTE_ADDR']; ?>">
        <input type="submit" name="Submit" value="Submit">
    </p>
    </form>
    <p>&nbsp;</p>
    </body>
    </html>
    Heres sorce for formprosses.php:

    PHP Code:
    <?php
    if ($_SERVER['REQUEST_METHOD'] != 'GET'){ 
     
    $job $_POST['job']; 
     
    $habbo $_POST['habbo'];
     
    $forum $_POST['forum'];  
     
    $why $_POST['why']; 
     
    $sample $_POST['sample']; 
    $email $_POST['email']

    $messig "

    Job: 
    $job
    \n
    Habbo Name: 
    $habbo
    \n
    Forum Username: 
    $forum
    \n
    Email: 
    $email
    \n
    Why Should I get the job: 
    $why
    \n
    Samples Of My Work: 
    $sample
    \n

    "
    ;

    $subject $_POST['subject']

     
    mail("[email protected]"$subject$messig); 

     
    Header("Location: thankyoupage.php"); 

    }
    else
    {
    echo 
    'ERROR';

     
    ?>
    If any1 can help great!

    Thanks,

    Tomdarkness

  2. #2
    Join Date
    Jun 2004
    Posts
    1,809
    Tokens
    0

    Latest Awards:

    Default

    $messig = "

    thats your prob
    70 Shaman
    70 Mage
    70 Rogue
    70 Druid
    70 Priest
    63 Paladin

  3. #3
    Join Date
    Jun 2005
    Posts
    511
    Tokens
    0

    Default

    he knows that he donno the error tho

  4. #4
    Join Date
    Jul 2004
    Location
    Webby Forums!
    Posts
    1,879
    Tokens
    0

    Latest Awards:

    Default

    and I think you need to make $email = $_POST['email'] , $email = $_POST['email'];

    Also in general a T_VARIABLE on line 10 means the error will be before line ten I experienced this the other day
    Last edited by splintercell!; 11-07-2005 at 06:38 PM.


    Chilimagik.net // Reviews, Band Biographies, News, Pics + Loads More!!
    [Thybag.co.uk - Vive la revolutione]

  5. #5
    Join Date
    Aug 2004
    Location
    UK
    Posts
    11,283
    Tokens
    2,031

    Latest Awards:

    Default

    $email = $_POST['email'] is missing its ; meaning that the php interpeter is not exspecting another veraible to appear as the last one hasnt be closem aka why it gives t varible errors

  6. #6
    Join Date
    Jun 2005
    Posts
    511
    Tokens
    0

    Default

    Quote Originally Posted by Mentor
    $email = $_POST['email'] is missing its ; meaning that the php interpeter is not exspecting another veraible to appear as the last one hasnt be closem aka why it gives t varible errors
    where do u put ;

  7. #7
    Join Date
    Jul 2004
    Location
    Webby Forums!
    Posts
    1,879
    Tokens
    0

    Latest Awards:

    Default

    after $email = $_POST['email'] that statement so it becomes $email = $_POST['email'];


    Chilimagik.net // Reviews, Band Biographies, News, Pics + Loads More!!
    [Thybag.co.uk - Vive la revolutione]

  8. #8
    Join Date
    Jun 2005
    Posts
    511
    Tokens
    0

    Default

    Quote Originally Posted by splintercell!
    after $email = $_POST['email'] that statement so it becomes $email = $_POST['email'];

    Forum Username: $forum
    \n
    Email: $email = $_POST['email'];

    how will that jelp if it is still having problems

  9. #9
    Join Date
    Jul 2004
    Location
    Webby Forums!
    Posts
    1,879
    Tokens
    0

    Latest Awards:

    Default

    Ok lets look at this:
    <?php
    if ($_SERVER['REQUEST_METHOD'] != 'GET'){
    $job = $_POST['job'];
    $habbo = $_POST['habbo'];
    $forum = $_POST['forum'];
    $why = $_POST['why'];
    $sample = $_POST['sample'];
    $email = $_POST['email']

    that creats a variable and take it from the form Ie when you name the input the name is inbeween the [] ok? Now after them is a ; to end the statement but after the
    $email = $_POST['email'] there isnt one which is causing the problem so all you have to do it add ad ; after the $email = $_POST['email'] statement. OK??


    Chilimagik.net // Reviews, Band Biographies, News, Pics + Loads More!!
    [Thybag.co.uk - Vive la revolutione]

  10. #10
    Join Date
    Jun 2005
    Posts
    511
    Tokens
    0

    Default

    now it says:


    Parse error: parse error, unexpected T_STRING in /home2/pixelme/public_html/form/formprossess.php on line 28

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
  •