dounianji7883 2009-12-10 06:12
浏览 13
已采纳

php重定向

My php script is working on localhost but after uploading online it's showing a blank page.

php installed on localhost version 5.2.6 php installed on production environment version 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";
}
?>

This is the code which is working on localhost but not online.

  • 写回答

2条回答 默认 最新

  • drkwpgrdb092239314 2009-12-10 06:35
    关注

    Another possibility might be, the php.ini in the server has show-warnings disabled. And you are unable to connect to the database for some reason and the warning/errors are not shown.

    In your connect code, you could try having an connect() or die('something') statement. This way if it does fail to connect, you see an error message.

    Even in this is not the case, you should see if warnings/error messages are generated and are not shown due to the settings in php.ini and you might need to change it temporarily.

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

报告相同问题?

悬赏问题

  • ¥15 windows2003服务器按你VPN教程设置后,本地win10如何连接?
  • ¥15 求一阶微分方程的幂级数
  • ¥15 关于#线性回归#的问题:【统计】回归系数要转化为相关系数才能进行Fisher' Z转化吗(相关搜索:回归模型)
  • ¥100 使用matlab解决含分段变量的优化问题
  • ¥15 matlab基于鲸鱼算法优化vmd
  • ¥20 PCB设计与制作问答
  • ¥20 课堂跑如何下载ppt
  • ¥15 STM32阿里云平台显示不了传感器采集的数据
  • ¥20 三菱FX系列PLC上位机串口下指令置位M64和M65,这两条指令分别是什么呢?
  • ¥15 有关结冰模拟程序咨询