Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

158
Views
¿Cómo soluciono el "token" de clave de matriz indefinida en C:\xampp\htdocs\TPO\registered.php en la línea 2?

Me gustaría enviar datos de javascript a php, pero este "token" de clave de matriz indefinida en C:\xampp\htdocs\TPO\registered.php en la línea 2" se activa en mi archivo php.

Función JavaScript

 function doSomething(Acronym) { $.post('registered.php', {token: "Hello"}); console.log($(Acronym).data('id')) }

registrado.php

 <?php $variable = $_POST['token']; echo($variable); ?>
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Puede usar jQuery Ajax para publicar datos en los archivos PHP mediante javascript.

Este puede ser su archivo js:

 <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js" ></script> <script> var vars = { 'token': 'Hello', }; var userStr = JSON.stringify(vars); $.ajax({ url: 'registered.php', type: 'post', data: { vars: userStr }, success: function (response) { console.log(response); } }); </script>

Y este es su archivo PHP:

 <?PHP $vars = $_POST['vars']; $variable = json_decode($vars, true); echo($variable); ?>
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!