veedeoo 474 Junior Poster Featured Poster

Here is another one from Blythe California.. this should be rated as IQ LEVEL: -180

You are not permitted to wear cowboy boots unless you already own at least two cows.

Carmel, California

A man can’t go outside while wearing a jacket and pants that do not match.

So, I guess NO GEEKS are allowed in Carmel. IQ LEVEL: -175

Arcadia, California

Peacocks have the right of way to cross any street, including driveways.

Peacocks are really special in Arcadia. IQ LEVEL: 2

Chico, California

Detonating a nuclear device within the city limits results in a $500 fine.

So, they think they can still collect the $500 dollars fine, after the detonation. IQ LEVEL: -180

veedeoo 474 Junior Poster Featured Poster

In my home state, State of California we have some really crazy laws if not dumb or stupid laws. Here are some of the few.

Please rate the IQ LEVEL of the legislature who wrote or proposed the law. IQ levels are measured between profound mental disability 1 and profoundly gifted 180.

  1. California prison workers will no longer be allowed to have sex with inmates.

Duh, that's given unless worker is pretty disperate. IQ LEVEL: 10

It’s unlawful to let a dog pursue a bear or bobcat at any time.

That's crazy, poor dogs they can no longer do what they do best. IQ LEVEL: 2

It is a misdemeanor to shoot at any kind of game from a moving vehicle, unless the target is a whale.

So, I guess whale don't deserve any respect at all. IQ LEVEL : 1

Women may not drive in a house coat.

This is insane, what is the difference between a house coat and a church coat? IQ LEVEL : 2

Animals are banned from mating publicly within 1,500 feet of a tavern, school, or place of worship.

That is why they are called animals. They don't know what the difference between public and private settings. IQ LEVEL : 0

veedeoo 474 Junior Poster Featured Poster

Are you using phpmailer class or the native php mail function? For what I have heard, phpmailer class is more reliable in terms of sending email with file attachement.

example implementation of phpmailer class with attachements. You can download phpmailer class here.

veedeoo 474 Junior Poster Featured Poster

I can't possibly think of alternative ways for recount. What would be the reason for unclear results? I know parties who can't accept their defeat will probably say;

We found out that some online voters voted with a Dimpled Monitor and therefore we demand re-counting of the votes.

I rather stay with the chad, at least dimples are pretty visible if questioned. In fact, we can probably pushed it back a little to make it look like a dimple.

veedeoo 474 Junior Poster Featured Poster

Something like this... I am not 100% sure, but please try running it on the phpMyAdmin or the command line and see.
The date is a table column.

 $beg_date = '2014-03-01';
 $end_date = '2014-03-07';

"SELECT * FROM YOUR_TABLE_NAME WHERE 'date' BETWEEN $beg_date AND $end_date ";
veedeoo 474 Junior Poster Featured Poster

I think we need to sort things out.

Viewing it as a file is the easiest, all you have to do is provide the url of the doc file and the user will be able to view it, depending on the user's desktop and browser's settings.

Viewing it as regenerated file created by parsing a doc file is a different method and it is a lot harder to achieved.

Viewing a doc file as generated by PHP from the collected data through a form is highly feasible. If you want to go for this option, you can use this class.

veedeoo 474 Junior Poster Featured Poster

thanks for sharing. I am currently using wapiti which is written in python.

veedeoo 474 Junior Poster Featured Poster

Hi, Hello, and welcome to Daniweb.

veedeoo 474 Junior Poster Featured Poster

Do you mean codeacademy.com? If yes, I think it is worth of your time.

veedeoo 474 Junior Poster Featured Poster

Some books on my shelves: Object-Oriented JavaScript from packt publishing, JavaScript for PHP Developers ( a concise guide to mastering javascript) from O'Reilly Media , Learning JavaScript Design Patterns (A JavaScript and jQuery Developer's Guide) from O'Reilly Media.

Lastly, not related to your question is my favorite book entitled "Object-Oriented Thought Process, 3rd Edition" from Addison-Wesley and written by Matt Weisfeld.

What I want to buy right now is the "JavaScript Testing" from packt publishing.

veedeoo 474 Junior Poster Featured Poster

