所以我已经将PayPal完全实现到我的系统中.该系统适用于用户'包',全部按设定价格计算.每个用户都有一个分配给他们的subscr_id(由PayPal设置),以及他们购买的包的详细信息.
我需要能够修改订阅,以便用户可以选择不同的包.基本上我只需要能够更改金额和"自定义"字段(这包含包裹详细信息,使用的优惠券等).
我会想到并希望,它会像向用户显示另一个带有隐藏字段的形式一样简单,其中包括'modify','subscr_id','custom'(新值)和'amount'(新值).不幸的是我无法在网上找到这个,而且PayPal的文档是如此单一,以至于我发现自己一圈一圈几个小时.
我的IPN都已设置好并且工作正常,我只需要构建一个表单,允许我将'amount'和'custom'变量设置为新的...我觉得这个位很容易!任何帮助是极大的赞赏.提前致谢.
我正在尝试上传css文件用户codigniter的上传类.这是控制器:
public function uploadcssfile()
{
$config['upload_path'] = './stylesheets/stores/'.$memberid.'/';
$config['file_name'] = 'main.css';
$config['allowed_types'] = 'css';
$config['overwrite'] = true;
$this->load->library('upload', $config);
if (! $this->upload->do_upload('filefieldname'))
{
die($this->upload->display_errors());
}
}
Run Code Online (Sandbox Code Playgroud)
我只想上传一个css类型的文件,但codeigniter总是会出现这个错误:
The filetype you are attempting to upload is not allowed.
Run Code Online (Sandbox Code Playgroud) 我是CodeIgniter的新手.我想创建包含菜单,页脚等基本样式的母版页或布局.我不想在所有页面中编写重复内容并自动加载所有页面.例如,我可以在asp.net中创建母版页或在asp.net mvc中创建布局.我确信我可以在CodeIgniter中完成它.
我正在尝试实现一个帖子功能,并希望从php视图中选择消息和图像.我的消息功能正常.但在图像上传时我收到错误You did not select a file to upload.这是我的控制器功能
function post_func()
{
session_start();
echo $post_message=$_POST['post'];
echo $share_with=$_POST['share_with'];
echo $image=$_POST['image'];
if($image==null){
echo "<br/>no image<br/>";
}
else{
////////////////////////////////////////////////////////////////////////////////////////
$config['upload_path'] = './application/css';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '100';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
$this->upload->initialize($config);
if ( ! $this->upload->do_upload())
{
$error = array('error' => $this->upload->display_errors());
echo "<br/>";
echo $this->upload->display_errors();
echo "<br/> image error<br/>";
}
else
{
echo "<br/> reached <br/>";
session_start();
$this->membership_model->insert_images($this->upload->data(),$email);
$data = array('upload_data' => $this->upload->data());
echo "<br/ problem<br/>"; …Run Code Online (Sandbox Code Playgroud) 我发现了很多类似的问题,但没有人与我的问题有关,但是,这是我的AJAX请求
data = JSON.stringify(data);
url = base_url + "index.php/home/make_order";
//alert(url);
var request = $.ajax({
url: url,
type: 'POST',
contentType: 'application/json',
data: data
});
request.done(function(response){
alert('success');
});
request.fail(function(jqXHR, textStatus, errorThrown){
alert('FAILED! ERROR: ' + errorThrown);
});
Run Code Online (Sandbox Code Playgroud)
我的问题是当它到达PHP CI控制器$ this-> input-> post('data')到空时!
更新 这是我的数据:如AJAX请求之前所示:
data = {"sum":"2.250","info":[{"id":"6","name":"bla","price":"1.000"}]}
请帮忙.提前致谢.
如何financial_year使用Codeigniter Dbforge迁移使该字段成为唯一字段?
function up() {
$this->dbforge->add_field(array(
'id' => array(
'type' => 'INT',
'constraint' => 11,
'unsigned' => TRUE,
'auto_increment' => TRUE
),
'financial_year' => array(
'type' => 'VARCHAR',
'constraint' => 20
),
'start_date' => array(
'type' => 'DATE'
),
'end_date' => array(
'type' => 'DATE'
),
'status' => array(
'type' => "ENUM",
'constraint' => "'Active','Inactive'",
'default' => "Active"
),
'created_on' => array(
'type' => 'TIMESTAMP'
)
));
$this->dbforge->add_key('id', TRUE); // add `id` as primary key
$this->dbforge->create_table('financial_year'); …Run Code Online (Sandbox Code Playgroud) 我想用codeigniter实现Pjax jquery库其他函数工作正常.但是,当我添加它时,它会分页并且它不起作用.当我点击分页按钮比它的更改网址但突然重新加载后,正常的PHP不是ajax ..
$this->load->library('pagination');
$FilterData = $this->input->get();
$config = bootstrapPagination();
$config['base_url'] = main_url('members');
$config["total_rows"] = $this->member->browse_search_total($FilterData);
$config["per_page"] = PER_PAGE;
$config['reuse_query_string'] = TRUE;
$this->pagination->initialize($config);
$data["links"] = $this->pagination->create_links();
$data['members'] = $this->member->browse_search($FilterData, PER_PAGE, $offset);
$this->pagination->initialize($config);
$data['links'] = $this->pagination->create_links();
if (isset($_SERVER['HTTP_X_PJAX']) && $_SERVER['HTTP_X_PJAX'] == TRUE)
{
$this->load->view('show_members', $data);
} else
{
$this->output->set_template('frontend');
$this->output->set_title('Members | ' . sitename());
$this->load->view('show_members', $data);
}
Run Code Online (Sandbox Code Playgroud) 我是codeIgniter的新手,我刚刚陷入困境.我正在使用HMVC扩展,并在验证时收到以下错误:
无法访问与您的字段名称密码对应的错误消息.(pword_check)
任何帮助将不胜感激
码:
public function submit()
{
$this->load->library('form_validation');
$this->form_validation->set_rules('username', 'Username', 'required|max_length[30]|xss_clean');
$this->form_validation->set_rules('pword', 'Password', 'required|max_length[30]|callback_pword_check|xss_clean');
if ($this->form_validation->run() == FALSE)
{
$this->login();
}
else
{
echo 'Success'; die();
}
}
public function pword_check($str)
{
if ($str == 'test')
{
$this->form_validation->set_message('pword_check', 'The %s field can not be the word "test"');
return FALSE;
}
else
{
return TRUE;
}
}
Run Code Online (Sandbox Code Playgroud) 我正在使用CodeIgniter 日历库.
我有两个表,我从我的数据库中获取日历数据.
问题我有2个foreach循环与第二个foreach循环$query2->result_array()它不让我从数据库表中获取每天的第一个事件extra_events我也试图能够设置额外事件表的限制但不工作.
从extra_events表中
例
Test 2 | Example 2
| Example 3
Run Code Online (Sandbox Code Playgroud)
它应该产生
Test 1 | Example 1 <!-- Missing
Test 2 | Example 2
| Example 3
Run Code Online (Sandbox Code Playgroud)
问我怎样才能确保为$ query2-> result_array()得到所有正确的结果.
图片
获得功能
public function get_events($year, $month) {
$calendar = array();
$this->db->select('*');
$this->db->from('events');
$this->db->where('year', $year);
$this->db->where('month', $month);
$query1 = $this->db->get();
foreach ($query1->result_array() as $event) {
$this->db->select('*');
$this->db->from('extra_events');
$this->db->where('events_id', $event['events_id']);
$this->db->where('year', $year);
$this->db->where('month', $month);
//$this->db->limit(2);
$query2 = $this->db->get();
foreach …Run Code Online (Sandbox Code Playgroud) 我正在使用Phil Sturgeon和Chris Kacerguis Restful服务器(访问https://github.com/chriskacerguis/codeigniter-restserver)并对使用API KEYS有一般性问题.我是API和概念的新手.
KEYS如何工作?有一个名为KEYS的表定义如下:
| Default table schema:
| CREATE TABLE `keys` (
| `id` INT(11) NOT NULL AUTO_INCREMENT,
| `user_id` INT(11) NOT NULL,
| `key` VARCHAR(40) NOT NULL,
| `level` INT(2) NOT NULL,
| `ignore_limits` TINYINT(1) NOT NULL DEFAULT '0',
| `is_private_key` TINYINT(1) NOT NULL DEFAULT '0',
| `ip_addresses` TEXT NULL DEFAULT NULL,
| `date_created` INT(11) NOT NULL,
| PRIMARY KEY (`id`)
| ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Run Code Online (Sandbox Code Playgroud)
类中有一些名为KEYS的方法如下:
index_put() // key created. builds a new …Run Code Online (Sandbox Code Playgroud) codeigniter ×10
php ×6
file-upload ×2
ajax ×1
api ×1
controller ×1
css ×1
dbforge ×1
hmvc ×1
jquery ×1
json ×1
migration ×1
mime-types ×1
pagination ×1
paypal ×1
paypal-ipn ×1
pjax ×1
rest ×1
validation ×1