Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Nuotraukos siuntimas - skelbimo pildymas

Parašė 1941· 2014 Sau. 10 13:01:51
#1

Sveiki,
Pažiūrėkite ką būtų galima padaryt, jog eitų pridėti laukelį, kur galėtumei pasirinkti nuotrauką iš kompiuterio.

1) Nuotrauka būtų talpinama į pasirinktą folderį FTP serveryje.
2) Nusiuntus žinutę į paštą būtų rodoma nuotraukos NUORODA.

Visas kodas:

<?php
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'])) {
	$error = "";
	$mailname = isset($_POST['mailname']) ? substr(stripinput(trim($_POST['mailname'])), 0, 50) : "";
	$email = isset($_POST['email']) ? substr(stripinput(trim($_POST['email'])), 0, 100) : "";
	$subject = isset($_POST['subject']) ? substr(str_replace(array("\r","\n","@"), "", descript(stripslash(trim($_POST['subject'])))), 0, 50) : "";
	$telefonas = isset($_POST['telefonas']) ? descript(stripslash(trim($_POST['telefonas']))) : "";
	$nuotrauka = isset($_POST['nuotrauka']) ? descript(stripslash(trim($_POST['nuotrauka']))) : "";
	$kaina = isset($_POST['kaina']) ? descript(stripslash(trim($_POST['kaina']))) : "";
	$kategorija = isset($_POST['kategorija']) ? descript(stripslash(trim($_POST['kategorija']))) : "";
	$message = isset($_POST['message']) ? descript(stripslash(trim($_POST['message']))) : "";
	$message = "Vardas Pavardė:".$mailname."\nTelefonas:".$telefonas."\nDaikto pavadinimas:".$subject."\nKaina:".$kaina."\nNuotrauka:".$nuotrauka."\nKategorija:".$kategorija."\n\nDetalus prekės aprašymas:".$message;
 
if ($mailname == "") {
		$error .= " <span class='alt'>".$locale['420']."</span><br />\n";
	}
	if ($email == "" || !preg_match("/^[-0-9A-Z_\.]{1,50}@([-0-9A-Z_\.]+\.){1,50}([0-9A-Z]){2,4}$/i", $email)) {
		$error .= " <span class='alt'>".$locale['421']."</span><br />\n";
	}
	if ($subject == "") {
		$error .= " <span class='alt'>".$locale['422']."</span><br />\n";
	}
	if ($message == "") {
		$error .= " <span class='alt'>".$locale['423']."</span><br />\n";
	}
if ($telefonas == "") {
		$error .= " <span class='alt'>".$locale['426']."</span><br />\n";
	}
if ($kaina == "") {
		$error .= " <span class='alt'>".$locale['427']."</span><br />\n";
	}
if ($kategorija == "") {
		$error .= " <span class='alt'>".$locale['429']."</span><br />\n";
	}
