doucuyu2259 2009-11-05 00:19
浏览 29
已采纳

javascript-php var post get

That code work:

startSlideshow(<?php echo json_encode(glob("photos-animaux/*.jpg"))?>);

that code dont :

$.post("",{'folder':'animaux'});
startSlideshow(<?php echo json_encode(glob("photos-".$_GET["folder"]."/*.jpg"))?>);

WHY ?, what i am doing wrong ?, help ! why the stupid php fonction just dont make the string right !! ahhhh!

---new infos---- that line work :

startSlideshow(<?php echo json_encode(glob("photos-".$_GET["folder"]."/*.jpg")) ?>);

because if i MANUALLY enter in the address bar ?folder=animaux...bam! work

so the problem shoul be there : $.get("photo-portfolio.php",{folder:"animaux"});

still dont know where !

  • 写回答

3条回答 默认 最新

  • duandang2123 2009-11-05 00:22
    关注

    If you're using $.post() from JQuery, you should use $_POST['folder'] to access your variable. If you use $.get(), then you use $_GET['folder'] in PHP. Try changing that $_GET to $_POST.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?
  • ¥20 IOS游览器某宝手机网页版自动立即购买JavaScript脚本
  • ¥15 手机接入宽带网线,如何释放宽带全部速度