473,434 Members | 1,854 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,434 software developers and data experts.

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 1969
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 javascriptvariable 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_read_this_I_am_spammed_too_m...@spam yourself.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 javascriptvariable 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******************************************@spam yourself.comwrote:
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_read_this_I_am_spammed_too_m...@spam yourself.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 javascriptvariable 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...@yahoo.comwrote:
On 3 Dec, 11:40, Erwin Moller<Since_humans_read_this_I_am_spammed_too_m.. .@spamyourself.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 javascriptvariable 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...@yahoo.comwrote:
>On 3 Dec, 11:40, Erwin Moller<Since_humans_read_this_I_am_spammed_too_m.. .@spamyourself.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 javascriptvariable 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.comwrote:
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.comwrote:
On Tue, 04 Dec 2007 11:34:49 +0100, Rik Wasmus

<luiheidsgoe...@hotmail.comwrote:
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
On Tue, 04 Dec 2007 12:33:46 +0100, Captain Paralytic
<pa**********@yahoo.comwrote:
On 4 Dec, 10:36, "Rik Wasmus" <luiheidsgoe...@hotmail.comwrote:
>On Tue, 04 Dec 2007 11:34:49 +0100, Rik Wasmus

<luiheidsgoe...@hotmail.comwrote:
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...

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)
You are offcourse totally correct. A very likely scenario now you mention
it. Luckily english is not my native language so I tend to get away with
oversights like these :).
--
Rik Wasmus
Dec 4 '07 #11
On Dec 4, 12:21 pm, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@spam yourself.com>
>
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

I had already tried things that you wrote.
Probably it is a bug of my apache version or php version.

Anyway, thanks. I have solved with using java script.I am replacing
"script" word with
"betikbetikbetikbetik" :) word before posting.

Dec 4 '07 #12
On Tue, 04 Dec 2007 15:51:32 +0100, Gökhan Altınsoy
<go************@gmail.comwrote:
On Dec 4, 12:21 pm, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@spam yourself.com>
>>
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


I had already tried things that you wrote.
Probably it is a bug of my apache version or php version.
I'm 99.999% sure it's a filter installed by someone somewhere, which
inherently has nothing to do with PHP and/or Apache itself. Seems to me
someone wanted to avoid XSS attacks in some crude way.
--
Rik Wasmus
Dec 4 '07 #13
� wrote:
On Dec 4, 12:21 pm, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@spam yourself.com>
>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


I had already tried things that you wrote.
Probably it is a bug of my apache version or php version.

Anyway, thanks. I have solved with using java script.I am replacing
"script" word with
"betikbetikbetikbetik" :) word before posting.
I have found that using any variable or function name in javascript the
remotely resembles a reserved word that the vendiors particular
implementation of javashite might just conceieavbly have used, reserved,
or simply decided to hang some speciality about is a Bad Idea.

Keep javashite names short, and entirely obsucre. I even had issues with
display_the_one() and display_the_other() type clashes. Some
interpreters seemed to discard all beyond the first few characters of
the name as well.
Dec 4 '07 #14
Rik Wasmus wrote:
On Tue, 04 Dec 2007 15:51:32 +0100, Gökhan Altınsoy
<go************@gmail.comwrote:
>On Dec 4, 12:21 pm, Erwin Moller
<Since_humans_read_this_I_am_spammed_too_m...@spa myourself.com>
>>>
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


I had already tried things that you wrote.
Probably it is a bug of my apache version or php version.

I'm 99.999% sure it's a filter installed by someone somewhere, which
inherently has nothing to do with PHP and/or Apache itself. Seems to me
someone wanted to avoid XSS attacks in some crude way.
Dito.
This has nothing to do with PHP-version, php.ini, or Apache. Must be in
the PHP program.

This filter is installed by the original makers, or maybe even by the
original poster and he has memory issues. ;-)

Regards,
Erwin Moller
Dec 5 '07 #15

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

Similar topics

3
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...
7
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....
4
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"...
27
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...
10
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...
4
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...
2
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...
6
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;...
5
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
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...
0
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.