Jump to content

owen

Members
  • Posts

    11
  • Joined

  • Last visited

Posts posted by owen

  1. Hi That link to the cgi thing didn't work, it kept failing when you pressed the download button. I've gone back to PHP here is a new script<?// $mailto - set to the email address you want the form// sent to, eg//$mailto = "youremailaddress@example.com" ;$mailto = 'owen@owenrimington.co.uk' ;// $subject - set to the Subject line of the email, eg//$subject = "Feedback Form" ;$subject = "ONK" ;// the pages to be displayed, eg//$formurl = "http://www.example.com/feedback.html" ;//$errorurl = "http://www.example.com/error.html" ;//$thankyouurl = "http://www.example.com/thankyou.html" ;$formurl = "http://www.madrugada-parties.co.uk/index.html" ;$errorurl = "http://www.madrugada-parties.co.uk/error.html" ;$thankyouurl = "http://www.madrugada-parties.co.uk/thankyou.html" ;$uself = 0;// -------------------- END OF CONFIGURABLE SECTION ---------------$headersep = (!isset( $uself ) || ($uself == 0)) ? "\r\n" : "\n" ;$name = $_GET['name'] ;$email = $_GET['email'] ;$comments = $_GET['comments'] ;$http_referrer = getenv( "HTTP_REFERER" );if (!isset($_GET['email'])) { header( "Location: $formurl" ); exit ;}if (empty($name) || empty($email) || empty($comments)) { header( "Location: $errorurl" ); exit ;}if ( ereg( "[\r\n]", $name ) || ereg( "[\r\n]", $email ) ) { header( "Location: $errorurl" ); exit ;}if (get_magic_quotes_gpc()) { $comments = stripslashes( $comments );}$messageproper = "This message was sent from:\n" . "$http_referrer\n" . "------------------------------------------------------------\n" . "Name of sender: $name\n" . "Email of sender: $email\n" . "------------------------- COMMENTS -------------------------\n\n" . $comments . "\n\n------------------------------------------------------------\n" ;mail($mailto, $subject, $messageproper, "From: \"$name\" <$email>" . $headersep . "Reply-To: \"$name\" <$email>" . $headersep . "X-Mailer: chfeedback.php 2.07" );header( "Location: $thankyouurl" );exit ;?>Still doesn't work though

  2. HiI am trying to set up a subscription button on website, The host server seems to have problems with the post method and sends a 405 method dissallowed message. I have tried using the get method but i'm still missing a trick somewhere because it's not working.Here is the html script<FORM METHOD="get" ACTION="http://www.madrugada-parties.co.uk/sendmail.php"> <INPUT Name="email" type="text" value="Email address" size="30"/> <INPUT TYPE="submit" class="submitbutton" VALUE="Join the Onk" alt="subscribe to mailing list" /> </FORM>and here's the php<? $email = $_GET['email'] ; mail( "owen@owenrimington.co.uk", "ONK", "From: $email" ); header( "Location: http://www.madrugada-parties.co.uk/thankyou.html" ); ?>Please help, thanks alot :)

  3. You can use the GET method for any HTML form no matter what scripting language you use to process it. The data will get passed in the url.if you are using PHP you would get the data like this.Say one of your fields in the form is named 'firstname' the get method will send the data in the url like thisyourpage.php?firstname=somevalueThen in PHP the variable name would be $firstname instead of using $_POST['firstname']. PHP grabs querystring into varaibles for you names the same as in the url.

    Hi aspnetguySorry you lost me a bit there. could you have a look at php posted above and tell me how it needs to change. i haven't used $_POST anywhere in the script. I'm new to all this. Thanks for your help
  4. HiThanks for the advice, i tried looking at CGI scripts last night from Matts script archive but i couldn't understand any of it. I've found a simple PHP script but it seems to be causing problems still.The html of the form goes like this:<FORM METHOD="post" ACTION="sendmail.php"> <INPUT Name="email" type="text" value="Email address" size="30"/> <INPUT TYPE="submit" class="submitbutton" VALUE="Join the Onk" alt="subscribe to mailing list" /> </FORM>And the php - sendmail.php goes like this:<? $email = $_REQUEST['email'] ; mail( "owen@owenrimington.co.uk", "Feedback Form Results", "From: $email" ); header( "Location: http://www.madrugada-parties.co.uk/new/index.html" ); ?>When i use the post method the browser says method not allowed and when i use the get method the browser says page cannot be found?????? :)

  5. HiI'm trying to set up a subscription to a mailing list button on a website. I've checked and the host server doesn't seem to support asp.What do i need to do to get a text box to to send it's contents to an email address?Please help :)

×
×
  • Create New...