Click here to Skip to main content
15,904,024 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 Updated

PHP 

10 Feb 2010 by #realJSOP
I think this question is too broad to be answered in Quick Answers. I believe the source code to this site is generally available, but if it is (and I were you), I'd only use it as an example to solve various problems you might encounter when developing your own site.All that being said,...
16 Apr 2010 by #realJSOP
To set the var:session_start();$_SESSION['myVariable'] = $myVariable; To use the var in another page:session_start();$myVariable = $_SESSION['myVariable'];
7 Jun 2010 by #realJSOP
Your best bet is to maintain some sort of progress file (I would probably use a XML file).When the job is about to start, put the job identifying info into the file, and when the job is successfully completed, remove the info. If the job fails, you can restart it based on the info in the file.
16 Jun 2010 by #realJSOP
Your parameters have to be escaped.Instead of having the pointy brackets, you have to use "" in your string.
13 Jul 2010 by #realJSOP
Do you even know what "client-server" means?
1 Sep 2010 by #realJSOP
That's typically not the way to create a web form using PHP as the back-end.I recommend you buy a book or look for better examples.
7 Oct 2010 by #realJSOP
As far as I know, you cannot call a C# class.method from within PHP code.
25 Nov 2010 by #realJSOP
You may be loading that php file in another file, and php sees the function header() twice.
31 Dec 2010 by #realJSOP
This question is too broad. Repost it in an appropriate forum so you can have a proper discussion about it.
31 Dec 2010 by #realJSOP
PHPVBScript...
1 Jan 2011 by #realJSOP
Do you by chance have to do add the first line shown below?$output = "";$input="this is a test";$my_dll = new COM("Tra.myClass.1");$my_com->testFunction($input, &$output);
20 Jan 2011 by #realJSOP
Ummm, that's not a good design approach. The data should be normalized to a single format before storing it in the database. After they enter the date, it should be validated, and converted to the "proper" format, whatever that proper format is.
14 Feb 2011 by #realJSOP
Google is your friend. It apears as if you need Apache, MySql and PHP before installing WordPress. I'm sure you have to binstall the correct versions of those packages, but once again, Google is your friend in that regard.
6 Apr 2011 by #realJSOP
Yes it's possible, google HttpWebRequest. You should be able to find a crapload of sample code out there.
12 Apr 2011 by #realJSOP
1. is codeproject is a database driven site?Yes.2. If codeproject is a database driven site then why its pages are like static pages?The question/votes/comments/solutions are all stored in the database. the page is built dynamically, and I bet they use URL rewriting so that it shows...
14 Apr 2011 by #realJSOP
Try google. I recommend searching for "joomla online training". You'll get almost 6.3 MILLION results, and the very first link probably has what you're looking for.
18 Apr 2011 by #realJSOP
That's not what PHP is for. PHP is an interpreted scripting language.
21 Apr 2011 by #realJSOP
The fuirst thing I'd do is make sure that $_GET['nome'] and $_Get['uid] actually contained what you're expecting them to contain.
21 Apr 2011 by #realJSOP
Google reveals all:http://learn.iis.net/page.aspx/246/using-fastcgi-to-host-php-applications-on-iis-7/[^]
29 Apr 2011 by #realJSOP
One program isn't going to bolster your resume. What got me my first programming job was that I not only attended school full time (I also have a certificate, and not a degree), but that I also held down a full-time job. Yeah, your first programming gig is gonna suck as far as compensation goes,...
6 May 2011 by #realJSOP
Only display posts that fall within a certain date range on the first page, and display older posts on the "other" page. there's no "transferring" involved. The posts that would be displayed on the first page would be determined when the page loads. I don't see how it's that difficult to get...
1 Jul 2011 by #realJSOP
Google is your friend:http://www.wampserver.com/en/[^]
7 Jul 2011 by #realJSOP
Ever heard of google?
10 Jul 2011 by #realJSOP
You can't design your website assuming the next version of a given browser is going to be fixed, much less that there will be wholesale switch to the newer version immediately upon its release. Fix it now.Regarding the placement of the footer, what is your intent? Is the footer supposed to...
18 Aug 2011 by #realJSOP
Why don't you try monster.com? You can find a bunch of highly skilled programmers there.
1 Sep 2011 by #realJSOP
You can set session variables in your asp.net page, and access them in php.
8 Nov 2011 by #realJSOP
WAMP stands for "Windows Apache MySQL Php". Essentially it setups up Apache, MySQL, and PHP on a Windows box. Apache becomes your web server on that machine (instead of IIS). You can even still run ASP.Net web sites hosted on that machine if you load the correct add-on module.IMHO, using...
28 Dec 2011 by #realJSOP
Google reveals all.This book is written in gujarati, so I imagine there MIGHT be something about using the appropriate font on your web site: http://books.google.com/books/about/MIcrosoft_ASP_Net_with_C_Gujarati_Editio.html?id=-1L9qvXBZmcC[^]And was the first link of 184,000 returned...
29 Dec 2011 by #realJSOP
Just do a request to the aspx page with the (encrypted) password and userID in the querystring, and if the login is valid, redirect to the appropriate aspx page.
2 Mar 2012 by #realJSOP
You can specify that NTFS be case-sensitive, but that might break other apps. Best practice ina multi-platform environment is to simply add code to normalize the folder and file names INTERNALLY to your application..
9 Jan 2017 by #realJSOP
The answer is - QA is not the place to have programming discussions. Use the various forums that exist on the site.
22 Mar 2018 by #realJSOP
Use SQL to build a dataset of days for the designated month . I would put that sql code into a stored procedure so that it can be used over and over without having to be tweaked for the current month/year. Here's the SQL you need to do that. Just give it a date in the month/year in which you...
13 Mar 2019 by #realJSOP
Looks to me like it might be a response code, and they're customizing messages for it.
26 Mar 2019 by #realJSOP
teh very first line in your javascript is var c='. I think you meant to put var c=0;. I don't know if this is your problem, but fix it and see.
8 Nov 2019 by #realJSOP
0) The delay does not go on the page where the user clicked the link - it goes on the page that has the download button. 1) To make a link open in a new tab, add target="_top" to the href. 2) You should respond to an event in order for the html to be rendered. 3) For the record, these...
4 Dec 2014 by /\jmot
http://stackoverflow.com/questions/19773418/regex-to-validate-date-in-php-using-format-as-yyyy-mm-dd[^]http://www.phpbook.net/date-validation-in-php.html[^][^]
10 Dec 2014 by /\jmot
See links..http://www.w3schools.com/php/[^]http://www.tutorialspoint.com/php/[^]http://php.net/manual/en/tutorial.php[^]Step-by-Step PHP Tutorials for Beginners - Creating your PHP program FROM SCRATCH: Basic Authentication, Membership and CRUD...
18 Feb 2015 by /\jmot
Use SQL SELECT DISTINCT Statementhttps://msdn.microsoft.com/en-us/library/ms176104.aspx[^]http://www.w3schools.com/sql/sql_distinct.asp[^]http://www.tutorialspoint.com/sql/sql-distinct-keyword.htm[^]
23 Dec 2021 by 0x01AA
Tools like PHP Code Checker - Online syntax check[^] helps to find the basic errors. For the code you posted it shows me a first error Parse error: Unclosed '{' on line 36 in file on line 61 Errors parsing file I hope it helps. Have a nice...
30 Dec 2021 by 0x01AA
Quote: Warning: explode() expects at most 3 parameters, 4 given in vault.php on line 43 Your code, 4 parameters: explode(' ','-1','0', $result[0]) vs. PHP: explode - Manual[^] 3 parameters explode(string $separator, string $string, int $limit...
3 Jan 2022 by 0x01AA
When SQL parameters can be NULL then at the end the SQL Server can come to a situation where it compares the NULL parameter with NULL values from the table you query. Comparing NULL = NULL is pretty undefined, respectively depends havy on the...
12 Jan 2022 by 0x01AA
I would guess the problem is the account under which the web service runs. See this... Quote: The credentials under which the Web server's process (or thread) is running must map to a valid SQL Server login in order to establish a connection. ...
22 Jun 2022 by 0x01AA
Hi Most probably only one comma.... INSERT INTO `kid`(`id`, `kimg`, `ad`, `yazar`, `yv`, `ft`, `stok`,) VALUES ('$br','$im','$ad','$yz','$yv','$ft','$st')"; vs. INSERT INTO `kid`(`id`, `kimg`, `ad`, `yazar`, `yv`, `ft`, `stok`) VALUES...
22 Jun 2022 by 0x01AA
Check your sql carefully... "INSERT INTO `kid`(`id`, `kimg`, `ad`, `yazar`, `yv`, `ft`, `stok` ) VALUES ('$br','$im','$ad','$yz','$yv','$ft'','$st')"; Focus on '$ft'', and here the '' What I mean, it should be like this: '$ft',
22 Jun 2022 by 0x01AA
Please.... check your SQL ;) $sql = "UPDATE `kid` SET `kimg`='$im',`ad`='$ad',`yazar`='$yz',`yv`='$yv,`ft`='$ft',`stok`='$st' WHERE id=$br"; $sql = "UPDATE `kid` SET `kimg`='$im',`ad`='$ad',`yazar`='$yz',`yv`='$yv',`ft`='$ft',`stok`='$st'...
4 Jul 2022 by 0x01AA
Please see here: Identifier Names - MariaDB Knowledge Base[^] Quote: Identifiers may be quoted using the backtick character - `.
15 Jul 2022 by 0x01AA
See comments to the question. Looks like a trivial syntax thing. A fast and dirty solution would be the following: prepare("SELECT * FROM users WHERE email=?")){ $error = ''; //Bind parameters (s=mstring, i= int, b=blob,etc),in our case the...
16 Jul 2022 by 0x01AA
I really suggest you to try to learn the language. I never programmed in PHP but in c++, c#, js. Looks like this should solve the issue.... bind_param('s',$email); $query->execute(); //Store the result so we can check if the account exists in...
17 Jul 2022 by 0x01AA
Same again? Please check line 8 and try to understand what is wrong here. I think to remember I gave you the correct solution here: What is wrong with this code and can you solve it for me[^] If that was wrong, please give a feedback what was...
10 Nov 2022 by 0x01AA
And you had a look to Line 88? This it is:
19 Feb 2023 by 0x01AA
Solved by OP. This answer is only to remove the question from unsolved list.
15 May 2023 by 0x01AA
Looks like OP solved it. Only answered to remove it from unanswered questions. According to OP, that piece of text was helpfull: Cursor Types (SQLSRV Driver) - PHP drivers for SQL Server | Microsoft Learn[^]
9 Apr 2018 by 123456patil
Quote: its working when i use first letter like "c", "a" etc, but when i put any in between letters like considering orange as example if i put "an" letter in the object then it should display which all the elements contain "an" so is their any way to do this. Please let me if any one know this ...
10 Apr 2018 by 123456patil
Quote: when i do any operation it work ok like 5+6 = 11, but again if i want to add say a number 5 to the evaluated answer its showing error that means only one time i can do operation again if i want to do operation its showing error. How to fix this issue any suggestion ? What I have tried: ...
3 Apr 2018 by 1234Amit
how to remove duplicates from the salad list? What I have tried: $veggies = array("Potato", "Cucumber", "Carrot", "Orange", "Green Beans", "Onion"); $fruits = array("Apple", "Banana", "Orange", "Pineapple", "Grapes", "Watermelon"); $salad =...
3 Apr 2018 by 1234Amit
Below is the code which i have tried with, but its only displaying the first day of Feb month, but instead i want all the odd days of the month, so what changes i should do to get the desired output? What I have tried: $startdate=strtotime("2/1/2018"); $enddate=strtotime("N",...
3 Apr 2018 by 1234Amit
I want to display the stars in this way > * * * * * But when i tried with the below code i'm getting it as right angle triangle, please can any one help to get the desired answer. ...
4 Apr 2018 by 1234Amit
$Object = 'Cucumber'; in the cucumber place if i put "C" it should list all the elements from the salad list which are starting from "C". Is their any way to do this? What I have tried: $veggies = array("Potato", "Cucumber", "Carrot", "Orange", "Green Beans", "Onion"); ...
27 Nov 2022 by 1234Amit
I'm developing a PHP calculator, actually my question is when i click to any of the input buttons the value should display in the text box. below is the code what i have tried with, but im unable to get the resut. can any one help me in my work,so that how i can get the desired result. What I...
12 Apr 2018 by 1994patil
Quote: when i enter any letter say "ra" "na" etc in the input box it should display all the items which all contain in the salald list, how can i do this ? can any one help me to solve this problem, Below is the code what i have tried with. What I have tried: ...
9 Oct 2014 by 19sanjeev
How to install Zend framework 2 on Linux/Ubuntu OS
9 Jul 2011 by 1sireland
hi i am recently doing my project on creating search engine.I don't know how to add bing API key in my search engine i am working with PHP colud anyone please help me. Mainly what i want do if user click on search it will connected with bing search engine through bing API Key. i got the key...
9 Feb 2021 by 20212a
You just need to match up your parentheses: if (!preg_match("/^[a-zA-Z0-9]*$/", $username)) preg_match takes 2 (or more) parameters.
22 Apr 2022 by 22bears
Hi guys. I'm kinda new into MySQL and PHP. but im in this challenge and im slowly getting things done. I was about to test the website and I get this error: Fatal error: Uncaught TypeError: mysqli_connect(): Argument #1 ($hostname) must be of...
13 Jul 2023 by 22bears
I'm learning PHP and MySQL and im on my 2nd project, this time is a big one for me.. an e-commerce I'm working 24/7 on this and I get multiple errors and I google as much as possible and I slowly get things fixed, but now I'm stuck at this, i...
2 Nov 2013 by 22majid22
hi allHow can i create time out with php,for membership registered?Thanks
29 Apr 2022 by 280_ Khadiza Akter_7A
...
21 Jun 2011 by 2irfanshaikh
I suppose this will help you:Whois Command in Unix,Linux[^]"whois" equivalent in CMD?[^]
31 Oct 2010 by 4addai
Hi, I need help with an algorithm to allocate rooms to people. I need to shuffle through a list of rooms to assign a room to a person and after the fourth person is assigned to the room, it should be out of the list(should be unavailable). I have not had any luck with PHP shuffling and sorting...
17 Mar 2020 by 533578
I have a php code that needs to update the data from the database, but it gives me this error: Error description:You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use...
22 May 2016 by 626262
Hello,At this moment I am learning html, css, javascript, jquerry, mysql and stuff. But after when I will read books what I have related with my mentioned topics I want to learn how to create websites such as e-shop and social network (by creating them I presume that I will gain some extra...
31 Oct 2020 by 67825
I have a website where I have a calendar with opening hours in the bottom of the page, it looks like this: photo The issue is, I want "Mandag" (monday) to be the first week day and not "Søndag" (sunday) as it is now. I have tried to figure out...
10 Oct 2017 by 91191109
Help me please... i have 2 textbox.. Textbox lastprice = 100 Textbox harga = 101 i want validation textbox harga... What I have tried: Harga Barang Terakhir Dibeli per satuan
28 Mar 2012 by 98onam
Hi, I want to create a grid with jquery and php so that i should add a new row by clicking on add and update or delete each row..any one please help me with the entire code for this...Edit: Unnecessary code tags removed.
14 Dec 2010 by @nuraGGupta@
If you are talking about content of the website coming from your database, then you may need to put on the full text searching in your database. This will lead you to search everywhere and all text in the database for the defined word.Then, write a stored procedure which will search all the...
7 Mar 2015 by @sunusi1
hi guys i am having problem in selecting the maximum of number of a column called booking id, in a 'booking' tablei wrote my sytax like this
2 Sep 2012 by __TR__
Take a look at this CP article. Send and Receive JSON between Android and PHP Web Service[^]
8 Sep 2012 by __TR__
referSend and Receive JSON between Android and PHP Web Service[^]Connection between PHP (server) and Android (client) Using HTTP and JSON[^]Android Development: Implementing a simple Client-Server model[^]More resources here[^]
2 Dec 2012 by __TR__
Try using ROW_COUNT()[^]
9 Aug 2012 by _Amy
Hi,Refer the links below:PHP tutorial for beginners[^]http://www.1keydata.com/php-tutorial/[^]PHP Tutorial[^]--Amit
16 Jun 2013 by _Amy
Refer the links below to learn about PHP Sessions: http://www.w3schools.com/php/php_sessions.asp[^]PHP : Session Handling[^]Also for creating login page, refer:How to Create Login Page in PHP and MySQL with Session[^]--Amit
30 Jun 2013 by _Amy
Please check : SMTP server response: 550 5.7.1 Unable to relay - *A Solution*[^]Or also you may have a look at this thread[^].--Amit
18 Jul 2013 by _Asif_
Check below link, you will get all the details required and how to patch the issue.https://www.owasp.org/index.php/Top_10_2013-A8-Cross-Site_Request_Forgery_(CSRF)[^]
2 Mar 2014 by _Asif_
Change your while loop line with below line and try againwhile ($strpos=strpos($u_text,$u_find,$offset) !== false ) {
27 Mar 2017 by _Asif_
My two cents.I suggest to engage the same team that have initially built the application, why?* They know the application business (You have put significant time (skype calls/documents/emails, etc) to make them understand the application business)). If you engage a new team prepare...
3 Jan 2022 by _Asif_
You can use IFNULL MySQL function for checking null values. IFNULL gives flexibility to return an alternate value if the underlying value is null. I have modified your SQL assuming that underlying table field names are of type int. SELECT *...
5 Jan 2022 by _Asif_
There could be two approachs over your problem. First approach is to modify your flawed approach to the solution. Correct steps would be like. 1. Read Number columns from DB 2. Split Number column using space separator and put it into an array...
3 Feb 2022 by _Asif_
Your UPDATE SQL seems to have problems. Please check the following fields. `closedby`='$flname', `archive`='$new_img_name' should be closedby='$flname', archive='$new_img_name' Secondly you need to use parameterization to avoid SQL...
15 Feb 2022 by _Asif_
You can also use a switch statement for the same purpose.
2 Jun 2022 by _Asterisk
Hi, new coder here. I have two tables. One is the employee table that holds all records about all the employees and the other is performance table which holds records about the performance of each employee. What I wanted to achieve is to display...
8 Mar 2010 by _Damian S_
Save the username (or userid, depending on how you identify your users internally to your database) in the session state, then have a stored procedure to retrieve the user's first name from the database when supplied with the userid/username.Call this stored procedure in the page load event...
8 May 2013 by _debasis
Here is a solution that might help.You can make a common generalized getSearchDateRange function it will return you an array having search start date and end date and use these values in your query.In this way you can use this search range function anywhere you want to use.You can get...
28 Apr 2013 by _debasis
Please check the return value in server side that it is in json format or not and also usedataType: "json" in client side.I think the server side data may not have proper json format.Then you can try json_encode in the sever side make a json string.
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...
8 May 2013 by _debasis
In while loop while( $data=mysql_fetch_array($result)){ echo $data[0].$data[1].$data[2].$data[3]}what it does? It just looping through the $result.So it give you the result as row1 row2 .....But when you echo it with out the while loop it prints the first row .And echo it again it...
27 May 2013 by _debasis
HiiThis will help! :)
27 May 2013 by _debasis
Hii..Look at this,It might help.Make your form onsubmit to return false and call repective function on button on click.Or if are using a hyperlink
13 Feb 2013 by _Maxxx_
Your $drums is actually a drum set, not a collection of drums, isn't it? So should you not be adding each cymbal to that collection rather than adding cymbal to a collection of cymbals then adding that collection to the drum set?So I would have a Drum Set to which I add each drum and...
14 Feb 2013 by _Maxxx_
It is not possible to answer your question sensibly;Your pseudo code will always return true given the info you have given.if you can add a drum kit to a cymbal, could you also add a cymbal to a cymbal, or a drum to a cymbal? Your Cymbal object seems to act both as an individual and a...