This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Remote script modification
#14
(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
Reply


Messages In This Thread
Remote script modification - by Hippolyte - 12.02.2018, 08:15
RE: Remote script modification - by admin - 13.02.2018, 11:33
RE: Remote script modification - by Hippolyte - 13.02.2018, 11:55
RE: Remote script modification - by Hippolyte - 20.03.2018, 13:39
RE: Remote script modification - by admin - 20.03.2018, 14:30
RE: Remote script modification - by Hippolyte - 20.03.2018, 16:27
RE: Remote script modification - by admin - 20.03.2018, 17:26
RE: Remote script modification - by Hippolyte - 21.03.2018, 11:11
RE: Remote script modification - by buuuudzik - 21.03.2018, 12:08
RE: Remote script modification - by admin - 21.03.2018, 12:41
RE: Remote script modification - by Hippolyte - 21.03.2018, 16:38
RE: Remote script modification - by admin - 21.03.2018, 17:14
RE: Remote script modification - by Hippolyte - 22.03.2018, 09:40
RE: Remote script modification - by buuuudzik - 22.03.2018, 10:19
RE: Remote script modification - by admin - 22.03.2018, 10:45
RE: Remote script modification - by Hippolyte - 23.03.2018, 14:28
RE: Remote script modification - by Hippolyte - 30.03.2018, 14:58
RE: Remote script modification - by admin - 30.03.2018, 15:20
RE: Remote script modification - by Leo681 - 26.02.2023, 21:13
RE: Remote script modification - by admin - 27.02.2023, 06:59

Forum Jump: