View Full Version : php help
My3tery
03-04-2006, 07:37 PM
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.
Luckyrare
03-04-2006, 07:49 PM
You can close the PHP tags or you can use a echo
<?php
// My 1st PHP code
?>
<script></script>
<?php
// My 2nd PHP code
?>
<?php
echo("<script></script>");
?>
You cant use " in the echo tag ;)
Mentor
03-04-2006, 09:19 PM
Unless you use ' when the echo uses " or vice versa. or slash out the " or ' s or use a more advanced echo method so as to avoide the problem all together "/
Robbie..
03-04-2006, 09:25 PM
e.g.
<?php
echo ("This is text<font face=\"verdana\" size=\"2\">This would make the font Verdana Size 2</font>")
?>
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:
<?php
#PHP here..
?>
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.
Example:
<?php
$date = date("l \- jS");
print '<script type="text/JavaScript">alert(\'The date is: '.$date.'\');</script>';
?>
My3tery
03-04-2006, 10:13 PM
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
My3tery
05-04-2006, 12:10 AM
i have to include this script in a php page \
<?
include("dynamicpoll/poll.php");
?>
How do i get it too work
Want to hide these adverts? Register an account for free!
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.