Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

130 users online



Need help "translating" something.

Need help "translating" something.

Currently viewing this thread: 1 (0 members and 1 guests)


Marvin

Marvin

Neverside Newbie
Status: Offline!

Need help "translating" something.

Ok, I want to make this javascript compatable with PHP.

here is the Javascript code.

Code:

<script>
//Popup Window Script
//By JavaScript Kit ([url]http://javascriptkit.com[/url])
//JavaScript tutorials and over 400+ free scripts

function openpopup(){
var popurl="$content[movieurl]"
winpops=window.open(popurl,"","width=$content[width],height=$content[height],")
}

openpopup()
</script>

Ok, now the thing is, I cant just like echo it in as PHP normal. Because it thinks that the function openpopup() is part of the PHP. And I need this in bPHP because the $content[WHATEVER] is results from the SQL tables. So could someone translate this in PHP so it would work? Thank you.

epyon

epyon

16, staying Asian.
Status: Offline!
PHP:

<?php
echo "function openpopup(){\n";
echo 
"var popurl=\"$content[movieurl]\"\n";
echo 
"winpops=window.open(popurl,\"\",\"width=$content[width],height=$content[height],\")\n";
echo 
"}\n";
?>

___________________

http://whatpulse.bounceme.net/sig/epyon.png

Marvin

Marvin

Neverside Newbie
Status: Offline!

WHAT! There you are again. Such a good man. thank you alot.

NoT_SupeRmaN

NoT_SupeRmaN

Status: Offline!

ROFL, All he did was echo what you gave..and added some slashes Smile
BTW: PHP is Server-Side, you can't open browser windows with PHP..Not to my knowledge at least...

___________________

Current Project: Getting a damn Portfolio/Resume Online.

IdleNut

IdleNut

Neverside Newbie
Status: Offline!

he isnt looking to open windows using PHP, just write the javascript between the PHP echo tags

erod

erod

uh yea
Status: Offline!

?>

<?php

dudez lol

___________________

I code alot.

Marvin

Marvin

Neverside Newbie
Status: Offline!

Well see, I tried that once before with the echo and stuff, but for some reason it kept thinking the funcion was a PHP function.

Adam

Adam

Status: Offline!

echo is a php function, else you are talking about JS

___________________


Current Project: LivermoreMuscle.com
Sig Hosted by Motorspin

amplify

amplify

I'm a Neverside Newbie?
Status: Offline!

What you can do is include an text document, etc containing the javascript. No escaping, etc.

Code:

script.txt
script.js (you can just echo an html tag to include a js file as well)

<script>
//Popup Window Script
//By JavaScript Kit ([url]http://javascriptkit.com[/url])
//JavaScript tutorials and over 400+ free scripts

function openpopup(){
var popurl="$content[movieurl]"
winpops=window.open(popurl,"","width=$content[width],height=$content[height],")
}

openpopup()
</script>

PHP:

<?php

incluce
("script.txt");

?>

Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0079 seconds.