jazzman1
Staff Alumni-
Posts
2,713 -
Joined
-
Last visited
-
Days Won
12
Everything posted by jazzman1
-
It's already taken from someone who doesn't visit the forum anymore:)
-
File Upload - Image Resize and Saves in Image Folder
jazzman1 replied to jillianmarie's topic in PHP Coding Help
The server does not care about the px of the image only from file size. Check that values in the php.ini file: file_uploads = On upload_max_filesize = 2048M max_file_uploads = 2M post_max_size = 2048M- 14 replies
-
- file upload
- upload
-
(and 3 more)
Tagged with:
-
Ha-ha-ha, I completely forgot what date is today. EDIT: @Philip a little beside, is it possible you to change my user name from jazzman1 to simple jazzman because of the length
-
Philip, I don't like this prefix. Our names are getting too long. How can I remove it? jazz.
-
Could you explain this query ? Example: $query = "EXPLAIN SELECT p.*, a.payout_level, a.buttonimage, a.smalldesc,a.companyname, v.* FROM products p left join advert a on p.advertId = a.id AND a.network='4' left join ( Select min(id), merchantid, code, value from vouchers group by merchantid ) as v on a.id = v.merchantid WHERE p.prod_name LIKE '%glass%' And p.cat like 'Glassware' order by p.fee asc LIMIT 0, 6";
-
By the way, do you have any idea what RAM on the server is?
-
Try, $email = 'jazzman@gmail.com'; $regexp = "/^[A-Za-z0-9](([_\.\-]?[a-zA-Z0-9]+)*)@([A-Za-z0-9]+)(([\.\-]?[a-zA-Z0-9]+)*)\.([A-Za-z]{2,})$/i"; if (preg_match($regexp, $email)) return true; else return false;
-
I don't know why you cannot retrieve the content from multiple tables and databases. Unfortunately, there is no way to test it how this wonderful program works in windows ( I have only windows 95) See my log, the last time that I restarted the mysql-workbench was at March 28. Log: [jazzman@localhost log]$ ps aux | grep /usr/bin/mysql-workbench jazzman 31356 0.0 0.0 106096 1276 ? Sl Mar28 63:27 /bin/bash /usr/bin/mysql-workbench jazzman 32504 0.0 0.0 103244 844 pts/0 S+ 12:57 0:00 grep /usr/bin/mysql-workbench
-
Hm..... that's very weird. I've never have a problem with it for one year on my CentOS6.x (Gnome) machine. I thing that problem appears because of yours linux graphical environment.
-
No, the first time when I ran the script into my local server I've got a pdf file with 0 size. Anyway I've made one more test this time from my server to godaddy (linux server). Works fine, here is it: <?php $file = 'jazzman_cv.pdf'; $file_size = filesize($file); $handle = fopen($file, "r"); $content = fread($handle, $file_size); fclose($handle); $content = base64_encode($content); $filename = "jazzmanCV.pdf"; $email_subject = 'Test attachment'; $from = 'jazzman'; $from_mail = 'jazzman@localdomain.localhost'; $replyto = 'jazman@gmail.com'; $subject = "Please See Attachment."; $mailto = 'tuparov86@gmail.com'; $message = 'Test message from jazzman'; // a random hash will be necessary to send mixed content $uid = md5(uniqid(time())); $header = "From: " . $from . " <" . $from_mail . "> \n"; $header .= "Reply-To: " . $replyto . "\n"; $header .= "MIME-Version: 1.0 \n"; $header .= "Content-Type: multipart/mixed; boundary=\"" . $uid . "\n"; $header .= "This is a multi-part message in MIME format.\n"; $header .= "--" . $uid . "\n"; $header .= "Content-type:text/plain; charset=iso-8859-1 \n"; $header .= "Content-Transfer-Encoding: 7bit \n"; $header .= $message . " \n"; $header .= "--" . $uid . "\n"; $header .= "Content-Type: application/octet-stream; name=\"" . $filename . "\n"; // use different content types here $header .= "Content-Transfer-Encoding: base64\n"; $header .= "Content-Disposition: attachment; filename=\"" . $filename . "\" \n"; $header .= $content . " \n"; $header .= "--" . $uid . "--"; if (mail($mailto, $subject, "", $header)) { echo "mail send ... OK"; // redirect the user } else { echo "mail send ... ERROR!"; } Don't use \r on an linux server or use PHP_EOL instead of it.
-
I'm not kidding about 95
-
Your server takes care of the pence Turn on error_reporting: Paste that on the top of the script: error_reporting(-1);
-
I see a lot of errors in your script you need to start it from scratch. Where do you define the variables $password and $username?
- 10 replies
-
- php
- login/registration
-
(and 3 more)
Tagged with:
-
Md5 hashes the value of the password, there is nothing strange here. What do you want to say in proper English to that statement, else if(!mysql_num_rows($results)) {
- 10 replies
-
- php
- login/registration
-
(and 3 more)
Tagged with:
-
1.CentOS / RedHat - GNOME 2. Bash / grep / ssh / grub /sendmail / fdisk / make / cURL /etc... 3. Bacula 4. MySQL / FireBird 5. mysql and firebird command line/ phpMyAdmin / MySQL WorkBench 6. GIMP 7. Git 8. NetBeans / Vim 9.Windows 95
-
How to download a pdf and mp3 file stored in mysql
jazzman1 replied to Jaswinder's topic in MySQL Help
Fix the headers errors and use the script from my reply #6. -
The problem was that you wasn't get the size of the file. With chunk_split() works too, $file = 'jazzman_cv.pdf'; $file_size = filesize($file); $handle = fopen($file, "r"); $content = fread($handle, $file_size); fclose($handle); $content = chunk_split(base64_encode($content)); continue.................
-
Take this one.... tested: <?php $file = 'jazmzan_cv.pdf'; $file_size = filesize($file); $handle = fopen($file, "r"); $content = fread($handle, $file_size); fclose($handle); $content = base64_encode($content); $filename = "jazzmanCV.pdf"; $email_subject = 'Test attachment'; $from = 'jazzman'; $from_mail = 'jazzman@localdomain.localhost'; $replyto = 'jazman@gmail.com'; $subject = "Please See Attachment."; $mailto = 'tuparov86@gmail.com'; $message = 'Test message from jazzman'; // a random hash will be necessary to send mixed content $uid = md5(uniqid(time())); $header = "From: " . $from . " <" . $from_mail . ">\r\n"; $header .= "Reply-To: " . $replyto . "\r\n"; $header .= "MIME-Version: 1.0\r\n"; $header .= "Content-Type: multipart/mixed; boundary=\"" . $uid . "\"\r\n\r\n"; $header .= "This is a multi-part message in MIME format.\r\n"; $header .= "--" . $uid . "\r\n"; $header .= "Content-type:text/plain; charset=iso-8859-1\r\n"; $header .= "Content-Transfer-Encoding: 7bit\r\n\r\n"; $header .= $message . "\r\n\r\n"; $header .= "--" . $uid . "\r\n"; $header .= "Content-Type: application/octet-stream; name=\"" . $filename . "\"\r\n"; // use different content types here $header .= "Content-Transfer-Encoding: base64\r\n"; $header .= "Content-Disposition: attachment; filename=\"" . $filename . "\"\r\n\r\n"; $header .= $content . "\r\n\r\n"; $header .= "--" . $uid . "--"; if (mail($mailto, $subject, "", $header)) { echo "mail send ... OK"; // redirect the user } else { echo "mail send ... ERROR!"; } Result:
-
Hm..... there is something wrong here. Give me few minutes.
-
Why did you attach the pdf file to the headers? If you are new in php I would recommend you using the swiftMailer php mail library to send your emails.
-
So, what error(s) do you get?
-
How to download a pdf and mp3 file stored in mysql
jazzman1 replied to Jaswinder's topic in MySQL Help
Well, it's pretty straightforward there is no file with this name in /songs directory Did you read the link which I sent you above? -
bash script to create xml from mysql query - out of memory
jazzman1 replied to carlosp's topic in Other Programming Languages
There is too much code, just use --xml or --html flags to retrieve the content from tables and write it down into a file. Example in Bash with a xml flag: #!/bin/bash # MYSQL DATABASE Login info DBHOST=localhost DBUSER=jazzman DBPASS=password # define the database and select the table CMD="use sakila;SELECT * FROM film WHERE release_year=2006;" /usr/bin/mysql -h ${DBHOST} -u ${DBUSER} --password=${DBPASS} --xml -e "$CMD">~/newXML.xml Results: <?xml version="1.0"?> <resultset statement="SELECT * FROM film WHERE release_year=2006" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <row> <field name="film_id">1</field> <field name="title">ACADEMY DINOSAUR</field> <field name="description">A Epic Drama of a Feminist And a Mad Scientist who must Battle a Teacher in The Canadian Rockies</field> <field name="release_year">2006</field> <field name="language_id">1</field> <field name="original_language_id" xsi:nil="true" /> <field name="rental_duration">6</field> <field name="rental_rate">0.99</field> <field name="length">86</field> <field name="replacement_cost">20.99</field> <field name="rating">PG</field> <field name="special_features">Deleted Scenes,Behind the Scenes</field> <field name="last_update">2006-02-15 05:03:42</field> </row> <row> <field name="film_id">2</field> <field name="title">ACE GOLDFINGER</field> <field name="description">A Astounding Epistle of a Database Administrator And a Explorer who must Find a Car in Ancient China</field> <field name="release_year">2006</field> <field name="language_id">1</field> <field name="original_language_id" xsi:nil="true" /> <field name="rental_duration">3</field> <field name="rental_rate">4.99</field> <field name="length">48</field> <field name="replacement_cost">12.99</field> <field name="rating">G</field> <field name="special_features">Trailers,Deleted Scenes</field> <field name="last_update">2006-02-15 05:03:42</field> </row> <row> <field name="film_id">3</field> <field name="title">ADAPTATION HOLES</field> <field name="description">A Astounding Reflection of a Lumberjack And a Car who must Sink a Lumberjack in A Baloon Factory</field> <field name="release_year">2006</field> <field name="language_id">1</field> <field name="original_language_id" xsi:nil="true" /> <field name="rental_duration">7</field> <field name="rental_rate">2.99</field> <field name="length">50</field> <field name="replacement_cost">18.99</field> <field name="rating">NC-17</field> <field name="special_features">Trailers,Deleted Scenes</field> <field name="last_update">2006-02-15 05:03:42</field> </row> </resultset> -
bash script to create xml from mysql query - out of memory
jazzman1 replied to carlosp's topic in Other Programming Languages
Do you want to give you an example in bash? -
bash script to create xml from mysql query - out of memory
jazzman1 replied to carlosp's topic in Other Programming Languages
No, it's Perl. What database is used for?