Use php to generate pictures, but the output is garbled characters, how to solve it
Use php to generate pictures, output is garbled characters, how to solve it? <?php $a=imagecreatetruecolor(300,200); imagepng($a); imagedestroy($a); ?> Use php to generate a picture The output is garbled characters, use echo The output content is not garbled characters ——Solution——————- For PHP , garbled characters will appear when outputting pictures. There are many reasons for garbled characters, the most common one is that there are other content output before outputting the picture, resulting in whether the picture can not be output normally . The reason for this phenomenon is this function: header(“Content-type:image/jpeg”); Note: the role of the header function It is to tell the browser how to output the following content , for example: header(“Content-type: html/text”); means to tell the browser that the content to be followed should be output as html text format output; header(“Content-type:application/stream”); means to tell the browser that the following content should be output in the form of byte stream ; header(“Content-type:image/jpeg”); means to tell the browser that the following content should be output as a picture . See the original solution: http://www.phpnewer.com/index.php/Cjwt/detail/id/10
PHP advanced confusion, how to solve it
PHP Advanced ConfusionLearned HTML+CSS+JS, PHP+MYSQL, smart and zend frameword, etc. I haven’t learned yet, now I want to practice these knowledge comprehensively, master it well before continuing go to school. But now I feel that I still can’t do anything, the basic knowledge is not solid, so I want to consolidate, I want to try to write some functional modules, but I can’t start, is it because I fooled something, I found some source code, but I don’t know How to start learning, and the source code is too long, it seems particularly difficult to persist, how should I do it now? Experienced seniors give advice to the younger brother. ——Solution——————-Since you know that it is extremely difficult for you to persevere, then you also know your weaknesses… The more difficult things are, the more courage you need to overcome them. ——Solution ———————To Saying “hold on” is bullshit. Programming is not a college entrance examination, it cannot be memorized by rote The purpose of programming is to let the computer do things for you, not to be his slaveIn this sense, you are Teacher, the computer is the student. Not only do you need to tell the computer your intentions…
PHPADODB database operation, how to solve it
PHP ADODB database operationRecently, I am working on a project. The client is MSSQL, but my resources here are only MYSQL, so I choose ADODB to operate. After developing the MYSQL version without problems, the code was packaged to the customer (the customer did not provide all resources due to security issues). The test results were resolved through emails, and it was found that Execute did not execute additions, deletions, and modifications. Only post key codes. Because time is urgent, I can’t go to the other party’s server to test, and I can’t access the page. Anyone who knows can let me know? $db = ADONewConnection(“”mssqlnative””);$sql9 = “UPDATE table SET table_type=1 WHERE user_id=1”; >$db->Execute($sql9); ——Solution idea———– ———– $db = ADONewConnection(“”mssqlnative””);//Double quotes in Chinese state ——Solution idea——————- —Don’t be kidding! You have to load the extension of the corresponding database before you can use the adodb class library The adodb class library also uses an error handling mechanism, don’t you read the error information it provides?
laravel5.1–PHP uses Soap to appear Function doesn’texist problem, how to solve it?
Article directory [hidden] Reply content: I am a novice, using Laravel framework and xampp to build a background management system. Because there is a need to do webservice interface functions, soap in php is used. However, there is a problem of Function doesn’t exist during the development process. It has been stuck for a long time, so I come to ask for help. The details are as follows: There are two php files:①client.php, as a soap clientPath: C:\xampp\htdocs\my_project\app\Services\client.php “http://localhost/my_project/ app/Services/server.php”, 'uri' => “http://localhost/”, 'encoding' => 'UTF-8')) ; echo $client->hello();} catch (SoapFault $fault) { echo “Error: “, $fault->faultcode, “, String: “, $fault->getMessage();} ②server.php, as a soap serverPath: C:\xampp\htdocs\my_project\app\Services\server.php <?php namespace App\Services;use App\User; // User is a model in Laravel, under C:\xampp\htdocs\my_project\app try { $soap = new \SoapServ(The source of this article is gaodai#ma#com @@代~&码网Gaodaima code er(null, array(‘uri’ => “localhost”)); $soap->addFunction(‘hello’); $soap->handle();}catch (\SoapFault $fault) { echo ” Error: “, $fault->faultcode, “, String: “, $fault->faultstring;}function hello(){ $model = new User; return “hello”;} Because it is necessary to use templates, namespace is used in server.php, and the User class is used by use is quoted. But in this way, SoapServer and SoapFault in server.php must be preceded by a slash to become \SoapServer and…
After installing ECMall, a PHPStrictStandards error is reported, how to solve it?
Strict Standards: Non-static method ECMall::startup () should not be called statically in /htdocs/ecmall/index.php on line 22 Deprecated: Assigning the return value of new by reference is deprecated in /htdocs /ecmall/eccore/controller/app.base.php on line141 Deprecated: Assigning the return value of new by reference is deprecated in /htdocs/ecmall/includes/ecapp .base.php on line 137 Strict Standards: Declaration of FrontendApp::jslang() should be compatible with ECBaseApp::jslang($lang) in /htdocs/ecmall/ecmall strong>/app/frontend.base.php on line 363 Strict Standards: Declaration of Message::display() should be compatible with BaseApp::display($n) in /htdocs/ecmall/eccore/ controller/message.base.php on line 329 and other similar error prompts (the same for PHP5.2.* version In this case), you can consider the solutions we give below: 1) Problem analysis: This error is a problem with PHP environment configuration, not a program problem; 2) Find php.ini file, change the value of error_reporting to: error_reporting = E_ALL & ~E_NOTICE 3) Restart Apache or IIS. 4) Complete After installing ECMall, PHP Strict Standards error is reported, how to solve it

