648 Posted Topics
Re: You should be proud of giving your program helping other programmers (framework) to the community after all. I am participating in a framework and I would really like to see new ideas in other frameworks … I searched the “hello world” application example with laravel or a simple db app … | |
Re: This is a very common problem. There are many solutions. The one you gave is one of them , to query db for each category – subcategory , one other is the nested tree model and many more. I will talk you about the Indexed List Model. You can see … | |
Re: Let’s break the issue in parts. What you want to do is to read data from an excel file and the second one is to save those data in DB. I guess you already know how to do the second part (saving data in DB) so I will suggest for … | |
Re: Propably the ‘ip_address’ in your ‘view’ table is VARCHAR so you need to use quotes ( '$user_ip' ) . Besides that I would really recommend you to take the time to learn how to use prepared statements … PHP has the PDO data access interface which is great , really … | |
Re: Why don’t you use the last dot as a delimiter? Example: <?php $string = "file.part001"; var_dump(beforeLast($string, ".")); function beforeLast($string,$search) { $lastIndex = mb_strrpos($string, $search); return $lastIndex == 0 ? $string : mb_substr($string, 0 ,$lastIndex); } ?> | |
Re: This could be interesting … Why could be characterized in any way as optimization (even micro as you said) ? . You have private methods with no setters and no getters … why ? . In the save method you said that you are saving those properties in db (how … | |
Re: showman13 you asked two questions • Two - whether there would be a more efficient means of doing this? And you answered it your self “-this has turned out to be a terrible idea, but it is what it is and I know I need to change it soon-” Well … | |
Re: There is something missing from your example, there is no way to define for example $data[0][0][0] = 'chelsea everton villa Liverpool' and in the var_dump to get '<b>chelsea everton<b/> villa liverpool'. Also there are many inconsistencies in the way that array. For example $data[0][0][0] is a string while $data[1][0][0] doesn’t … ![]() | |
Re: How do you store that image ? | |
Re: Contact those sites and ask them if it is ok to parse their results, if it is then just learn PHP and a post with Curl or other tools and then parse those data is nothing if you already know PHP…. | |
Re: If ImageMagick and imagick are installed in your server (or you can install them) the safest way I would suggest is: if(extension_loaded('imagick') && class_exists("Imagick")) { echo "Imagick IS ISTALLED <br/>"; try { // Let’s suppose that the name of the file input is “newFile” $image = new Imagick($_FILES["newFile"]["tmp_name"]); echo "THE … | |
Re: You mean that everything else is working (e.g. var_dump($_FILES["file"]["name"]) is correct) but the temporary file in the file system ( e.g. var_dump($_FILES["file"][" tmp_name"]) ) isn’t ? If this is the case what outputs the last statement; | |
Re: Hello davy_yg, I guess that you aren’t a MySql table as you said but a human ( ;)) ) so try: SELECT COUNT(idads) AS COUNTER FROM admgt About the mysql_select problem you are facing you have to share your code to give you advices. ( I am using PDO but … ![]() | |
Re: Well this has nothing to do with PHP, but I hill give you a hint using jQuery (I could do it also without it but to be honest jQuery is nowadays something like standard in web UI). I am using also jQuery to set the values of the hidden field … | |
Re: > but if my session cookies are disabled how come it works when i try to echo it from the same page? Because you define it and assign value to it in the same page . In the same page if there is no session id in the request, it … | |
Re: I will not tire to point out that PHP has a really great OOP interface for accessing databases named PDO. Every PDO object has the method lastinsertid witch returns the last inserted id (of the auto increment primary key) Moreover lastinsertid method works great with MySql databases and I would … | |
I knew that I can use variable variables instead of reflection in PHP but I have never gone that way because my OOP background stated that this is not a clean way. Recently I made a test using both methods and the results made me rethink it. Using variable variables … | |
Re: phpHelp you have a lot of work reading and understanding upon you if you are a programmer . If you are just a client than just Google it …. If you are a programmer I have made such projects and I would be happy to share with you any knowledge … | |
Re: How is the data structure in your flat data.txt for the options of the select? value=text <line> ? ![]() | |
Re: Where exactly do you have the session_start ? And where you give value to $_SESSION['USERID'] ? …. | |
Re: Minitauros you said that you have a class that contains a lot of functions and some variables that are used inside other classes in the same flow. If this class has really a lot of functions –methods , then probably there is something wrong with it. Reading a class you … | |
Re: Doesn’t line 15 have eregi ? That wasn’t the topic ? Is that the old code ? | |
![]() | Re: I can’t see any object there …. except from the stdClass that is used for typecasting to object. What exactly are you trying to do? ![]() |
Re: What are you trying to do: Explain in details what you are trying to do . How are you trying to do it: Explain how you are trying to archive what ever you are trying to do. Where is the problem / question: After the above two steps explain where … | |
| |
Re: At first step this has nothing to do with PHP … google “htaccess redirect”. At second level maybe you should consider strengthening your programming knowledge and than move to a framework that handles those things for you. | |
Re: To know the number (or some more details) of the visitors that are online may seem a really easy thing to be done but ain’t. First of all you will need a table , lets call it “visitors” that will certainly will have an auto increment ID and a LAST_VISIT … | |
Re: Did you searched (googled) what is mysql_query before asking here ? … You say that you want to understand … that is a big step , but search before asking and if there is something than that you don’t understand we are here for you. (by the way PHP has … | |
Re: Of course you can … (the question could be … should you … ) … just work it and if you have any questions about it we are here for you …. | |
Re: I believe that communism was a stage that we (as humanity) had to gone through and built in order to reveal the goodness of human kind. Some might say that it failed one hundred percent , others , that it never really applied. From what I have read in books … | |
Re: Actually PHP is great in that field. You have many things in your PHP script that I don’t get, it aint a class but a script … why ? … How are you going to call that ? Don’t you have a spl_autoload_register there? So what is that INCLUDE constant? … | |
Re: You are a beginner so a blank page … so why to write that page with bad practices? There are so many frameworks out there in PHP like CI or YII and of course there is there the OOP approach. PHP has a great database interface support class called PDO … | |
Re: The uproach that Bachov shared can do the work. Of course there could be many variations to it, no need to match session id with the log in id , if you have an architecture that provides different log in ids for each user , and therefore no reason to … | |
Re: Of course there could be many approaches , one of them is : Create a table for interests (e.g. interests) that has an ID and a TITLE (there could be many more there as for example if you like to deactivate or many more) I suppose that you already have … | |
Re: So there was no real question …. Or was a question out there that I too stupid to understand? | |
Re: I don’t know any other project in Java that empowers such behaviors’ than http://ant.apache.org/ . You said that you don’t know a lot about programming … so maybe doing so is not making sense. First really understand OOP and then Java and then what PHP can be .... You may … | |
Re: Hello Matt , pattmorter You didn’t even described the problem , but I am happy that you figured it out. So mark it as solved and next time describe what you are asking if you want answers …. | |
Re: You can see also here http://www.daniweb.com/web-development/php/threads/430854/dropdown-search-from-mysql-database-help#post1847583 The answer I gave there is working but it was an answer for anyone that don’t like to be acquaintance with MVC and OOP. The IndexedList pattern described in PWF is solving most graphs and self referential issues (not only in AJAX needs) and … | |
Re: It is the second same question over a day ( @see http://www.daniweb.com/web-development/php/threads/433941/would-you-still-use-pdo-with-an-mvc-model ) , so maybe I would really benefit to understand what puzzles you … | |
![]() | Re: PDO is a consistent interface for accessing databases in PHP while MVC is a software design pattern. Stating that , I believe that is clear that you can have MVC without the use of PDO or with it , and of course the use of PDO in a MVC or … |
Re: What puzzles you ? Why $confirmation is undefined ? You define , it inside two conditional statements so logically those conditions are not satisfied. | |
Re: Just few thoughts … fallow OOP , MVC , clean coding , separate layers, comments everywhere, don’t be afraid of AJAX (since it is online examination) but don’t overdo it, and of course should be in SOA architecture with web services in order you want to share those examinations in … ![]() | |
First of all if anyone knows where I can go to ask a question about Google policies and get a legitimate answer please share with me ( where exactly … the URL). My question seems simple. I am planning to create a URL shortener service. Anyone can enter a search … | |
I am not sure if this is the right daniweb forum to ask your opinions about a new site idea. If not ,I am sorry and please remove it. Now, to the site idea. I am aware that there are many social bookmarking sites, I am not custom with a … | |
Re: You want to cash those variable with visit scope (if I got your question right) …so why don’t you use session ? | |
Re: If I understand what you are doing, you are trying to create a select input with categories that when the selected option change a HTML table were the “rezultates” are shown. Of course if you want to do it dynamically without page form submission you should use AJAX. To be … | |
Re: To be honest if I didn’t knew anything about programming then procedural scripting with some functions on it would seem the easy way to go, but believe me it isn’t. Understanding the concepts of OOP has a learning curve, but at the end you will gain more writing clean code … | |
Re: Of course digital-ether answer is more accurate but to make thinks a bit simpler associate class with the object and function with the behavior of the object. To go many years back, if the object-class is a bicycle it has attributes (color, speed) and behavior (changeColor , changeSpeed), the function … | |
Re: Lets’ simplify your code and give an example of what is happening in the comments of the code <?php class member { // Why don't you declare if it the visibility of var e.g. public ? // Yes PHP will made it public , but it's best to declare the … | |
Re: As humankind we will embrace the scientific method but I believe that we are neonate as a species and what we call science these days may vary a lot of what science mean some years from now. The scientific method can never replace beliefs, the decision of what way will … |
The End.