HTML Editor
Moderator: Lixas
youmust have php and appache installed to view a php file on your computer something like this doesnt need an interperator, i tdont know why
But this scripts needs appache and php interpiter installed
Code: Select all
<?php
$email1 = "admin@kon-clan.recongamer.com";
$from = stripslashes($_POST['email']);
if($_POST['emailwhich'] == 1){
$sendTo = $email1;
}
else if($_POST['emailwhich'] == 2){
$sendTo = $email2;
}
if($from){
$subject = stripslashes($_POST['subject']);
$message = stripslashes($_POST['message']);
$headers = "From: $from\n";
$headers .= "Content-type: text;\r\n";
mail($sendTo,$subject,$message,$headers);
header("location:http://www.yourdomain.com/thankyou.htm");
exit;
}
else{
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Contact us</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<h1>Contact Form</h1>
<form name="contact" action="<? echo $_SERVER['PHP_SELF']; ?>" method="POST">
Please use this form to contact us:</p>
Your e-mail will be sent to::
<select name="emailwhich">
<option value="1">email 1</option>
</select></p>
Enter Your Email Address:
<input type="text" name="email" style="width:150px;"></p>
Enter Your Website:
<input type="text" name="subject" style="width:250px;"></p>
Enter Your Message:
<textarea name="message" cols="0" rows="0" style="width:300px;height;200px;"></textarea>
</p>
<input type="submit" value="Send Email">
<input type="reset" name="Reset" value="Reset">
<a>[b]Copyright ELRocco of ELRocco.co.nr</a>[/b]
</form>
</body>
</html>
<?
}
?>
Code: Select all
<?
switch($_GET['act']) {
case '':
include('contact');
break;
default:
include('contact');
break;
}
?>
-
- Posts: 243
- Joined: Mon Feb 28, 2005 4:34 am
- Contact:
ELRocco wrote:youmust have php and appache installed to view a php file on your computer something like this doesnt need an interperator, i tdont know why
But this scripts needs appache and php interpiter installedCode: Select all
<?php $email1 = "admin@kon-clan.recongamer.com"]Copyright ELRocco of ELRocco.co.nr</a>[/b] </form> </body> </html> <? } ?>
Code: Select all
<? switch($_GET['act']) { case '': include('contact'); break; default: include('contact'); break; } ?>
It is basically that both those above scripts need an interpretor. However you are able to find some of the results of the first script within a html editor because it has some html in it. However only the html part is being recognised. Anything placed between <? and ?> will not be executed unless and untill a server is installed with php.
This happens because php is a server side scripting language. The browsers that we use dont have the ability to process a php code. That is why always whenever you use a php file, you have an extention .php and not .htm or .html. All the files having the extension as .php first get processed by the php interpretor that can be installed only on a server and then finally the executed code is sent to the browser which recognises it in terms of html.
-
- Posts: 243
- Joined: Mon Feb 28, 2005 4:34 am
- Contact: