Page 1 of 1

echo is outputting unexpected result

Posted: Fri Feb 06, 2004 1:53 pm
by dsdsdsdsd
hello; I have an echo statement which sends info to .swf file:

Code: Select all

<?php
{ echo ("&var=good");}
?>
the output that I am getting:
---------------------------------------------------
good<br/>
<b>blahh blahh <b>
</body>
</html>
--------------------------------------------------
any thoughts?

thanks
Shannon Burnett

Posted: Fri Feb 06, 2004 2:33 pm
by Derfel Cadarn
many thoughts, but none about this subject.... :lol:

Posted: Fri Feb 06, 2004 2:46 pm
by dsdsdsdsd
Groop I implore thee, my foonting turlingdromes.
And hooptiously drangle me with crinkly bindlewurdles.
Or I will rend thee in the gobberwarts with my burglecruncheon, see if I don't!

if you wrote this - very nice

Posted: Fri Feb 06, 2004 2:49 pm
by John Cartwright
What are you expecting it to do?

Posted: Fri Feb 06, 2004 2:50 pm
by Derfel Cadarn
Nope, the Prostetnic Vogon Jeltz did.... :lol:
and it's awfull when a Vogon read poems....
as we all know :twisted: :twisted: :twisted:

Posted: Fri Feb 06, 2004 2:54 pm
by dsdsdsdsd
I was expecting merely ' good ' as a response; ofcourse I can cut all the extra stuff away but nevertheless I would like to know why I am getting all that extra stuff

Posted: Fri Feb 06, 2004 3:46 pm
by John Cartwright
show me the rest of the code.. I'm a bit confused..

Good is being outputted isnt it?

Posted: Fri Feb 06, 2004 4:23 pm
by dsdsdsdsd
hello phenom; here is my php code:
----------------------------------------------------
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
<?
echo "$var=good";
?>
</body>
</html>
------------------------------------------------------
and the output is:
-------------------------------------
good<br/>
</body>
</html>
-------------------------------------

please note that in my earlier post I had also <b>blahh blahh <b> but that I have removed it

thanks
dsdsdsdsd

Posted: Fri Feb 06, 2004 4:31 pm
by John Cartwright
When you open the page and click source code

this is all you see?

good<br/>
</body>
</html>

Posted: Fri Feb 06, 2004 4:37 pm
by dirtyoldgoat
The only odd thing I see is that the '/' is in the wrong place for the <br>...

He doesn't have it placed in the source code for the php page, but the misplaced backslash could be jacking it up...

Posted: Fri Feb 06, 2004 4:39 pm
by John Cartwright
I have no idea where he's getting this from

<br/>

........ or how it is generated

Posted: Fri Feb 06, 2004 6:22 pm
by DuFF
Not sure what you're trying to do with echo "$var=good"; . Are you trying to output this?

Code: Select all

$var=good
&lt;/body&gt;
&lt;/html&gt;
If so you have to add a slash so PHP doesn't interpret it as a variable:

Code: Select all

<?php
echo "\$var=good"; 
?>
If thats not what you're trying to do, is this?

Code: Select all

<?php
$var = "Rating";
echo $var . "=good";
?>
Which would output:

Code: Select all

Rating =good&lt;br/&gt;
&lt;/body&gt;
&lt;/html&gt;

Posted: Fri Feb 06, 2004 8:35 pm
by dsdsdsdsd
I apologize, I did not make myself clear;

echo "&var=good" is echoing to an .swf file;

in the .swf file I will end up with a variable called 'var' whose value should be 'good';

however I end up with 'var' having a value of
' good<br/>
</body>
</html> '

also I mistakingly posted '$var=...' earlier - should have been a '&', not a '$'