473,788 Members | 2,784 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

javascript content in $_POST

Hi,

I am trying to post a javascript content via form textarea input
element.
But when i click send (post) the posted page comes unaccesible.

example content for post :

<script type="text/javascript"
src="http://test.com">
</script>

I think it is about apache or php configuration.

In my local computer , there is no problem.Problem occurs my hosting
environment.
Regards,
--
Gokhan Altinsoy ~= 15000 -->
http://www.itinfomap.com/bilin/perso...iew&itemid=106
Dec 3 '07 #1
14 1996
Gökhan Altınsoy wrote:
Hi,

I am trying to post a javascript content via form textarea input
element.
Hi,

I am unsure I understand what you mean.
You cannot post a JavaScript variable by means of posting a form.
You can of course put the value of a javascriptvaria ble INTO a form
before posting it.
But the only thing that arrives at the server after the post is the
content of the form, not one JavaScript variable will be posted by itself.

But when i click send (post) the posted page comes unaccesible.
What do you mean by that?
>
example content for post :

<script type="text/javascript"
src="http://test.com">
</script>
That is NOT a form, nor a post. It is just a piece of JavaScript.
>
I think it is about apache or php configuration.
I don't think so.
>
In my local computer , there is no problem.Problem occurs my hosting
environment.

Please understand we can only guess what you are doing, and so we can
also only guess at your problem.
Write it over in a more clear way with a little piece of relevant code.

Regards,
Erwin Moller
Regards,
--
Gokhan Altinsoy ~= 15000 -->
http://www.itinfomap.com/bilin/perso...iew&itemid=106
Dec 3 '07 #2
On 3 Dec, 11:40, Erwin Moller
<Since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote:
I am unsure I understand what you mean.
You cannot post a JavaScript variable by means of posting a form.
You can of course put the value of a javascriptvaria ble INTO a form
before posting it.
Erwin, he was quite clear in his post (on this point at least). He is
not trying to post a javacript variable.

He said that he is putting:
<script type="text/javascript"
src="http://test.com">
</script>

in a textarea.

What is not clear to me is precisely in what way "the posted page
comes unaccesible"?
Dec 3 '07 #3
On Mon, 03 Dec 2007 12:40:22 +0100, Erwin Moller
<Si************ *************** *************** @spamyourself.c omwrote:
Gökhan Altınsoy wrote:
> I am trying to post a javascript content via form textarea input
element.

I am unsure I understand what you mean.
Neither can I
>But when i click send (post) the posted page comes unaccesible.

What do you mean by that?
Posted 'page'? Chances are this is a CMS backend, and this particular code
breaks the CMS?
> example content for post :
<script type="text/javascript"
src="http://test.com">
</script>

That is NOT a form, nor a post. It is just a piece of JavaScript.
> I think it is about apache or php configuration.

I don't think so.
> In my local computer , there is no problem.Problem occurs my hosting
environment.
Keep in mind the different 'security clearances' of javascript depending
on where it comes from..

Please understand we can only guess what you are doing, and so we can
also only guess at your problem.
Write it over in a more clear way with a little piece of relevant code.
Indeed. An url of (a mockup of) the form would also help a lot in
understanding the OP.
--
Rik Wasmus
Dec 3 '07 #4
Captain Paralytic wrote:
On 3 Dec, 11:40, Erwin Moller
<Since_humans_r ead_this_I_am_s pammed_too_m... @spamyourself.c omwrote:
>I am unsure I understand what you mean.
You cannot post a JavaScript variable by means of posting a form.
You can of course put the value of a javascriptvaria ble INTO a form
before posting it.
Erwin, he was quite clear in his post (on this point at least). He is
not trying to post a javacript variable.

He said that he is putting:
<script type="text/javascript"
src="http://test.com">
</script>
Yes, you are right.
He clearly stated he was posting that piece of javascript.

Nothing wrong with that as far as I can see.

