Navigacija

Vartotojų tinkle

Prisijungusių svečių: 40
Prisijungusių narių: 0
Prisijungusių narių nėra

Registruoti nariai: 25,952
Naujausias narys: tomeem

Naujausi straipsniai

Paskutiniai nariai

tomeem 1 savaitė
Reikalas 2 savaitės
weberiz 4 savaitės
mRokass 7 savaitės
kartoonas 8 savaitės
iaescortsmap 8 savaitės
ozzWANTED 9 savaitės
grunskiz10 savaitės
Bruksnys11 savaitės
illusion11 savaitės
ordo12 savaitės
Jurgaila13 savaitės
originalcs1613 savaitės
Rytis13 savaitės
halis15 savaitės
junkus18 savaitės
morlis18 savaitės
Majakas19 savaitės
andsoft20 savaitės
picolee9022 savaitės

Informacija:


OS: Unknown
Naršyklė: Nežinoma
IP: 13.58.39.23
Naujienų: 529
Straipsnių: 235
Temų: 52,584
Postų: 522,522
Postų pask. parą: 0
Shout'ų pask. parą: 0
P.S.C. pask. parą: 0
Nuorodų kataloge: 13

Lankomumo Statistika

Peržiūrų šiandien: 22

Iš viso peržiūrų: 22948724

Prisijungti

REGISTRUOTIS
Nario vardas

Slaptažodis



Pamiršai slaptažodį?
Paprašyk naujo

Aktyvuoti save

Šaukykla

Jei norite rašyti žinutes, turite prisijungti.

ozzWANTED
2024 Sau. 17 01:01:00
Desperatiškus komentarus šaukykloje su accountu po mėnesio prasibuvimo, ištryniau. Pasaulis ir taip juodas. Įjungiam šviesą, prašviesės. šypsosi

Majakas
2023 Gru. 10 19:12:39
Negaliu patikėti jog žinutės/pranešimai visi yra nuo 2008 m akinanti šypsen

Žmogus
2023 Rugs. 7 21:09:14
O gal BloodKiller pasijungs?

Apocal
2023 Rugs. 2 18:09:23
Nu davai nuveikiam kažką akinanti šypsen. Prisijungti kada visi čia akinanti šypsen.

Apocal
2023 Rugs. 2 00:09:18
Šiaip atėjau pažiūrėti ar dar lopas nesby yra ar koks ten buvo.

Šaukyklos archyvas

Apklausa

Ar esate patenkinti lietuviško vertimo kokybe?

Taip!

Taip, bet yra ką taisyti (parašysiu komentaruose)

Ne

Norėdamas balsuoti turite prisijungti.
Archyvas
Reklama 400x60
PHP: Contact Forma + file attach
Forumas | PHP-Fusion, WordPress, Shopify, PHP ir MySQL (PROGRAMAVIMAS) | Kiti PHP, HTML, MySQL klausimai

Autorius: briedelis Peržiūrų: 2891      Spausdinti temą
2014 Rugp. 28 04:08:59          1 žinutė iš 6
Spausdinti pranešimą
Sveiki, gal galit pagelbėti, dvi dienas akinanti šypsen bandau padaryti bet niekaip neišeina. Turiu contact formą, bet joje nėra funkcijos prisegti failą. HTML kodą susiradau, bet nežinau kaip papildyti php script.

Taigi, HTML kodas:


<form name="htmlform" method="post" action="html_form_send.php">
<table width="450px">
</tr>
<tr>
<td valign="top">
<label for="first_name">First Name *</label>
</td>
<td valign="top">
<input type="text" name="first_name" maxlength="50" size="30">
</td>
</tr>
 
<tr>
<td valign="top"">
<label for="
last_name">Last Name *</label>
</td>
<td valign="
top">
<input type="
text" name="last_name" maxlength="50" size="30">
</td>
</tr>
<tr>
<td valign="
top">
<label for="
email">Email Address *</label>
</td>
<td valign="
top">
<input type="
text" name="email" maxlength="80" size="30">
</td>
 
