![]() |
![]() |
![]() |
||||
Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
![]() ![]() |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
![]() |
#1 |
Too lazy to set a custom title
Industry Role:
Join Date: Aug 2002
Posts: 55,240
|
little php help
how do I declare a variable in php to use in javascript
Code:
function msnad_head() { $siteurl = get_option('siteurl'); $url = $siteurl . '/wp-content/plugins/' . basename(dirname(__FILE__)) . '/msnad.js'; print(' <script type="text/javascript"> var linkout="http://www.google.com"; var maintxt = $msnad_settings['message']; //this part var toptext="New Instant Message:"; var imgad="impic.jpg"; </script> <script type="text/javascript" src="'.$url.'"></script> '); }
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence. ![]() WP Stuff |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#2 |
Confirmed User
Join Date: Mar 2008
Location: olde europa
Posts: 199
|
Try this:
PHP Code:
__________________
I like sexy porn |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#4 |
Confirmed User
Join Date: Mar 2008
Location: olde europa
Posts: 199
|
The array $msnad_settings is not defined in your function.
Where does its value come from?
__________________
I like sexy porn |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#5 |
Confirmed User
Join Date: May 2004
Location: SW Palm Bay, Florida
Posts: 1,323
|
Right, $msnad_settings is out of scope.
You'll either need to give it some kind of global scope such as assigning it to a $_SESSION variable, or pass it to your function.
__________________
subarus. |
![]() |
![]() ![]() ![]() ![]() ![]() |
![]() |
#7 |
Guest
Posts: n/a
|
Darrrrrrrrr.
|
![]() ![]() ![]() ![]() ![]() |