22.03.2018, 09:40
(21.03.2018, 17:14)admin Wrote: You probably have a non breaking space there, either use another code editor or remove all leading spaces from the code.
Whether I put it perfectly like this
Code:
<?
require('apps')
name = getvar('name')
scriptdata = getvar('script')
if name and scriptdata then
item = script.get(name)
if item then
item.script = scriptdata
db:update('scripting', { script = scriptdata }, { id = item.id })
script.save(item, true)
reload script/group monitor
script.reloadsingle(item)
print('update ok')
else
print('script not found')
end
else
print('invalid arguments')
end
?>
Or this
Code:
<?
require('apps')
name = getvar('name')
scriptdata = getvar('script')
if name and scriptdata then
item = script.get(name)
if item then
item.script = scriptdata
db:update('scripting', { script = scriptdata }, { id = item.id })
script.save(item, true)
reload script/group monitor
script.reloadsingle(item)
print('update ok')
else
print('script not found')
end
else
print('invalid arguments')
end
?>
I still have "Error in /www/user/update.lp at line 11: '=' expected near 'script'"
when I type http://192.168.1.230/user/update.lp?name...log(event) in Chrome