MySQL server is free of charge, try downloading uniserver Zero here. This is a whole package of apache, mysql, PHP and many other useful modules.

veedeoo 474 Junior Poster Featured Poster

Please Ignore this answer and read my response below.

veedeoo 474 Junior Poster Featured Poster

change this

<p style='text-align:center; margin: 0 auto; color:white; font-size: 2em; '>Made By HDminecraftnerd</p> "

?>

to this

<p style='text-align:center; margin: 0 auto; color:white; font-size: 2em; '>Made By HDminecraftnerd</p> ";

?>

Please allow me express my concern about your codes. I just need to know the reasons why use echo for the html tags.

You can close the pHP here

href='register.php'>&larr; Back </a>'");
}
}
?>

and remove the

echo "

go down to the page right on the codes that I corrected, change it to this

<p style='text-align:center; margin: 0 auto; color:white; font-size: 2em; '>Made By HDminecraftnerd</p> 

By doing so, you will have a clean PHP/ html separation, while allowing the server to parse the PHP codes and letting the browser does its job on the html part of the document.

veedeoo 474 Junior Poster Featured Poster

Yes, this is possible. There are four options to be able achieved this.

  1. Use PHP
  2. Use the HTML5 file reader
  3. Use javascript
  4. ASP.net

Try google with 'reading text file in javascript' and for PHP read this. If you are developing in asp.net mvc there is a method called ReadAllText, I don't remember the proper syntax, but it should be on the Microsoft website.

veedeoo 474 Junior Poster Featured Poster

Hi,

Please allow me to use the first database you have presented. Keep in mind the query is pretty much the same, regardless if we use the second database that you posted. Just replace the column names.

In my example that should represent the school_id on the first table and school_id on the second.

Simple rule I made for myself only. I always assign my query to some variable for easy update and modification.

Here we go. Say we have these tables school and school_info as shown above.

I would do this in a long-hand version for clarifications, but you are always welcome to do it differently.

Itimize all pertinent columns from both tables.

$db_filters = "school_id,school_name,district,persion_in_charge,in_charge_title,in_charge_contact, date_added,address,telephone,badge,badge_name";

I only use school_id once because both tables have the same column name.

We define our query

$get_items = ("SELECT ".$db_filters." FROM YOUR_DATABASE LEFT JOIN school_info ON(school.school_id = school_info.school_id) ORDER by `date_added`");

We execute our query... WARNING! please USE PDO. I don't have any PDO reference at this moment, so I will use the OLD mysql. $conn is the database instantiated or persistent connection

$result = mysql_query($get_items, $conn) or trigger_error("SQL", E_USER_ERROR);

loop the result

echo 'put your table tags here';
while($row = mysql_fetch_array( $result )) {

    /*
    * the column name can be from either table.
    */

    echo $row['column_name'];

    }

If you are happy with the result, slowly build your html around them to achieve the presentation style your boss wanted.

I am not really sure if your …

veedeoo 474 Junior Poster Featured Poster

If you are using windows, try Microsoft Web Matrix 3. It is an all around web developing tool. I have not seen it yet, but a good friend of mine told me it is worth trying.

veedeoo 474 Junior Poster Featured Poster

Sorry :), this

 ## this can be use on the view page or template page
$paginate_it = $this->pagination->create_links() 

should read

 ## this can be use on the view page or template page
$paginate_it = $this->pagination->create_links(); 
veedeoo 474 Junior Poster Featured Poster

that could work pretty well also. You can put your pagination class in the application/libraries and then include it in the application/config/autoload.php

$autoload['libraries'] = array('database', 'session', 'YourpaginationClassName');

Alternatively we can also load it as needed by either loading it on the controller's constructor or (in model's constructor if necessary).

public function __construct(){

    $this->load->library('YourpaginationClassName');

    }

It can get a little bit tricky as we try to get the current page, so we have to load the url helper function by placing it just above the pagination class. Actually it does not matter, but pagination class will later become dependent on the routed page number e.g. /2 or /++i

  public function __construct(){

    $this->load->helper(array('url'));
    $this->load->library('YourpaginationClassName');


    }

