jazzman1
Staff Alumni-
Posts
2,713 -
Joined
-
Last visited
-
Days Won
12
Everything posted by jazzman1
-
I was found the following code few years ago somewhere in the web and still works. It should be easy to understand and re-write your script to it. Here it is, <?php $to = "nobody@example.com"; $from = "jazzman@centos-box.com"; $subject = "Here is your attachment"; $mess = "test pdf message"; $fileatt = "SQL.pdf"; $fileatt_type = "application/pdf"; $fileatt_name = "mypdf.pdf"; $headers = "From: $from"; $file = fopen($fileatt, "rb"); $data = fread($file, filesize($fileatt)); fclose($file); $semi_rand = md5(time()); $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x"; // Add the headers for a file attachment $headers .= "\nMIME-Version: 1.0\r\n" . "Content-Type: multipart/mixed;\r\n" . " boundary=\"{$mime_boundary}\""; // Add a multipart boundary above the plain message $message = "This is a multi-part message in MIME format.\r\n\r\n" . "--{$mime_boundary}\r\n" . "Content-Type: text/plain; charset=\"iso-8859-1\"\r\n" . "Content-Transfer-Encoding: 7bit\r\n\r\n" . $mess . "\r\n\r\n"; // Base64 encode the file data $data = chunk_split(base64_encode($data)); // Add file attachment to the message $message .= "--{$mime_boundary}\r\n" . "Content-Type: {$fileatt_type};\r\n" . " name=\"{$fileatt_name}\"\r\n" . "Content-Transfer-Encoding: base64\r\n\r\n" . $data . "\r\n\r\n" . "--{$mime_boundary}--\r\n"; if (mail($to, $subject, $message, $headers)) { echo "<p>The email was sent.</p>"; } else { echo "<p>There was an error sending the mail.</p>"; }
-
There is a wireshark packet for windows systems. Another alternative I could suggest it's named ettercat (I used to it many years ago) but a wincap packet should be installed manually to get work with it.
-
You need to install in your machine a sniffer network tool to capture network data. If you are on linux/unix environment, wireshark and tcpdump are great tools.
-
What is the default encoding of this application ( windows live mail ) being set?
-
Can you format your code using our code tags. So, you are saying, you are able to send a pdf file and the file has been sent to the mail server successfully, but without attachment view, only as binary data, right? Why are you calling the mail function twice?
-
It's a "JOIN" but using old style comma-separated list of tables syntax, something like - from table1, table2, etc..... This statement says to the parser, to list only those rows from the topics table with matching rows from the categories table (c.id), which id2 is equal to 1. Everything else will be omitted in the select block. I'd recommend you to start reading up on "JOIN" syntax, which is more readable, powerful and flexible.
-
Block or Dissallow http string in Contact Form Message Box
jazzman1 replied to AndreD's topic in PHP Coding Help
Captcha and data sanitization. -
I am not sure where the problem is, but have you tried - REPAIR TABLE db_name.table_name. The other method that could try is to export table data to sql file, then drop the table and restore it from the same dump sql file.
-
Weird! Maybe it's a bug. Does that happen only to this particular database/table? What specific permissions have the user to this database/tables? Is this a root account?
-
Try to set the second parameter of a ftp_nlist function to null or to empty string, both cases work to me (linux server). $buff= ftp_nlist($conn_id, ''); // or $buff= ftp_nlist($conn_id, NULL); You can also turn a passive mode on in case the ftp server required. Try, <?php $ftp_server = "eeeproject.host22.com"; $ftp_user_name = "user"; $ftp_user_pass = "password"; $conn_id = ftp_connect($ftp_server) or die("Couldn't connect to $ftp_server"); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); // turn passive mode to on ftp_pasv($conn_id, true); if ($login_result) { ftp_chdir($conn_id, "public_html"); echo ftp_pwd($conn_id); $buff = ftp_nlist($conn_id,'.'); var_dump($buff); } ftp_close($conn_id);
-
I'm not familiar with this library, however, at a starting point add the following error reporting functions on top of the file. <?php ini_set('display_startup_errors',1); ini_set('display_errors',1); error_reporting(-1); $ftp_server="eeeproject.host22.com"; $ftp_user_name="user"; $ftp_user_pass="password"; $conn_id = ftp_connect($ftp_server) or die ("Couldn't connect to $ftp_server"); $login_result = ftp_login($conn_id, $ftp_user_name, $ftp_user_pass); if($login_result){ ftp_chdir($conn_id, "public_html"); echo ftp_pwd($conn_id); $buff= ftp_nlist($conn_id, '.'); var_dump($buff); } ftp_close($conn_id); What OS is the server running?
-
You should get an error message if you try to use superglobals along with prepared queries
-
Most likely this library isn't installed to this version of php. Did you try to turn on error reporting as Psycho suggested above? I believe not. You would also check whether a ftp_connect function exists or not to your current version of laguage: if(!function_exists('ftp_connect')){ echo "Not exist"; } else { echo "Exists"; } // to get all defined functions echo '<pre>'.print_r(get_defined_functions(),true).'</pre>';
-
Send me email at tuparov86@gmail.com, to check the mail headers.
-
But, how that happened? The minChat() function is out of jquery scope. It would be much more easier for us if you provide a link to your chat app to see what actually happens.
-
Really? The animate function isn't part of core JS. Is this a real script, if so, I tested it and the minChat function does't work at all.
-
By default this app uses the phpMailer library whose default charset is set to iso-8859-1, but apache headers are being set to utf-8, don't ask me why So, find the file named class_mail.inc.php, the full path is - /maian_events/events/classes/class_mail.inc.php and change the charset inside mailHeaders() function from utf-8 to iso-8859-1. The function, // Mail headers.. function mailHeaders($name,$email) { if ($this->html) { $headers = "Content-type: text/html; charset=utf-8\r\n"; $headers .= "From: \"".$this->injectionCleaner($name)."\" <".$email.">\n"; } else { $headers = "Content-type: text/plain; charset=utf-8\r\n"; $headers .= "From: \"".$this->injectionCleaner($name)."\" <".$email.">\n"; } $headers .= "X-Sender: \"".$this->injectionCleaner($name)."\" <".$email.">\n"; $headers .= "X-Mailer: PHP\n"; $headers .= "X-Priority: 3\n"; $headers .= "X-Sender-IP: ".$_SERVER['REMOTE_ADDR']."\n"; $headers .= "Return-Path: \"".$this->injectionCleaner($name)."\" <".$email.">\n"; $headers .= "Reply-To: \"".$this->injectionCleaner($name)."\" <".$email.">\n"; return $headers; }
-
Show us the html form and php script with the mail() function.
-
update v 5.3.x => v 5.5.x
jazzman1 replied to blondie72's topic in PHP Installation and Configuration
I didn't have any issues by compiling a php version 5.5.10 on my centos6.4 machine and everything works just fine. Here are all configure options that I've used: [root@localhost php-5.5.10]# ./configure --with-config-file-path=/etc --with-config-file-scan-dir=/etc/php.d \ --with-apxs2 --with-libdir=lib64 --with-mysql --with-mysqli \ --with-pdo-mysql --with-mysql-sock --with-gd --with-vpx-dir \ --with-jpeg-dir --with-png-dir -with-zlib-dir --with-xpm-dir \ --with-freetype-dir --with-t1lib --enable-gd-native-ttf --enable-gd-jis-conv --with-curl -
Does a substr function return the result you are expected? Substr just returns some part of a string and the foreach construct provides an easy way to iterate over arrays, you can't use it here.
-
I don't have any idea how this software works that's why I'm asking stupid questions As I stated above all files and directories starting with dot (.) sign are considered as hidden, so, php doesn't (cannot) hide them because they are already hidden, what php does is to disable all requests to them whose requests coming from the browser or other clients software using same http ports and protocols. You could redirect or just give some notice to every request to those hidden directories/files or directories/files starting with underscore using apache rules instead writting a php script to achieve this. Can you tell me how the members browse their files by browser or other software?
-
So, you want to say that you have no control to say where the soft to create this _SYNCAPP directory in your web site? You can disable all requests using an apache mod_secuity instead of writting a ton of php scripts.
-
Why don't you create a hidden directory and let Allway Sync to look for the _SYNCAPP folders there? What do you mean by saying this? How the members browse their files and directories in yours web site using a control panel or something different?
-
Hm....yes, my idea was to make this folder hidden renaming it inside Allway Sync Software, but obviously it's an impossible task. If you try to rename that folder in your website this could bring into conflict with Allway Sync. What do you think?