jazzman1
Staff Alumni-
Posts
2,713 -
Joined
-
Last visited
-
Days Won
12
Everything posted by jazzman1
-
PHP Exec Function Doesn't work with cd Ubuntu Command
jazzman1 replied to unemployment's topic in PHP Coding Help
Give me the message back: <?php $dir = shell_exec('pwd'); echo $dir; -
PHP Exec Function Doesn't work with cd Ubuntu Command
jazzman1 replied to unemployment's topic in PHP Coding Help
Ok, step by step...... this is a not real directory - "/var/www/mysite.com/mysite.com" What is the real one? -
Does XAMPP have a proper connection to MSSQL?
-
PHP Exec Function Doesn't work with cd Ubuntu Command
jazzman1 replied to unemployment's topic in PHP Coding Help
Yes, that's correct you can do this. Write a simple bash script which take exerything that you want to get and execute that script by shell_exec(). That's all. -
PHP Exec Function Doesn't work with cd Ubuntu Command
jazzman1 replied to unemployment's topic in PHP Coding Help
I think you do not understand very proper how those functions work. -
Convert UTF8 characters to ISO when exporting from MySQL DB to Excel file
jazzman1 replied to Baltas's topic in MySQL Help
Sorry, I don't use Microsoft products, but about the second one with a mb_convert_encoding() function try to get all results from mysql database into an array(). Something like that: $str = array("ąčęėįšųūž","ąčęėįšųūž","ąčęėįšųūž"); $out = mb_convert_encoding(implode(',', $str), "ISO-8859-13", "UTF-8"); header('Content-type: application/octet-stream'); header("Content-Disposition: attachment; filename=excelfile.csv"); header("Pragma: no-cache"); header("Expires: 0"); echo $out; -
No, is not. I think the us-ascii code for an "á" symbol is: $str = "\xe1"; // á echo utf8_encode($str); Can you try to get a ascii code for an "á" symbol?
-
Put your emails into an array and just implode them. Example: // multiple recipients $to = array('examle1@example.com','example2@example.com','example3@example.com'); // send emails mail(implode(',', $to), $subject, $message, $headers);
-
@OP, this is wrong: $msg = "NAME: " .$_POST['name'] ."<br>\n"; $msg .= "EMAIL: " .$_POST['email'] ."<br>\n"; $msg .= "COMMENTS: " .$_POST['comments'] ."<br>\n"; Correct one for Unix platform: $msg = "NAME: " .$_POST['name'] ."\n"; $msg .= "EMAIL: " .$_POST['email'] ."\n"; $msg .= "COMMENTS: " .$_POST['comments'] ."\n"; For non-Unix platform: $msg = "NAME: " .$_POST['name'] ."\r\n"; $msg .= "EMAIL: " .$_POST['email'] ."\r\n"; $msg .= "COMMENTS: " .$_POST['comments'] ."\r\n"; You can also check - PHP_EOL. EDIT: Never ever loop the mail function. Take a look at this.
-
PHP Include workaround need for tough/rough coded site
jazzman1 replied to mag00's topic in PHP Coding Help
Why don't you create a custom php.ini file if you're thinking that the problem is there? -
PHP Exec Function Doesn't work with cd Ubuntu Command
jazzman1 replied to unemployment's topic in PHP Coding Help
A shell_exec() should be work too! Try, $test = shell_exec('cd /var/www/mysite.com/mysite.com;pwd'); echo $test; -
Convert UTF8 characters to ISO when exporting from MySQL DB to Excel file
jazzman1 replied to Baltas's topic in MySQL Help
Christian's answer is correct, you don't have to convert anything, just make sure that your tables are on collation utf8_general_ci. Change and add those: $dbc = mysql_connect('localhost', 'user', 'password') or die('Error connecting to MySQL server.'); $db_name = mysql_select_db('database', $dbc); //set charset to utf8 mysql_set_charset('utf8',$dbc); $query = "SELECT first_name AS 'Pavardė', age AS 'Amžius', etc. etc. etc. FROM $DB_TBLName"; $result = mysql_query($query) or die('Error querying database.'); $file_ending = "xls"; // change also that header("Content-Type: application/octet-stream; charset=utf-8"); -
PHP Exec Function Doesn't work with cd Ubuntu Command
jazzman1 replied to unemployment's topic in PHP Coding Help
Try to run a shell_exec() php function instead of exec(), it should work. Exemple: $test = shell_exec('cd /var/www/mysite.com/mysite.com', $output); echo $test; If you want to list another directories where apache does not have permissions: //create a copy of catalogDB to attach $cd = shell_exec("chmod 755 /home/user/Downloads -R; cd /home/user/Downloads; ls -la ."); echo $cd; -
UTF8 lithuanian characters unrecognized in MySQL database
jazzman1 replied to Baltas's topic in MySQL Help
When you are using mysqli_set_charset() the first argument must be the link identifier unlike from mysql_set_charset(). -
I know that Jessi, she is a teenage but obviously she is still a kid.
-
UTF8 lithuanian characters unrecognized in MySQL database
jazzman1 replied to Baltas's topic in MySQL Help
What would happen if you try to insert lithuanian characters without filling the html form? <?php $conn = mysql_connect('host','user','password'); $db_name = mysql_select_db('wp-database', $conn); mysql_set_charset('utf8', $conn); $query = "INSERT reg_form (title,body) value ('Aciu. Ačiū', 'Sveiki atvyke Sveiki atvykę')"; $res = mysql_query($query); -
UTF8 lithuanian characters unrecognized in MySQL database
jazzman1 replied to Baltas's topic in MySQL Help
This doesn't make sanse to me. Can you show us the result of: SHOW TABLE STATUS FROM wp-database; -
Hey guys, our daughter lost them few days ago and she is telling us today. What is the standart procedures in these cases? Is it possible the providers or me tracking them by GPS or something else? Thanks in advance jazz...
-
UTF8 lithuanian characters unrecognized in MySQL database
jazzman1 replied to Baltas's topic in MySQL Help
Just compare the status of collation. Example: SHOW TABLE STATUS FROM wp-database; AND SHOW TABLE STATUS FROM new-database; -
@regunix, I think he wants to execute a php GET variable by terminal. My suggestion: <?php $DealerID = $_GET['DealerID']; //create a copy of catalogDB to attach exec("php-cgi -f /home/terra/public_html/CreateDealerCatalogDB.php ID=$DealerID save=1");
-
I think that the post content-length of the binary file exceeds the limit. Paste in that on the top of your script: <?php error_reporting(-1); ?>
-
PHP does not care about ids from the form, only names and values atributes.
-
Hm.... intersting. I never used json_decode converting json objects into associative php arrays. Anyway, I've tested your suggestion minutes ago and.........it's true. Here is it: <?php $data = '{"result":"success","data":{"high":{"value":"207.00000","value_int":"20700000","display":"$207.00","display_short":"$207.00","currency":"USD"},"low":{"value":"172.13000","value_int":"17213000","display":"$172.13","display_short":"$172.13","currency":"USD"},"avg":{"value":"190.06255","value_int":"19006255","display":"$190.06","display_short":"$190.06","currency":"USD"},"vwap":{"value":"189.49989","value_int":"18949989","display":"$189.50","display_short":"$189.50","currency":"USD"},"vol":{"value":"105772.39701647","value_int":"10577239701647","display":"105,772.40\u00a0BTC","display_short":"105,772.40\u00a0BTC","currency":"BTC"},"last_local":{"value":"205.97101","value_int":"20597101","display":"$205.97","display_short":"$205.97","currency":"USD"},"last_orig":{"value":"159.39420","value_int":"15939420","display":"159.39\u00a0\u20ac","display_short":"159.39\u00a0\u20ac","currency":"EUR"},"last_all":{"value":"207.57907","value_int":"20757907","display":"$207.58","display_short":"$207.58","currency":"USD"},"last":{"value":"205.97101","value_int":"20597101","display":"$205.97","display_short":"$205.97","currency":"USD"},"buy":{"value":"205.55333","value_int":"20555333","display":"$205.55","display_short":"$205.55","currency":"USD"},"sell":{"value":"205.97101","value_int":"20597101","display":"$205.97","display_short":"$205.97","currency":"USD"},"item":"BTC","now":"1365510862857980"}}'; $obj = json_decode($data, true); echo '<pre>'.print_r($obj['data']['avg'], true).'</pre>'; Results: Very good forum. I will take a note in the future
-
Sorry, but your php code messed up, so if I try to help you, I have to rewrite almost everything from scratch. You need to take a step back learning more about good practices in php. Take a look at that web site.
-
Can you show us how you are defined the "INCLUSIONS" constant? I thing you have a problem with the proper path to the file. Also, could you paste on the top of your srcript that line: error_reporting(-1);