Advertisement
Guest User

hjælp med php

a guest
Jan 4th, 2012
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.36 KB | None | 0 0
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  4. <title>Untitled Document</title>
  5. </head>
  6.  
  7. <body>
  8.  <?php
  9.  $to = $_REQUEST['sendto'] ;
  10.  $from = $_REQUEST['Email'] ;
  11.  $name = $_REQUEST['Name'] ;
  12.  $headers = "From: $from";
  13.  $subject = "Web Contact Data";
  14.  
  15.  $fields = array();
  16.  $fields{"Name"} = "Name";
  17.  $fields{"Company"} = "Company";
  18.  $fields{"Email"} = "Email";
  19.  $fields{"Phone"} = "Phone";
  20.  $fields{"list"} = "Mailing List";
  21.  $fields{"Message"} = "Message";
  22.  
  23.  $body = "We have received the following information:\n\n"; foreach($fields as $a => $b){   $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); }
  24.  
  25.  $headers2 = "From:yusef@deltapix.dk";
  26.  $subject2 = "Thank you for downloading DeltaPix InSight";
  27.  $autoreply = "To start your download of DeltaPix InSight please click the following link: http://www.google.dk";
  28.  
  29.  if($from == '') {print "You have not entered an email, please go back and try again";}
  30.  else {
  31.  if($name == '') {print "You have not entered a name, please go back and try again";}
  32.  else {
  33.  $send = mail($to, $subject, $body, $headers);
  34.  $send2 = mail($from, $subject2, $autoreply, $headers2);
  35.  if($send)
  36.  {header( "Location: http://www.deltapix.dk" );}
  37.  else
  38.  {print "We encountered an error sending your mail, please notify yusef@deltapix.dk"; }
  39.  }
  40. }
  41.  ?>
  42. </body>
  43. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement