648 Posted Topics

Member Avatar for ramsiva

Hello, take 5 minutes (and I am saying a lot) to read what file upload is (e.g. http://php.net/manual/en/features.file-upload.php or http://php.net/manual/en/features.file-upload.php was the first two searching in Google). As you will realize in less than a minute your code doesn't make any sense. [“name”] is the name of the file as …

Member Avatar for jkon
0
221
Member Avatar for jay.barnes

Let's brake down what you are trying to do. You are trying to validate form inputs. There are many many ways with OOP to do this but let choose one that is near to your original approach. Create an abstract class (lets call it FormValidatorAbstract) , having as constructor an …

Member Avatar for jay.barnes
0
420
Member Avatar for Bile

You remind me how we doing it before AJAX. We were loading an iframe that supposed to be js but was originated through Java or PHP and called functions of the main app.js . Now we don't have need for such approach. It seems that what you really want is …

Member Avatar for Bile
0
6K
Member Avatar for SimonIoa

What do you mean with “for some reason it doesnt work” , what happens ? . What is the #click DOM element that clicking it returns false , is it inside this <a> ? There are many issues with the code that you provided that are irrelevant with your question …

Member Avatar for SimonIoa
0
493
Member Avatar for Saqoom

How I would respond in such question? “ Move to OOP , you are describing an object , and you keep its properties in an associative array that could be anything or nothing”. OOP isn't the greatest thing can be , but is the greater we have so far.

Member Avatar for almostbob
0
126
Member Avatar for KateyB

I guess reading your post that you already have an action selecting “a pet” and change its group. How do you do this , by a radio button and a submit ? If so you just have to select one more field in each pet that is checkbox and a …

Member Avatar for lps
0
251
Member Avatar for shashigowda

And I want to earn 3.000$ every day and of course ... world peace . Is there any question ?

Member Avatar for jj.dcruz
0
288
Member Avatar for AntonyRayan

As I understood you serve images dynamically so you are familiar on how to serve images in other sizes as well. It alls has to do with how you store image data in your database and how you serve them. For example if serving them you resizing images in a …

Member Avatar for jj.dcruz
0
143
Member Avatar for phoenix254

Lets start with one really obvious. 23 - No start tag (<button>). (an editor could help you a lot)

Member Avatar for phoenix254
0
398
Member Avatar for raul2329
Member Avatar for v1shwa

Let me understand , you don't want to HOLD your script while you are waiting to receive the response of GET or you don't know at all how to get the response? In any case what method do you use in order to create those GET requests ?

Member Avatar for jkon
0
401
Member Avatar for jkon

Hello , today I was developing a short url system and I created this class to help me encode / decode integer (id) to small string. That way for example “Ac” means 3674 . Because I believe that it may be helpful to others too I share it here. Notice …

Member Avatar for diafol
2
3K
Member Avatar for ramsiva
Member Avatar for Prog_1
Member Avatar for jkon
0
213
Member Avatar for KingGold171

A db results array that you could use to instantiate a real object. The only advanced I see here is a variables mess

Member Avatar for jkon
0
209
Member Avatar for jrotunda85

I believe this one has a simpler approach. What you need is two columns in your table latitude and longitude then just use them to insert a Google map with them as location. Before that get acquaintance with Google Map and make your own JavaScript function to make it easy …

Member Avatar for Yong woon
0
583
Member Avatar for romiaujla

You don’t store anywhere your booksList , despite that you just give values to that array in the constructor of your Model. As I understand this is visitor scope caching so you could be fine using session, BUT this is something the controller is responsible for not the model in …

Member Avatar for charlie_3
0
603
Member Avatar for Jack_9

Hello Jack_9 , what do you mean that you have created PHP applications that aren't for web ? Do you mean a standalone application using a PHP GUI , or a single background server process , or something completely different?

Member Avatar for veedeoo
0
240
Member Avatar for davidjennings

davidjennings maybe diafol will answer that but there are too many things that you are doing wrong in my opinion. This is a tip to check on them. Really what is the reason to use Get after all ? ... To make that URL accessible to everyone ? .. You …

Member Avatar for davidjennings
0
973
Member Avatar for afaaro

I have seen a number of questions of that type and I am thinking of writing a tutorial here about the Indexed List Model in OOP PHP with Assigners and Data Workers (but to be honest I don't see much interest in the OOP approach of this issue) . For …

Member Avatar for afaaro
0
435
Member Avatar for malatamil

Hello, First of all you must explain what you mean with the term “tabs”. Normally we would mean by that term browser tabs , which means that you have two separate pages opened (that can communicate through JavaScript if the one opened the other) , but maybe you refer to …

Member Avatar for diafol
0
548
Member Avatar for diafol

Just a different approach since it is an interesting question $keys = array('key1', 'key2', 'key3'); $value = 'some value'; $md = array(); $md[$keys[count($keys)-1]] = $value; for($i=count($keys)-2; $i>-1; $i--) { $md[$keys[$i]] = $md; unset($md[$keys[$i+1]]); } var_dump($md);

Member Avatar for Webville312
0
9K
Member Avatar for Elusive

What exactly trubles you with the message "Cannot modify header information" ? The message is complete you have an outpout in line 229 .... What it should say more ?

Member Avatar for Elusive
0
200
Member Avatar for saadi06

I always use PHP as an OOP language (it is a cheap language in terms of system recourses and employs salaries) . Sometimes I forget what amateur code lye underneath the sophisticated layers we have to create. A big thanks Bob for remind me this.

Member Avatar for jkon
0
209
Member Avatar for Belton

Take a moment to read what you are asking and then read in wikipedia (or anywhere) what is html and what is excel. So the problem is producing the html table or do you really want to export your data to excel file ? . Recently I learned that learning …

Member Avatar for mglobs
0
260
Member Avatar for azareth

The flower of winter … [Click Here](http://www.youtube.com/watch?v=WBtx1IvWbQk) No the singer hasn’t a great voice or the music isn’t too prototype or the lyrics. But that mix of sorrow, anger, sensitivity and hope is very close to what I feel that period.

Member Avatar for GrimJack
0
1K
Member Avatar for dhruvarora227

Start by understanding HTML 5 , than JavaScript . then jQuery and then CSS 3 ., of course then you should learn some PHP …

Member Avatar for jkon
0
73
Member Avatar for CarterLangley

To be honest a “hell of a timesaver” would be also if you let your visitors alter the system tables by their selves. But you don’t want that, why ? . I suppose because you want to have rules of what user can edit what table, what row and in …

Member Avatar for CarterLangley
0
183
Member Avatar for vukhacbiet

Hello vukhacbiet, You are asking something very generic without going in details on what you are trying to do ( “the same as a basecamp or teambox” you refer to , doesn’t mean a lot to me for example) . It is like you are asking an easy way or …

Member Avatar for Doug_Vann
0
247
Member Avatar for iamthwee

> I just need to make sure the user can't really change a field with an id they shouldn't have access to. The sort answer: you have the user id that has being logged in your session , and as I understood you have some rules of what fields whose …

Member Avatar for iamthwee
0
163
Member Avatar for jkon

Some weeks ago I posted this and I realized from the referrals that it may help to be as a code snippet. This is an example of getting products details from categories – subcategories using ajax call. I am fond of OOP and this is not , but I believe …

Member Avatar for pritaeas
1
3K
Member Avatar for vukhacbiet

If A and B will use the same source code and database what will be the difference the view?

Member Avatar for vukhacbiet
0
81
Member Avatar for garwil

To be honest I can’t get It. I am tending to believe that there should be a hidden (till now) field … lets call it for now the timestamp of a priority. To give you a full answer if this is the case I would need the schema (the PHP …

Member Avatar for garwil
0
259
Member Avatar for BenWard

A general principle is not jumping to coclusions without reading and trying. You wrote : *“so if $foo contains objects and not simply strings, if I call a method in that object which sets some property, as soon as the foreach moves to the next object in the array that …

Member Avatar for BenWard
0
235
Member Avatar for showman13

Hello Douglas and a happy new year, *if I create an associative array and place several key>value pairs in the array, will they remain in the order that they are placed, or will they be re-ordered in any way?* They will remain in the order that you inserted them to …

Member Avatar for showman13
0
228
Member Avatar for mattyd

I am not sure that I got the way that you collect those IP’s . You said “email registration/email confirmation” probably that means that “confirm” an email registration by sending a special link to each one. If this is the case and you get the IPs through the confirmation tier …

Member Avatar for JorgeM
0
138
Member Avatar for Ambrish_1

Of course before asking you have experimented with some technologies. What have you read and tried? … java applets ? web sockets ? ..

Member Avatar for Ambrish_1
0
249
Member Avatar for M.Waqas Aslam

Hello, First of all let talk a bit about what is the meaning of using CURLOPT_PROXY (http://www.php.net/curl_setopt ) . The meaning is that you are going to use one other proxy server to fulfil the request and finally give results to your visitor. As I understood this has nothing to …

Member Avatar for M.Waqas Aslam
0
297
Member Avatar for Iikeloa

The first and most serious issue is that you are not using prepared statements. The second one is that you are using a reserved word as a field named “real” . Take a look at http://dev.mysql.com/doc/refman/5.0/en/reserved-words.html

Member Avatar for Iikeloa
0
177
Member Avatar for jkon

Hello, first of all let me clarify that I am just a programmer but I needed a dedicated server , with no many modification so I bought an unmanaged dedicated server from a hosting company (I try to avoid using their support as they stated a lot that this is …

0
398
Member Avatar for mrnutty

When I first signed in at daniweb I worked for more than 12 hours a day (including Saturdays and Sundays) in a company taking Cobol programs and turning them to Java. So it were j … everything … jMornings jEvenings jNights and more over my name is Kon so it …

Member Avatar for Reverend Jim
0
687
Member Avatar for game4tress

Over the past I have used two main ways (with some variations) that really worked with application that needs to know who is online. The first is quite simple … an online visitors table with a code (could be a hash with internal salt of a session id if the …

Member Avatar for jkon
0
279
Member Avatar for levesque123456

I really can’t see how this code is working properly, In line 7 you open an if that is never closed. Using an IDE like Eclipse or Netbeans would reveal you that in the first place. I believe that IDE’s are not only for programmers but for beginners as well.

Member Avatar for diafol
0
367
Member Avatar for 9tontruck

If you use namespaces you want have to require or to have a autoloader class ? ust use logic .. you provided those data in a file … in somehow that file should be read..

Member Avatar for 9tontruck
0
146
Member Avatar for kcrazy

In my point of view there couldn’t be such thing as “the best” framework. There are many factors of choosing a framework but I strongly believe that three of them are the most significant 1) What is your programming background 2) Why do you need a framework and therefore what …

Member Avatar for jkon
0
443
Member Avatar for rhodoscoder

Don’t look at it , it is a very bad coding example , the title of it could be “things you should never do”. In OOP PHP you never have to deal with function (few exceptions as fatal error calling functions)… The laughing part is func_get_args() , if you don’t …

Member Avatar for rhodoscoder
0
212
Member Avatar for TIM_M_91

You want to use https .. do you have ssl certificate ? If you haven’t don’t use https … In your basic code you use $_SERVER['REQUEST_URI'] So check that primitive variable that is the page that you want to apply the rule for and if it is apply it ..

Member Avatar for LastMitch
0
145
Member Avatar for jkon

Hello, I suspect that this is an elementary question but maybe I don’t understand how to search for it. I am a programmer, but having a small company and we can’t afford yet a system administrator, so I play this role as well with my limited practice on it. Currently …

Member Avatar for rubberman
0
453
Member Avatar for Eagle.Avik

Hello. The main reason isn’t working is that in line 25 you make a check with a variable ($data) that is not declared. Although you use PDO you don’t use prepared statements that is really a bad idea, with those in mind lines 23 through 30 could be (You have …

Member Avatar for simplypixie
0
917
Member Avatar for urbanthistleuk

Urban you could benefit from PDO and a medium (framework or not) delivering the post data. You might thing that the code there after all those lines is secure but is really wide open… You could achieve more security with fewer lines of code … think about it …

Member Avatar for urbanthistleuk
0
242

The End.