content top

Using PHP GET and POST simultaneously via single HTML form

Using PHP GET and POST simultaneously via single HTML form

As we know, HTTP POST and HTTP GET are two great means of passing user data to servers. Previously, we have discussed about how to create different pages via a single script using URL variables, ie using GET method. Now, there can be occasions where, you need to have HTTP POST forms to get data from users. The question is, can you use GET and POST method together to create different dynamic pages from a single script? The answer is...

Read More

Understanding the basic of HTML form and PHP GET and POST method

Understanding the basic of HTML form and PHP GET and POST method

The idea of this post originated from the topic, using PHP GET and POST method simultaneously via a single form. While writing about the tutorial, I felt that, one need to know the basics of HTML forms and PHP suparglobal POST and GET variables to understand how HTTP interaction takes place in between user and the Server. The most useful feature of any server side scripting language is the interactive capability of receiving and...

Read More

Understanding PHP eval function and usage Do more than just evaluating

Understanding PHP eval function and usage Do more than just evaluating

No doubt PHP is a powerful interpreter… It has everything a programmer need to make his program. Today we are going to talk about a little less used but very powerful language construct eval(). Basically it evaluates some string passed through it as PHP code. It may seem easy, but there are a few thing one need to know before using this construct. [Note, this is not a function]. Sometime the usage gets so much confusing which...

Read More

Howto: Stream downloadable files using PHP and tell browser to save it instead of opening

Howto: Stream downloadable files using PHP and tell browser to save it instead of opening

Just a few days back, we were having some discussion at DigitalPoints forum about sharing and streaming download links via PHP. The problem was that if we have say a doc file and if we link that file directly then some browser may attempt to download it, or some will just show it! So, what we will learn today is how to stream a file using PHP, instead of direct linking and force the browser to download it with a custom name defined by us!...

Read More

Single index.php PHP script to load different page using URL Variable

You should have many links like http://www.domain.com/index.php?page=home OR http://www.domain.com/index.php?page=about where different pages are shown from a single script. [In this case index.php is the script]. Now the question is how to make such kind of system… Basically, what we can do is, use PHP GET method to pass variable URL to the server and response different pages accordingly. Have a look at the online demo… If, you think...

Read More

Shorten Paragraph or String without broken/incomplete word using PHP up to a maximum character length

Shorten Paragraph or String without broken/incomplete word using PHP up to a maximum character length

Ever wondered how to shorten a paragraph or string using PHP without broken words? There is a function in PHP substr() which cops a string upto a character length. But the problem is, that it leaves incomplete words after shortening. Say you have a paragraph: The famous astrophysicist, speaking in a new documentary, said spaceships could one day be capable of such high speeds that time slowed down for those on board. According to the Times...

Read More
Page 1 of 212
content top
TOP