</tr>
<tr>
<td valign="
top">
<label for="
telephone">Telephone Number</label>
</td>
<td valign="
top">
<input type="
text" name="telephone" maxlength="30" size="30">
</td>
</tr>
<tr>
<td valign="
top">
<label for="
comments">Comments *</label>
</td>
<td valign="
top">
<textarea name="
comments" maxlength="1000" cols="25" rows="6"></textarea>
</td>
 
</tr>
<tr>
<td colspan="
2" style="text-align:center">
<input type="
submit" value="Submit">
</td>
</tr>
</table>
</form>


php script kodas:


<?php
if(isset($_POST['email'])) {
 
// CHANGE THE TWO LINES BELOW
$email_to = "email@email.com";
 
$email_subject = "subject";
 
 
function died($error) {
// your error code can go here
echo "We are very sorry, but there were error(s) found with the form you submitted. ";
echo "These errors appear below.<br /><br />";
echo $error."<br /><br />";
echo "Please go back and fix these errors.<br /><br />";
die();
}
 
// validation expected data exists
if(!isset($_POST['first_name']) ||
!isset($_POST['last_name']) ||
!isset($_POST['email']) ||
!isset($_POST['telephone']) ||
!isset($_POST['comments'])) {
died('We are sorry, but there appears to be a problem with the form you submitted.');
}
 
$first_name = $_POST['first_name']; // required
$last_name = $_POST['last_name']; // required
$email_from = $_POST['email']; // required
$telephone = $_POST['telephone']; // not required
$comments = $_POST['comments']; // required
 
$error_message = "";
$email_exp = '/^[A-Za-z0-9._%-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,4}$/';
if(!preg_match($email_exp,$email_from)) {
$error_message .= 'The Email Address you entered does not appear to be valid.<br />';
}
$string_exp = "/^[A-Za-z .'-]+$/";
if(!preg_match($string_exp,$first_name)) {
$error_message .= 'The First Name you entered does not appear to be valid.<br />';
}
if(!preg_match($string_exp,$last_name)) {
$error_message .= 'The Last Name you entered does not appear to be valid.<br />';
}
if(strlen($comments) < 2) {
$error_message .= 'The Comments you entered do not appear to be valid.<br />';
}
if(strlen($error_message) > 0) {
died($error_message);
}
$email_message = "Form details below.\n\n";
 
function clean_string($string) {
$bad = array("content-type","bcc:","to:","cc:","href");
return str_replace($bad,"",$string);
}
 
$email_message .= "First Name: ".clean_string($first_name)."\n";
$email_message .= "Last Name: ".clean_string($last_name)."\n";
$email_message .= "Email: ".clean_string($email_from)."\n";
$email_message .= "Telephone: ".clean_string($telephone)."\n";
$email_message .= "Comments: ".clean_string($comments)."\n";
 
 
// create email headers
$headers = 'From: '.$email_from."\r\n".
'Reply-To: '.$email_from."\r\n" .
'X-Mailer: <span style="border-bottom: 1px dotted black;">PHP</span>/' . phpversion();
@mail($email_to, $email_subject, $email_message, $headers);
?>
 
<!-- place your own success <span style="border-bottom: 1px dotted black;">html</span> below -->
 
Thank you for contacting us. We will be in touch with you very soon.
 
<?php
}
die();
?>


Pridedu aš į HTML kodą, file attach kodą, o ką pridėti php scripte niekur nerandunežino

<form action="index.php" enctype="multipart/form-data">
Select a file to upload: <input type="file" name="selectedfile" />
</form>

2014 Rugp. 28 15:08:39          2 žinutė iš 6
Spausdinti pranešimą
Siūlyčiau naudot kokia nors biblioteką email siuntimo, nes nelabai teko susidurti su paprastu php mail, kad veiktu prisėgimai
https://www.google.lt/?gws_rd=ss...p;safe=off

2014 Rugp. 28 18:08:44          3 žinutė iš 6
Spausdinti pranešimą
Aš radau kodą kuris, veikia 100% bet man jis netinkamas, kadangi mano žinios nėra labai stiprios, tai jį persiredaguoti kaip man reikia nelabai išeina, nes jame reikia įrašyti kokiam email siųsti žinutę, o man reikia, kad jau būtų nurodytas email automatiškai, kokį esu įrašęs HTML kode. Meginau iš šio kodo persikelti ta attach funkciją, bet ji tada neveikia. Štai tas kodas:

