Page 1 of 1

HTML Editor

Posted: Fri Feb 25, 2005 4:31 pm
by NeedASite
Can you use php in it?

Posted: Sat Feb 26, 2005 5:43 am
by Lixas
yes, you are, but you will not be available to see result if in your computer is'nt installed php interpeter
Or if you are talking about cpanel editor, then yes, save file, and view with browser

Posted: Sat Feb 26, 2005 9:36 pm
by ELRocco
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

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>
<?
}
?>
But this scripts needs appache and php interpiter installed

Code: Select all

  <?
switch($_GET['act']) {
case '':
include('contact');
break;

default:
include('contact');
break;
}
?>

Posted: Tue Mar 01, 2005 8:00 am
by pooplematic
hahaha

that is over my head.
but i'll learn this with time.

Posted: Tue Mar 01, 2005 9:43 am
by SHAdmin
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

Code: Select all

  <?php
$email1 = "admin@kon-clan.recongamer.com"]Copyright ELRocco of ELRocco.co.nr</a>[/b]
</form>
</body>
</html>
<?
}
?>
But this scripts needs appache and php interpiter installed

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.

Posted: Tue Mar 01, 2005 11:29 am
by pooplematic
i see, i have learned something. thank you very much.