What is the problem with this php file? After PHP is successfully written to the database, the link to this value is automatically redirected. The last line of this post is "defined (PCPAY_PATH) & nbsp;" edited by a7478729 at 2015-02-2415: 04: 02; or & nbsp; exit; class & nbsp; record_control & nbsp; what is the problem with the php file exte? How to enable PHP to automatically jump to this value link after writing data to the database
This post was last edited by a7478729 on 15:04:02
Defined ('pcpay _ path') or exit;
Class record_control extends admin_control {
Public function add (){
$ Uid = $ this-> _ user ['uid'];
If (empty ($ _ POST )){
$ This-> _ pkey = 'content ';
$ This-> _ ukey = 'record-add ';
$ This-> _ title = 'Post ';
$ This-> _ place = 'content> article management> Publish the topic ';
$ Habits = (array) $ this-> kv-> get ('User _ habits_uid _ '. $ uid );
$ Cid = isset ($ habits ['last _ add_cid '])? (Int) $ habits ['last _ add_cid ']: 0;
$ Data = $ this-> kv-> get ('auto _ save_record_uid _ '. $ uid );
If ($ data ){
! Empty ($ data ['CID']) & $ cid = $ data ['CID'];
} Else {
$ Data ['Intro'] = array ();
$ Data ['View'] = 0;
}
$ This-> assign ('data', $ data );
$ Cidhtml = $ this-> category-> get_cidhtml_by_mid (2, $ cid );
$ This-> assign ('cihtml ', $ cidhtml );
$ Edit_cid_id = '& mid = 2 ';
$ This-> assign ('edit _ cid_id ', $ edit_cid_id );
$ This-> display('record_set.htm ');
} Else {
$ Cid = intval (R ('CID', 'P '));
$ Products = intval (R ('products', 'P '));
$ Amount = intval (R ('amount ', 'P '));
$ Pc = intval (R ('PC', 'P '));
$ Data = array (
'CID' => $ cid,
'Products' => $ products,
'Amount '=> $ amount,
'IP' => ip2long ($ _ ENV ['_ IP']),
);
$ This-> cms_content-> table = 'cms _ record ';
$ Id = $ this-> cms_content-> create ($ data );
If (! $ Id ){
E (1, 'Write content table error ');
}
$ This-> _ user ['tents'] ++;
$ This-> user-> update ($ this-> _ user );
$ Categorys ['count'] ++;
$ This-> category-> update ($ categorys );
$ This-> category-> update_cache ($ cid );
$ Data = $ this-> kv-> delete ('auto _ save_record_uid _ '. $ uid );
$ Habits = (array) $ this-> kv-> get ('User _ habits_uid _ '. $ uid );
$ Habits ['last _ add_cid '] = $ cid;
$ Habits = $ this-> kv-> set ('User _ habits_uid _ '. $ uid, $ habits );
// E (0, 'publish finished '. $ endstr );
If (! $ Data-> E (0, $ endstr )){
Echo $ errormsg;
}
Elseif ($ pc = "hh "){
$ Url = "www.w3school.com.cn ";
Header ("Location: $ url ");
Exit;
}
Elseif ($ pc = "ff "){
$ Url = "www.baidu.com ";
Header ("Location: $ url ");
Exit;
}
Elseif ($ pc = "dd "){
$ Url = "bbs.csdn.net ";
Header ("Location: $ url ");
Exit;
}
Else {
$ Url = "www.baidu.com ";
Header ("Location: $ url ");
Exit;
}
}
}
}
Untitled Document
The above is the processing file written to the database by PHP.
For example, if the pc value is submitted as "ff" and the PHP file is successfully written to the database after submission, how can I automatically jump to the "ff" value link?
elseif($pc=="ff"){
$url="www.baidu.com";
Header("Location:$url");
exit;
}
This is how to automatically jump to this link after the database is successfully written.
------ Solution ----------------------
29 rows: $ pc = intval (R ('PC', 'P '));
All intval, whether it is hh ff or dd, and the last $ pc is 0, so it cannot jump.
In addition, the jump must start with "http: //".