[PHP/JavaScript]: Call PHP file through JavaScript code with argument

后端 未结 4 919
不思量自难忘°
不思量自难忘° 2021-01-28 14:44

I want to call a PHP file but want to pass an argument to the PHP file. Not getting the correct approach, I am attempting to write a cookie and read that cookie when the PHP fil

4条回答
  •  北海茫月
    2021-01-28 15:25

    Cookies are not the way to transfer variables between client and server. you should append key/variables pairs to your request URL using either a get (querystring) or post method.

    jQuery ajax example;

    $.get('http://www.myphpserver.com/script.php?row_id=' + NewCookieValue);
    

提交回复
热议问题