on our index method with page number from the url helper

 $current_page = ($this->uri->segment(2)) ? $this->uri->segment(2) : 0;

 ## instantiate your pagination class
 $paginate_it = pagination($current_page,$count);

CodeIgniter's built-in pagination class can also be use in parsed data from rss feeds, xml files. As long as we can get the total count it can work on CI. Below is a classic CI pagination calls

$count = 'Count of Items to be paginated';
$config = array();
    $config["base_url"] = base_url() . "/yourController/";
    $config["total_rows"] = $count;
    $config["per_page"] = 20;
    $config["uri_segment"] = 2;
    $config['use_page_numbers'] = TRUE;
    $this->pagination->initialize($config);

    $page = ($this->uri->segment(2)) ? $this->uri->segment(2) : 0;

    ## this can be use on the view page or template page
    $paginate_it = $this->pagination->create_links() 

Lastly, we can adjust our router page to the controllers name of the page where the …

veedeoo 474 Junior Poster Featured Poster

In addition to Cereal's observations, if extending a class, and if the child class has its own contructor, the parent's constructor must explicitly called like so...

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

    class Index_model extends MY_Model {

        public function __construct(){

            ## before loading anything like library and helper
            parent::__construct();

        }


        }

I hope that helps a little.. :)

veedeoo 474 Junior Poster Featured Poster

have you look into join as described here?

Can you show us your tables?

veedeoo 474 Junior Poster Featured Poster

thanks very much Diafol for the clarification.

@m1k3.mca, Diafol is correct we are trying to live just like everybody else.

Back to your question, what you need to look for is a stable login/registration script. You can then extend the script for the CMS function of the script.

There is one in my forked github repositories , but I never have the chance to upload my modified version.

If you will be looking at the login script, this file right here can create a user table automatically.

Somewhere between lines 765 and 774, we can find these codes

 $qry = "Create Table $this->tablename (".
            "id_user INT NOT NULL AUTO_INCREMENT ,".
            "name VARCHAR( 128 ) NOT NULL ,".
            "email VARCHAR( 64 ) NOT NULL ,".
            "phone_number VARCHAR( 16 ) NOT NULL ,".
            "username VARCHAR( 16 ) NOT NULL ,".
            "password VARCHAR( 32 ) NOT NULL ,".
            "confirmcode VARCHAR(32) ,".
            "PRIMARY KEY ( id_user )".
            ")";

I remember writing the PDO CRUD , the CMS extension , the multi-upload extension with thumbnail generator for this script.

I also made a twig, TBS, and Smarty version of this script. Just don't have the time to put it up on gitHub.

veedeoo 474 Junior Poster Featured Poster

Hi,

Next time, state your questions as clearly as possible. We can simply write codes like this.

<?php

$min_year = 1900;
$max_year = 1992;

echo '<form>';
echo '<select name="year">';
foreach (range($max_year, $min_year, -1) as $x) {

    echo '<option value="'.$x.'">'.$x.'</option>';

    }
echo '</select>';
echo '</br>';    
echo '<input type="submit" value="submit"/>';    
echo '</form>';  

-1 reverses the count from max_year to min_year. If you want 1900 to be the first on the option, then you can switch the position of the max_year and the min_year and then declare the step parameter to 1 , instead of -1.

veedeoo 474 Junior Poster Featured Poster

You cannot forcebly destroy session on a remote client using script. The only way you can do this is by connecting by way of FTP or when you change the session.save_path directive to something else.

Sessions are stored above your public directory. In some servers, it is called 'tmp' directory.

You can easily find the exact location by running a simple phpinfo() and look for the session directive called session.save_path

If you want to change the directory for the save_path, please read more here.

Warning! changing the location for the save_path create serious vulnerabilities. This is the reason why we don't want to put the item price in session variables.

veedeoo 474 Junior Poster Featured Poster

Just one last thing, confident developers will not encrypt their source codes. PHP is a fast evolving programming language, if we encrypt every little classes and methods, it will be very hard to decrypt and encrypt during script upgrades. Besides, using a PHP MVC framework is enough to protect an application source codes.

But then, the final choice to encrypt or not is on the developer.

veedeoo 474 Junior Poster Featured Poster

