|
v7 contact.php patobulinimas - help
|
| romualdas666 |
parašyta 2010-01-04 22:20
|

Naujokas

Reputacija:
0
Pranešimai: 9
Įstojo: 2009-12-25
|
PAdkite kas turi patirties - reikia pagalbos patobulinant contact.php faila:
Po langeliu "Problemos apra?ymas" noriu, kad bt galimyb sveiams prisegti (PRISEGIMAS SU BROWSE...) wordin, pdf ar kitu formatu (pvz. img, jpg) dokument, kuris pasilikt mano serveryje. Kaip suprantu reikia papildomai susikurti Upload skripta ir segtuv, taiau niekaip nei?eina "integruoti" contact.php fail sios html formos:
GeSHi: HTML <form action="upload_file.php" method="post" enctype="multipart/form-data"> <input type="file" name="file" id="file" /> <input type="submit" name="submit" value="Submit" />
Parsed in 0.003 seconds, using GeSHi 1.0.8.10
Band?iau tai padaryti - neiseina - meta klaidas, esu pradedantis...
kodas:
Code
/*-------------------------------------------------------+
| Filename: contact.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------*/
require_once \"maincore.php\";
require_once THEMES.\"templates/header.php\";
include LOCALE.LOCALESET.\"contact.php\";
add_to_title($locale['global_200'].$locale['400']);
if (isset($_POST['sendmessage'])) {
include_once INCLUDES.\"securimage/securimage.php\";
$error = \"\";
$mailname = substr(stripinput(trim($_POST['mailname'])), 0, 50);
$email = substr(stripinput(trim($_POST['email'])), 0, 100);
$subject = substr(str_replace(array(\"\r\",\"\n\",\"@\", \"\", descript(stripslash(trim($_POST['paslauga'])))), 0, 50);
$telefonas = substr(stripinput(trim($_POST['telefonas'])), 0, 11);
$message = descript(stripslash(trim($_POST['message'])));
$message1 = \"Telefonas: \".$telefonas.\" ?inut: \".$message;
if($telefonas!=\"\"{
if (!preg_match(\"/^[-0-9\s]+$/i\", $telefonas)){
$error .= \"Neteisingai nurodytas Telefono numeris \n\";
}
}
if ($mailname == \"\" {
$error .= \" \".$locale['420'].\" \n\";
}
if ($email == \"\" || !preg_match(\"/^[-0-9A-Z_\.]{1,50}@([-0-9A-Z_\.]+\.){1,50}([0-9A-Z]){2,4}$/i\", $email)) {
$error .= \" \".$locale['421'].\" \n\";
}
if ($subject == \"\" {
$error .= \" \".$locale['422'].\" \n\";
}
if ($message == \"\" {
$error .= \" \".$locale['423'].\" \n\";
}
$securimage = new Securimage();
if (!isset($_POST['captcha_code']) || $securimage->check($_POST['captcha_code']) == false) {
$error .= \" \".$locale['424'].\" \n\";
}
if (!$error) {
require_once INCLUDES.\"sendmail_include.php\";
if (!sendemail($settings['siteusername'],$settings['siteemail'],$mailname,$email,$subject,$message1)) {
$error .= \" \".$locale['425'].\" \n\";
}
}
if ($error) {
opentable($locale['400']);
echo \" \n\".$locale['442'].\"
\n\".$error.\" \n\".$locale['443'].\"
\n\";
closetable();
} else {
opentable($locale['400']);
echo \" \n\".$locale['440'].\"
\n\".$locale['441'].\"
\n\";
closetable();
}
} else {
opentable($locale['400']);
echo $locale['401'].\"
\n\";
echo \"\n\";
closetable();
}
require_once THEMES.\"templates/footer.php\";
?>
Redagavo tabux 2010-01-05 05:03 |
| |
|
|
| aqditt |
parašyta 2010-01-05 01:17
|
Savekas

Reputacija:
0
Pranešimai: 159
Įstojo: 2009-12-25
|
O tu nepagalvoji kad php reikia kist i html, o ne html i php. |
| |
|
|
| tabux |
parašyta 2010-01-05 05:11
|

S.Administratorius

Reputacija:
0
Pranešimai: 1009
Įstojo: 2008-10-16
|
aqditt para?:
O tu nepagalvoji kad php reikia kist i html, o ne html i php.
Pats supranti kokius vjus para?ei?
Tau i? tos formos jokios naudos, ji t fail nekels, imk:
Code
/*-------------------------------------------------------+
| Filename: contact.php
| Author: Nick Jones (Digitanium)
+--------------------------------------------------------*/
require_once \"maincore.php\";
require_once THEMES.\"templates/header.php\";
include LOCALE.LOCALESET.\"contact.php\";
add_to_title($locale['global_200'].$locale['400']);
if (isset($_POST['sendmessage'])) {
include_once INCLUDES.\"securimage/securimage.php\";
$error = \"\";
$mailname = substr(stripinput(trim($_POST['mailname'])), 0, 50);
$email = substr(stripinput(trim($_POST['email'])), 0, 100);
$subject = substr(str_replace(array(\"\r\",\"\n\",\"@\", \"\", descript(stripslash(trim($_POST['paslauga'])))), 0, 50));
$telefonas = substr(stripinput(trim($_POST['telefonas'])), 0, 11);
$message = descript(stripslash(trim($_POST['message'])));
$message1 = \"Telefonas: \".$telefonas.\" ?inut: \".$message;
if($telefonas!=\"\"){
if (!preg_match(\"/^[-0-9\s]+$/i\", $telefonas)){
$error .= \"Neteisingai nurodytas Telefono numeris \n\";
}
}
if ($mailname == \"\") {
$error .= \" \".$locale['420'].\" \n\";
}
if (($email == \"\") || !preg_match(\"/^[-0-9A-Z_\.]{1,50}@([-0-9A-Z_\.]+\.){1,50}([0-9A-Z]){2,4}$/i\", $email)) {
$error .= \" \".$locale['421'].\" \n\";
}
if ($subject == \"\") {
$error .= \" \".$locale['422'].\" \n\";
}
if ($message == \"\") {
$error .= \" \".$locale['423'].\" \n\";
}
$securimage = new Securimage();
if (!isset($_POST['captcha_code']) || $securimage->check($_POST['captcha_code']) == false) {
$error .= \" \".$locale['424'].\" \n\";
}
if (!$error) {
require_once INCLUDES.\"sendmail_include.php\";
if (!sendemail($settings['siteusername'],$settings['siteemail'],$mailname,$email,$subject,$message1)) {
$error .= \" \".$locale['425'].\" \n\";
}
}
if ($error) {
opentable($locale['400']);
echo \" \n\".$locale['442'].\"
\n\".$error.\" \n\".$locale['443'].\"
\n\";
closetable();
} else {
opentable($locale['400']);
echo \" \n\".$locale['440'].\"
\n\".$locale['441'].\"
\n\";
closetable();
}
} else {
opentable($locale['400']);
echo $locale['401'].\"
\n\";
echo \"\n\";
closetable();
}
require_once THEMES.\"templates/footer.php\";
?>
|
| |
|