HTML:

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Email Attachment Without Upload - Excellent Web World</title>
<style>
body{ font-family:Arial, Helvetica, sans-serif; font-size:13px;}
th{ background:#999999; text-align:right; vertical-align:top;}
input{ width:181px;}
</style>
</head>
<body>
<form action="emailSend.php" method="post" name="mainform" enctype="multipart/form-data">
<table width="500" border="0" cellpadding="5" cellspacing="5">
<tr>
<th>Your Name</th>
<td><input name="fieldFormName" type="text"></td>
</tr>
<tr>
<tr>
<th>Your Email</th>
<td><input name="fieldFormEmail" type="text"></td>
</tr>
<tr>
<th>To Email</th>
<td><input name="toEmail" type="text"></td>
</tr>
 
<tr>
<th>Subject</th>
<td><input name="fieldSubject" type="text" id="fieldSubject"></td>
</tr>
<tr>
<th>Comments</th>
<td><textarea name="fieldDescription" cols="20" rows="4" id="fieldDescription"></textarea></td>
</tr>
<tr>
<th>Attach Your File</th>
<td><input name="attachment" type="file"></td>
</tr>
<tr>
<td colspan="2" style="text-align:center;"><input type="submit" name="Submit" value="Send"><input type="reset" name="Reset" value="Reset"></td>
</tr>
</table>
</form>
</body>
</html>


PHP:

<?php
 
$to = $_POST['toEmail'];
$fromEmail = $_POST['fieldFormEmail'];
$fromName = $_POST['fieldFormName'];
$subject = $_POST['fieldSubject'];
$message = $_POST['fieldDescription'];
 
/* GET File Variables */
$tmpName = $_FILES['attachment']['tmp_name'];
$fileType = $_FILES['attachment']['type'];
$fileName = $_FILES['attachment']['name'];
 
/* Start of headers */
$headers = "From: $fromName";
 
if (file($tmpName)) {
/* Reading file ('rb' = read binary) */
$file = fopen($tmpName,'rb');
$data = fread($file,filesize($tmpName));
fclose($file);
 
/* a boundary string */
$randomVal = md5(time());
$mimeBoundary = "==Multipart_Boundary_x{$randomVal}x";
 
/* Header for File Attachment */
$headers .= "\nMIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/mixed;\n" ;
$headers .= " boundary=\"{$mimeBoundary}\"";
 
/* Multipart Boundary above message */
$message = "This is a multi-part message in MIME format.\n\n" .
"--{$mimeBoundary}\n" .
"Content-Type: text/plain; charset=\"iso-8859-1\"\n" .
"Content-Transfer-Encoding: 7bit\n\n" .
$message . "\n\n";
 
/* Encoding file data */
$data = chunk_split(base64_encode($data));
 
/* Adding attchment-file to message*/
$message .= "--{$mimeBoundary}\n" .
"Content-Type: {$fileType};\n" .
" name=\"{$fileName}\"\n" .
"Content-Transfer-Encoding: base64\n\n" .
$data . "\n\n" .
"--{$mimeBoundary}--\n";
 


Gal turite kokių minčių? nežino

2014 Rugp. 29 09:08:10          4 žinutė iš 6
Spausdinti pranešimą
Nu tai, kur $to = $_POST['toEmail']; nurodai savo emailą $to = 'emailas@emailas.emailas';
O html faile ištrini ta eilutę:

<tr>
 
<th>To Email</th>
 
<td><input name="toEmail" type="text"></td>
 
</tr>


2014 Rugp. 29 20:08:06          5 žinutė iš 6
Spausdinti pranešimą
Ieškau žmogaus galinčio į pirmąjį kodą įdėti attach funkciją iš antrojo. Sumokėsiu 20LT

Dar kartelį kodai:

1 kodas:
http://www.freecontactform.com/h...

2 kodas:
http://www.excellentwebworld.com...using-php/

2014 Rugs. 2 22:09:21          6 žinutė iš 6
Spausdinti pranešimą
-------------------up----------------------
Peršokti į forumą: