0

I'm using xampp on XP.

I can't get PHP to read my var from the URL. example, when I hit www.foobar.com/whatever.php?azz=wala then I should get wala to print to the browser with the following code. Any ideas??

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>Untitled</title>
</head>

<body>
	before
<?php
  echo "middle  ".$azz."  zoo";
  echo "aftermiddle";
?>
	after
</body>
</html>
3
Contributors
5
Replies
6
Views
7 Years
Discussion Span
Last Post by directweb
0

I'm using xampp on XP.

I can't get PHP to read my var from the URL. example, when I hit www.foobar.com/whatever.php?azz=wala then I should get wala to print to the browser with the following code. Any ideas??

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>Untitled</title>
</head>

<body>
	before
<?php
  echo "middle  ".$azz."  zoo";
  echo "aftermiddle";
?>
	after
</body>
</html>

Your below script modified will do the same -

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
	<title>Untitled</title>
</head>

<body>
	before
<?php
  echo "middle  ".$_GET['azz']."  zoo";
  echo "aftermiddle";
?>
	after
</body>
</html>
0

coz. you directly use $azz variable without first defining it...
define it like this

$azz = $_GET;

just put that above your code, befor you output $azz.

0

both of those were good ideas but neither worked. there might be something special needed to echo it?

i resolved my root problem though, i was using this as a test to get my variable names. i had some old script that didn't have the single parenthesis around the var in the condition. it used to work though, maybe a newer version php requires this.

Thanks!

0

Actually vault that was the final half, it didn't work 100% til defining it. PHP seems much more strict in windows w/ xampp defaults. Anyway Thanks!

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.