- 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
43 Posted Topics
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: 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>? | |
Re: We always try to prevent ourselves from sinking into recursive function in PHP. However, if that is what you need, please consider the simple function I wrote to demonstrate how recursion works. Recursion in PHP is a function or method that calls itself within itself. Huh!???? I know my definition … | |
Re: I totally agree with it being bad. Bad if you allow your user to see it. Errors about your script, database, config file, ando other site related settings must be keep private and must be recorded in the log file. | |
Re: I normally develop PHP apps in windows environment using Uniserver as WAMP server. Before the app release, I would run my application to linux environment to make sure everything works. Some basic differences between developing PHP application in Windows vs. Linux. 1. in Linux, we can use nginx as the … | |
I need to know how many people are interested in learning how to write a desktop application using PHP? If I get enough interest on this topic, then I will write a simple tutorial on how its done. We (veedeoo and me) were experimenting on Desktop apps utilizing the [Daniweb … ![]() | |
Re: I truly admire your ability to write and read your codes in this form. However, I would also like to advice you to at least indent your codes, so that we can at least follow the flow of your script. PHP-FIG suggested [PSR-1](http://www.php-fig.org/psr/psr-1/) and [PSR-2](http://www.php-fig.org/psr/psr-2/). ![]() | |
Re: You need to at least show us something that you have done. | |
Re: XAMPP is intended for quick web application development and should not be use as a frontend for production environment. Try [Uniserver](http://sourceforge.net/projects/miniserver/files/Uniform%20Server%20ZeroXI/ZeroXImodules/Source/). Uniserver allows you to easily configure the server to either production or development. The apache, PHP, and MySQL configurations are easy to tweak. I have a client who wanted … | |
Re: try to validate between the hash and the something['user_pass']? user password input --- hash this password Vs. something['user_pass']. Make sure the password stored in your database used the same hashing mechanism as the validation hashing mechanism. | |
Re: the subdata is a multidimensional array. it must be expressed like this.. $data['sub_data'] = array( 'extra_script' => $this->Mediatutorialaccount->extra_script(), 'column_1' => $this->Mediatutorialaccount->update_status(), 'column_2' => $this->Mediatutorialaccount->profile_detail() ); you can then iterate them using foreach or whatever is your preferences in iterating an array. | |
Re: I've noticed on your codes, why are you still using mysql_*? I have not seen this for a while. Use either PDO or MySQLI. mysql_* has already been abandoned and the authors have not intension of any future upgrade. | |
Re: nice proofs veed. You can also spread those proofs upwards and sideways similar to 4 axis, thus making it not leaving any stone unturned. | |
Re: I totally agree with the Moderator and the Administrator. Item can be set and it can also be empty. $test = ''; if(isset($test)){ echo 'Test is set and is empty'; } | |
Just wanted to say hello to Daniweb. Finally, I have the time to sign up for an account. Veedeoo keeps on bugging everyday to join this great community, but I was always been busy. |
The End.