Get $_GET value [closed] - php

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 7 years ago.
Improve this question
I am trying to make a simple PHP program. I am trying to get the value from the URL and check if the dev is equal to true. I am using this code:
if($_GET['dev']==true){...}else if($_GET['dev']==false){...}

$_GET variable are all strings, you will need to cast it to a boolean
if (isset($_GET['dev']))
{
$dev= (bool) $_GET['dev'];
if($dev){
}
}

details are not enough, tell us more about your problem.
maybe you need to compare dev to a string and not to boolean:
if($_GET['dev']=="true"){...}else if($_GET['dev']=="false"){...}

Related

what does $_GET['2020'] mean? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
a challenge like this $_GET['2020'] snippet boring me a long time, i want to know how this work, but do not know which keywords to search, maybe how the parameter works?
$_GET reads querystring parameters from the URL. So if someone goes to your PHP script with a URL like http://servername/scriptname.php?2020=ABC then when the PHP script runs, the variable $_GET['2020'] will contain the value ABC.
More info is available in the documentation: https://www.php.net/manual/en/reserved.variables.get.php

Can I assign Address of a variable in PHP [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 4 years ago.
Improve this question
In PHP I want to assign address of variable, like in C Language we use * pointer to assign or store address of any variable. In php the variable address assigning system is possible or not?
You can't get the pointer address but you can use references
$var1 = &$var2

Pass a URL as a get parameter in php [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 6 years ago.
Improve this question
http://example.com/geturl.php?url=http://example.org/index.php?parafile=1698%3A1562%3A0%3A0&para_action=print_ticket&parafile=dance://here.kodas/print&token=3ec2b0d3e6e0ca152bc024cc3f30f16c
So i want each of this parameters in a different varaible in the geturl.php file. I am using the regular get url
You can use anything like this :
$url = "http://example.com/geturl.php?url=".urlencode($urlPart);
$_server[QUERY_STRING] solved my problem

When we pass an array as an argument to a function, what actually gets passed? [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
When we pass an array as an argument to a function, what actually gets passed?
Someone told me that it is "Base address of the array"? but I am not sure about it. How this array is processed then?
this is the answer: Are arrays in PHP passed by value or by reference?

Inputting php the right way....GET php [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Hello I was wondering if I am doing this PHP correct. I am almost 100% is right and should be working. Here is the code:
if($url == '/user/view.html.php?user_id='. $_GET['user_id'].') {
I was wondering if the $_GET part was correct. Is the PHP above correct?
You don't need the second tick. You're done concatenating after your $_GET statement it looks like.
if($url == '/user/view.html.php?user_id='. $_GET['user_id']) {

Categories