$_GET inside of case [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 8 years ago.
Improve this question
so I would like to use something like /action=productSpec?product=1
And then echo the value "1".
I have this:
case "productSpec":
$show = $_GET['product']
echo $show;
break;
But it doesn't work.
Why? Thank you.
"Case is also GET";

Change that part in the URL to ?action=productSpec&product=1

Related

How to make if else if have search query in my url [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 days ago.
Improve this question
i have url with string like this
example.com/?id=
i want to create a condition when my url looks like this in a search query
Thank you to all of you

PHP logical operator base on string [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
Is there a way to make something like this:
$bob = $request->bob;
return $bob in_array()....
to resolve to something like
return ! in_array()....
or
return in_array()....
base on the variable value...
You can use ?:
return $variable ? in_array('x', $some_arr) : !in_array('x', $some_arr);

Determine source of code that is making a query [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
Exist any way to know the source page that is calling the query and store it?
Are you looking for $_SERVER['PHP_SELF'] ?
Check also print_r($_SERVER) if something is more accurate for what you need

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

PDO PHP how to customize header function [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
is there any way i can get the id inside this code:
header('Location: assigned.php?success?$ticket_id');
I am new to PDO. sorry for the simple question
You are adding ? twice. it should be like..
header('Location: assigned.php?success='.$ticket_id);

Categories