Jump to content

Adam

Moderators
  • Posts

    5,717
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by Adam

  1. Are you asking for pre-written software that will track usage and report statistics back, or how to encode/send the data to your server yourself? Sorry I'm just a little unclear on what you're asking for.. FYI - JSON is actually very simple. All it is a data structure that, due to it being in plain-text, is easily interchangeable between machines. The only thing you really need to learn is the syntax, but as the name suggests (JavaScript Object Notation) JavaScript is already able to read it, and PHP has built-in functions to parse/encode it.
  2. Adam

    Array

    If you have any knowledge of regex you may be comfortable with a solution like: The characters in red are where you'd need to expand the code (with a pipe character delimiter between them) if you wanted to expand it to remove more characters in future -- the plus is a special character so it must be escaped first with a backslash.
  3. Yeah just store each check box in a child array: <select name="test[set1][]" multiple="multiple">options here</select> <select name="test[set2][]" multiple="multiple">options here</select>
  4. In the world? You're probably going to have to pay for something like that; especially if you want it kept up to date.
  5. If you want to store 3 digits (assuming up to 999) you'd need to use a smallint, as the max. value for an unsigned tinyint is 255. The manual explains it all: http://dev.mysql.com/doc/refman/5.0/en/numeric-types.html
  6. That's not really spoofing your IP though, and you still have the same kind of problems using a proxy. There's security risks if that's what your original worry was over revealing your IP, or if it's just to keep yourself anonymous from the server for whatever reason the proxy you use has your IP address.
  7. Okay well looking at the code I'm going to guess that 1 or more of the paths you're trying to create don't have parent directories. Try passing the recursive parameter to mkdir and see if that fixes the problem.
  8. Why exactly do you want to hide your server's details? There's plenty of information about each function - with examples - in the manual. Although you're not going to be able to spoof the IP address with cURL..
  9. The server's - however if you're using cURL you can pass your own user agent: curl_setopt($ch, CURLOPT_USERAGENT, 'user agent here');
  10. Could you post more information about the actual data (echo it out) you're passing to the functions, and the errors you're getting..?
  11. Adam

    Oracle

    Xe is the express edition, though I stand corrected about the combined Oracle / web hosting packages they have. Can't seem to see the £6 package you have? Does that include VAT?
  12. Adam

    Oracle

    Oracle database hosting, or web hosting with some kind of Oracle integration? If it's the latter you're unlikely to find it. Oracle charge for a license to use it so you're unlikely to find a web host willing to go through the trouble of providing both, plus they're both kind of specialist areas. You can however get shared Oracle database hosting; though I can't recommend any in-particular as at work we house our own servers. I guess it depends upon how much usage it will receive as to whether it's actually worth paying for your own dedicated server and license? Also what are your requirements from Oracle (and why Oracle)? They do offer an 'express edition', but the features are a lot lacking in comparison to the paid version... of course.
  13. Within the loop just store the result into an array: $result = array(); while($row = mysql_fetch_array($get_x)) { $result[] = $row; }
  14. Or.. $month = date('Y-m', strtotime('+ 3 months', strtotime('2010-01-31'))); Of course I just realised in your first example, the date returned is correct. There's no 31st of February so it's carried on to the next month; unfortunately this is the behaviour of strtottime().
  15. You want to get the year and month in 3 months time? $month = date('Y-m', strtotime('+ 3 months'));
  16. You need to add the enctype attribute to your form with the value multipart/form-data in order to upload files: <form action="<?php $_SERVER['PHP_SELF']; ?>" method="post" enctype="multipart/form-data">
  17. That's happening because the parameters tell the code to do that. To stop that behaviour you need to redirect back to the cart page without the parameters.
  18. Yeah, pretty easily with the GD library. There'll be plenty of information about on how to keep the aspect ratio too.
  19. At a guess, you're trying to touch a new file that's within a directory that doesn't exist.
  20. .. and your question?
  21. You wouldn't actually create a new page as such. Basically once you have the data stored, you'd pass some type of unique identifier (normally an ID) through the URL parameters. Within the code you'd read this ID, perform the database query to return the associated data and then display it, or a fitting "page cannot be found" error message if not found of course.
  22. As I mentioned before you need to place the code within the constructor of your class, outside of methods you can only declare properties: class jobs extends generic_module { public function __construct() { $root = $_SERVER['DOCUMENT_ROOT']; require_once( $root . "/classes/config.php" ); require_once( $root . "/classes/mysql.php" ); $mysql = new mysql(); $mysql->connect(); $query = 'SELECT * FROM Company WHERE `jobs` = 1'; $results = $mysql->query( $query ) or die( mysql_error() ); while( $row = mysql_fetch_array( $results ) ) { var $allowed = $row["company_id"]; } } } One thing to note is that any variables defined not as class properties (i.e. $foo instead of $this->foo) will only be created as local variables in the constructor. That means from other methods you won't be able to access them. If that doesn't make much sense I'd read up on variable scope before you continue.
  23. .. on the same line or throughout the string?
  24. It doesn't work like that. Since you're including the file into index.php, the anchor passed into the original URL applies to any of the included content as well; there's no need to pass it into the files.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.