Brother, I want to display the php file code on the web page, how to do it safely?
I want to display the php file code in the web page, how to do it safelyThis post was last edited by taodala on 2012-11-08 21:58:29 I have a website, and I want to create a function, which is to browse php files uploaded by netizens online. My current idea is to filter out <?php so that php files cannot be executed. Is this safe? Why,——The best solution——————–How can I automatically post my last post? Out I would say that as long as you don’t use eval, just output directly What needs to be guarded against is XSS attacks. The simplest way is to use htmlspecialchars to filter all entities into entity characters——Other solutions———– ———It is risky to filter only these two impressions. It is best to filter them all, which is safe—- –Other solutions——————–This post was last edited by xuzuning on 2012-11-09 22:22:29 highlight_file highlight_string Both safe and beautiful——Other solutions——————–As long as you don’t eval——Other solutions——————– Quote: Why did my last post get automatically posted I would say that as long as you don’t use eval, just output directly What needs to be guarded against is XSS attacks. The simplest way is to use htmlspecialchars to filter all entities…

Brother, what is my php journey?
What is my php journey? ? ? ? I just watched the PHP tutorial for a day yesterday. I don’t know how similar the ASP I learned before is to this one, but after learning it for a day, I feel that PHP is really good and powerful! I like it, but I just don’t know where to start. I hope I can basically learn PHP in 2011 and build a small business website using PHP. This is my biggest goal! ! ! ! ! After studying PHP for half a semester in school, I still can’t type code, sweat it! ! ! Hope everything goes well for you! ! ! Cheer up for yourself! Come on php! ! ! Study hard and make progress every day! ! ! 1st Floor hbsb2007 2011-08-22 What makes perfect…take your time! 2nd Floor macoo3 2011-08-24 Thank you
Brother, why is my var_dump($file_suffix==”php”) always false? The value is obviously the same.
Why is my var_dump($file_suffix==”php”) always false? The values are obviously the same.I wanted to read the contents of the php file in the compressed package, but I encountered this strange problem and was confusedvar_dump($file_suffix==”php”); The values are obviously the same, why is it false… PHP code //Get suffix function function suffix($filename){ $string= strrpos($filename,’.’); $suffix = substr($filename,$string+1); return $suffix; } $zip = zip_open(“test.zip”); //Open ZIP file if ($zip) { while ($zip_entry = zip_read($zip)) { //Read the next item in the ZIP file echo “Name: ” . $file_name=zip_entry_name($zip_entry) . “”; //Return the name of an item in the ZIP file echo “Actual Filesize: ” . zip_entry_filesize($zip_entry) . “”; //Return the actual file size of an item in the ZIP file echo “Compressed Size: ” . zip_entry_compressedsize($zip_entry) . “”; //Return the compressed size of an item in the ZIP file echo “Compression Method: ” . zip_entry_compressionmethod($zip_entry) . “”; //Return the compression method of an item in the ZIP file echo $file_suffix=suffix($file_name); var_dump($file_suffix==”php”); if($file_suffix==’php’){ zip_entry_open($zip, $zip_entry, “r”); //Open an item in the ZIP file for reading echo “File Contents:” . “”; $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry)); //Read an open item in the ZIP file echo “$buf”; zip_entry_close($zip_entry); //Close an item in the ZIP file }…
Brother, I want to learn the principles and knowledge of communication between the client written in C++ on the desktop and the program written in PHP on the web page. If you know anything, please come in and give me some advice.
I want to learn the principles and knowledge of communication between the client written in C++ on the desktop and the program written in PHP on the web page. If you know, please come in and give me some advice I don’t know if the website of your company has an online customer service function. , this function should realize that the customer service specialist logs in to the desktop client to monitor website customers. As long as the customer browsing the website opens a web page, he can communicate with the customer service specialist using a client like QQ. I don’t know if you have ever used the software livezilla. The function I want to describe is the same as the function it implements. It’s just that I am new to this aspect and I don’t know how to use the terminology. Haha. What I want to ask now is obvious: I now want to learn to write a program that can realize the main functions. I hope experienced friends can give me a clear direction for my efforts. Now I can use C++ alone. Or write PHP to communicate between clients, but the program I want to write…
Brother, I want to learn php, what books should I read?
I want to learn PHP, which book is good?Have experience in web developmentNow I want to learn PHP, but I don’t know what kind of book is better ——Solution——————–The author has programming experience and should get started quickly. The w3school tutorial is very good. You can take a look and refer to the manual. Make some small examples. ——Solution——————–See Source code typing code Loop ——Solution——————–Personal I think if you read the “Bible” of “PHP and MYSQL WEB Development” in its entirety, you will be able to work without any obstacles. ——Solution——————–Initial Scholar: PHP from Beginner to Master (2nd Edition)You can learn some basics and the code is relatively complete ——Solution——————– Discussion I personally think that if you read the “Bible” of “PHP and MYSQL WEB Development” in its entirety, you will be able to work without any obstacles. ——Solution——————–Me I’m also looking at “PHP and MYSQL WEB Development” and I can’t find the source code for Chapters 2 and 3. Urgent! ——Solution——————–w3school Tutorials, mainly looking at PHP and MYSQL
Brother, I use phpmyadmin to import excel. Brother, I have an auto-increment field in the table and it cannot be imported. What should I do?
I use phpmyadmin to import excel. What should I do if there are auto-increment fields in the table that cannot be imported? I converted excel to csv and imported it. I want to skip inserting auto-increment fields. What should I do? ——Solution– —————— Specify fields to import load data infile ‘csv file’ into table table name (name,age);
Brother, my Chongqing PHP has been offline for 16 days, and Baidu still doesn’t include me.
My Chongqing PHP has been online for 16 days, but Baidu still doesn’t include me After more than a month of hard work, my website Chongqing PHP was finally online… Then I started to pay attention to the inclusion status of Baidu and Google every day. Google is pretty good, spiders come every day, and the ranking has risen from page 7 to first. Page… The situation of Baidu is not optimistic. Except for the day after Baidu went online, that is, 2011-10-11, Baidu grabbed two pages and has not touched it. No spiders are coming… I have submitted the website to Baidu, but no spiders are coming… I don’t understand.
Brother, the Chongqing PHP community developed by our team
Chongqing PHP community developed by our team We have a team of 3 people and use CI2.0 to develop the Chongqing PHP community website. Mainly sharing original articles related to PHP programming. It has just been online for a few days and many areas are not yet perfect. We have recorded our development process in the development log. Interested students can visit the link below to view us. Development log:http://www.php-chongqing.com/index.php/devlog The code is still very confusing at the moment, and the code structure will be adjusted after a while. Finally, we will open source the source code of the entire website. Chongqing PHP: http://www.php-chongqing.comWe welcome everyone to help us find bugs, comments and suggestions are welcome, thank you!
Brother, I will also post a menstruation post about whether PHP is possible.
I would also like to post a menstrual post about whether PHP worksI used to often encounter people asking: How about PHP? Is php okay? Which major websites use PHP? Is .net better than php? What about java? Every time I see posts like this, my eggs break… In fact, this question has a clear answer already, Because cloud computing is gradually becoming popular, and on the cloud computing platforms developed by several domestic portals (Sina sae, Baidu bce, Tencent open, Alibaba ace), without exception, PHP is the default supported programming language. Other than that, it’s java, and .net can’t be seen at all. Will it be seen in the future? Who will analyze it ——Solution——————–How to kill a chicken with a bull’s knifeIt is enough to make a website with php ——Solution——————–Language It’s just language ——Solution——————–Yes When many people look at this issue, they may not look at it from a macro perspectivebut only look at it from the perspective of how many recruitments there are in the country and how much salary they will get after workingAfter all, it may not be possible whether PHP will work. What they care about, and more importantly, is whether PHP can…
Brother, I use NETBEANS to connect to the SVN on thinkphp official website. How to operate it?
How do I use NETBEANS to connect to the SVN on the thinkphp official website? How do I use NETBEANS to connect to the SVN on the thinkphp official website? ——Solution——————–Those updates don’t mean much. Can be done manually. ——Solution——————–NETBEANS I don’t know how to use svn. Use TortoiseSVN directly,or zend studio