Jump to content

Recommended Posts

I am using Windows 2003 (Silly Me!) and am having a problem getting my contact form to work. I have literally tried a number of scripts that would normally work on Apache Servers. I don't know what i'm missing is there something extra i need to do to get my PHP Scripts to work.

 

The php version is  PHP Version 4.3.2...I am using FastHosts reseller account....  :'( :'( :'( :'(

Link to comment
https://forums.phpfreaks.com/topic/54319-contact-forms-on-windows-2003/
Share on other sites

post ur code then?

 

Its from Hotscripts and has been working well with Apache but witrh Windows 2003 there seems to be a problem...

 

/* The Code Below*/

 

<?php

$nasaadresa = "info@yuordomain.com";  //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='center'><br />

<b>Your message has sucessfully been sent!<br /></b>

 

 

A copy of this message has been sent to your email address <br /><br /><b>($mail).</b><br />We will reply you 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 MESSAGE

 

if($_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("^[a-zA-Z0-9_@.-]+$", $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: $Email

 

Message: $Message

 

-----------------------------

Browser: $browser

IP: $ip

";

//END OF INCOMING MESSAGE (this message goes to your inbox)

 

$subject = "General Enquiry - Sent by $Name"; //subject OF YOUR INBOX MESSAGE sent to you

 

$subject2 = "Your message has been sent"; //subject of OUTGOING MESSAGE - edit this

//OUTGOING MESSAGE TEXT

$message2 = "You have sent a message to Your Name:

-----------------------------

From: $Name:

E-mail: $Email

 

Message: $Message

 

-----------------------------

";

//END OF outgoing MESSAGE

 

 

mail($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 '

 

<form name="contactform" action="'.$PHP_SELF.'" method="post">

<input type="hidden" name="require" value="Name,Email,Message"></input>

 

 

  <label>Name</label>

<input name="Name" type="text" id="Name" value="" />

<br />

 

<label>Email Address:</label>

<input name="Email" type="text" id="Email" value="" />

<br />

<label>Message:</label>

<textarea name="Message" cols="20" rows="5" id="Message"></textarea>

<br />

 

<input type="submit" value="Send" name="submitform" id="submitbutton"></input>

 

 

</form>';

}

?>

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.