dudusf04 Posted February 11, 2020 at 12:06 PM Report Share #617307 Posted February 11, 2020 at 12:06 PM Olá, Tenho um dúvida de como pegar um valor(que esta em uma variável) que esta em uma página e passar para outra, sendo que está outra pagina aparece com uma inclusion tag. já tentei fazer uma simple tag e enviar para o para a função da inclusion tag mas não funciona. desde já obrigado pela ajuda. Link to comment Share on other sites More sharing options...
M6 Posted February 11, 2020 at 03:30 PM Report Share #617309 Posted February 11, 2020 at 03:30 PM Não percebo se estás a falar de um include de um snippet de página ou de uma chamada a uma página/url diferente. 10 REM Generation 48K! 20 INPUT "URL:", A$ 30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50 40 PRINT "404 Not Found" 50 PRINT "./M6 @ Portugal a Programar." Link to comment Share on other sites More sharing options...
dudusf04 Posted February 11, 2020 at 05:33 PM Author Report Share #617310 Posted February 11, 2020 at 05:33 PM Olá M6, o que eu fiz foi uma inclusion_tag(), só que nessa pagina que recebe esse inclusion tem valor que quero em outra pagina, mais especifico na pagina que vai fazer essa inclusão. Não sei se me fiz perceber. Link to comment Share on other sites More sharing options...
M6 Posted February 11, 2020 at 05:36 PM Report Share #617313 Posted February 11, 2020 at 05:36 PM Não sei se percebi bem. Podes usas a sessão para passar esse valor? 10 REM Generation 48K! 20 INPUT "URL:", A$ 30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50 40 PRINT "404 Not Found" 50 PRINT "./M6 @ Portugal a Programar." Link to comment Share on other sites More sharing options...
dudusf04 Posted February 17, 2020 at 02:49 PM Author Report Share #617372 Posted February 17, 2020 at 02:49 PM vou tentar ser o mais simples possível. eu tenho duas paginas um device.html e outra bakup.html. o que eu quero é obter um valor que está no device.html (que é o IP) e passar para o backup. Será que com uma simple tag será possível?? Link to comment Share on other sites More sharing options...
M6 Posted February 19, 2020 at 03:15 PM Report Share #617389 Posted February 19, 2020 at 03:15 PM Continuo sem perceber se essa passagem através de uma nova chamada ao servidor, em que o device.html faz uma invocação ao servidor para obter a páginas backup.html, ou se a página backup.html é chamada como um snippet via include dentro da página device.html... 10 REM Generation 48K! 20 INPUT "URL:", A$ 30 IF A$(1 TO 4) = "HTTP" THEN PRINT "400 Bad Request": GOTO 50 40 PRINT "404 Not Found" 50 PRINT "./M6 @ Portugal a Programar." Link to comment Share on other sites More sharing options...
Marco Lima Posted February 19, 2020 at 05:04 PM Report Share #617391 Posted February 19, 2020 at 05:04 PM Para fazeres isso precisas de javascript ou fazes no backend. Se queres enviar um valor de uma página para a outra, podes utilizar cookies (acredito que seja a forma mais fácil), ou então podes usar os parámetros da página. Invés de redirecionares com 'device.html', fazes 'device.html?ip=111.111.111.111', depois com o javascript consegues obter a esse parámetro da seguinte forma: var urlParams = new URLSearchParams(window.location.search); alert(urlParams.get('ip')); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now