What is OPML?
PHP web-programming
Hello Guest
  
  • Login
• Register…
• Start blog
  • Кто, Где, Когда
• Что тут делать?
• Сообщества
  • Опросы
• Аватары
• Интересы
  • Редактор изображений new!
• Случайный дневник
• Поиск пользователей
  • Дуэли
• Желания
• Ссылки
  • Search
• Games
• Tests
• QAIX
  • Трансляции
• Talxy Chat
• Horoscope
• Online
 
Register!

QAIX > PHP web-programmingGo to page: « previous | 1 | 2 | 3 | 4 | 5 | 6 | 7 | next »

  Top users: 
  Рейтинг сообществ: 
  Advertising:
  Recent blog posts: 
  They have birthday today: 
  Forums:   
  Discuss: 
  Recent forum topics: 
  Recent forum comments:
  Модератор:
пятница, 24 апреля 2009 г.
poop Guest 17:27:10
 poop
comment 1 answer | Add comment
пятница, 3 апреля 2009 г.
Michael Sims, thnx for the help ) I had the same problem ) Guest 10:20:13
 Michael Sims, thnx for the help ) I had the same problem )
Add comment
вторник, 31 марта 2009 г.
jello Guest 01:59:09
 jello
Add comment
воскресенье, 22 марта 2009 г.
mailform Yolanda Montealegre 06:16:55
 Hi everyone, I have been racking my brains trying to get a simple maiform script to work. I keep getting an Internal Server Error 500. I have the file in the cgi-bin, I have chmod permissions set correctly and my form input tags are correct and yet nothing. Does it matter if I upload in Binary or Ascii?
I'm including the php code for the form, plus my HTML tags. Any help would be fabulous. I want to be able to reuse the script simply by changing email to send data, and thank you redirect page.
Thanks ahead of time!!
Yolanda
HTML TAGS: (and yes, I have: email not E-Mail)
<FORM method="POST" action="http://www.­patzcuarolake.com/cg­i-bin/mailform.php">­
<INPUT type="hidden" name="recipient" value="famalli@hotm­ail.com">
<INPUT type="hidden" name="subject" value="Real Estate Information Request">
<INPUT type="hidden" name="redirect" value="http://www.p­atzcuarolake.com/cam­brons_realestate_tha­nkyou.htm">
<INPUT type="hidden" name="required" value="name,email,d­ay_phone">
<INPUT type="hidden" name="print_config"­ value="email,subjec­t">
<INPUT type="hidden" name="print_blank_f­ields" value="1">
PHP SCRIPT:
<?php
/******************­********************­********************­***********
* >>>> DO NOT CHANGE THIS FILE OR IT MIGHT NOT WORK <<<<
* >>>> WE WILL NOT SUPPORT THIS SCRIPT IF IT IS <<<<
* >>>> ALTERED IN ANY WAY FROM IT'S ORIGINAL FORM <<<<
* 1.) Verify they are coming from our server
* 2.) Get the current Time
* 3.) Get all variables from Get and Post
* 4.) Make sure they entered all required fields
* 5.) Send Email
* 6.) Print HTML/redirect to proper page
*
* change this line to $debug = true; if you want to enable debugging*/
$debug = false;
/******************­********************­********************­**********/
if($debug) {
echo "<pre>";
echo "GET Variables:";
print_r($_GET);
echo "POST Variables:";
print_r($_POST);
echo "</pre>";
error_reporting(E_A­LL);
}
else {
error_reporting(0);­
}
/******************­********************­********************­***********
* 1.) Verify they came from our server.
*******************­********************­********************­**********/
//get just the domain name from the referer and server we are on
$referer=preg_repla­ce('/^http:\/\//',''­,$_SERVER['HTTP_REFERER']);
$referer=preg_repla­ce('/\/.*/','',$refe­rer);
$referer=preg_repla­ce('/^www./','',$ref­erer);
$server=preg_replac­e('/^www./','',$_SER­VER['SERVER_NAME']);
//if server does not match referer, print error page
if($referer!=$serve­r) {
error($server,"Bad Referer. You can only send email through this script if you use a form on this domain.<br> If you are using a form on this domain, and still get this message, try disabling any<br> firewalls you have running, it could be blocking the headers this script checks before sending mail.");
}
/******************­********************­********************­***********
* 2.) Get the current Time.
*******************­********************­********************­**********/
$date=date("l, F dS, Y \a\\t H:i:s");
/******************­********************­********************­***********
* 3.) Get all variables from Get & Post put them into $fields array
*******************­********************­********************­**********/
if($_SERVER['REQUEST_METHOD']=="GET")­ {
foreach($_GET as $name=>$value) {
$fields[$name]=$value;
}
}
elseif($_SERVER['REQUEST_METHOD']=="P­OST") {
foreach($_POST as $name=>$value) {
$fields[$name]=$value;
}
}
else {
error($server,"Unko­wn method. You must specify method=\"GET\" or method=\"POST\" in order for the mailform script to work.");
}
/******************­********************­********************­***********
* 4.) Make sure they entered all required fields
*******************­********************­********************­**********/
$config=array("reci­pient","subject","em­ail","realname","red­irect","required", "env_report","sort"­,"print_config","pri­nt_blank_fields","ti­tle","return_link_ur­l", "return_link_title"­,"missing_fields_red­irect","background",­"bgcolor", "text_color","link_­color","vlink_color"­,"alink_color");
if(isset($fields['required'])) {
$required=preg_spli­t("/,/",$fields['required']);
}
else {
$required=array();
}
//make sure they at least have the email and receipient fields
array_push($require­d,'email');
array_push($require­d,'recipient');
$required = array_unique($requi­red);
$field_keys=array_k­eys($fields);
$missing="";
foreach($required as $value) {
if(!$fields[$value] && $fields[$value]!="0"){
$missing.="<li>$val­ue</li>";
}
}
//if they have missing fields
if($missing) {
//if they have their own missing fields page, direct them there
if(isset($fields['missing_fields_redirect'])) {
header("Location: ".$fields['missing_fields_redirect']);
exit;
}
else {
error($server,"You have not filled in all of the required fields. The missing fields are:<br> <ul>$missing</ul>")­;
}
}
//if the email address looks invalid
if(!eregi("([_\.0-9a-z-]+@)([0-9a-z][0-9a-z-]+\.­)+([a-z]{2,3})", $fields['email'])) {
error($server,"Plea­se enter a valid email address.");
}
foreach($config as $value) {
if(preg_match("/\~|­\`|\#|\%|\^|\&|\*|\(­|\)|\+|\=|\{|\}|\[|\]|\<­|\>|\;|\|/",$fields[$value])­) {
error($server, "Invalid Charaters detected in $value. You may not use any of these characters<br>
~ \` # $ % ^ & * ( ) + = { } [ ] < > ; | <br>
In the form fields.");
}
}
/******************­********************­********************­***********
* 5.) Send Email
*******************­********************­********************­**********/
//sort fields, if needed
if(isset($fields['sort'])) {
if($fields['sort']=="alphab­etic") {
ksort($fields);
}
else {
$fields['sort']=preg_replac­e('/^order:/','',$fi­elds['sort']);
$sort_order=preg_sp­lit("/,/",$fields['sort']);
foreach($sort_order­ as $value) {
$temp[$value]=$fields[$value];
}
$temp_keys=array_ke­ys($temp);
foreach($fields as $name=>$value) {
if(!in_array($value­,$temp_keys)) {
$temp[$name]=$value;
}
}
$fields=$temp;
}
} //end of sort routine
//create body of email message
$body="Below is the result of your feedback form on www.$server. It was submitted by\n";
if(isset($fields['realname'])) {
$body.=$fields['realname']." (".$fields['email'].")";
}
else {
$body.=$fields['email'];
}
$body.=" on $date \n";
$body.="-----------­--------------------­--------------------­--------------------­----\n";
//don't print config fields:
//unless they have print_config set
if(isset($fields['print_config'])) {
$print_config=preg_­split("/,/",$fields['print_config'])­;
$config=array_diff(­$config,$print_confi­g);
}
foreach($fields as $name=>$value) {
if(!in_array($name,­$config)) {
$body.="$name: $value\n";
}
}
$body.="-----------­--------------------­--------------------­--------------------­----\n";
//Print off the env_report if that is set
if(isset($fields['env_report'])) {
$env_fields=preg_sp­lit("/,/",$fields['env_report']);
foreach($env_fields­ as $value) {
if(isset($_SERVER[$value]))­ {
$body.="$value: ".$_SERVER[$value]."\n";
}
}
}
//set the subject if one doesn't exist
if(!isset($fields['subject']))­ {
$fields['subject']="www.$serve­r Form Submission";
}
//Finally, send the message!
mail($fields['recipient'], $fields['subject'], $body, "From: ".$fields['email']);
if($debug) {
echo "<pre>";
echo "Email being sent:<br>";
print_r($body);
echo "</pre>";
}
/******************­********************­********************­***********
* 6.) Print HTML/redirect to proper page
*******************­********************­********************­**********/
//if they set a redirect page, send user there
if(isset($fields['redirect'])) {
header("Location: ".$fields['redirect']);
}
//Set some default values if they are not set
if(!isset($fields['print_blank_fields']))­ {
$fields['print_blank_fields']=1;
}
if(!isset($fields['title']))­ {
$fields['title']="Thank You!";
}
if(!isset($fields['bgcolor']))­ {
$fields['bgcolor']="#ececec";
}
if(!isset($fields['text_color']))­ {
$fields['text_color']="#000000";
}
if(!isset($fields['link_color']))­ {
$fields['link_color']="#000000";
}
if(!isset($fields['vlink_color']))­ {
$fields['vlink_color']="#000000";
}
if(!isset($fields['alink_color']))­ {
$fields['alink_color']="#000000";
}
echo <<<TERMHTML
<html>
<head>
<title>Thank You for contacting $server</title>
</head>
<body bgcolor="$fields[bgcolor]" text="$fields[text_color]" link="$fields[link_color]" vlink="$fields[vlink_color]">
<center>
<table border="1" bordercolor="#00000­0" width="600" cellpadding="4">
<tr>
<td bgcolor="#FEA096">
<font face="arial" size="4" color="$fields[text_color]"><b>­<center>Here is what you submitted to $server on $date</center></b><­/font>
</td>
</tr>
<tr>
<td>
TERMHTML;
foreach($fields as $name=>$value) {
if(!in_array($name,­$config) && ($value || $fields['print_blank_fields'])) {
echo "<b>$name:</b> $value<br>";
}
}
if(isset($fields['return_link_url']) && isset($fields['return_link_title'])) {
echo "<ul><li><a href=\"$fields[return_link_url]\" target=\"_top\">$fi­elds[return_link_title]</a></ul>";
}
echo <<<TERMHTML
<font face="arial" size="2"></font></t­d>
</tr>
</table><br><a href="http://www.$s­erver">Click here to return to our main page</a></b>
</body>
</html>
TERMHTML;
/******************­********************­********************­***********
* Function: Error($server,$valu­e)
* purpose: print off the error message in $value, nice and neat
* Then exit program.
*******************­********************­********************­**********/
function error($server, $value) {
echo <<<TERMHTML
<html>
<head><title>$serve­r Mailform Error</title></html­>
<body bgcolor="$fields[bgcolor]" text="$fields[text_color]" link="$fields[link_color]" vlink="$fields[vlink_color]">
<center>
<table border="1" bordercolor="#00000­0" width="600" cellpadding="4">
<tr>
<td bgcolor="#FEA096">
<font face="arial" size="4" color="$fields[text_color]"><b>­<center>$server Mailform Error</center></b><­/font>
</td>
</tr>
<tr>
<td><b>$value</b>
</td>
</tr>
</table><br><b>Your­ IP is $_SERVER[REMOTE_ADDR]</b>
</center>
</body>
</html>
TERMHTML;
exit;
}
?>
comment 3 answer | Add comment
понедельник, 16 февраля 2009 г.
$ech= "
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или законы РФ. Ваш ip-адрес записывается.
  
 
Пожалуйста, относитесь к собеседникам уважительно, не используйте нецензурные слова, не злоупотребляйте заглавными буквами, не публикуйте рекламу и объявления о купле/продаже, а также материалы нарушающие сетевой этикет или законы РФ. Ваш ip-адрес записывается.


QAIX > PHP web-programmingGo to page: « previous | 1 | 2 | 3 | 4 | 5 | 6 | 7 | next »

see also:
pass tests:
ДЛЯ РУССКИХ ЧУВАКОВ
see also:
Nidesoft Inc. Released Best MP3…
How to Get Videos from Youtube and Use…
Enjoy Your iPod with More Videos: from…

  Copyright © 2001—2010 QAIX
Идея: Монашёв Михаил.
Авторами текстов, изображений и видео, размещённых на этой странице, являются пользователи сайта.
See Help and FAQ in the community support.qaix.com.
Write in the community about the bugs you have noticedbugs.qaix.com.
Write your offers and comments in the communities suggest.qaix.com.
Information for parents.
Пишите нам на .
If you would like to report an abuse of our service, such as a spam message, please .
Если Вы хотите пожаловаться на содержимое этой страницы, пожалуйста .