| | |
Help With PHP & Javascript
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Oct 2006
Posts: 75
Reputation:
Solved Threads: 0
There is a script I am using....A Media Gallery...everytime I put in a javascript, it does not work. When I put
I recieve this when I view the source of the script
Is there anything I can do for it to ignore <br />
Note...the script was intended for html
•
•
•
•
<script type="text/javascript"
src="http://www.example.com/js/swfobject.js">
</script>
<script language="javascript"
src="http://www.example.com/js/player.js">
</script>
<script language="javascript">
var config = new Array();
config["width"] = 400;
config["height"] = 300;
config["clientId"] = "example";
config["bgColor"] = "#FFFFFF";
config["playList"] = "1191";
showSanagaPlayer(config);
</script>
•
•
•
•
<script type="text/javascript"<br />
src="<A href="http://www.example.com/js/swfobject.js"><br">http://www.example.com/js/swfobject.js"><br />
</script><br />
<script language="javascript"<br />
src="<A href="http://www.example.com/js/player.js"><br">http://www.example.com/js/player.js"><br />
</script><br />
<script language="javascript"><br />
var config = new Array();<br />
config["width"] = 400;<br />
config["height"] = 300;<br />
config["clientId"] = "example";<br />
config["bgColor"] = "#FFFFFF";<br />
config["playList"] = "1191";<br />
showSanagaPlayer(config);<br />
</script>
Note...the script was intended for html
It looks to me like you entered this somewhere in your mediagalary, but that it got parsed. To because that a tag was wrapped around the URL's. Bit weird is the <br"> and that it didn't close the a tag, if it were a parser.
So I ask you, did you nativly pasted this into PHP like:
[php]
<?php
//code here
?>
<script type="text/javascript"
src="http://www.example.com/js/swfobject.js">
</script>
<script language="javascript"
src="http://www.example.com/js/player.js">
</script>
<script language="javascript">
var config = new Array();
config["width"] = 400;
config["height"] = 300;
config["clientId"] = "example";
config["bgColor"] = "#FFFFFF";
config["playList"] = "1191";
showSanagaPlayer(config);
</script>
<?php
//code here
?>
[/php] or did you enter this somewhere in a form in the media galary your using. If you didn't enter it in a form it's still theoraticly possible to style it with ob_start() and output buffer functions, seems unlikely though. You might wanna add what gallery your using.
So I ask you, did you nativly pasted this into PHP like:
[php]
<?php
//code here
?>
<script type="text/javascript"
src="http://www.example.com/js/swfobject.js">
</script>
<script language="javascript"
src="http://www.example.com/js/player.js">
</script>
<script language="javascript">
var config = new Array();
config["width"] = 400;
config["height"] = 300;
config["clientId"] = "example";
config["bgColor"] = "#FFFFFF";
config["playList"] = "1191";
showSanagaPlayer(config);
</script>
<?php
//code here
?>
[/php] or did you enter this somewhere in a form in the media galary your using. If you didn't enter it in a form it's still theoraticly possible to style it with ob_start() and output buffer functions, seems unlikely though. You might wanna add what gallery your using.
•
•
Join Date: Oct 2006
Posts: 75
Reputation:
Solved Threads: 0
When I add this to the form in the php scripts which is I recieve this when I view the source of the website I get I think there must be a code in the php that adds <br /> when I put in my code
•
•
•
•
<script type="text/javascript"
src="http://www.example.com/js/swfobject.js">
</script>
<script language="javascript"
src="http://www.example.com/js/player.js">
</script>
<script language="javascript">
var config = new Array();
config["width"] = 400;
config["height"] = 300;
config["clientId"] = "example";
config["bgColor"] = "#FFFFFF";
config["playList"] = "1191";
showSanagaPlayer(config);
</script>
•
•
•
•
<script type="text/javascript"<br />
src="<A href="<A href="http://www.example.com/js/swfobject.js"><br">http://www.example.com/js/swfobject.js"><br">
</script><br />
<script language="javascript"<br />
src="<A href="<A href="http://www.example.com/js/player.js"><br">http://www.example.com/js/player.js"><br">
</script><br />
<script language="javascript"><br />
var config = new Array();<br />
config["width"] = 400;<br />
config["height"] = 300;<br />
config["clientId"] = "example";<br />
config["bgColor"] = "#FFFFFF";<br />
config["playList"] = "1191";<br />
showSanagaPlayer(config);<br />
</script>
Where are you putting in the JS script? Directly into a PHP file? HTML file?
Are you entering it via a form?
The New Lines are being parsed into <br /> tags somewhere..
Are you entering it via a form?
The New Lines are being parsed into <br /> tags somewhere..
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
The form handler uses the function nl2br() on the content it receives.
You'll have to remove that or upload your script via ftp or some other method.
or
Put the JS in a file and upload the file anywhere on the web.
Plase <script src="http://example.com/js_file.js"></script>
in the form you're using. make sure it links to the js file. That way the form won't corrupt your js.
what gallery are you using by the way. It is a stand alone gallery or on top of another app?
You'll have to remove that or upload your script via ftp or some other method.
or
Put the JS in a file and upload the file anywhere on the web.
Plase <script src="http://example.com/js_file.js"></script>
in the form you're using. make sure it links to the js file. That way the form won't corrupt your js.
what gallery are you using by the way. It is a stand alone gallery or on top of another app?
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
In the form you are uploading your script, look at the HTML source. The form will have an "action" attribute. This points to the form handler. This file is the one thats changing the code you're putting in. Post the file contents here or put it in a text editor and search for nl2br.
www.fijiwebdesign.com - web design and development and fun
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
Cpanel Email - Let users Register email accounts on your website upon registration
Ajax Chat - Fully browser based chat!
![]() |
Similar Threads
- how to access accessing PHP variable in JavaScript (PHP)
- I Need Help To Do an e-vite with php & javascript (PHP)
Other Threads in the PHP Forum
- Previous Thread: placing site
- Next Thread: small question please
| Thread Tools | Search this Thread |
action address ajax apache api array auto autoincrement beginner binary broken cakephp checkbox class classes cms code cron curl database date dehasher destroy display domain dynamic echo email error errorlog fatalerror file files folder form forms function functions google href htaccess html if-else image include insert integration ip java javascript joomla limit link load login loop mail masterthesis menu mlm multiple mysql mysqlquery oop paypal pdf php popup problem query radio random record recursion regex remote script search security server sessions sms soap sockets source space sql syntax system table tutorial update upload url validator variable video web xml youtube






