Home  >  Article  >  Backend Development  >  菜鸟问些很基础的问题,php是不是我代码保存为php文件然后一个单个的php文件传到空间可以吗?多谢!!

菜鸟问些很基础的问题,php是不是我代码保存为php文件然后一个单个的php文件传到空间可以吗?多谢!!

WBOY
WBOYOriginal
2016-06-23 14:39:06892browse

本帖最后由 qbnrg968119 于 2013-11-26 20:00:48 编辑

我人家一个很简单的签到的代码如下,我想传到百度BAE空间,我可以把下面代码保存为php文件然后打包,这单个的php文件传上去吗? 还是说一定还要写别的代码别的文件才能工作的?

我试了一下,上传到百度BAE空间,我zip文件传上去以后它会报错:
Parse error: syntax error, unexpected T_STRING in code/builder/work/appidwihbq31d16/0/uxinsign.php on line 7
Errors parsing code/builder/work/appidwihbq31d16/0/uxinsign.php
是不是这个代码本身就有错误呢?

菜鸟没做过网络编程,只做过桌面软件.php完全不懂,百分相求,万分感谢!!
<?phpheader("Content-type: text/html; charset=UTF-8");$id=$_GET["id"];$pw=$_GET["pw"];if($id!=''){        $rang=rand(300,777);        $ch=curl_init("im.uxin001.com:8887/login?sn=".$rang."&account=".$id."&pwd=".md5($pw)."&pv=android&v=1.7.1&sign=".md5($rang.$id."k1oET&Yh7@EQnp2XdTP1o/Vo=")."&netmode=3&brand=samsung&model=GT-I9100&osv=2.3.4&imei=".rand(10000,99999).rand(10000,99999).rand(10000,99999));        curl_setopt($ch,CURLOPT_HEADER,1);        curl_setopt($ch,CURLOPT_RETURNTRANSFER,true);        $cont=curl_exec($ch);        list($head,$body)=explode("\r\n\r\n",$cont);        preg_match("/set\-cookie[^\r\n]*)/i",$head,$matches);        $cookie=$matches[1];        curl_close($ch);        if(strstr($body,': 0}')){                echo $id."----登录成功----";        }else{                echo $id."----登录失败----";        }        $rang=rand(333,999);        $ch_2=curl_init("im.uxin001.com:8887/signin?sn=".$rang."&sign=".md5($rang."k1oET&Yh7@EQnp2XdTP1o/Vo="));        curl_setopt($ch_2,CURLOPT_HEADER,0);        curl_setopt($ch_2,CURLOPT_RETURNTRANSFER,true);        curl_setopt($ch_2,CURLOPT_COOKIE,$cookie);        $content=curl_exec($ch_2);        curl_close($ch_2);        if(strstr($content,'\u6210\u529f')){                echo "签到成功";        }else{                echo "签到失败";        }}else{echo "手机号或密码不能为空!";}?>

回复讨论(解决方案)

不知道你的代码是怎么输入的
从第 7 行开始,把前面的空白去掉!

经测试 ,没有报错。

有可能是你的文件是带BOM头,所以

不知道你的代码是怎么输入的
从第 7 行开始,把前面的空白去掉! 还真是,去掉前面空白就不报错了.多谢版主!!

这是有信签到啊。怎么弄的。有输入帐号页面吗?

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn