php重定向

php重定向,php,mysql,Php,Mysql,我的php脚本在localhost上运行,但在线上传后,它会显示一个空白页面 php安装在localhost 5.2.6版上 php安装在生产环境5.1.4版上 <?php define('INCLUDE_CHECK',true); require 'connect.php'; session_start(); php require 'function.php'; ?> <html> <head>

我的php脚本在localhost上运行,但在线上传后,它会显示一个空白页面

php安装在localhost 5.2.6版上 php安装在生产环境5.1.4版上

<?php 
define('INCLUDE_CHECK',true);
require 'connect.php';
session_start();                        
php require 'function.php';    
?>

<html>
<head>
</head>
<body>
session_name('smsapp');
session_start(); 
$fname = mysql_real_escape_string($_POST['fname']);
$name = mysql_real_escape_string($_POST['name']);
$email =mysql_real_escape_string($_POST['email']);
$phone = mysql_real_escape_string($_POST['phone']);
$pass = substr(md5($_SERVER['REMOTE_ADDR'].microtime().rand(1,100000)),0,6);
$str = "INSERT INTO members(fname, name, pass, phone, email, regIP, dt, level)
        VALUES(
               '".$fname."',
               '".$name."',
               '".md5($pass)."',
               '".$phone."',
               '".$email."',
               '".$_SERVER['REMOTE_ADDR']."',
                  1,
                  NOW()
    )" ;
mysql_query($str);

if(mysql_affected_rows($link) == 1 && 
  ($_SESSION['security_code'] == $_POST['security_code']))
{
    echo "Password will be sent to you by sms.";
    $url = "http://sms.kohlihosting.com/sendsmsv2.asp?
            user=username&
            password=12345&
            sender=kohli&
            text=Your+password" . $pass . "&
            PhoneNumber=".$phone;

    $homepage = file_get_contents($url) ;   
}
else if(!($_SESSION['security_code'] == $_POST['security_code']))
{
    echo "Please Input correct letters ";
}
else
{
    echo "Not registered";
}
?>

会话名称(“smsapp”);
会话_start();
$fname=mysql\u real\u escape\u字符串($\u POST['fname']);
$name=mysql\u real\u escape\u字符串($\u POST['name']);
$email=mysql\u real\u escape\u字符串($\u POST['email']);
$phone=mysql\u real\u escape\u字符串($\u POST['phone']);
$pass=substr(md5($_SERVER['REMOTE_ADDR'].microtime().rand(1100000)),0,6);
$str=“插入成员(fname、name、pass、电话、电子邮件、regIP、dt、level)
价值观(
“$fname。”,
“$name。”,
“.md5($pass)。”,
“$phone。”,
“$email。”,
“$”服务器[“远程地址]。”,
1.
现在()
)" ;
mysql_查询($str);
如果(mysql_受影响的_行($link)==1&&
($_会话['security\u code']=$_POST['security\u code']))
{
echo“密码将通过短信发送给您。”;
$url=”http://sms.kohlihosting.com/sendsmsv2.asp?
用户=用户名&
密码=12345&
发送方=科利&
text=您的+密码“$pass”&
PhoneNumber=“.$phone;
$homepage=file\u get\u contents($url);
}
否则如果(!($会话['security\u code']=$\u POST['security\u code']))
{
回显“请输入正确的字母”;
}
其他的
{
echo“未注册”;
}
?>


这是在本地主机上工作但不联机的代码。

我猜您的主机在使用
文件获取内容时不允许url访问(出于安全原因)

如果您有权限,可以在php.ini中打开url访问:

allow_url_fopen = On

另一种可能是,服务器中的php.ini已禁用显示警告。由于某种原因,您无法连接到数据库,并且不会显示警告/错误

在连接代码中,可以尝试使用
connect()或die('something')
语句。这样,如果连接失败,您将看到一条错误消息


即使在这种情况下,您也应该查看是否由于php.ini中的设置而生成警告/错误消息且未显示,您可能需要暂时更改它。

这段代码很难阅读您在本文中的格式。另外,您的第二个抱歉在哪里!我的代码太差了