If i want to add a script to a php page when i wanna put it somewhere, do i go
<script> php here </script> Cause i do that and its not working.
p.s first time adding scripts to my site.
If i want to add a script to a php page when i wanna put it somewhere, do i go
<script> php here </script> Cause i do that and its not working.
p.s first time adding scripts to my site.
You can close the PHP tags or you can use a echo
PHP Code:<?php
// My 1st PHP code
?>
<script></script>
<?php
// My 2nd PHP code
?>You cant use " in the echo tagPHP Code:<?php
echo("<script></script>");
?>![]()
e.g.
Code:<?php echo ("This is text<font face=\"verdana\" size=\"2\">This would make the font Verdana Size 2</font>") ?>
Last edited by Robbie..; 03-04-2006 at 09:25 PM.
What are you trying to do? Add PHP to the site, or are you trying to add JavaScript using PHP?
To add PHP to the site:
To add JavaScript, just place the script tag outside of the PHP tag. If you're trying to add dynamic content though, you'll just need to print the JavaScript tag.PHP Code:<?php
#PHP here..
?>
Example:
PHP Code:<?php
$date = date("l \- jS");
print '<script type="text/JavaScript">alert(\'The date is: '.$date.'\');</script>';
?>
Im trying to add a poll i got everything uploads and did the stuff then i have to add its to a box on my site so then i get a code and i put it in but it doesnt work..
im noob at php
i have to include this script in a php page \
How do i get it too workPHP Code:<?
include("dynamicpoll/poll.php");
?>
Want to hide these adverts? Register an account for free!