Results 1 to 9 of 9
  1. #1
    Join Date
    Feb 2005
    Posts
    2,503
    Tokens
    0

    Latest Awards:

    Default Please can some one help me with this request php code

    I have made two pages for a request page , on the request page I have
    PHP Code:
    <form name="form" id="form" method="post" action="LOCATION.php"><br>
    question :<input name="title" type="text"  /><br>
    <
    br>
    <
    br>
    <
    select name="rate">
                <
    option>5</option>
                <
    option>4</option>
                <
    option>3</option>
                <
    option>2</option>
                <
    option>1</option>
              </
    select><br><br>
    <
    textarea name="message" ></textarea>
    <
    br><br>
    <
    input type="submit" name="Submit" value="button text"
    And on a page called "LOCATION.php" I have
    PHP Code:
    <?phpif ($_SERVER['REQUEST_METHOD'] != 'GET'){ 
    $name $_POST['name']; 
    $email $_POST['email']; 
    $subject $_POST['subject']; 
    $message $_POST['message]; 
    $email = " 
    Name: $name /n Email: $email /n Subject: $subject/n Message: $message /n 
    "; 
    mail("my email address", $subject, $email); 
    Header("Location: thanks.html"); 

    else 

    echo "Sorry your message could not be sent. Go back and try again!"; 

    ?>
    Does anyone know what i'm doing wrong many thanks , Matty

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

    Latest Awards:

    Default

    Try this:
    PHP Code:
    <?phpif ($_SERVER['REQUEST_METHOD'] != 'GET'){
    $name $_POST['name'];
    $email $_POST['email'];
    $subject $_POST['subject'];
    $message $_POST['message'];
    $email "
    Name: 
    $name /n Email: $email /n Subject: $subject/n Message: $message /n
    "
    ;
    mail("EMAIL"$subject$email);
    Header("Location: thanks.html");
    }
    else
    {
    echo 
    "Sorry your message could not be sent. Go back and try again!";
    }
    ?>
    and also the bit that says EMAIL make it your email!


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

  3. #3
    Join Date
    Feb 2005
    Posts
    2,503
    Tokens
    0

    Latest Awards:

    Default

    i did use my email i juts put that in so no 1 get my email address
    that did not work i send 2 send a request and it now says
    Parse error: parse error, unexpected '{' in /home2/habbteam/public_html/LOCATION.php on line 1

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

    Latest Awards:

    Default

    PHP Code:
    <?php
    if ($_SERVER['REQUEST_METHOD'] != 'GET'){
    $name $_POST['name'];
    $email $_POST['email'];
    $subject $_POST['subject'];
    $message $_POST['message];
    $email = "
    Name: $name /n Email: $email /n Subject: $subject/n Message: $message /n
    ";
    mail("my email address", $subject, $email);
    Header("Location: thanks.html");
    }
    else
    {
    echo "Sorry your message could not be sent. Go back and try again!";
    }
    ?>
    Try that :s


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

  5. #5
    Join Date
    Feb 2005
    Posts
    2,503
    Tokens
    0

    Latest Awards:

    Default

    it doesnt work
    it just says Parse error: parse error, unexpected $ in /home2/habbteam/public_html/LOCATION.php on line 17

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

    Latest Awards:

    Default

    PHP Code:
    <?php
    if ($_SERVER['REQUEST_METHOD'] != 'GET'){
    $name $_POST['name'];
    $email $_POST['email'];
    $subject $_POST['subject'];
    $message $_POST['message'];
    $info "
    Name: 
    $name /n Email: $email /n Subject: $subject/n Message: $message /n
    "
    ;
    mail("my email address"$subject$info);
    Header("Location: thanks.html");
    }
    else
    {
    echo 
    "Sorry your message could not be sent. Go back and try again!";
    }
    ?>


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

  7. #7
    Join Date
    Feb 2005
    Posts
    2,503
    Tokens
    0

    Latest Awards:

    Default

    i tryed 2 send a request and then it says The page cannot be found
    The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.
    it cant find the page:S+it does not send it

  8. #8
    Join Date
    Aug 2004
    Location
    Over there. ^_^
    Posts
    1,100
    Tokens
    0

    Latest Awards:

    Default

    PHP Code:
    <?php
    if(isset($_POST["send"])){
    $name $_POST["name"];
    $email $_POST["email"];
    $subject $_POST["subject"];
    $msg $_POST["msg"];
    $receiver "EMAIL";
    if(empty(
    $name)){
    echo(
    "-There was no name!<br />");
    }
    if(empty(
    $email)){
    echo(
    "-The email was empty or invalid!<br />");
    }
    if(empty(
    $subject)){
    echo(
    "-There was no subject!<br />");
    }
    if(empty(
    $msg)){
    echo(
    "-There was no message!<br />");
    }
    if(!empty(
    $name) && !empty($email) && !empty($subject) &&
    !empty(
    $msg)){
    $headers "MIME-Version: 1.0";
    $headers .= "Content-type: text/html; charset=iso-8859-1";
    $headers .= "From: ".$email."";

    $messageproper =

    "------------------------- Email -------------------------\n\n" .
    "Name: $name\n" .
    "Email: $email\n" .
    "Message: $msg\n" .

    "\n------------------------------------------------------------\n" ;

    mail("$receiver"$subject$messageproper"From: \"$name\"
    <
    $email>\nReply-To: \"$name\" <$email>\nX-Mailer: chfeedback.php 2.02"
    );
    echo( 
    "Thank you <b>$name</b>, your email was sent!" );
    }
    }
    ?>
    </font>
    <form method='post'>
    Name:<br />
    <input type='text' name='name' size='35'><br />
    E-mail:<br />
    <input type='text' name='email' size='35'><br />
    Subject:<br />
    <input type='text' name='subject' size='35'><br />
    Message:<br />
    <textarea name='msg' rows='8' cols='42'></textarea><br />
    <input type='submit' name='send' value='Send Email'> <input type='reset' value='Reset'>
    </form>
    I use something like that.. just customize it how you need it
    *Image Removed


    Ahemm.. How exactly was my sig innapropriate?
    Goddamit i hate this forum :@
    I RESIGN FROM GRAPHICS DESIGNER :@ :@ :@

  9. #9
    Join Date
    Feb 2005
    Posts
    2,503
    Tokens
    0

    Latest Awards:

    Default

    coolThanks for that, it works+rep

Posting Permissions

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