if ($nuotrauka == "") {
		$error .= " <span class='alt'>".$locale['428']."</span><br />\n";
	}
	$_CAPTCHA_IS_VALID = false;
	include INCLUDES."captchas/".$settings['captcha']."/captcha_check.php";
	if ($_CAPTCHA_IS_VALID == false) {
		$error .= " <span class='alt'>".$locale['424']."</span><br />\n";
	}
	if (!$error) {
		require_once INCLUDES."sendmail_include.php";
		if (!sendemail($settings['siteusername'],$settings['siteemail'],$mailname,$email,$subject,$message)) {
			$error .= " <span class='alt'>".$locale['425']."</span><br />\n";
		}
	}
	if ($error) {
		opentable($locale['400']);
		echo "<div style='text-align:center'><br />\n".$locale['442']."<br /><br />\n".$error."<br />\n".$locale['443']."</div><br />\n";
		closetable();
	} else {
		opentable($locale['400']);
		echo "<div style='text-align:center'><br />\n".$locale['440']."<br /><br />\n".$locale['441']."</div><br />\n";
		closetable();
	}
} else {
	opentable($locale['400']);
	echo $locale['401']."<br /><br />\n";
	echo "<form name='userform' method='post' action='".FUSION_SELF."'>\n";
	echo "<table cellpadding='0' cellspacing='0' class='center'>\n<tr>\n";
	echo "<td width='200' class='tbl'>".$locale['402']."</td>\n";
	echo "<td class='tbl'><input type='text' name='mailname' maxlength='50' class='textbox' style='width: 200px;' /></td>\n";
	echo "</tr>\n<tr>\n";
	echo "<td width='200' class='tbl'>".$locale['403']."</td>\n";
	echo "<td class='tbl'><input type='text' name='email' maxlength='100' class='textbox' style='width: 200px;' /></td>\n";
	echo "</tr>\n<tr>\n";
	echo "<td width='200' class='tbl'>".$locale['404']."</td>\n";
	echo "<td class='tbl'><input type='text' name='telefonas' maxlength='50' class='textbox' style='width: 200px;' /></td>\n";
	echo "</tr>\n<tr>\n";
	echo "<td width='200' class='tbl'>".$locale['409']."</td>\n";
	echo "<td class='tbl'><input type='text' name='subject' maxlength='50' class='textbox' style='width: 200px;' /></td>\n";
	echo "</tr>\n<tr>\n";
	echo "<td width='200' class='tbl'>".$locale['411']."</td>\n";
	echo "<td class='tbl'><input type='text' name='kaina' maxlength='5' class='textbox' style='width: 200px;' /></td>\n";
	echo "</tr>\n<tr>\n";
	echo "<td width='200' class='tbl'>".$locale['412']."</td>\n";
	echo "<td class='tbl'><input type='text' name='kategorija' maxlength='50' class='textbox' style='width: 200px;' /></td>\n";
	echo "</tr>\n<tr>\n";
	echo "<td width='200' class='tbl'>".$locale['410']."</td>\n";
	echo "<td class='tbl'><input type='text' name='nuotrauka' maxlength='70' class='textbox' style='width: 200px;' /></td>\n";
	echo "</tr>\n<tr>\n";
	echo "<td width='200' class='tbl'>".$locale['405']."</td>\n";
	echo "<td class='tbl'><textarea name='message' rows='10' class='textbox' cols='50'></textarea></td>\n";
	echo "</tr>\n<tr>\n";
	echo "<td width='100' class='tbl'>".$locale['407']."</td>\n";
	echo "<td class='tbl'>";
	include INCLUDES."captchas/".$settings['captcha']."/captcha_display.php";
	if (!isset($_CAPTCHA_HIDE_INPUT) || (isset($_CAPTCHA_HIDE_INPUT) && !$_CAPTCHA_HIDE_INPUT)) {
		echo "</td>\n</tr>\n<tr>";
		echo "<td class='tbl'><label for='captcha_code'>".$locale['408']."</label></td>\n";
		echo "<td class='tbl'>";
		echo "<input type='text' id='captcha_code' name='captcha_code' class='textbox' autocomplete='off' style='width:100px' />";
	}
	echo "</td>\n</tr>\n<tr>\n";
	echo "<td align='center' colspan='2' class='tbl'>\n";
	echo "<input type='submit' name='sendmessage' value='".$locale['406']."' class='button' /></td>\n";
	echo "</tr>\n</table>\n</form>\n";
	closetable();
}
 
require_once THEMES."templates/footer.php";
?>


O čia, kas nežinote, ta eilutė, kuri nurodo, kas bus atvaizduojama el. pašte, kai forma bus užpildyta:
$message = "Vardas Pavardė:".$mailname."\nTelefonas:".$telefonas."\nDaikto pavadinimas:".$subject."\nKaina:".$kaina."\nNuotrauka:".$nuotrauka."\nKategorija:".$kategorija."\n\nDetalus prekės aprašymas:".$message;


Štai taip viskas atrodo dabar:
http://www.part.lt/img/54e7c418d...603966.PNG