Hi,

I will give you a simple example on how to encrypt function and execute it .

My response is not a direct response to your question, but this is one of the many ways sneaky developer can hide their sources.

Let say, we have a golden function that will increase in value in some distant future.

For the sake of simplicity, I will utilize the base64. In real world application, developers would use the ioncube encoder.

example of our golden function as raw.

    <?php

        function say_something($string){

            echo $string;
            }

the base64 encoded function above

   eval("?>".base64_decode("PD9waHANCiAgICAgICAgDQogICAgICAgICAgICBmdW5jdGlvbiBzYXlfc29tZXRoaW5nKCRzdHJpbmcpew0KICAgICAgICAgICAgDQogICAgICAgICAgICAgICAgZWNobyAkc3RyaW5nOw0KICAgICAgICAgICAgICAgIH0="));                     

Now, we want to take our little secret to the next level. We will encode our function with our very own made keys.

Raw keys and sequence

$encode_sequence = array('f'=>5,'c'=>3,'n'=>2,'a'=>1,'y'=>4,'s'=>8,'t'=>7);
$keys = array( 5 =>'f',3=>'c',2=>'n',1=>'a',4=>'y',8=>'s',7=>'t');

encoded keys and sequence

eval("?>".base64_decode("PD9waHAgDQoNCiRlbmNvZGVfc2VxdWVuY2UgPSBhcnJheSgnZic9PjUsJ2MnPT4zLCduJz0+MiwnYSc9PjEsJ3knPT40LCdzJz0+OCwndCc9PjcpOw0KJGtleXMgPSBhcnJheSggNSA9PidmJywzPT4nYycsMj0+J24nLDE9PidhJyw0PT4neScsOD0+J3MnLDc9Pid0Jyk7DQoNCiA/Pg=="));

now, we test our secret.. the script in its entirety

<?php
 eval("?>".base64_decode("PD9waHANCiAgICAgICAgDQogICAgICAgICAgICBmdW5jdGlvbiBzYXlfc29tZXRoaW5nKCRzdHJpbmcpew0KICAgICAgICAgICAgDQogICAgICAgICAgICAgICAgZWNobyAkc3RyaW5nOw0KICAgICAgICAgICAgICAgIH0="));

eval("?>".base64_decode("PD9waHAgDQoNCiRlbmNvZGVfc2VxdWVuY2UgPSBhcnJheSgnZic9PjUsJ2MnPT4zLCduJz0+MiwnYSc9PjEsJ3knPT40LCdzJz0+OCwndCc9PjcpOw0KJGtleXMgPSBhcnJheSggNSA9PidmJywzPT4nYycsMj0+J24nLDE9PidhJyw0PT4neScsOD0+J3MnLDc9Pid0Jyk7DQoNCiA/Pg=="));

$string = 'Hello World';
$encoded_function = "814_8ome7hi2g";



call_user_func(strtr($encoded_function, $keys),$string);

The above code should return Hello World.

How to use our simple encoder to encode our secret function

$function_name = 'my_function';
$encoded_function_y = 'm4_5u237io2';

echo 'encoded  '.(strtr($function_name, $encode_sequence)).'<br/>';
echo 'Decoded  '.(strtr($encoded_function_y, $keys)).'<br/>';

The above codes should return the encoded function_name and the decoded my_function.

You can use the same techniques and methods to evaluate and decypher the encrypted functions on your wordpress plugin.

veedeoo 474 Junior Poster Featured Poster

The path should be the directory wherein the wordpress is installed. I believe that is an strict rule given by the wordpress codex.

Looking at your site, the reason it is blank because of this error

Call to undefined function language_attributes()

Try loading your page with all of the language_attribute() function commented just to see if the page will load properly.

I personally tested the above code snippets on the latest version of wordpress and it is working just the way I would expect them to work.

veedeoo 474 Junior Poster Featured Poster

correction: update the $posts variable.

$posts = get_posts('numberposts='.$number_of_post.'&order='.$order.'&orderby='.$order_by);
veedeoo 474 Junior Poster Featured Poster

change private column to privacy_setting. "private is a reserved word and MUST not be use.. sorry about that.. that really slipped away :).

veedeoo 474 Junior Poster Featured Poster

Simple CMS logic design.

  1. Create page for public viewing with links.
  2. Create registration page, login page, members only page.
  3. Create page for latest album, top rated album, most commented albums ...etc.
  4. Create database
  5. Create administration page for the site owner.

user table

+---------+-------------+-------------+----------+
+ user_id +  user_name  +  password   +   email  +
+---------+-------------+-------------+----------+

user_setting table . This table will be the user's privacy control.

+------+----------+----------+----+-------+
+ user +  private +  comment + pm + share +
+------+----------+----------+----+-------+

albums

+----------+----------+-------------+-----------+------------+
+ album_id + owner_id +  link_url   + img_count + disk_space +
+----------+----------+-------------+-----------+------------+

photos this is for the photos for the albums.

+----------+----------+------------+-----------+--------------+
+ image_id + album_id + image_name + thumb_loc + size_on_disc +
+----------+----------+------------+-----------+--------------+

comments this will record comments posted by other members

+--------+-----------+-----------+-----------+
+ cmt_id + member_id +  cmt_date + album_id  +
+--------+-----------+-----------+-----------+

rating

+----------+--------+--------+----------+
+ album_id + rating +  votes + voter_id +
+----------+--------+--------+----------+

favorites

+----------+----------+--------+----------+-----------+
+ album_id + owner_id + fav_by + fav_date + fav_count +
+----------+----------+--------+----------+-----------+

shared

+----------+----------+------------+-----------------+-------------+
+ album_id + owner_id +  shared_by + destination_url + share_count +
+----------+----------+------------+-----------------+-------------+

Make sure to change some of the column names to unique names to prevent colision and confusion. There are columns in the database that needs to be incremented based on the members activity e.g. favorites, shared, and photos.

Write your PHP codes based on the database skeleton design.. For administrative control, make sure to add columns on the albums table e.g. suspended, tobe_remove, or violation.

veedeoo 474 Junior Poster Featured Poster

Hi,

I thought it should be like this

<?php
require('Your_Wordpress_directory/wp-blog-header.php');
?>

If you want to show your article, it can be written like this

<?php
require('Your_Wordpress_directory/wp-blog-header.php');
?>

<?php
$number_of_post = 5; ## change this value to your own needs
/*
*@order is for the database query Ascending or Descending sort method
*/
$order = 'ASC'; 

/*
*@ order_by
* post title is the column name of the wp_post table. 
* You can change this to several options e.g. post_date, etc..
*/
$order_by = 'post_title'; 

$posts = get_posts('numberposts=10&order=ASC&orderby=post_title');
foreach ($posts as $post) : setup_postdata( $post ); ?>
<?php the_date(); echo "<br />"; ?>
<?php the_title(); ?>    
<?php the_excerpt(); ?> 
<?php
endforeach;
?>

You can also copy and paste these codes from the codex as shown..

<?php
    require('Your_Wordpress_directory/wp-blog-header.php');

    global $post;

    $args = array( 'posts_per_page' => 3 );
    $myposts = get_posts( $args );
    foreach( $myposts as $post ) :  setup_postdata($post); ?>
    <a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a><br />
    <?php endforeach; ?>

Those PHP tags mixed-up are so tempting for correction, please don't do it. It is part of the Wordpress Syntax.

To acquire the theme style, just view the html source of your wordpress and use the css file url.

veedeoo 474 Junior Poster Featured Poster

I addition to Cereal's recommendations, there were few voice (of course converted to audio) recognition applications written in PHP. I'm not sure if they still exist today.

  1. Voice PHP
  2. PHP Voice

Try searching these terms on sourceforge. I am pretty sure I forked this application some years ago, but due to lack of interest from the developers, the original author abandoned the project.

You will need FFMPEG PHP to use it as an audio comparator.

veedeoo 474 Junior Poster Featured Poster
  1. Pirates of the Caribbean (all)
  2. Ironman ( All)
  3. Spiderman ( All)
  4. Superman ( 1 and 2 only)
  5. Django Unchained
  6. Kill Bill (all)
  7. The GodFather ( all)
  8. Matrix ( all)
  9. Face Off
  10. My Way ( Korean Movie 2011)
