Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Edit components
#1
Hi everybody,
I am facing an unexpected problem. I created a new component - OK. Then I put a JS script in there an GS refuses to save it.
You don't have permission to access /get/admin/components.php on this server. The script is:
 <script>



var before="Something before"
var current="Something after"
var montharray=new Array("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec")

function countdown(yr,m,d){
theyear=yr;themonth=m;theday=d
var today=new Date()
var todayy=today.getYear()
if (todayy < 1000)
todayy+=1900
var todaym=today.getMonth()
var todayd=today.getDate()
var todayh=today.getHours()
var todaymin=today.getMinutes()
var todaysec=today.getSeconds()
var todaystring=montharray[todaym]+" "+todayd+", "+todayy+" "+todayh+":"+todaymin+":"+todaysec
futurestring=montharray[m-1]+" "+d+", "+yr
dd=Date.parse(futurestring)-Date.parse(todaystring)
dday=Math.floor(dd/(60*60*1000*24)*1)
dhour=Math.floor((dd%(60*60*1000*24))/(60*60*1000)*1)
dmin=Math.floor(((dd%(60*60*1000*24))%(60*60*1000))/(60*1000)*1)
dsec=Math.floor((((dd%(60*60*1000*24))%(60*60*1000))%(60*1000))/1000*1)
if(dday==0&&dhour==0&&dmin==0&&dsec==1){
document.forms.count.count2.value=current
return
}
else
document.forms.count.count2.value="Remains "+dday+ " days, "+dhour+" hours, "+dmin+" minutes, and "+dsec+" second to "+before
setTimeout("countdown(theyear,themonth,theday)",1000)
}
countdown(2025,05,08)
</script>
What shal i du to
I understand that allowing scripts in the components breaks the security, but after all its my security.
For the site I am creating (with your help) this countdown script is vital. Gimme some advice, please.
Reply
#2
you are probably being blocked by a security filter, server side or browser side, to prevent reflected xss injectkon.
NEW: SA Admin Toolbar Plugin | View All My Plugins
- Shawn A aka Tablatronix
Reply
#3
I guessed so too, but
how can I avoid it?
Reply




Users browsing this thread: 2 Guest(s)