WriteGreatCode
-
Posts
5 -
Joined
-
Last visited
Never
Posts posted by WriteGreatCode
-
-
-
does alert function have to defined in the php page?
alert is pre-defined rite?
echo "<script type='text/javascript'>alert('{$variabl}');</script>
the alert box does not appear...
alert if a Java Script function, so it doesn't have to be defined on the PHP page. And what he said works fine besides the fact that he forgot the ending quote after </script>
<?php $Text = "Hello World!"; echo "<script type='text/javascript'>alert('{$Text}');</script>" ?>
haha we both messed up, you forgot a ; at the end..
sorry btw @OP I can't really see too well you have to pardon my crappy help
<?php $Text = "Hello World!"; echo "<script type='text/javascript'>alert('{$Text}');</script>"; ?>
Ooops, well that's embarrassing
-
does alert function have to defined in the php page?
alert is pre-defined rite?
echo "<script type='text/javascript'>alert('{$variabl}');</script>
the alert box does not appear...
alert if a Java Script function, so it doesn't have to be defined on the PHP page. And what he said works fine besides the fact that he forgot the ending quote after </script>
<?php $Text = "Hello World!"; echo "<script type='text/javascript'>alert('{$Text}');</script>" ?>
-
You should post what errors you get when you go to run your code.
display php variable in alert box
in PHP Coding Help
Posted
It seems that it only works if there's only one line in the file. Maybe the hidden \r\n character (it is used in edit controls in the C++ Win32 API, which is what Notepad.exe was made in, for a new line) in the text is messing it up. Because I can echo it to the screen fine:
Just not use the alert function =/
So, not sure on this one, maybe someone else can help you out.