veedeoo 474 Junior Poster Featured Poster

Honestly, the last time I have seen plesk parallel was 5 years ago. I can't even recall what is the httpd.conf and vhost equivalent for it. However, I am pretty sure there is some type of server configuration file that can enable rewrite_module.

Can you check with your host what modules are installed on your server as far as rewriting?

You've mentioned about the web.config file. Can you please let me know if you have PHP parser installed on your server? I just want to make sure.

Here is a very nice reference in working with web.config file as a url prettifier.

can you run this scripts on your server? save this as test.php

<?php

    echo 'Server Request URI .'.$_SERVER['REQUEST_URI'];

Direct your browser to test.php. and let me know what did you see.

The reason I am making you test it like this, because I might be able to write something that don't even need .htaccess, but I cannot guarantee that it will work.

veedeoo 474 Junior Poster Featured Poster

Hi,

Never tested, but it is more likely something like this will work for you.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^/]+)/$ $1.php 

or can be something like this.

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([^/]+)/$ $1.php 


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]

the above should be able to handle

www.abc.com/index.php
www.abc.com/index/

veedeoo 474 Junior Poster Featured Poster

I just noticed that you are on plesk. Holy Macaroni. My proposed solution may not even work.

veedeoo 474 Junior Poster Featured Poster

I find "boondockers" to be pretty cool for a field shoes. My Dad used tell me grab your "boondockers" and let's go.

veedeoo 474 Junior Poster Featured Poster

let me try this.. I must warn you before hand that the 2014.html must be changed to 2014.php else, it is not going to work.

What we are trying to do here is a simple router. This is similarly found in some MVC frameworks, but example below is approximately 1/10000 of what is the actual router. Jus to help you out.

First sTep: Create a file called .htaccess, paste the codes below and save it in the example.com directory.

Options +FollowSymLinks
RewriteEngine On

RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f

RewriteRule ^.*$ ./index.php

What the codes above will do is to redirect all request to the index.php. index.php now will serve as the executor of our made-up function. I will also provide you the function later on.

Step TWo: Create another file called index.php, paste the codes below and save it in the example.com directory ( normally, this is in public_html).

function process_url($file_location){

  $url_segments = array();

  $url_request  = $_SERVER['REQUEST_URI'];

  $url_segments    = explode("/", $url_request);

   $file_name = pathinfo($url_segments[3], PATHINFO_FILENAME);


   if(file_exists($file_location.$file_name.'.php')){

   return ($file_location.$file_name.'.php');

   }

   else{
   return false;

   }
  }

  ## now we define the actual page location
  $actual_file_location = './mtfiles/2014/';

  ## we call the function above
  $this_short_url =  ((process_url($actual_file_location) != false)? include(process_url($actual_file_location)) : 'page not available');

I need to make some short explanation on what I just did above. The url segments array split the url into segments. So, for the uri request http://example.com/2014.html $url_segments[3], will approximately give us the script name which is 2014.html. We further process this information, …

veedeoo 474 Junior Poster Featured Poster

it is also working on my side.

veedeoo 474 Junior Poster Featured Poster

Hi,

I am not familiar with Pan card, but this site might help you.

veedeoo 474 Junior Poster Featured Poster

To be very honest with you, Windows 7 and XAMPP cannot co-exist. They just hate each other.

There are many alternatives out there for your OS. There are WAMPP, Uniform Server, and Nginx for windows. These applications were proven to work with Windows7.

If those items mentioned above, does not work for you, try Usbwebserver . I am recommending this to you because you can change the port to prevent any conflicts with any running windows 7 applications.

veedeoo 474 Junior Poster Featured Poster

try changing this

$spix = $row[spix];

to this

$spix = $row['spix'];
veedeoo 474 Junior Poster Featured Poster

There is one for PDO modification for CI here.

You can also take the user input by simply

$this->input->get('user_input', true);
$this->input->post('user_input',true);

the second parameter tells the input class that we want the first parameter to undergo XSS filter.

Without filtering at all, just put single parameter.

$this->input->get('user_input');

I am still hesitant on the binding method though, I don't know why? Maybe it is just me.

