So you create a .bat file with a long list of arguments and it fails with a message:
“the input line is too long”
To avoid this, split your long single line into multitude of shorter lines separated by the caret character to mark the line break. Like this:
echo 1^ 2^ 3
After (re-)installing PHP and attempting to run a script, you may see an error message saying “PHP Fatal error: Uncaught Error: Call to undefined function mb_strtoupper()”.
Well, you may be missing the php-mbstring extension to PHP. Simply install it by:
sudo apt-get install php-mbstring
You have a table. The table has a primary key auto-increment numeric ID field. You want to fast-forward the ID to a certain value (which is larger than or equal to the last value the field has).
Example, let the ID of the next entered record be 1000:
ALTER TABLE `mytable` AUTO_INCREMENT = 1000;
- This simple command will give you an SVG file with QR code vector image in it:
echo "Hello world!" | qrencode --level=H --dpi=300 --type=SVG -o qr.svg
- If a bitmap is enough, just type:
echo "Hello world!" | qrencode --level=H --dpi=300 -o qr.png
- Even this simple command will work:
qrencode -o qr.png "Hi!"
- Change the color from standard black to any if you like:
echo "Hello world!" | qrencode --foreground=808080ff --level=H --dpi=300 --type=SVG -o qr.svg
- Alpha supported too:
echo "Hello world!" | qrencode --foreground=FFFF00FF --background=0000FF55 --level=H --dpi=300 -o qr.png
echo "Hello world!" | qrencode --foreground=FFFF00FF --background=0000FF55 --level=H --dpi=300 --type=SVG -o qr.svg
The data you have in MySQL is all in UTF-8, you have UTF-8 specified in your HTML, PHP is set up to use UTF-8, but you still get gibberish as output, with question marks showing up on screen instead of correct symbols.
The problem may be that the communication between MySQL and PHP is not happening in UTF-8.
Try telling “SET NAMES ‘utf8′” to MySQL when you initiate the connection, before you run any other queries.
For example, as soon as you establish the connection to database, run this in your script:
mysqli_query( $conection, “SET NAMES ‘utf8′” );
Sometimes it is enough to remove comments from your PHP code to make it not worth stealing, as a potential violator will spend more time figuring out what did you mean by all that, than writing his own version of the software to do the same job.
This very simple solution, based on an example in a forum here, does that for all files in the directory and its subdirectories.
find . -type f -name '*.php' | while read VAR; \
do mv $VAR "$VAR-old"; php -wq "$VAR-old" > $VAR ; \
unlink "$VAR-old"; done
Unlike obfuscators, it does not mess with your actual code.
The php options engaged here are:
-w Output source with stripped comments and whitespace
-q Quiet-mode. Suppress HTTP header output (CGI only).
You are serving a file for download directly from your PHP script, by setting its mime type, sending headers with Content-Type and Content-Disposition, then piping the contents.
Everything works fine, but then suddenly the downloads become corrupted, with extra data added in their top, with blank extra lines clearly visible in downloaded text files.
The first thing to do without thinking much is to go through your PHP files and remove closing “?>“, if they are at the very end of the file. They are not needed and actually can be harmful, as anything after “?>” may served to the user with potentially damaging results.
Just remove those “?>” and your downloads may be fine again.