Re: [PHP] PHP URL query

2006-05-11 Thread tedd

At 5:43 PM +0100 5/10/06, IraqiGeek wrote:

Hi all,

I'm somewhat new to php, though I have played a bit with the 
language. I'm currently learning the language, and I'm having a 
problem passing variables through URL query.



The following will show you how to do post and get :

http://www.weberdev.com/get_example-4345.html

hth's

tedd
--

http://sperling.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] PHP URL query

2006-05-10 Thread IraqiGeek

Hi all,

I'm somewhat new to php, though I have played a bit with the language. I'm 
currently learning the language, and I'm having a problem passing variables 
through URL query. Here is what I have:


A simple HTML file that contains:
A HREF=test.php?var=test Hi, this is a test! /A

and a php file that contains:
?php
echo( Welcome to our Web site, $var! );
?

However, when I click on the link on the HTML file, I dont get the value of 
$var passed to the php script. I have also tried passing multiple variables 
separated by , and none of those gets passed to the php script.


The files are hosted on a local Debian etch server running apache 2.0.54 and 
php 4.3.10.


Is there something I need to check/change in the config files of apache or 
php?



Regards,
IraqiGeek
www.iraqigeek.com

Boat: A hole in the water surrounded by wood into which one pours money.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP URL query

2006-05-10 Thread Jason Gerfen

IraqiGeek wrote:


Hi all,

I'm somewhat new to php, though I have played a bit with the language. 
I'm currently learning the language, and I'm having a problem passing 
variables through URL query. Here is what I have:


A simple HTML file that contains:
A HREF=test.php?var=test Hi, this is a test! /A

and a php file that contains:
?php
echo( Welcome to our Web site, $var! );
?


try
echo Welcome to our website, $_GET['var'];

However, when I click on the link on the HTML file, I dont get the 
value of $var passed to the php script. I have also tried passing 
multiple variables separated by , and none of those gets passed to 
the php script.


The files are hosted on a local Debian etch server running apache 
2.0.54 and php 4.3.10.


Is there something I need to check/change in the config files of 
apache or php?



Regards,
IraqiGeek
www.iraqigeek.com

Boat: A hole in the water surrounded by wood into which one pours money.




--
Jason Gerfen
Student Computing Labs, University Of Utah
[EMAIL PROTECTED]

I will never tolerate your innocence
~ Blood has been shed

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP URL query

2006-05-10 Thread Brad Bonkoski

?php
$var = $_GET['var'];
echo( Welcome to our Web site, $var! );
?

-B

IraqiGeek wrote:


Hi all,

I'm somewhat new to php, though I have played a bit with the language. 
I'm currently learning the language, and I'm having a problem passing 
variables through URL query. Here is what I have:


A simple HTML file that contains:
A HREF=test.php?var=test Hi, this is a test! /A

and a php file that contains:
?php
echo( Welcome to our Web site, $var! );
?

However, when I click on the link on the HTML file, I dont get the 
value of $var passed to the php script. I have also tried passing 
multiple variables separated by , and none of those gets passed to 
the php script.


The files are hosted on a local Debian etch server running apache 
2.0.54 and php 4.3.10.


Is there something I need to check/change in the config files of 
apache or php?



Regards,
IraqiGeek
www.iraqigeek.com

Boat: A hole in the water surrounded by wood into which one pours money.



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP URL query

2006-05-10 Thread Eric Butera

On 5/10/06, IraqiGeek [EMAIL PROTECTED] wrote:

Hi all,

I'm somewhat new to php, though I have played a bit with the language. I'm
currently learning the language, and I'm having a problem passing variables
through URL query. Here is what I have:

A simple HTML file that contains:
A HREF=test.php?var=test Hi, this is a test! /A

and a php file that contains:
?php
echo( Welcome to our Web site, $var! );
?

However, when I click on the link on the HTML file, I dont get the value of
$var passed to the php script. I have also tried passing multiple variables
separated by , and none of those gets passed to the php script.

The files are hosted on a local Debian etch server running apache 2.0.54 and
php 4.3.10.

Is there something I need to check/change in the config files of apache or
php?


Regards,
IraqiGeek
www.iraqigeek.com

Boat: A hole in the water surrounded by wood into which one pours money.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Try $_GET['var'].

echo( Welcome to our Web site, {$_GET['var']}! );

