Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

variable passing 1

Status
Not open for further replies.

Ablecken

Programmer
Jun 5, 2001
130
US
Hey guys,

I am just trying to learn PHP. Most of my work is done in asp but I really want to learn. I have read that if you send a var in a url like this:


It is supposed to automatically make a variable called somevar on that page. When I try to use this variable i comes up like this:

Notice: Undefined variable: somevar in c:\inetpub\ on line 12

Is there something I need to do?

Here is my code:

Code:
<html>

<head>
<meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=windows-1252&quot;>
<title>somepage</title>
</head>

<body>

<?php echo ($somevar); ?>

</body>

</html>

Any ideas?

Thanx
 
No.

You should refer to the var as $_GET['somevar'].

That way of passing vars to PHP, is deprecated. You can still use it, but you need to change one thing in the php.ini file.

Anikin
Hugo Alexandre Dias
Web-Programmer
anikin_jedi@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top