648 Posted Topics

Member Avatar for pritaeas

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 …

Member Avatar for cereal
0
189
Member Avatar for OsaMasw

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 …

Member Avatar for jkon
0
463
Member Avatar for navneet patel

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 …

Member Avatar for jkon
0
292
Member Avatar for hwoarang69

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 …

Member Avatar for james.anthoney.716
0
190
Member Avatar for OsaMasw

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); } ?>

Member Avatar for OsaMasw
0
134
Member Avatar for aa_day90

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 …

Member Avatar for aa_day90
0
86
Member Avatar for showman13

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 …

Member Avatar for showman13
0
194
Member Avatar for cussel

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 …

Member Avatar for diafol
0
186
Member Avatar for ghersese
Member Avatar for axymak

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….

Member Avatar for veedeoo
0
1K
Member Avatar for Echo89

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 …

Member Avatar for phorce
0
308
Member Avatar for shahai.ali

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;

Member Avatar for hakeemtunde
0
273
Member Avatar for davy_yg

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 …

Member Avatar for diafol
0
181
Member Avatar for AndreRet

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 …

Member Avatar for AndreRet
0
196
Member Avatar for rikkitikkitavi

> 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 …

Member Avatar for jkon
0
687
Member Avatar for onixbwcrap

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 …

Member Avatar for onixbwcrap
0
221
Member Avatar for jkon

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 …

Member Avatar for bato3
0
459
Member Avatar for phpHelp

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 …

Member Avatar for Djmann1013
0
190
Member Avatar for watonca

How is the data structure in your flat data.txt for the options of the select? value=text <line> ?

Member Avatar for diafol
0
826
Member Avatar for gamebits

Where exactly do you have the session_start ? And where you give value to $_SESSION['USERID'] ? ….

Member Avatar for gamebits
0
778
Member Avatar for minitauros

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 …

Member Avatar for jkon
0
382
Member Avatar for daniel36

Doesn’t line 15 have eregi ? That wasn’t the topic ? Is that the old code ?

Member Avatar for pritaeas
0
157
Member Avatar for LastMitch

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?

Member Avatar for LastMitch
0
440
Member Avatar for andyy121

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 …

Member Avatar for andyy121
0
215
Member Avatar for Kniggles
Member Avatar for AndreRet
0
105
Member Avatar for sinZ

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.

Member Avatar for jkon
0
82
Member Avatar for cssweb

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 …

Member Avatar for jkon
0
201
Member Avatar for andyy121

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 …

Member Avatar for cigoL..:)
0
118
Member Avatar for muratsal

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 ….

Member Avatar for <M/>
0
60
Member Avatar for predator78

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 …

Member Avatar for mike_2000_17
2
734
Member Avatar for ZER09

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? …

Member Avatar for ZER09
0
202
Member Avatar for kx220

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 …

Member Avatar for jkon
0
234
Member Avatar for yumyam09

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 …

Member Avatar for jkon
0
80
Member Avatar for jeconje

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 …

Member Avatar for jeconje
0
254
Member Avatar for smitty1140

So there was no real question …. Or was a question out there that I too stupid to understand?

Member Avatar for smitty1140
0
235
Member Avatar for ssfox

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 …

Member Avatar for ssfox
0
152
Member Avatar for pattmorter

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 ….

Member Avatar for jkon
0
213
Member Avatar for ericjw316

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 …

Member Avatar for dcdruck
0
192
Member Avatar for extjac

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 …

Member Avatar for jkon
0
198
Member Avatar for iamthwee

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 …

Member Avatar for jkon
0
582
Member Avatar for davy_yg

What puzzles you ? Why $confirmation is undefined ? You define , it inside two conditional statements so logically those conditions are not satisfied.

Member Avatar for davy_yg
0
320
Member Avatar for vinay7868

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 …

Member Avatar for diafol
-1
193
Member Avatar for jkon

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 …

Member Avatar for ankitaray
0
178
Member Avatar for jkon

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 …

Member Avatar for pritaeas
0
224
Member Avatar for DaveyMoyes

You want to cash those variable with visit scope (if I got your question right) …so why don’t you use session ?

Member Avatar for broj1
0
201
Member Avatar for mlucianpavel1

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 …

Member Avatar for mlucianpavel1
0
470
Member Avatar for empror9

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 …

Member Avatar for empror9
0
119
Member Avatar for arctushar

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 …

Member Avatar for fpaquin
0
1K
Member Avatar for flynismo

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 …

Member Avatar for mschroeder
0
383
Member Avatar for MooGeek

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 …

Member Avatar for Stuugie
0
356

The End.