Skip to main content

What is the role of $_GET and $_POST?

Entry PHP
Quick Answer $_GET: data from URL query string (?name=Alice&age=25). Visible in URL, bookmarkable, cached. Use for read operations (search, filtering). $_POST: data from form body (not in URL). More secure for sensitive data, not cached. Use for write operations (login, form submission). GET has length limits; POST supports large data and file uploads. Validate both before use.

Answer

$_GET gets URL parameters. $_POST retrieves data sent through the request body, often for forms.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice