📄 confirm.php
字号:
<?php
require( "inc/init.php" );
require( "inc/mysql.php" );
require( "inc/functions.php" );
require( "inc/pfunctions.php" );
require( "inc/qfunctions.php" );
require( "inc/vfunctions.php" );
$varnames = array( "sid", "uid", "upasswd", "csubmit" );
setvars( $varnames );
$relocateURL = "error.php";
if ( !$uid || !$sid )
{
header( "Location: {$relocateURL}" );
exit( );
}
$mqsurvey = mysql_query( "select * from phpQSurvey where SID = \"".protectmysql( $sid )."\"" );
if ( !( $masurvey = mysql_fetch_array( $mqsurvey ) ) )
{
header( "Location: {$relocateURL}" );
exit( );
}
if ( strlen( ini_get( "sendmail_path" ) ) == 0 && strlen( ini_get( "SMTP" ) ) == 0 )
{
header( "Location: {$relocateURL}?errormsg=NoMailSupport" );
exit( );
}
setlanguage( $masurvey['Language'] );
$errorstyle = $masurvey['ErrorStyle'] ? $masurvey['ErrorStyle'] : "color: red;";
if ( $upasswd )
{
$upasswd = protectmysql( $upasswd );
$mquser = mysql_query( "select * from phpQUser where UID = \"".protectmysql( $uid )."\" and SID = \"".protectmysql( $sid )."\" and Confirm = \"{$upasswd}\"" );
if ( !( $mauser = mysql_fetch_array( $mquser ) ) )
{
$errormsg = sprintf( $phpQlang['ConfirmIncorrect'], protecthtml( $upasswd ) );
}
else
{
mysql_query( "update phpQUser set EmailConfirm = \"y\" where UID = \"".protectmysql( $uid )."\" and SID = \"".protectmysql( $sid )."\"" );
if ( $masurvey['OnComplete'] == 1 && $masurvey['SurveyResults'] )
{
header( "Location: stats.php?sid={$sid}" );
exit( );
}
else if ( $masurvey['OnComplete'] == 2 && $masurvey['RedirectURL'] )
{
header( "Location: ".protecthtml( $masurvey['RedirectURL'] ) );
exit( );
}
else if ( $masurvey['OnComplete'] == "3" )
{
$contents = $phpQlang['YourResponse']."<BR><BR>";
$contents .= recreatesurvey( $sid, $uid, $masurvey['Width'], $masurvey, 1 );
}
else if ( $masurvey['Completed'] )
{
$contents = $masurvey['Completed'];
}
else
{
$contents = printmessage( $phpQlang['SurveyCompleted'] );
}
}
}
if ( !$upasswd || $errormsg )
{
$buttonsubmit = getbutton( $masurvey, "submit" );
$contents = "<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=".$masurvey['Width']."><TR><TD ALIGN=center><TABLE CELLSPACING=0 CELLPADDING=2 BORDER=0>\n";
if ( !$errormsg && $csubmit )
{
$errormsg = $phpQlang['ConfirmEmpty'];
}
$contents .= "<TR><TD>".$phpQlang['ConfirmRequest']."</TD></TR>\n";
$contents .= "</TABLE>\n";
$contents .= "<TABLE CELLPADDING=2 CELLSPACING=0 BORDER=0>\n";
if ( $errormsg )
{
$contents .= "<TR><TD COLSPAN=3 STYLE=\"{$errorstyle}\">{$errormsg}</TD></TR>\n";
}
$contents .= "<FORM ACTION=confirm.php METHOD=POST>\n";
$contents .= "<INPUT TYPE=hidden NAME=sid VALUE={$sid}>\n";
$contents .= "<INPUT TYPE=hidden NAME=uid VALUE={$uid}>\n";
$contents .= "<INPUT TYPE=hidden NAME=csubmit VALUE=1>\n";
$contents .= "<TR>\n";
$contents .= "<TD>".$phpQlang['ConfirmPrompt']."</TD>\n";
$contents .= "<TD><INPUT TYPE=text NAME=upasswd VALUE=\"".protecthtml( $upasswd )."\"></TD>\n";
$contents .= "<TD>{$buttonsubmit}</TD>\n";
$contents .= "</TR>\n";
$contents .= "</FORM>\n";
$contents .= "</TABLE></TD></TR></TABLE>\n";
}
createpage( $sid, sprintf( $phpQlang['ConfirmTitle'], $masurvey['Name'] ), $contents, false, "" );
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -