在 URL 末尾附加变量 - PHP [英] Append variable at end of URL - PHP

查看:30
本文介绍了在 URL 末尾附加变量 - PHP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想将变量 $name 附加到 URL http://google.com/script.php 以便我可以在另一个脚本中调用该变量.

I want to append the variable $name to the URL http://google.com/script.php so that I can call the variable in another script.

如何修改以下代码而不会出现这些语法错误?

How do I modify the following code without having those syntax errors?

谢谢.

代码:

$name = $_GET['smsname'];
$call = $client->account->calls->create('+103632', $number,                                             
        'http://google.com/script.php'
    );

推荐答案

像这样追加

$name = $_GET['smsname'];
$call = $client->account->calls->create('+103632', $number,                                             
        'http://google.com/script.php?name='.$name
    );

在下一页你可以使用 $_GET['name']

这篇关于在 URL 末尾附加变量 - PHP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