Page 1 of 2

Big bug with $_GET

PostPosted: 20. October 2010 12:13
by zairakai
Hi all, I use xampp with ubuntu 10.01 LTS. No probleme first but I try to use $_GET variable. And the PHP can"t found this. I try the same code online and it's working. Do tou know how to turn on the get systeme for php?
Thanks a lot.

P.S: I'm French, and not really good in English, sorry about that.

Re: Big bug with $_GET

PostPosted: 20. October 2010 17:01
by Altrea
Maybe you want to show us your code?
very common this is a short_open_tags issue

Re: Big bug with $_GET

PostPosted: 20. October 2010 18:29
by zairakai
yes if you want;
I call http://localhost/index.php?toto=azerty
on my index.php
if have
Code: Select all
<?php
      if(isset($_GET['toto'])){
            echo $_GET['toto'];
      }else{
            echo 'error';
      }
?>


and when i see the answer, I have :
Code: Select all
Notice: Undefined variable: codecom in /opt/lampp/htdocs/index.php on line 2
error


And I try this code whith WAMP no probleme and online, no probleme.
I try too POST and SESSION no probleme with that only with GET.

Re: Big bug with $_GET

PostPosted: 20. October 2010 19:06
by Altrea
zairakai wrote:
Code: Select all
Notice: Undefined variable: codecom in /opt/lampp/htdocs/index.php on line 2

Are you really really sure, that this is the error message with the script you postet here?
Please doublecheck that.

There is no "codecom" variable anywhere in your example script

Re: Big bug with $_GET

PostPosted: 20. October 2010 19:39
by zairakai
it's the same. it's not my code, it's working on another serveur.

It's jeut xampp not suporte the GET.

I want to use the get with xampp (if not, it's not a good webserver than wampp (windows)).
Do you kow how to make that?

Re: Big bug with $_GET

PostPosted: 20. October 2010 19:52
by Altrea
xampp supports GET out of the box.

Are you sure xampp Apache webserver is running and not any other webserver of your Linux distribution?

Re: Big bug with $_GET

PostPosted: 20. October 2010 20:44
by zairakai
Yes, all xampp was run and I install (with apt-get xampp) only xammp. If ubuntu has not another apache, Normaly it"s ok.

Re: Big bug with $_GET

PostPosted: 20. October 2010 20:48
by Altrea
please take a look at this file: /opt/lampp/htdocs/index.php

Is this your file you posted here?

Re: Big bug with $_GET

PostPosted: 20. October 2010 21:05
by zairakai
/opt/lampp/htdocs/index.php
yes it was that

Re: Big bug with $_GET

PostPosted: 20. October 2010 21:12
by Altrea
I just can't believe php throws a notice for a variable which don't exists anywhere.
php don't create ghost variables :shock:

Re: Big bug with $_GET

PostPosted: 20. October 2010 21:21
by Altrea
btw: there is no xampp package which you can install with apt-get.
AFAIK the XAMPP package can only be downloaded from apachefriends or sourceforge

Re: Big bug with $_GET

PostPosted: 20. October 2010 21:24
by zairakai
what do you want to say?


I install xampp with this tuto http://doc.ubuntu-fr.org/xampp
I download XAMPP Linux 1.7.3a on http://www.apachefriends.org/fr/xampp-linux.html
I used this
Code: Select all
<?php echo $_GET['toto']; ?>


and I call
http://localhost/index.php?toto=1

And I receive

Notice: Undefined variable: toto in /opt/lampp/htdocs/index.php on line 1

Re: Big bug with $_GET

PostPosted: 20. October 2010 21:28
by Altrea
zairakai wrote:what do you want to say?

That your descriptions must be the truth.
I can't see whats on your screen.
I don't know your system.
I don't know anything about the tuts you follow.

I just know what you tell us in this board!

Don't know what i want to say? :

Code: Select all
Notice: Undefined variable: codecom in /opt/lampp/htdocs/index.php on line 2


IS NOT THE SAME AS

Code: Select all
Notice: Undefined variable: toto in /opt/lampp/htdocs/index.php on line 1

Re: Big bug with $_GET

PostPosted: 20. October 2010 21:35
by Altrea
Next thing i can't believe:

If i use your sourcecode and provoke an error (error_reporting at highest level, don't give an argument in the address line) i get this message:
Code: Select all
Notice: Undefined index: toto in C:\xampp\htdocs/get.php on line 2


not undefined variable, undefined index!

I don't know whats going wrong with your installation.
Maybe someone else knows.

Re: Big bug with $_GET

PostPosted: 20. October 2010 21:41
by zairakai
Do you know where can I found a tuto for using apache mysql php ftp ... Simply (not like xampp but it have a bug with that).