Jump to content

colap

Members
  • Posts

    302
  • Joined

  • Last visited

Everything posted by colap

  1. The older way of doing this, with gconftool-2 doesn’t seem to work anymore in GNOME 3 – used to be something like:<br /><br /> However, there is still possible to change the background image, by using the gsettings tool instead. You will need the libglib2.0-bin package, which is probably already installed on your system. To change the background, use a command like the following: I need to convert the string into=> The older way of doing this, with gconftool-2 doesn’t seem to work anymore in GNOME 3 – used to be something like:<br /><br />However, there is still possible to change the background image, by using the gsettings tool instead. You will need the libglib2.0-bin package, which is probably already installed on your system. To change the background, use a command like the following: How can i do this ? How can i remove that newline character from the middle of the string and concat those two lines and make into one sentence?
  2. User can edit a post. I need to replace the html '<br/>' element to newline character ('\n') . When a user will edit a post he/she will not see the '<br/>'. How can i do this with php ?
  3. How can i check whether a string contains '\n' or not ?
  4. User can post anything. After a line user can hit enter and can start a new sentence. I wan to replace the newline character ('\n') to html '<br/>' element. I need to output a break in html page. How can i do this with php ? How can i check whether a string contains '\n' or not ? Which function can i use for that ?
  5. So the 'from' address will be 'mypcuseraccount@mypchomedomain.com' , right ? And gmail server will act as a relay, right ? Which mail server do you use ?
  6. I have searched in google, spent couple of days , but can't solve this. It's not sending email.
  7. Has anyone sent email with php mail function installing postfix mail server ? Please post you /etc/postfix/main.cf . Please elaborate/explain with example how you did and what you did . Email will be sent to any email address from 'no-reply@yourhomelocaldomain.com' . I have searched in google but could not find any solution . Here is my /etc/postfix/main.cf myorigin = /etc/mailname smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU) biff = no # appending .domain is the MUA's job. append_dot_mydomain = no # Uncomment the next line to generate "delayed mail" warnings #delay_warning_time = 4h readme_directory = no # TLS parameters smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key smtpd_use_tls=yes smtpd_tls_auth_only = no smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache # See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for # information on enabling SSL in the smtp client. myhostname = mail.myriderdomain.com alias_maps = hash:/etc/aliases alias_database = hash:/etc/aliases myorigin = /etc/mailname mydestination = $myriderdomain, localhost.$myriderdomain, localhost relayhost = mynetworks = 127.0.0.0/8 mailbox_command = procmail -a "$EXTENSION" mailbox_size_limit = 0 recipient_delimiter = + inet_interfaces = all inet_protocols = ipv4 hostname = mail.myriderdomain.com /etc/mailname = mail.myriderdomain.com /etc/aliases = root:user1 I tried , mail -s 'subject' xxx@xxx.com body . Nov 5 13:16:39 mail postfix/smtp[7163]: DBC468AAA4: to=<xxx@xxx.com>, relay=none, delay=56061, delays=55956/0.02/105/0, dsn=4.4.1, status=deferred (connect to mta7.am0.yahoodns.net[98.137.54.237]:25: Connection timed out) Can anyone help me to fix this error ?
  8. Still confusion. What will be the 'from' address to send email ? Do i have to use the gmail address to send the email ? Please elaborate/explain with example .
  9. No, the from address won't be 'abc@gmail.com' rather it would be 'no-reply@domain-of-mailserver.com'
  10. I don't want to send email to gmail account only. It should send email to any email address . And the from address would be 'no-reply@domain-of-mailserver.com'
  11. Which is better php web framework ? (codeigniter,zend framework,cakephp,symfony) ? Which is faster ? Comparison would be in terms of fastness.
  12. The domain i bought has mail server running there.
  13. I don't have any domain with this local pc. But i have bought a domain for my website. Yes, in that case i have a domain.
  14. How can i configure sendmail to send email using php function ?
  15. How can i send email from my local pc ? Suppose my local pc hostname has been set to "myhost.com" .
  16. It's localhost. So the from email address will be 'no-reply@localhost.com' .
  17. <?php $to = 'nobody@example.com'; $subject = 'the subject'; $message = 'hello'; $headers = 'From: webmaster@example.com' . "\r\n" . 'Reply-To: webmaster@example.com' . "\r\n" . 'X-Mailer: PHP/' . phpversion(); mail($to, $subject, $message, $headers); ?> http://php.net/manual/en/function.mail.php I have installed sendmail, do i have to configure it to send email with php email ? How can i configure sendmail to send mail ?
  18. beat me to it. Is there any shortcut way to write these three lines ? echo '<pre>'; var_dump($var); echo '</pre>';
  19. Can you post the full code ?
  20. It's a function=> function _wp_call_all_hook($args) { global $wp_filter; //var_dump($wp_filter); //exit(); reset( $wp_filter['all'] ); do { foreach( (array) current($wp_filter['all']) as $the_ ) if ( !is_null($the_['function']) ) call_user_func_array($the_['function'], $args); } while ( next($wp_filter['all']) !== false ); } Why is $wp_filter variable declared as global ? Was $wp_filter assigned before ?
  21. var_dump($var); displays this=> array(1) { [0]=> array(2) { ["wp_maybe_load_widgets"]=> array(2) { ["function"]=> string(21) "wp_maybe_load_widgets" ["accepted_args"]=> int(1) } ["wp_maybe_load_embeds"]=> array(2) { ["function"]=> string(20) "wp_maybe_load_embeds" ["accepted_args"]=> int(1) } } } array(1) { [10]=> array(2) { ["wp_cron"]=> array(2) { ["function"]=> string(7) "wp_cron" ["accepted_args"]=> int(1) } ["sanitize_comment_cookies"]=> array(2) { ["function"]=> string(24) "sanitize_comment_cookies" ["accepted_args"]=> int(1) } } } array(1) { [10]=> array(1) { ["preview_theme"]=> array(2) { ["function"]=> string(13) "preview_theme" ["accepted_args"]=> int(1) } } } array(1) { [10]=> array(1) { ["twentyeleven_setup"]=> array(2) { ["function"]=> string(18) "twentyeleven_setup" ["accepted_args"]=> int(1) } } } array(1) { [10]=> array(1) { ["kses_init"]=> array(2) { ["function"]=> string(9) "kses_init" ["accepted_args"]=> int(1) } } } array(4) { [0]=> array(2) { ["create_initial_post_types"]=> array(2) { ["function"]=> string(25) "create_initial_post_types" ["accepted_args"]=> int(1) } ["create_initial_taxonomies"]=> array(2) { ["function"]=> string(25) "create_initial_taxonomies" ["accepted_args"]=> int(1) } } [1]=> array(1) { ["wp_widgets_init"]=> array(2) { ["function"]=> string(15) "wp_widgets_init" ["accepted_args"]=> int(1) } } [5]=> array(1) { ["smilies_init"]=> array(2) { ["function"]=> string(12) "smilies_init" ["accepted_args"]=> int(1) } } [10]=> array(4) { ["_show_post_preview"]=> array(2) { ["function"]=> string(18) "_show_post_preview" ["accepted_args"]=> int(1) } ["kses_init"]=> array(2) { ["function"]=> string(9) "kses_init" ["accepted_args"]=> int(1) } ["wp_schedule_update_checks"]=> array(2) { ["function"]=> string(25) "wp_schedule_update_checks" ["accepted_args"]=> int(1) } ["_wp_admin_bar_init"]=> array(2) { ["function"]=> string(18) "_wp_admin_bar_init" ["accepted_args"]=> int(1) } } } array(2) { [10]=> array(1) { ["twentyeleven_widgets_init"]=> array(2) { ["function"]=> string(25) "twentyeleven_widgets_init" ["accepted_args"]=> int(1) } } [100]=> array(1) { ["0000000045af3aff00000000ff5da154_register_widgets"]=> array(2) { ["function"]=> array(2) { [0]=> object(WP_Widget_Factory)#173 (1) { ["widgets"]=> array(13) { ["WP_Widget_Pages"]=> &object(WP_Widget_Pages)#145 ( { ["id_base"]=> string(5) "pages" ["name"]=> string(5) "Pages" ["widget_options"]=> array(2) { ["classname"]=> string(12) "widget_pages" ["description"]=> string(33) "Your site’s WordPress Pages" } ["control_options"]=> array(1) { ["id_base"]=> string(5) "pages" } ["number"]=> bool(false) ["id"]=> bool(false) ["updated"]=> bool(false) ["option_name"]=> string(12) "widget_pages" } ["WP_Widget_Calendar"]=> &object(WP_Widget_Calendar)#144 ( { ["id_base"]=> string( "calendar" ["name"]=> string( "Calendar" ["widget_options"]=> array(2) { ["classname"]=> string(15) "widget_calendar" ["description"]=> string(37) "A calendar of your site’s posts" } ["control_options"]=> array(1) { ["id_base"]=> string( "calendar" } ["number"]=> bool(false) ["id"]=> bool(false) ["updated"]=> bool(false) ["option_name"]=> string(15) "widget_calendar" } ["WP_Widget_Archives"]=> &object(WP_Widget_Archives)#146 ( { ["id_base"]=> string( "archives" ["name"]=> string( "Archives" ["widget_options"]=> array(2) { ["classname"]=> string(14) "widget_archive" ["description"]=> string(44) "A monthly archive of your site’s posts" } ["control_options"]=> array(1) { ["id_base"]=> string( "archives" } ["number"]=> bool(false) ["id"]=> bool(false) ["updated"]=> bool(false) ["option_name"]=> string(15) "widget_archives" } ["WP_Widget_Links"]=> &object(WP_Widget_Links)#180 ( { ["id_base"]=> string(5) "links" ["name"]=> string(5) "Links" ["widget_options"]=> array(2) { ["classname"]=> string(12) "widget_links" ["description"]=> string(13) "Your blogroll" } ["control_options"]=> array(1) { ["id_base"]=> string(5) "links" } ["number"]=> bool(false) ["id"]=> bool(false) ["updated"]=> bool(false) ["option_name"]=> string(12) "widget_links" } ["WP_Widget_Meta"]=> &object(WP_Widget_Meta)#181 ( { ["id_base"]=> string(4) "meta" ["name"]=> string(4) "Meta" ["widget_options"]=> array(2) { ["classname"]=> string(11) "widget_meta" ["description"]=> string(43) "Log in/out, admin, feed and WordPress links" } ["control_options"]=> array(1) { ["id_base"]=> string(4) "meta" } ["number"]=> bool(false) ["id"]=> bool(false) ["updated"]=> bool(false) ["option_name"]=> string(11) "widget_meta" } ["WP_Widget_Search"]=> &object(WP_Widget_Search)#182 ( { ["id_base"]=> string(6) "search" ["name"]=> string(6) "Search" ["widget_options"]=> array(2) { ["classname"]=> string(13) "widget_search" ["description"]=> string(27) "A search form for your site" } ["control_options"]=> array(1) { ["id_base"]=> string(6) "search" } ["number"]=> bool(false) ["id"]=> bool(false) ["updated"]=> bool(false) ["option_name"]=> string(13) "widget_search" } ["WP_Widget_Text"]=> &object(WP_Widget_Text)#183 ( { ["id_base"]=> string(4) "text" ["name"]=> string(4) "Text" ["widget_options"]=> array(2) { ["classname"]=> string(11) "widget_text" ["description"]=> string(22) "Arbitrary text or HTML" } ["control_options"]=> array(3) { ["id_base"]=> string(4) "text" ["width"]=> int(400) ["height"]=> int(350) } ["number"]=> bool(false) ["id"]=> bool(false) ["updated"]=> bool(false) ["option_name"]=> string(11) "widget_text" } ["WP_Widget_Categories"]=> &object(WP_Widget_Categories)#184 ( { ["id_base"]=> string(10) "categories" ["name"]=> string(10) "Categories" ["widget_options"]=> array(2) { ["classname"]=> string(17) "widget_categories" ["description"]=> string(32) "A list or dropdown of categories" } ["control_options"]=> array(1) { ["id_base"]=> string(10) "categories" } ["number"]=> bool(false) ["id"]=> bool(false) ["updated"]=> bool(false) ["option_name"]=> string(17) "widget_categories" } ["WP_Widget_Recent_Posts"]=> &object(WP_Widget_Recent_Posts)#185 (9) { ["id_base"]=> string(12) "recent-posts" ["name"]=> string(12) "Recent Posts" ["widget_options"]=> array(2) { ["classname"]=> string(21) "widget_recent_entries" ["description"]=> string(34) "The most recent posts on your site" } ["control_options"]=> array(1) { ["id_base"]=> string(12) "recent-posts" } ["number"]=> bool(false) ["id"]=> bool(false) ["updated"]=> bool(false) ["option_name"]=> string(19) "widget_recent-posts" ["alt_option_name"]=> string(21) "widget_recent_entries" } ["WP_Widget_Recent_Comments"]=> &object(WP_Widget_Recent_Comments)#186 (9) { ["id_base"]=> string(15) "recent-comments" ["name"]=> string(15) "Recent Comments" ["widget_options"]=> array(2) { ["classname"]=> string(22) "widget_recent_comments" ["description"]=> string(24) "The most recent comments" } ["control_options"]=> array(1) { ["id_base"]=> string(15) "recent-comments" } ["number"]=> bool(false) ["id"]=> bool(false) ["updated"]=> bool(false) ["option_name"]=> string(22) "widget_recent-comments" ["alt_option_name"]=> string(22) "widget_recent_comments" } ["WP_Widget_RSS"]=> &object(WP_Widget_RSS)#187 ( { ["id_base"]=> string(3) "rss" ["name"]=> string(3) "RSS" ["widget_options"]=> array(2) { ["classname"]=> string(10) "widget_rss" ["description"]=> string(33) "Entries from any RSS or Atom feed" } ["control_options"]=> array(3) { ["id_base"]=> string(3) "rss" ["width"]=> int(400) ["height"]=> int(200) } ["number"]=> bool(false) ["id"]=> bool(false) ["updated"]=> bool(false) ["option_name"]=> string(10) "widget_rss" } ["WP_Widget_Tag_Cloud"]=> &object(WP_Widget_Tag_Cloud)#188 ( { ["id_base"]=> string(9) "tag_cloud" ["name"]=> string(9) "Tag Cloud" ["widget_options"]=> array(2) { ["classname"]=> string(16) "widget_tag_cloud" ["description"]=> string(35) "Your most used tags in cloud format" } ["control_options"]=> array(1) { ["id_base"]=> string(9) "tag_cloud" } ["number"]=> bool(false) ["id"]=> bool(false) ["updated"]=> bool(false) ["option_name"]=> string(16) "widget_tag_cloud" } ["WP_Nav_Menu_Widget"]=> &object(WP_Nav_Menu_Widget)#189 ( { ["id_base"]=> string( "nav_menu" ["name"]=> string(11) "Custom Menu" ["widget_options"]=> array(2) { ["classname"]=> string(15) "widget_nav_menu" ["description"]=> string(60) "Use this widget to add one of your custom menus as a widget." } ["control_options"]=> array(1) { ["id_base"]=> string( "nav_menu" } ["number"]=> bool(false) ["id"]=> bool(false) ["updated"]=> bool(false) ["option_name"]=> string(15) "widget_nav_menu" } } } [1]=> string(17) "_register_widgets" } ["accepted_args"]=> int(1) } } } array(1) { [10]=> array(1) { ["send_frame_options_header"]=> array(2) { ["function"]=> string(25) "send_frame_options_header" ["accepted_args"]=> int(0) } } } array(2) { [9]=> array(1) { ["wp_print_head_scripts"]=> array(2) { ["function"]=> string(21) "wp_print_head_scripts" ["accepted_args"]=> int(1) } } [10]=> array(1) { ["noindex"]=> array(2) { ["function"]=> string(7) "noindex" ["accepted_args"]=> int(1) } } } array(1) { [10]=> array(1) { ["wp_just_in_time_script_localization"]=> array(2) { ["function"]=> string(35) "wp_just_in_time_script_localization" ["accepted_args"]=> int(1) } } } How can i get the output with newline formatted ?
  22. Every poll can have 7 or 8 or more options. Every quiz can have 5 or more options. This is what i tried => create table polls (id integer not null auto_increment primary key, question varchar(300) not null, mark tinyint not null, created datetime, modified datetime); create table pollsanswers (id integer not null integer auto_increment primary key, poll_id integer not null, answer varchar(500) not null, mark tityint not null, created datetime, modified datetime); create table quizes (id integer not null auto_increment primary key, question varchar(300) not null, mark tinyint not null, created datetime, modified datetime); create table quizesanswers (id integer not null integer auto_increment primary key, quiz_id integer not null, answer varchar(500) not null, mark tityint not null, created datetime, modified datetime);
  23. No, there problem was here => 'validator'=>$temp,
  24. http://mysite/products/create Not Found The requested URL /products/create was not found on this server. Apache/2.2.16 (Debian) Server at site5.example.com Port 80 routes.php => $route['default_controller'] = 'products'; $route['404_override'] = ''; model => <?php class Products_model extends CI_Model { function __construct() { $this->load->database(); } function get_products($slug = FALSE) { if ($slug === FALSE) { $query = $this->db->get('products'); return $query->result_array(); } $query = $this->db->get_where('products', array('slug' => $slug)); return $query->row_array(); } function set_products() { $this->load->helper('url'); $slug = url_title($this->input->post('title'), 'dash', TRUE); $data = array( 'title' => $this->input->post('title'), 'slug' => $slug, 'text' => $this->input->post('text') ); return $this->db->insert('products', $data); } } controller => <?php class Products extends CI_Controller { function __construct() { parent::__construct(); $this->load->model('products_model'); } function index() { $data['products'] = $this->products_model->get_products(); $data['title'] = 'Products archive'; $this->load->view('products/index', $data); } function view($slug) { $data['products'] = $this->news_model->get_news($slug); } function create() { $this->load->helper('form'); $this->load->library('form_validation'); $data['title'] = 'Create a products item'; $this->form_validation->set_rules('title', 'Title', 'required'); $this->form_validation->set_rules('text', 'text', 'required'); if ($this->form_validation->run() === FALSE) { //$this->load->view('templates/header', $data); $this->load->view('products/create'); //$this->load->view('templates/footer'); } else { $this->news_model->set_news(); $this->load->view('products/success'); } } } ?> view => <h2>Create a news item</h2> <?php echo validation_errors(); ?> <?php echo form_open('products/create') ?> <label for="title">Title</label> <input type="input" name="title" /><br /> <label for="text">Text</label> <textarea name="text"></textarea><br /> <input type="submit" name="submit" value="Create news item" /> </form> Why did i get this error ? Where is the error ?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.