Monday, January 31, 2022

[FIXED] In html we use href for navigating to another page. how to perform the same operation in php

Issue

I am very beginner in php.I need to know how to fetch the data from the url and pass it to another page using html.

http://localhost/userdetails.php?branchId=2

This is my url i need to get the value branchId=2 and pass it to next page userdetails.2php what is the syntax for this operation As a beginner am having trouble in doing that.


Solution

When getting parameters from url, use $_GET. So in userdetails.php, use

$_GET['branchId'];


Answered By - Niranjan N Raju

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.