astheria Posted January 6, 2007 Share Posted January 6, 2007 PHP is not my forte, and I've been browsing the web looking for an answer to this question. I'm in need of a contact form for my site and came across a free open-source file that seems to be just the ticket. However, I'm having trouble getting it to load into my html page, and I'm not sure why. Here is the snippet of HTML:[code] <h2>Contact</h2> <p>Voilà! In view, a humble vaudevillian veteran, cast vicariously as both victim and villain by the vicissitudes of Fate. This visage, no mere veneer of vanity, is it vestige of the vox populi, now vacant, vanished, as the once vital voice of the verisimilitude now venerates what they once vilified. However, this valorous visitation of a bygone vexation stands vivified, and has vowed to vanquish these venal and virulent vermin vanguarding vice and vouchsafing the violently vicious and voracious violation of volition. The only verdict is vengeance; a vendetta held as a votive, not in vain, for the value and veracity of such shall one day vindicate the vigilant and the virtuous. Verily, this vichyssoise of verbiage veers most verbose vis-à-vis an introduction, and so it is my very good honor to meet you and you may call me V.</p> <?php include("/phpincludes/contactform.php"); ?> </div>[/code]And the PHP file (sorry if it's long):[code]<?php$nasaadresa = "[email protected]"; //please replace this with your address$mail = $_POST['Email'];$porukaa = $_POST['Message'];$poruka = str_replace("\r", '<br />', $porukaa);//START OF THANKS MESSAGE//you may edit $thanks message. this is a message which displays when user sends mail from your site$thanks = "<p align='left'><br>Thank you for your e-mail, this is confirmation that it has been received.<br>#### MESSAGE TEXT #### <br><br>$poruka<br><br>#### END OF MESSAGE ####<br><br>You will recive a copy of the message at your email address ($mail).<br>I will do my best to respond as soon as possible.<br></p>";//do not edit nothing below this line until comment (ME) say so if you don't have skills with PHP//END OF THANKS MESSAGEif($_POST['submitform']) { $Name = $_POST['Name']; $Email = $_POST['Email']; $Message = $_POST['Message']; $require = $_POST['require']; $browser = $HTTP_USER_AGENT; $ip = $_SERVER['REMOTE_ADDR']; $dcheck = explode(",",$require); while(list($check) = each($dcheck)) { if(!$$dcheck[$check]) { $error .= "You have not filled this filed(s): <b>$dcheck[$check]</b>.<br>"; } } if ((!ereg(".+\@.+\..+", $Email)) || (!ereg("^[[email protected]]+$", $Email))){ $error .= "Wrong e-mail.<br>This e-mail address <b>$Email</b> - is not valid. Please enter correct e-mail address."; } if($error) { echo $error; echo '<br><a href="#" onClick="history.go(-1)">Please try again.</a>'; } else {//START OF INCOMING MESSAGE (this message goes to your inbox)$message = "Name: $Name:E-mail: $EmailMessage: $Message-----------------------------Browser: $browserIP: $ip";//END OF INCOMING MESSAGE (this message goes to your inbox)$subject = "Message from your site.com - Message was sent by $Name"; //subject OF YOUR INBOX MESSAGE sent to you$subject2 = "Email to Astheria.com Successful!"; //subject of OUTGOING MESSAGE - edit this//OUTGOING MESSAGE TEXT$message2 = "You have sent a message to Kyle Meyer of Astheria.com:-----------------------------From: $Name:E-mail: $Email Message: $Message-----------------------------";//END OF outgoing MESSAGEmail($nasaadresa,"$subject","$message","From: $Name <$Email>");mail($Email,"$subject2","$message2","From: <$nasaadresa>");echo "$thanks"; }}else{//this is contact form down here, please edit if you know what are you doing... or the contact form may not be working.echo '<p>Feel free to get in touch with me, I am always happy to receive feedback or anything else you may have to say.</p><p>Fields marked <em>*</em> are required.</p><br /><br /><form name="contactform" action="'.$PHP_SELF.'" method="post"><input type="hidden" name="require" value="Name,Email,Message"> <fieldset> <ul> <li> <label for="name">Name<em>*</em></label> <input name="Name" size="30"> </li> <li> <label for="email">E-mail<em>*</em></label> <input name="Email" size="30"> </li> <li> <label for="message">Message<em>*</em></label> <textarea name="Message" rows="10" cols="30"></textarea> </li> <li> <input type="submit" value="Send" name="submitform"> <input type="reset" value="Reset" name="reset"> </li> </ul> </fieldset></form>';}?>[/code] Link to comment https://forums.phpfreaks.com/topic/33117-solved-quick-contact-form-question/ Share on other sites More sharing options...
psychohagis Posted January 6, 2007 Share Posted January 6, 2007 umm well you said[quote]I'm having trouble getting it to load into my html page[/quote]but you cant do [code]<?php include("/phpincludes/contactform.php"); ?>[/code] on a html page, it has to be a php page, unless youve configured your server to process html pages with php Link to comment https://forums.phpfreaks.com/topic/33117-solved-quick-contact-form-question/#findComment-154292 Share on other sites More sharing options...
astheria Posted January 6, 2007 Author Share Posted January 6, 2007 Thank you, as I said, I have relatively no knowledge of php.How would I go about inserting that contact form into an html page then? Link to comment https://forums.phpfreaks.com/topic/33117-solved-quick-contact-form-question/#findComment-154479 Share on other sites More sharing options...
john010117 Posted January 6, 2007 Share Posted January 6, 2007 Is there any specific reason why you need an HTML page to load the form? .php extensions loads html fine. Link to comment https://forums.phpfreaks.com/topic/33117-solved-quick-contact-form-question/#findComment-154484 Share on other sites More sharing options...
astheria Posted January 6, 2007 Author Share Posted January 6, 2007 It's kind of a one page site (don't mind glitches in other browsers besides FF as I haven't really debugged yet)http://www.astheria.com/sneaky.htm Link to comment https://forums.phpfreaks.com/topic/33117-solved-quick-contact-form-question/#findComment-154486 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.