ManiacDan
Staff Alumni-
Posts
2,604 -
Joined
-
Last visited
-
Days Won
10
Everything posted by ManiacDan
-
When you updated PHP the new installed version defaulted to showing errors. Now you're seeing an error that was previously hidden. That's not a bug in PHP, though it represents a bug in your code. $_GET['page'] doesn't exist when you expect it to exist. Fix that. The date timezone thing can be safely ignored, but it won't hurt you to explicitly set the timezone. -Dan
-
This code should only print once. Are you including it more than once? Have you attempted to debug this using debug statements at all?
-
You can place them outside the web root and you can include a check at the beginning of each file that dies if the URL points to that file directly. Note, however, that if someone navigates directly to your class file nothing will happen. The class will be parsed and they'll see a white screen. -Dan
-
Ok...you have a bunch of code. put that code into a function. The manual will be helpful here.
-
I wrote an article on this subject. -Dan
-
Call Public Function in Another Public Function
ManiacDan replied to unemployment's topic in PHP Coding Help
It's the critical variable in object oriented programming. It defines the current class scope and allows you access to the current class's methods and variables (and any inherited ones). I recommend reading that entire manual chapter that's linked above. -
Ah if that's the case then yeah, you don't want that. A sub-query to find the last 5 games for each team might work.
-
You seem to be making less sense the more you explain things. Copy and paste? Call a function? make a web service? We have no idea what you're talking about. Did you read what was said about leap years? PHP handles them for you.
-
You can look into the GROUP BY WITH ROLLUP MySQL command, which will put an extra row at the end of your result set with the "grand total" of the other rows. -Dan
-
Call Public Function in Another Public Function
ManiacDan replied to unemployment's topic in PHP Coding Help
$this->get_primary_edge() -
Notice: Use of undefined constant variable - assumed 'variable' in ...
ManiacDan replied to erme's topic in PHP Coding Help
The manual section on Arrays will tell you everything you need to know about proper array syntax. Also, you were developing without error-reporting turned on before. Always turn it on and leave it on, otherwise one day you'll realize every single line of array access is wrong. -Dan -
Usually you can't. The "name" attribute is required for an input box inside a form. print_r($_POST); and see if it comes up. -Dan
-
Then name the input boxes adultFri[1] and adultFri[2] for adults 1 and 2. Then you'll have to: foreach ( $_POST['adultFri'] as $adultId => $value ) You could also name them: adult[Fri][1] ...and do a nested loop. -Dan
-
Agreed, don't use globals. Option 1 is most correct, but 3 is most common.
-
So that JOINs are faster. If the columns being used in a join are indexed, the rows are matched up faster because the database doesn't have to build a mini-index manually to support the join (in a manner of speaking)
-
If this query is inside a function then you need to pass the $connect variable into that function. Also, if you only have one database connection you can do away with $connect entirely, php will just use the open connection for everything. -Dan
-
I didn't bother reading your code, it's far too long. You would do this the exact same way you did it here for your search (note, I only read the first 4 lines of your code, one of which is wrong) - Make a PHP page that accepts $_GET['postcode'] - Have that page display the details for the post code - When you print the search results, make the post code into a link that goes to theNewPage.php?postcode=$thePostCode This is exactly what PHP is designed to do. What is confusing you about this?
-
A wordpress or drupal might be enough for you. A fire-and-forget CMS will have all the features you need for this sort of thing. They might not be fully sequestered into the own feeds, but I'm sure a module exists so that you can separate each user's posts into their own sections. Also, your application will NOT get 100,000 users in the first year. I don't care how good you think the idea is or how much you're going to spend on advertising. Twitter only had 1,200,000 TWEETS in the year after it was founded. Not users, posts.
-
Post to the Freelancing board with the amount you're willing to pay. This is a simple task, the reason we can't help you is because the content of your question kept changing and we never got access to the actual form.
-
Google does this by only selecting subsets of the data and by storing zoom versions which are calculated periodically. The rest of this post assumes your universe (like the real one) will be very sparsely populated. You will need a sparse matrix setup for one thing. You cannot create 40,000,000,000 empty data points, it just won't work. You will need a table for each zoom level. Start at the bottom. Make a table which contains X, Y, and VALUE (or whatever, I'm just summarizing for effect). Then make a table for the first "zoom out". Write a script that translates every 10x10 grid space on your board to a single pixel. If there is any data inside the range 0 < X < 10, 0 < Y < 10 then put a piece of data in for 1,1 in the first zoom level. Repeat until you have the entire zoom-out map made. Now, repeat this for enough zoom levels to be usable. You will end up with a map where each data point represents "do any of the 1,000,000 data points inside this point have any data at all?" Once you have that, you can print it very easily (as it will fit on a monitor). Now, once the user clicks on this map, figure out where he clicked (simple exercise left up to you) and where in the data he clicked, then load the next zoom level IN for where he clicked, centered around the pixel he clicked on. The pixel he clicked on will now be blown up to a 10x10 area of the next zoom level. Using the above method you'll have 1 "real" data table with X "interpreted" data tables above it representing all the possible zoom levels you support. The users can zoom in and out and even pan through the current zoom level without sacrificing performance. This is nearly exactly the way google maps works, except instead of a single VALUE point (or colored pixel) they obviously have full scale PNG images all knitted together. That's much more difficult, but it's the same theory. They use a lot more calculus to do this than I did. -Dan
-
The first time you posted the response you posted invalid XML. Data cannot exist outside a tag, you had data outside the tag. The second time (just now) you posted nearly the exact same document and yet now the data is magically back INSIDE the tag. Which is which? What is happening? Why does your output keep changing format?
-
As I suspected, that's not valid XML. There is no content in the id_costumer tag. Whatever produces this XML needs to be rewritten. You cannot use any XML parsing tools for this document, because it's not XML. I recommend regular expressions I guess.
-
You're printing a TD cell inside a TD cell.
-
Requinix posted two separate things: 1) PHP code to retrieve an XML document, parse it with simpleXML, and print the results. 2) The results of executing that PHP code. You were asked to copy and paste the first part and see if your results match the second part. You unfortunately do not know enough PHP to recognize the difference between valid code and debug output. It may be in your best interest to purchase a PHP book and work through it on your own until your proficiency is increased.
-
Use simplexml, like was stated above. It's not as easy as you think, you'll have to actually use quite a bit of PHP to get it to do what you want, but there are simplexml tutorials out there.