Click here to Skip to main content
15,892,298 members
Everything / Programming Languages / PHP

PHP

PHP

Great Reads

by Tomas Petricek
Phalanger is a PHP language compiler for the .NET Framework which introduces PHP as a first-class .NET citizen.
by Member 4206974
FormGen, a JavaScript Form Generator
by Christoph Buenger
Describes PHP application development with the free Scavix Web Development Framework (Scavix-WDF).
by Ozesh Thapa
Converting Docx To Html to Docx

Latest Articles

by Member 4206974
FormGen, a JavaScript Form Generator
by Dan Letecky
Weekly HTML5 event calendar with CSS themes, drag and drop support, date navigator. PHP and ASP.NET Core REST API backends.
by Jason Sultana
A look at some injection-style vulnerabilities
by Richard Chambers
Creating a simple VisionFive 2 RISC-V SBC web site using Apache2, PHP, and Postgres with the Mosquitto message broker and installing Golang, Java, and Rust.

All Articles

Sort by Title

PHP 

1 Feb 2016 by JaironLanda
I wonder if tag can refresh page while server down. tag still working if the main server is down?
1 Feb 2016 by ZurdoDev
No. I assume you mean a meta tag that refreshes the page? All that does is cause the page to be requested from the server again. So, if the server is down then you will get an error.
9 Dec 2023 by Arambar Company
Hello, I have a system in which a number of drivers are supposed to register and work. There are also some individuals who act as owners of goods. The owners of goods can announce their loads in their own panel, and the drivers can see these...
15 Nov 2015 by AdamDedanga
I keep getting these errors when I create MySQL tables from CSV files.ERROR - Error No: 1103 - Error: Incorrect table name 'Hospital_Value_Based_Purchasing__HVBP____Healthcare_Associated_Infection_Scores' - Call: Function createTableFromCSV in...
16 Nov 2015 by markkuk
The maximum length for table name and most other identifiers is 64 characters: https://dev.mysql.com/doc/refman/5.7/en/identifiers.html[^]The name you are trying to use is 79 characters long. Add code to limit the length of identifiers.
24 Dec 2017 by miktg
Hi everyone, I want to say thanks for your support in advance. I am trying to consume a web service which written in ASP.Net using PHP. When I run the code i got this error :-HTTP Error: Couldn't open socket connection to server http://office-server/tempPlace/Service.asmx, Error (10272051):...
16 Jul 2011 by Uday P.Singh
your code looks fine to me, the problem could be in your network settings, check your firewall and antivirus settings.hope it helps :)for further queries comment here!!
24 Dec 2017 by mohammadian7
hi i have similar problem with soap connection and get same error i add tcp port and use port forwarding but i cant resolve this problem
25 Apr 2019 by David_Wimbley
You are better going to the cpanel forums and logging your support request there. This link looks to be what you need https://forums.cpanel.net/threads/phpmyadmin-authenticationcpanel-php-error.620063/ but the resolution in this one it seems you've already tried. Thats why i say your better off...
25 Apr 2019 by Member 13435586
Today while accessing phpmyadmin through cpanel i got this error "mysqli_connect(): (28000/1045): Access denied for user 'umer'@'localhost' (using password: YES)" and warning "Undefined index: auth_type" . Kindly help me out to recover this. What I have tried: Try to find...
4 Dec 2023 by Member 16155723
We resolved this issue by changing the cpanel password from WHM(not from cpanel) with mysql synch checkbox selected . goto WHM>password modification>enter password (select synch mysql checkbox selected). After that login to cpanel with new...
24 Jun 2023 by Kunal Pradhan 2023
Hi, I was running a project from github getting the error "Parse error: syntax error, unexpected identifier "string", expecting variable" it uses sebastianbergmann library. please help to solve the issue.
23 Jun 2023 by Sandeep Mewara
It mostly should be related to the version of the PHP you are using. Believe you are on an older version as readonly was added in PHP v8.1[^]. Just make sure you are using the right version of PHP and the error should go away.
24 Jun 2023 by Andre Oosthuizen
Quote: I tried deleting readonly from - You cannot just delete it as it needs to be defined. The best solution is Sandeep's solution as most servers now require php 8.> version code anyways, but if you want to delete the deprecated code, you...
23 Jun 2022 by BHANU PRATAP 2022
"Save & Exit" and "Save & Preview" button stopped working. Data not getting saved in database nor it is showing in the saved list page. No error message. No action happening on click. $(document).ready(function() { ...
21 Sep 2011 by Member 8022411
How to create a search engine in php or javascript. I do not want to connect with the database..I have read the data from an xml file and displayed it in an HTML table with border in the php webpage.. Pagination is also done for displaying the data and I got stuck with "search"...
28 Sep 2011 by Sunasara Imdadhusen
You can do XML searching using JQueryReading XML with jQuery[^]
17 Dec 2020 by Demetri K.2
Writing a little shopping cart thing in raw php, but suddenly I get this problem. (login file)
17 Dec 2020 by OriginalGriff
Try: include 'models/m_template.php'; PHP include and require[^]
9 Aug 2021 by Member 15318723
object(stdClass)#2834 (2) { ["code"]=> string(3) "000" ["content"]=> object(stdClass)#2833 (4) { ["Customer_Name"]=> string(10) "Mr DsTEST" ["Status"]=> string(4) "Open" ["Customer_ID"]=> string(10) "1212121212" ["DUE_DATE"]=> string(19)...
9 Aug 2021 by Richard Deeming
Nobody can help you because we cannot see where your $thisresponse variable comes from. However, the error message suggests that it's an array of strings. The string type does not contain properties called Customer_Name, Customer_ID, etc. PHP:...
9 Sep 2008 by Mosso Hosting Cloud
After experiencing scaling issues with their previous hosting provider, the founders of the #1 iPhone tutorial site turned to Mosso, Rackspace’s cloud hosting division, because of the company’s tech support, scalability and affordability.
30 May 2018 by divinity02
need to find this error cant find it please help What I have tried: CREATE TABLE tbl_images ( img_id int (100) NOT NULL AUTO_INCREMENT, name varchar (100) NOT NULL, image longblob (100) NOT NULL, size int (15) NOT NULL, type varchar (12) NOT NULL, PRIMARY KEY (img_id)...
30 May 2018 by RossMW
Try CREATE TABLE tbl_images ( img_id int (11) NOT NULL AUTO_INCREMENT, name varchar (100) NOT NULL, image longblob (100) NOT NULL, size int (15) NOT NULL, type varchar (12) NOT NULL, PRIMARY KEY (img_id) ); See MySQL :: MySQL 5.5 Reference Manual :: 11.2.1...
30 May 2018 by Dave Kreskowiak
You're specifying a field size for your integer columns and the longblob column. You can't do that. I don't do MySQL but I think the CREATE TABLE statement should be something like: CREATE TABLE tbl_images ( img_id int NOT NULL AUTO_INCREMENT, name varchar (100) NOT NULL, image...
13 Mar 2015 by Member 11470912
$(’li:has(a)’) what this query do ....What is the output of this Code.I have seen this in a Code but i dont understand what the actualy happen
13 Mar 2015 by Sergey Alexandrovich Kryukov
This is the combination of element selector with :has() selector. The documentation is crystal clear: http://api.jquery.com/has-selector[^].See also:http://api.jquery.com/element-selector/[^],http://api.jquery.com/category/selectors[^].—SA
30 Sep 2013 by Ronnie22
I have two filessearh_journal.phpfunction submitForm() { var form = document.myform; var dataString = $(form).serialize(); $.ajax({ type: 'POST', url: 'journal_table/get_data_journ.php', data:...
30 Sep 2013 by Kamran Ayati
perhaps you can not correctly connectand then php cant to recieve data
10 Dec 2021 by Rebecca2002
hello this used to work before but since I have added a php mailer file to send an email it has stopped working. I want to be able to delete my record after the user has pressed on one of the two buttons. but right now I'm getting the error ...
7 May 2013 by Hercal
Dears ,I am a beginner in PHP , i like it so much ,i try everyday to know a new thing about it .I have a question and I hope to find an answer .lets first have a look on the below simple code .first page : first.php
7 May 2013 by _debasis
$_post is not mandatory it is rather optional thing.This is due to a setting in your php ini.Using Register Globals.There are various way to on off it.Making it on is not the best practice.By using this means $fname to access the value you will be meshed up while handling larger code...
15 Jul 2017 by Member 13049972
i have a form and it has two combo boxes, each boxes are containing yes,no values. if both boxes are yes then execute stage 1 on php code else if one box value=yes and other box value = no then execute stage 1 on php code else if one box value=no and other box value = yes then execute stage 1...
11 Jul 2017 by Peter Leow
Why the quotations? instead of '$_POST[NicChk]' , just $_POST[NicChk] , and this appears to be redundant, else if(('$_POST[NicChk]'=="no")&&('$_POST[RCcheck]'=="no")) { echo "stange 4"; }
15 Jul 2017 by Member 13049972
i have found my mistake instead of using if(('$_POST[NicChk]'=="yes")&&('$_POST[RCcheck]'=="yes")) i have to change it as if(($_POST['NicChk']=="yes")&&($_POST['RCcheck']=="yes")) Thanks for help guys!
6 Feb 2017 by ELMAGLAYA
Why every time I click register submit button the output is always "not empty!" even though I did not type anything. What i want is when I type something it will tell me not empty and when there is no any character it will tell me "empty".Hope someone can enlightened me on this matter. ...
6 Feb 2017 by Jochen Arndt
That is because the $_POST array itself is not empty. All keys (the names of your input fields) are set. You probably want to check if the values are empty.You can check this using the following code (untested):foreach ($_POST as $key => $value){ if (empty($value)) { ...
11 Aug 2020 by Uncodeable
Hi, I am trying to get data from an uploaded file. I tried to read the tmp_name property, but it returns as blank. I can read the name property, and get the file name on the user's machine, but not on the server. I can't find a solution anywhere,...
7 May 2019 by Member 14315552
So I have a sql query (below) which is supposed to use the login id from login page and do a query based on that user. I can't figure out the correct formatting for the $_session, seems to print the correct user id in the error message but the rest of the query is not pulling any data. error...
7 May 2019 by W Balboos, GHB
select pendingindex.* from pendingindex join sorttest on pendingindex.pendreckey = sorttest.pendreckey where agentid in ( select agentid from pinagentid where pin = . {$_SESSION['user_id']} order by $sort $sort_order Notice your "agentid in (" subquery . . . you did not have a closing ")"...
7 May 2019 by MadMyche
First problem I see is that you have the potential for a SQL Injection vulnerability by way you concatenate together your SQL command. How you should be doing this is by creating a prepared statement and then binding in a parameter. Second item I see is an error there is no closing parenthesis...
4 Sep 2017 by MarioPT
One of my $_SESSION is not going to another page if I echo it in the first page the echo is: BG-12 Pull Station Fire Alarm Security: 1 |-| EPDM Double Jacket Fire Hose: 1 |-| Coolcam HD 1080P Wireless WiFi 2way Audio with Night Vision and Motion Detect: 1 |-| 12inch CCTV TFT LCD Monitors with...
4 Sep 2017 by HKHerron
Just as Mohibur Rasgid stated above, Make sure every page has the session_start() function.
5 Jul 2012 by project virus
I am having the problem in following code for uploading the file.File Uploading FormFile Upload:Select a file to upload:
5 Jul 2012 by Libish Varghese Jacob
What is the error that you are getting?$_FILES['file'] will have error info in it. Debug into that and you could get the actual reason for failure.If you are getting any error, please paste it here.
14 Jun 2020 by sujit995
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '$query = "SELECT * FROM posts WHERE post_catecory_id = $post_category_id "' at line 1 i get this...
14 Jun 2020 by Patrice T
The problem is that the query depend on value of variables, we have no idea of what is the real query: $query = "SELECT * FROM posts WHERE post_catecory_id = $post_category_id " Not necessary a solution to your question, but another problem you...
14 Jun 2020 by Maciej Los
Follow the steps from: MySQL Error 1064: You have an error in your SQL syntax | InMotion Hosting Support Center[^] Quote: Missing Data Sometimes data can be missing from the database. This causes issues when the data is required for a query to...
31 Aug 2017 by Patrice T
Quote: this query is not working.why? What kind of 'not working' do you have ? Error message ? or empty result ? Not a solution to your question, but another problem you have. Never build an SQL query by concatenating strings. Sooner or later, you will do it with user inputs, and this opens...
22 Jan 2015 by Shreekant kembhavi
Hi guys,I am handling a scenario in PhP where the input is in %XXXXX% format, where XXXXX can be any number of characters/numbers. The input will be sent to sql for processing (the main intention is to send the input that contains %TEXT% to sql).What I understand from the scenario is...
15 Jun 2021 by Somar Rateeb
Hi, when I tried to execute a command using exec() function to call 'mysqldump'from php I got: 'mysqldump' is not recognized as an internal or external command, operable program or batch file. but when I run the same command directly from CMD...
26 Jan 2014 by Ron Anders
2 days is enough, so I'll bug you all about it. :-)I'm new to PHP but have to use it.My web server is receiving this from another server at 192.168.2.2 on the LAN. The following is from the apache access log. Notice how all the variables on the query string are nice and...
26 Jan 2014 by Mitchell J.
Your code looks like it is supposed to work! This is what I would do in this situation:1. Remove all not-working variables, then put them back in one by one, testing the code with each addition, seeing what trips the system, etc.2. Create a small scale simulation with some files that you...
27 Jan 2014 by Ron Anders
I "Fixed" it.Like a More - Ron I was sending FirstName LastName as Customername and all variables following were "ignored" presumebly because of the space. Attempts to replace space with %20 didn't work for me so I stopped using the full name and just started passing around fist and last in...
5 Jun 2022 by Member 14362033
Hello, I am trying to include a php file using require_once but it's not working at all. It doesn't load that file. Recently I changed php version from 5.6 to 7.2 for my application. I have a backup of this application which uses php 5.6 and all...
31 Oct 2020 by Patrice T
Quote: When I click the submit button it shows the error above from lines 11 through to line 16 and then 22 Unfortunately, we can't do much for you because problem is not in this code. Problem only become visible in this code. This code process...
31 Oct 2020 by OriginalGriff
Check your HTML code: the chance are you have misspelled you indexes, or have no matching controls on your page. This explains it with simple sample code: PHP $_POST[^] And as Patrice T has said: Never concatenate strings to build a SQL...
16 Jun 2021 by Member 15251069
if(isset($_POST['submit'])) { if(!empty($_POST['name']) && ($_POST['id']) && ($_POST['contact_id']) && ($_POST['gender']) && ($_POST['email_id']) && ($_POST['role']) && ($_POST['status'])) && ($_POST['date'])) { $name=...
16 Jun 2021 by OriginalGriff
Too many brackets... if(!empty($_POST['name']) && ... && ($_POST['status'])) && ($_POST['date'])) ^ |
13 May 2020 by Peter_in_2780
That error is almost always an incomplete block. I took a quick look at your PHP code, and I can't see the } to close the big else block
14 May 2020 by Patrice T
The else at line 30 opens a { , but it is never closed. You probably missing a } at line 52 (a guess from code indentation).
8 Apr 2019 by AtulSharma609
Hello can anyone help me do this , i do not know PHP and i have to do this in asp.net c# function sign_ipn($reply, $token) { ksort($reply); $flat_reply = ""; foreach ($reply as $key=>$value) { $flat_reply = $flat_reply."$key=$value&"; } $flat_reply =...
7 Apr 2019 by OriginalGriff
Translating code from one language to another rarely works well, unless they share a common "philosophy" and framework, like VB and C#. But PHP and C# are very, very different: one is an interpreted language, and the other is compiled. They do not share a framework. Converting a (fairly poorly...
8 Apr 2019 by AtulSharma609
private void getResponce() { string requestJson = string.Empty; using (StreamReader reader = new StreamReader(System.Web.HttpContext.Current.Request.InputStream)) { requestJson = reader.ReadToEnd(); string returnUrl =...
3 Nov 2022 by shady morsi
Im making an update page. To me it looks strange, because the query function in php is in-built and in my case it should work properly. But it doesn't. My code class update { function GetQuestion($question) { // Question ...
3 Nov 2022 by Richard MacCutchan
Look at your code. You are using the variable $question in three different places for three different purposes ... $sql12query =$question->query("SELECT DISTINCT question FROM questions WHERE uniq_name='" . $question . "'"); ...
22 Nov 2012 by Member 9622369
// Put your device token here (without spaces):$deviceToken = '0f744707bebcf74f9b7c25d48e3358945f6aa01da5ddb387462c7eaf61bbad78';// Put your private key's passphrase here:$passphrase = 'pushchat';// Put your alert message here:$message = 'My first push...
24 May 2013 by Kislay Raj
Options +FollowSymLinksRewriteEngine onRewriteRule ^([a-zA-Z]*)/?([a-zA-Z]*)?/?([a-zA-Z0-9]*)?/?$ index.php?page=$1&action=$2&id=$3 [NC,QSA,L]
1 Jan 2014 by bmw318mt
Why when I put this online the php content is being ignored when having the page index.html, while when I save the page as index.php the php content is displayed.index.htmlWelcome to my home page.
1 Jan 2014 by ZurdoDev
If you name a file with .html then the server is not going to parse any code pieces. When it sees one with .php it will know that it needs to look for php code.Basically it's the same as when you double-click on an .xlsx file. The computer knows to open it with Excel.
1 Jan 2014 by Kornfeld Eliyahu Peter
The extension tells the server side (web server) to which handler to pass the file.HTML extension will go to the basic html handler, but files with PHP extension will be passes to an other handler that can process PHP commands.If your html file contains PHP blocks the basic handler will...
28 Aug 2014 by NILADRI SEN
First of all, sorry for this extra descriptive question.I was implementing my own assembly rather calling anything from GAC! I started with a Class Library project in Visual C# 2010 Express edition. The file Class1.cs looked very simple as:using System;using...
6 Nov 2015 by Peta2010
Hi guys I have cloud hosting account and have wordpress website setup under root. now i created new folder www.site.com/subfolder/ and uploaded micro site which has all pages in .php extension and have their own config.php fileBut when i try to open microsite page it shows below...
7 Nov 2015 by Peta2010
It was my scripting issue in .php file for form POST submission. I have removed string value to variable and works fine.
20 Jan 2013 by Chi Ller
Hey guys I have a little problem.I need 2 actions in 1 form.the one action is on my own side (I want to insert sth. in a database) and the other action takes you to a payment system.Somebody knows how to do this?
20 Jan 2013 by Vyacheslav Voronenko
Typical recommended approach would be:1. Form is submitted to your page with custom logic. ( insert necessary data into db etc)2. Page validates data, if validation fails - displays form again with validation errors3. If data are OK - saves necessary data into db and issues 301 redirect...
9 May 2021 by yuval.pikel
I am trying to run 2 Ajax calls in parallel but they are running one by one and not together How it could be achieved? What I have tried: I've created 2 simple HTTPRequests
9 May 2021 by Gerry Schmitz
Probably because you're making synchronous requests. Ajax Synchronous and asynchronous requests | CreativeDev[^]
18 Feb 2017 by Member 13009199
Hi,I want to have 2 forms on 1 page, I had duplicated the 1st form and gave it an other ID but for some reason the 2nd forms validation / success messages do not appear in the form page but a blank page. The form is send successfully however.
7 May 2015 by Muhamad Faizan Khan
My Website is deployed on a server with windows xp I am using WAMP SERVER.Two days ago I am receiving this error continuously!Warning: mysql_connect() [function.mysql-connect]: [2002] Only one usage of each socket address (protocol/network address/port) is normally permitted.well I...
6 Jun 2014 by nest101234
I am now in a place on time under gmt+6I want to see my time in 24 hour time format. I wrote the code :date_default_timezone_set('Etc/GMT+6');echo $date2=date("H:i:s");But it shows time in 12 hour format like now 10:02:00 .but whet I write only the following lineecho...
6 Jun 2014 by Peter Leow
It is correct, it showed 10:02:00 hrs, just happen to be the same as 12 hour format. You can verify the current date time by entering out 'Etc/GMT+6' at timezoneconverter.com[^]. At this moment, it show Fri 6-Jun-2014 11:09 A.M.
6 Jun 2014 by nest101234
$timezone = +6; //(GMT +6:00)echo gmdate("H:i:s", time() + 3600*($timezone+date("I")));
27 Oct 2020 by Member 13784265
I'm constantly getting this error in safari but google chrome doesn't show any such error. As far as I know my syntax is correct. Any lead what possible I am doing wrong ? i have mentioned the error like code with the error in the code below ...
27 Oct 2020 by Richard Deeming
Quote: data: {answered_array} According to MDN, shorthand property names work in Safari 9 or later. Version 9 was released in September 2015. If you're running an older version on Mac or iOS, then you are dangerously out of date. NB: The...
7 Apr 2011 by Sandeep Mewara
You are looking for a 'Cascading dropwdown'Google it, try to implement and then post specific issue that you face. BTW, Here is what is expected by enquirers:1. TRY first what you want to do!2. Formulate what was done by you that looks like an issue/not working. Try them and...
4 Nov 2021 by Christian Tejano
What's wrong in my code? It seems like it's not counting even if I try many attempts because I want to redirect the user to account registration page after 3 error attempts.
4 Nov 2021 by Dave Kreskowiak
You cannot count attempts like that. It would only work if there was only ever one user of the system, but websites rarely ever have a single user. You would normally track the number of attempts in the database, along with the datetime of the...
4 Nov 2021 by phil.o
You have a much bigger problem: your code is left open to SQL injection attacks. Never ever build SQL queries by concatenating with user-input strings. Better use parameterized queries instead. Parameterized queries in PHP with MySQL...
7 Nov 2015 by Member 11829782
Hello .I have a project written in PHP based on MVC. The problem is I get a 301 error on apache but not on windows servers.I converted web.config to htaccess file using an online tool.now the details of the problem : the url is like : www.abc.com?cid=0 in which cid is id of a root of a...
8 Nov 2015 by Jochen Arndt
This may be sourced by role looping when using the RewriteRule [L] flag in .htaccess files. See RewriteRule Flags[^] for a description.You may also inspect the full 301 response to check the passed Location. It may indicate which part is not rewritten as expected.