Two things you should note:
- using $var would be using register_globals which is depricated.
(http://us2.php.net/register_globals)
- echoing out get variables can lead to a XSS attack. (read
http://ha.ckers.org/xss.html)

As many like to point out, please read http://phpsec.org/ for some
security articles since most tutorials always strip any security
related code for simplicity.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP URL query

2006-05-10 Thread Dave Goodchild

register_globals is disabled on your system, which is a good thing. So you
have to reference all values sent via a form using GET with the $_GET
superglobal array as follows:

Welcome to our web site, {$_GET[var]}

or

'Welcome to our web site, ' . $_GET['var']

etc etc

On 10/05/06, IraqiGeek [EMAIL PROTECTED] wrote:


Hi all,

I'm somewhat new to php, though I have played a bit with the language. I'm
currently learning the language, and I'm having a problem passing
variables
through URL query. Here is what I have:

A simple HTML file that contains:
A HREF=test.php?var=test Hi, this is a test! /A

and a php file that contains:
?php
echo( Welcome to our Web site, $var! );
?

However, when I click on the link on the HTML file, I dont get the value
of
$var passed to the php script. I have also tried passing multiple
variables
separated by , and none of those gets passed to the php script.

The files are hosted on a local Debian etch server running apache 2.0.54and
php 4.3.10.

Is there something I need to check/change in the config files of apache or
php?


Regards,
IraqiGeek
www.iraqigeek.com

Boat: A hole in the water surrounded by wood into which one pours money.

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php





--
http://www.web-buddha.co.uk

dynamic web programming from Reigate, Surrey UK (php, mysql, xhtml, css)

look out for project karma, our new venture, coming soon!


Re: [PHP] PHP URL query

2006-05-10 Thread John Nichel

IraqiGeek wrote:

Hi all,

I'm somewhat new to php, though I have played a bit with the language. 
I'm currently learning the language, and I'm having a problem passing 
variables through URL query. Here is what I have:


A simple HTML file that contains:
A HREF=test.php?var=test Hi, this is a test! /A

and a php file that contains:
?php
echo( Welcome to our Web site, $var! );
?

However, when I click on the link on the HTML file, I dont get the value 
of $var passed to the php script. I have also tried passing multiple 
variables separated by , and none of those gets passed to the php script.


The files are hosted on a local Debian etch server running apache 2.0.54 
and php 4.3.10.


Is there something I need to check/change in the config files of apache 
or php?




register_globals is off (leave it off)

http://us2.php.net/manual/en/language.variables.external.php

--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP URL query

2006-05-10 Thread IraqiGeek

On Wednesday, May 10, 2006 6:08 PM GMT,
Jason Gerfen [EMAIL PROTECTED] wrote:


IraqiGeek wrote:


Hi all,

I'm somewhat new to php, though I have played a bit with the
language. I'm currently learning the language, and I'm having a
problem passing variables through URL query. Here is what I have:

A simple HTML file that contains:
A HREF=test.php?var=test Hi, this is a test! /A

and a php file that contains:
?php
echo( Welcome to our Web site, $var! );





try
echo Welcome to our website, $_GET['var'];


Jason, brad, Eric, Dave, and John,

Thank you all for pointing $_GET and register_globals. The tutorial I'm 
reading is from 2000 and references PHP 4.1.





However, when I click on the link on the HTML file, I dont get the
value of $var passed to the php script. I have also tried passing
multiple variables separated by , and none of those gets passed to
the php script.

The files are hosted on a local Debian etch server running apache
2.0.54 and php 4.3.10.

Is there something I need to check/change in the config files of
apache or php?


Regards,
IraqiGeek
www.iraqigeek.com

Boat: A hole in the water surrounded by wood into which one pours
money.



Regards,
IraqiGeek
www.iraqigeek.com

The trouble with doing something right the first time is that nobody 
appreciates how difficult it was. 


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] PHP URL query

2006-05-10 Thread Vedanta Barooah
Try this :
?php
$foo=$_GET['var'];
echo ($foo);
?

Refer: http://www.zend.com/zend/art/art-sweat4.php

- Vedanta Barooah

-Original Message-
From: IraqiGeek [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, May 10, 2006 10:14 PM
To: php-general@lists.php.net
Subject: [PHP] PHP URL query

Hi all,

I'm somewhat new to php, though I have played a bit with the language. I'm 
currently learning the language, and I'm having a problem passing variables 
through URL query. Here is what I have:

A simple HTML file that contains:
A HREF=test.php?var=test Hi, this is a test! /A

and a php file that contains:
?php
echo( Welcome to our Web site, $var! );
?

However, when I click on the link on the HTML file, I dont get the value of 
$var passed to the php script. I have also tried passing multiple variables 
separated by , and none of those gets passed to the php script.

The files are hosted on a local Debian etch server running apache 2.0.54 and

php 4.3.10.

Is there something I need to check/change in the config files of apache or 
php?


Regards,
IraqiGeek
www.iraqigeek.com

Boat: A hole in the water surrounded by wood into which one pours money.

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] PHP URL query

2006-05-10 Thread Jochem Maas

IraqiGeek wrote:

Hi all,



...

two things which have nothing to do with your original question
(that seems to have been covered rather well)



Regards,
IraqiGeek
www.iraqigeek.com


try viewing your site in firefox - notice all those question marks
in the content? might be interesting to find out why that is. :-)



Boat: A hole in the water surrounded by wood into which one pours money.


that really made me laugh :-)





--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php