Chances are that the receiving script is part of some CMS and doesn't
want Javascript content, like Rik suggested in the other thread.
Maybe it filters it away, or takes some other action.
Hard to say. More onfo please! :-)

Erwin
>
in a textarea.

What is not clear to me is precisely in what way "the posted page
comes unaccesible"?
Dec 3 '07 #5
On Dec 3, 1:55 pm, Captain Paralytic <paul_laut...@y ahoo.comwrote:
On 3 Dec, 11:40, Erwin Moller<Since_hu mans_read_this_ I_am_spammed_to o_m...@spamyour self.comwrote:
I am unsure I understand what you mean.
You cannot post a JavaScript variable by means of posting a form.
You can of course put the value of a javascriptvaria ble INTO a form
before posting it.

Erwin, he was quite clear in his post (on this point at least). He is
not trying to post a javacript variable.

He said that he is putting:
<script type="text/javascript"
src="http://test.com">
</script>

in a textarea.
That is right.
What is not clear to me is precisely in what way "the posted page
comes unaccesible"?
It is very intersting problem.
When i click to post, browser shows "Page can not be displayed" error.
If i put normal text to text are , there is no problem.

It seems, post content with js corrupts posting header or something
like that.

I published a test page for this problem.You can test it.

<script type="text/javascript"
src="http://test.com">
</script>

copy paste js content and save on

http://www.taginternet.com/tagger/testpost.php

address
Thanks everybody for comments
Dec 3 '07 #6
Gökhan Altınsoy wrote:
On Dec 3, 1:55 pm, Captain Paralytic <paul_laut...@y ahoo.comwrote:
>On 3 Dec, 11:40, Erwin Moller<Since_hu mans_read_this_ I_am_spammed_to o_m...@spamyour self.comwrote:
>>I am unsure I understand what you mean.
You cannot post a JavaScript variable by means of posting a form.
You can of course put the value of a javascriptvaria ble INTO a form
before posting it.
Erwin, he was quite clear in his post (on this point at least). He is
not trying to post a javacript variable.

He said that he is putting:
<script type="text/javascript"
src="http://test.com">
</script>

in a textarea.

That is right.
>What is not clear to me is precisely in what way "the posted page
comes unaccesible"?
Hi,

A wild guess: Maybe your receiving script doesn't escape "?

Try posting this and see what happens:
test with " in it

Does that also produce an error?

And what is more: Be sure you see the error instead of 'Page cannot be
displayed'.

Make sure errorreporting is on.

Good luck.

Regards,
Erwin Moller

>
It is very intersting problem.
When i click to post, browser shows "Page can not be displayed" error.
If i put normal text to text are , there is no problem.

It seems, post content with js corrupts posting header or something
like that.

I published a test page for this problem.You can test it.

<script type="text/javascript"
src="http://test.com">
</script>

copy paste js content and save on

http://www.taginternet.com/tagger/testpost.php

address
Thanks everybody for comments
Dec 4 '07 #7
On Mon, 03 Dec 2007 20:49:33 +0100, Gökhan Altınsoy
<go************ @gmail.comwrote :
copy paste js content and save on

http://www.taginternet.com/tagger/testpost.php

address
I'd day this is input filtering go overboard, '<script' is enough to break
it, other tags seem to be OK, '<scrip' is also allowed.

So, what kind of filtering do you use?
--
Rik Wasmus
Dec 4 '07 #8
On Tue, 04 Dec 2007 11:34:49 +0100, Rik Wasmus
<lu************ @hotmail.comwro te:
On Mon, 03 Dec 2007 20:49:33 +0100, Gökhan Altınsoy
<go************ @gmail.comwrote :
>copy paste js content and save on

http://www.taginternet.com/tagger/testpost.php

address

I'd day
Huh? "I'd think"... I can't for the life of me trace back how 'day' was
entered there...
--
Rik Wasmus
Dec 4 '07 #9
On 4 Dec, 10:36, "Rik Wasmus" <luiheidsgoe... @hotmail.comwro te:
On Tue, 04 Dec 2007 11:34:49 +0100, Rik Wasmus

