<?php echo "css entered value: "; echo '$fname','$lname','$country'; ?> 

PHP does not show the values ​​passed to the browser via css, what's wrong with the script? here is the archive on with the sources. transfer css file parameters to the php script. browser shows

  • one
    Sorry, but what have the css? - andreymal

5 answers 5

To get the values ​​from the form sent by the GET method (as in the question), you need to use the $_GET superglobal array .

In this way:

 $firstName = $_GET['firstname']; 

or, checking for availability:

 $firstName = isset($_GET['firstname']) ? $_GET['firstname'] : null; // что угодно 

or, with check for availability in PHP7 :

 $firstName = $_GET['firstname'] ?? null; 

An interesting question, interesting answers ..

    Your php does not define $fname , $lname and $country before $lname their values.

    If you put double quotes instead of single quotes, then you should simply get css entered value: without continuing.

       echo '$fname','$lname','$country'; 

      replace with

       echo $fname.$lname.$country; 
      • echo $ fname. $ lname. $ country; nothing has changed, thanks and on that. - Ryslandeveloper
      • Strange, the company is not at hand, it should work. And try print ($ fname. $ Any); - hitcode
       echo "$fname","$lname","$country"; 

      Simply replace single quotes with double quotes. And read in the documentation , than in PHP is different processing of strings in single and double quotes.

        transfer value from css to php script thank