How do I split the URL and then get its value and store the value on each text input?
URL:
other.php?add_client_verify&f_name=test&l_name=testing&dob_day=03&dob_month=01&dob_year=2009&gender=0&house_no=&street_address=&city=&county=&postcode=&email=&telp=234&mobile=2342&newsletter=1&deposit=1
PHP:
$url = $_SERVER['QUERY_STRING'];
$para = explode("&", $url); 
foreach($para as $key => $value){   
    echo '<input type="text" value="" name="">';    
} 
above code will return:
l_name=testing  
dob_day=3  
doby_month=01  
....
and i tried another method:
$url = $_SERVER['QUERY_STRING'];
$para = explode("&", $url); 
foreach($para as $key => $value){   
    $p = explode("&", $value);
    foreach($p as $key => $val) {
       echo '<input type="text" value="" name="">';
    }   
} 
                The parameters from a URL string can be retrieved in PHP using parse_url() and parse_str() functions.
PHP $_GET is a PHP super global variable which is used to collect form data after submitting an HTML form with method="get". $_GET can also collect data sent in the URL. When a user clicks on the link "Test $GET", the parameters "subject" and "web" are sent to "test_get.
Read the Data: PHP has $_GET superglobal that accepts all the data from the URL and stores it as an array. Syntax: print_r($_GET); Get data and store in an array with some extra information.
Why not using $_GET global variable?
foreach($_GET as $key => $value)
{  
  // do your thing.
}
                        If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With