1

I know this is a dumb question, but I can't figure out what this means. When I see .php?=. Also wondering how will go about using that.

Thanks for any help.

user2756684
  • 45
  • 2
  • 7
  • Read up on $_GET variables: http://php.net/manual/en/reserved.variables.get.php – Karl Sep 23 '13 at 10:34
  • Related, but not a dupe: http://stackoverflow.com/questions/3737139/reference-what-does-this-symbol-mean-in-php – David Thomas Sep 23 '13 at 10:37
  • @DavidThomas is it really related? i think that article is about comparison... – Timothy Groote Sep 23 '13 at 10:38
  • @DavidThomas not related... – meze Sep 23 '13 at 10:38
  • Simply `.php?=` means nothing. It could make sense only if in php code there is a strange "handmade" check of url and get – Luca Rainone Sep 23 '13 at 10:39
  • It's related only in the sense that this is a beginner question, and I'd anticipate future questions asking 'what is `&&`?' And so forth; hence my 'not a dupe' (attempt at) classification. – David Thomas Sep 23 '13 at 10:40
  • @David Thomas Future questions like what's && won't be coming for me as I already know what that is. I try to find answer for this question with out asking, but was not able to find the answer. – user2756684 Sep 23 '13 at 10:53
  • 1
    No problem, 'beginner' questions are still welcome, and we're not averse to teaching those newer than ourselves; it is difficult to search for syntax, since the literal characters are often used for specific purposes in searches and database queries. – David Thomas Sep 23 '13 at 11:01

4 Answers4

3

It marks the start of a query string,which can be accessed with GET.

http://somesite.com/index.php?foo=1

$_GET['foo'] will be 1
Mihai
  • 26,325
  • 7
  • 66
  • 81
0

The question mark is supposed to mark the start of the portion of a GET request where you can pass it variables (known as the query string). This is not just for PHP.

Example :

if you send the following :

http://www.myserver.com/file.php?something=12&another=blah

to a php file that looks like this :

<?php 

print($_GET["something"]);
print($_GET["another"]);

?>

the result will be this :

12blah
Timothy Groote
  • 8,614
  • 26
  • 52
0

This is not

.php?=

There must be a variable name before =.

Like this:

.php?x=.

This is variable passed from URL to script. You can read this variable from PHP code like this:

$_GET['x']

More information here: http://php.net/manual/en/reserved.variables.get.php

Kamil
  • 13,363
  • 24
  • 88
  • 183
0

suppose I have file1.php open and in it, I want to create a statement, which passes values to another page, file2.php. This is usually done through an html link or button. I will do it through a link in the below example.

In file1.php, I will include some code that does that:

<a href="edit.php?attribute=value> Link name</a>

This creates a "Link name" hyperlink that, when clicked, passes values by "GET" function into "edit.php".

I will catch the same in file2.php using the following statement in file2.php:

$variable=$_GET['attribute']

P.S. If you didn't understand anything, try forgetting every worry you have and now read the answer again.

Dharman
  • 30,962
  • 25
  • 85
  • 135