php+mysql object-oriented addition, deletion, modification and query, how to solve it
Back-end development | php tutorial nbsp,gt,lt,mysql,localhost back-end development-php tutorial php+mysql object-oriented addition, deletion, modification and queryA novice, please guide . Dream weaving video station source code download, ubuntu and Kirin, start two tomcat locally, online crawler music, php confirm password and input password, Handan seo lecturer lzw <?php// Mysql_class.php class Mysql{ private $localhost; private $root; private $password; public $database; public function __construct($localhost,$root,$password,$database) { //In the following methods, if you want to use the $localhost variable $this->localhost = $localhost; //Use $this->localhost instead. $this->root = $root; $this->password = $password; $this->database = $database; } public function Connect( ){ mysql_connect ($this->localhost,$this-root,$this->password); mysql_select_db ($this->database); mysql_query (“set names utf8”); } public function Close(){ mysql_close(); } public function myarray($result){ //formal parameter return mysql_fetch_array($result); } public function myquery($sql){ return @mysql_query($sql); } public function myrows( $result){ return mysql_num_rows($result); } public function myselect($users){ return $this->myquery(“select * from $ users”); }}$db = new Mysql(“localhost”,”root”,””,”stu_system”); id name sex phone <?php include_once “mysql_class.php”; $result = $db->myselect(“users”); if(is_array($result)){ while($row=$db->myarray($result)){?> & name = & sex = & phOne=”> Modify “> Delete <?php } } else echo “no result”; mysql_close();?> I can’t get my resources, and I can’t find the problem. ——Solution ideas——————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————— Internet, sqlite is too slow, corporate web design costs, asp update access database,…
Finding a job and advice to friends who are just learning PHP, how to solve it
Looking for a job and advice to friends who are new to PHPCurrently looking for a job in Wuhan Found that most companies are nothing less than two One is to engage in outsourcing and use foreign frameworks such as zend and cakephp Also be familiar with foreign open source systems A kind of domestic modification site is nothing more than dedecms, ecshop, shopex, etc. Some companies even use some smaller systems to modify the site So friends who are just learning, please avoid detours. If e-text can be outsourced, learn the above things If the e text is not good, just study the following things Of course, there may be better companies that develop native php, but I guess there are very few novices to weigh it——Solution———- ———-That’s right, I’m also looking for people who understand the frameworks of dede, ecshop, shopex
Discuz7php source code, how to solve it
Discuz7 php source codeWho has a relatively complete Discuz7 source code analysis (directory, file structure, functions of each file, template structure, more complete code comments, etc.), the more complete the better, thank you? ——Solution——————- PHP code <?php /* [Discuz!] (C)2001-2009 Comsenz Inc. This is NOT a freeware, use is subject to license terms $Id: common.inc.php 17460 2008-12-24 01:46:38Z monkey $ */ //Close magic_quotes_gpc reference, set to close PHP error report error_reporting(0); set_magic_quotes_runtime(0); //Get the start time of the script, and finally subtract this from the end time of the script to get the running time of the entire script $mtime = explode(' ', microtime()); $discuz_starttime = $mtime[1] + $mtime[0]; // set some constants //SYSY_DEBUG is the current debugging state //IN_DISCUZ is used in some pages that are not allowed to be browsed directly. If you browse these pages directly, it will exit and Access Denied will appear //DISCUZ_ROOT is the absolute path to obtain the main directory of the current forum //MAGIC_QUOTES_GPC is the current state of magic_quotes_gpc //CURSCRIPT is the name of the currently running script… set it to empty now… there will be values in other scripts…. define('SYS_DEBUG', FALSE); define('IN_DISCUZ', TRUE); define('DISCUZ_ROOT', substr(dirname(__FILE__), 0, -7)); define('MAGIC_QUOTES_GPC', get_magic_quotes_gpc()); !defined('CURSCRIPT')…
I upgraded PHP with phposxbyLiip, but the terminal executes PHP is still the old version, how to solve it?
Article directory [hidden] Reply content: Upgraded PHP with (php-osx by Liip) to 5.4.10curl -s http://php-osx.liip.ch/install.sh | bash -s 5.4 Modify /etc/apache2/httpd.confLoadModule php5_module /usr/local/php5/libphp5.so Open the terminal, enter php -v, the result is shown as follows: From 4 sources gaodaimacom to engage in #code% code * networkengage in generation gaodaima codePHP 5.3.15 with Suhosin-Patch (cli) ( built: Aug 24 2012 17:45:44) Copyright (c) 1997-2012 The PHP GroupZend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies How to let the terminal also use PHP5.4? This question has been closed for: Reply content: Upgraded PHP to 5.4.10 with (php-osx by Liip)curl -s http://php-osx.liip.ch/install.sh | bash -s 5.4 Modify /etc/apache2/httpd.confLoadModule php5_module /usr/local/php5/libphp5.so Open the terminal, enter php -v, the result is shown as follows: PHP 5.3.15 with Suhosin-Patch (cli) (built: Aug 24 2012 17:45:44) Copyright (c) 1997-2012 The PHP GroupZend Engine v2.3.0, Copyright (c ) 1998-2012 Zend Technologies How to let the terminal also use PHP5.4? Add the PHP5.4 bin directory to the PATH environment variable export PATH=/your_php_bin_path:$PATH There are multiple versions of php-cli installed on your computer. The latest installed cli version needs to be set with an alias to replace the previous version. This happens because of PHP’s sapi. Different sapis are used…