<luiheidsgoe... @hotmail.comwro te:
On Mon, 03 Dec 2007 20:49:33 +0100, Gökhan Altýnsoy
<gokhanaltin... @gmail.comwrote :
copy paste js content and save on
>http://www.taginternet.com/tagger/testpost.php
address
I'd day

Huh? "I'd think"... I can't for the life of me trace back how 'day' was
entered there...
--
Rik Wasmus
Maybe you were gonna say "I'd say" and the "d" and "s" keys are next
to each other (at least they are on my quay bored)
Dec 4 '07 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
8615
by: Phil Powell | last post by:
Has anyone here ever done a case where you have a select multiple form element and you have to do both server-side and client-side validation? I am honestly not sure how to do it in Javascript (I keep getting errors thrown that I can't verify because the form processes onto itself too quickly for me to check the Javascript errors) because the select multiple form element name has to be in the form of "var" because PHP will then recognize...
7
1718
by: Paul Charlton-Thomson | last post by:
Hi! I have nearly cracked this and am stuck on the last bit. I am asking my visitors to rank 8 different items (a,b,c,d,e,f,g,h) from 1 to 10 and then I want to draw a pie chart of those values. My page (draw_pie.php) that draws the pie chart works as it should and I link to it like this ... <A HREF="draw_pie.php?a='.$a.'&b='.$b.'&c='.$c.'&d='.$d.'&e='.$e.'&f='.$f.'&g=' ..$g.'&h='.$h.'">Pie Chart</A>
4
2822
by: Adam Smith | last post by:
Hello, How can I call or trigger an external javascript twice in a form? I have <script language="JavaScript" src="country_state.js" name="Country_State"> <script type="text/javascript" src="country_state.js"> </script>
27
4759
by: Chris | last post by:
Hi, I have a form for uploading documents and inserting the data into a mysql db. I would like to validate the form. I have tried a couple of Javascript form validation functions, but it appears that the data goes straight to the processing page, rather than the javascript seeing if data is missing and popping up an alert. I thought it may be because much of the form is populated with data from the db (lists, etc.), but when I leave...
10
6106
by: IchBin | last post by:
I am trying to set the state of a radio button. I do not see what I am doing wrong. Sorry, I am new at this.. I need another set of eyes to look at this snip of code. I am trying to set the radio button with this link of code: echo 'SCRIPT language=JavaScript setCheckedValue("'.$_SESSION.'");</SCRIPT>'; //? <snip of code>
4
1705
by: Ryan Knopp | last post by:
Two questions. 1) Is there a way i can determine the page was a POST or a GET w/o checking the "?" in the url? 2) Is there a way i can get the POST variables using javascript? (example: like in php $_POST would have info if the page was return as a post with a name field.)
2
3683
by: sufian | last post by:
<input type="image" id="imageField" class="btn" src="<?php bloginfo('template_url'); ?>/media/global/btn-go.gif" onclick = "sendRequestPost(document.getElementById('email1').value);" /> The function sendRequestPost() is in a file named header.php: function sendRequestPost(data) { // Open PHP script for requests MM_validateForm('email1','','RisEmail'); if (document.MM_returnValue) { <?php
6
2456
The1corrupted
by: The1corrupted | last post by:
I don't know if this is the right forum or not, but right now, my Javascript, that is embedded in PHP, is not working! It works everywhere else but not here. HELP!! <?php $soldnumber=$_POST; $cavnumber=$_POST; $artnumber=$_POST; if ($marray==1) { $tanknumber=$_POST;
5
1555
TheServant
by: TheServant | last post by:
Hey there again, I have made a form which allows users to train soldiers depending on whether or not they have the resources. The content concerned is set out like this: -- Header -- -- Info Bar (how much gold etc available) -- -- Form -- -- Footer -- Here is a screen shot: http://supremewarfare.com/main/pics/scrn_shot.jpg
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10370
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10177
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10113
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9969
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7519
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6750
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5402
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5538
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.