- Strength to Increase Rep
- +4
- Strength to Decrease Rep
- -1
- Upvotes Received
- 25
- Posts with Upvotes
- 19
- Upvoting Members
- 12
- Downvotes Received
- 0
- Posts with Downvotes
- 0
- Downvoting Members
- 0
Re: you need to create routing directives for it. $route['movies'] = "movies/cool"; assuming that you have movies.php in your application/controllers/ directory and it is coded something similar to this class Movies extends CI_Controller { public function __construct() { parent::__construct(); } public function index() { // you can do some other options … | |
Re: Honestly, you've developed a bad coding habit already. I am not trying to be negative here, but the way I see it, you will have a hard time correcting them. Also, I second the moderator's comments above in regards to your excessive used of static methods. The way I see … | |
Re: I thought this $HTTP_SESSION_VARS has been [deprecated ](http://php.net/manual/en/reserved.variables.session.php)100 years ago? I might be wrong. | |
Re: ASP.net is a development framework which allows you to use either C sharp or VB.NET language. There is also a new release called ASP.net 5 that supports angularJS, GruntJs, and node.js. Visual Basic and web forms are somewhat excluded in the features. | |
Re: try including your connection.php after you include the header.php. Include it above all, when header.php is also needing the connection. In your case the $connection is a variable, and one of the Dont's in developers code of ethics is to avoid using variable in global scope. The reason is that … | |
Re: this will also work as an alternative to str_replace $string = trim($string,'(())'); | |
Re: $result->num_rows is a method for select query, while $conn->affected_rows; is for the affected rows after executing an insert query. That's what I think. I might be wrong ???? | |
Re: It's a matter of preference. However, regardless of what you use, you still have to loop through the result. There is not much difference between while loop and foreach loop. There is an 8th of advantage if you don't loop inside the logic of your application. What requires the most … | |
Re: another option that will give you a total control is [php html DOM parser API](http://simplehtmldom.sourceforge.net/manual_api.htm). for example, $scrape = file_get_html('somesite_to_scrape.com'); /* get the css line */ foreach($scrape->find('link.href') as $css_file){ /* this is the css file location */ $css_file; } you can also do it with javascript.. | |
Re: you can try creating functions that will sequentially handle the steps. example, function firstStep() { /* create database here */ /* if database has been created */ /* return true; */ } function secondStep() { /* insert dummy data */ } check if ready for the second step.. if(firstStep()){ /* … | |
Re: you should add return true; somewhere in your confirm_query() function, preferrably after the die() function and then you can evaluate like this if(confirm_query($insert_query)){ /* you won't pass this point if it is false right? */ /* do whatever you have to do */ } relying on die() function is a … | |
Re: try, public function add_email() { /* set errors var as array */ $errors = array(); $this->load->library('form_validation'); $this->form_validation->set_rules('name', 'Name', 'trim|required'); $this->form_validation->set_rules('email', 'Email Address', 'trim|required|xss_clean'); /* check if any of the validations fails */ if ($this->form_validation->run() == false) { /* take all of the validation errors as errors */ $errors['errors'] = $this->form_validation->set_err(); … | |
Re: Hi, Just to give you a simple example. By the way there are many terminologies used to describe what you want to accomplished. On a lower level, it can be called simple router and simple dispatcher. Some will call this as front controller which is a pattern that implements a … | |
Re: can you post your composer.json? Just want to see how you set up the autoload for PSR-4. For example, I have something like this for the MVC I co-wrote with Veedeoo "autoload":{ "psr-4":{ "System\\" : "vendor/geeglerapp/system/", "App\\" : "vendor/geeglerapp/app/", "Tbs\\": "vendor/tinybutstrong/" } } keep in mind that some packages are … | |
Re: $_REQUEST will also process even if the method is not defined. Such as <form method="" action="yourprocessor.php"> Malicious request can also be sent to your site, in this manner yourprocessor.php?name=hello&last=world&code=javascript:;alert(something); print_r($_REQUEST); although the javascript will not cut it on today's advance browsers, the use of $_REQUEST is highly discouraged. It was … | |
Re: you can try using is_uploaded_file('some_file'); to validate if the file was uploaded. Another alternative way of doing this is to check if the file has been moved or not. if(move_uploaded_file()){ //do whatever is needed to done } you can also check based on the user's input, $there_is_file = (!empty($_POST['upload']) ? … | |
Re: I totally agree with all of the definitions above. On the other hand, frameworks can limit the type of application that you can built. However, there is a framework like CodeIgniter that can be easily bent, molded, and hammered to your requirements. If you will be distributing an application intended … | |
Re: this should be an easy thing for you to code. Have you look at jquery ajax? | |
Re: did you try something like this? if(pwd.value != rpwd.value) | |
Re: plus, you can rewrite this if($ins>0){ echo "sucess"; } to something like this if($ins){ echo "sucess"; } because anything greater than zero are always presumed to be true. | |
Re: this $content = file_get_contents("http://www.phpfastcache.com/testing.php"); get the remote page named testing.php from the phpfastcache.com by way of cURL, API or mySQL query. for example if the testing.php returns <!doctyp html> <html> <head> </head> <body> <h1>Hello world </h1> </body> then the cache class will make a cache file of the page and … | |
Re: I totally agree with the above response. Once you declare an abstract method within abstract class, it will impose a mandatory must have method in the child class. Unlike, in factory pattern a class can also be written in abstract class without abstract method, but methods within the abstract class … | |
Re: If you are really serious about your question and willing to invest a $1.99 for a good used PHP book. Look for the book entitled Programming PHP(second edition) by Rasmus Lerdorf, Kevin Tatroe,Peter MacIntyre. It is currently on sale for $1.99 at barnes&noble. You can also look for the PHP … | |
Re: It would be nice if we can have server side js e.g. node.js, google polymer and jquery.mobile sections. I honestly believe that node must be treated as a server side scripting like PHP. | |
Re: @V, dude I like your style :). | |
Re: I honestly believe that the lastInsertId() is the most error proof for this purpose. | |
Re: I think PHP is pretty loose in implementing license compliance. Providing link to your webpage is an excellent way showing your appreciation to the creators and contributors of PHP distribution. You can also aknowledge them by just including your acknowledgement inside the source code. for example, <?php /* * source … | |
Re: you probably need node.js. It is a server side javascript. Server side javascript can pretty much do what other server side scripting languages can do. | |
Re: whatever happened to your <body> after </head>? |