binding is like a walk on a park

$this_query = "SELECT * FROM your_table WHERE col1 = ? AND col2 = ? ";

$this->db->query($this_query, array('col 1 value ', 'col 2 value')); 

but I prefer something like this

$this_query = "SELECT * FROM your_table WHERE col1 =".$this->db->escape('from user')." AND col2 = ".$this->db->escape('from user ');
veedeoo 474 Junior Poster Featured Poster

when you say

I have query the picture from the database and store it to $pix

you mean the image is stored as blob or binary?

veedeoo 474 Junior Poster Featured Poster

What kind of error are you getting?

veedeoo 474 Junior Poster Featured Poster

@Douglas

You can pretty much add a column on your dbtable to accomodate the processed status.

for example, if we have a database table called prod_enroll, having the following columns. enroll_id, rel_code, fname, lname, gender, birthdate, cover_start, cover_end, enroll_status. We can easily add a column named process.

enroll_id, rel_code, fname, lname, gender, birthdate, cover_start, cover_end, enroll_status, process.

The process column value could be set to bolean false as default and then update it to true ONLY WHEN the CSV file creation was successful.

If we go this route, then on your query during the CSV file creation, we can add another WHERE clause.

something like this.

FROM prod_enroll
WHERE mem_id = '$mem_id'
AND enroll_status!='A'
AND process = false
ORDER BY enroll_id

So, if we are to use the above query then we should assign a default value of 0 to the column process.

We can then check if the csv file exist in the directory and if it exist, we can run the update query setting the "process" column value to true or 1 for all of the rows affected by the first query.

veedeoo 474 Junior Poster Featured Poster

Have you written any codes yet?
Do you mind posting them here, so that we can take a look?

If you have not done anything yet, search google for comment system script PHP. It should return many links to the script intended for this purpose.

veedeoo 474 Junior Poster Featured Poster

May I know which one do you have Unix or Linux?
Is phpsuExec or suExec installed?
After generating the CSV file, what is the permission given to this file?

Simple things about directory and file permissions.

We can view directory and file permission or CHMOD as it would apply to our valuable possessions. As the rightful owner, we can control access to these possessions at all times.

The access controls can be imposed on three major user classifications.
1. Owner = this is you
2. Group = user group
3. World = you, user group, and the entire world

you can be a member of a user group, which is pretty common in linux environment.

There are three permissions that can be given to the users.
1. permission to read
2. permission to write
3. permission to execute

Integer values of the permissions.
1. Read = 4
2. Write = 2
3. Execute = 1

The loosest permission is 7 for each user group. Which is pretty scary. Most hackers can exploit any file ( NOT directory) with write permission 777 for the file.

Illustration of your current settings

At 777, this is pretty scary scenario if this applies to a file.

+---------+--------+---------+-------+
+---------+  owner +  group  + world +
+---------+--------+---------+-------+
+ read    +    4   +    4    +   4   +
+ write   +    2   +    2    +   2   +
+ Execute +    1   +    1    +   1   +
+---------+--------+---------+-------+ …
veedeoo 474 Junior Poster Featured Poster

0755 is the recommended directory permission for linux servers. However, this can change depending on the server's server API. When you run a simple php info() script anywhere in your public directory, you will find what is on your server.

for example, if the Server API is an apache module, then your server write permission or CHMOD should be set to 0777 or 777. This I don't know of any other alternatives.

The truth is, pretty much nobody uses the apache module as server API. What are commonly use these days are Apache Handler 2.x and Fast/CGI which allows the recommended 0775 or 775 permission for directory permission and giving all files a persmisson of 644. Most hosting companies only allow maximum permissibility value of 0755 or 755.

Test your application if it can write with 755 permission.

Also, I noticed that you are using fputs() function. I know for sure PHP have a dedicated function in handling CSV files and it is called fputcsv() function.

veedeoo 474 Junior Poster Featured Poster

Can we see at least ONE of those script samples? Maybe it just need minor tweakings.

Normally, if the query is successful, we can decode the row document like this

echo base64_decode($row['document']);
veedeoo 474 Junior Poster Featured Poster

Hello and Welcome to Daniweb.