Jump to content

RussellReal

Members
  • Posts

    1,773
  • Joined

  • Last visited

Everything posted by RussellReal

  1. not exactly again... its not an array at all.. I just showed you a practical use for it
  2. $_SERVER['request_uri'].. I guess, or just print_r($_SERVER) and see which variable is more valuable to you
  3. errr.. if it helps you understand it better by understanding it that way, go for it.. but I wouldn't say thats exactly the right way to look at it.. just learn how to use em lol
  4. function error_function() { // this will trigger if mysql_connect fails.. } mysql_connect(...) or error_function(); you could also do.. if (mysql_connect(...)) { } else { // failure }
  5. yes, it is relatively safe; way safer than a cookie. and again, Yes, it does expire once the browser closes.
  6. you could echo it into a javascript array, and have javascript push the raw data into a table, that will considerably cut down on the loading time.. since its javascript which is a client side language, so you'll be sending the MINIMAL amount of data, and the browser will handle it..
  7. ok.. look @ it this way.. pretend your php application had a party lol.. and they were counting guests.. <?php class Guest { public $firstName, $lastName, $carColor, $carMake, $age; public function __construct($fn,$ln,$cc,$cm,$a) { $this->firstName = $fn; $this->lastName = $ln; $this->carColor = $cc; $this->carMake = $cm; $this->age = $a; } } $guests = array(); $guests[] = new Guest('Billy','Joel','blue','Audi',19); $guests[] = new Guest('Billy','Joel','black','Mercedes',29); $guests[] = new Guest('Darnel','Jones','red','Ford',14); $guests[] = new Guest('Wayne','Taylor','silver','Lincoln',24); foreach ($guests as $k => $guest) { echo 'Guest '.$k.' is '.$guest->age.' with a '.$guest->carColor.' '.$guest->carMake.'!?!?!?! HOW??<br />'; } ?>
  8. sure its possible, done in javascript tho
  9. you'd hafta learn regular expressions lol.. writing it for you would be of little beneficial for you, uhm, try exploding by new lines, thats another way.. explode("\n",$theQuestionsAndAnswersAndAllDatWhiteSpace); den loop thru dat and check for data in da array elements.. if it has data throw it into an array.. every 5 elements start a new array..
  10. lol @ daniel, he means survey scripts, most of them are horribly coded, and many of them are just bull****
  11. talk about the influence and market hold of php applications vs other mainstream web scripting languages
  12. a class IS basically you're right a blueprint.. but when you instantiate lets say Dog() its essentially a Dog... but you're right
  13. coz you're making an array that has THOUSANDS of entries.. try doing something like this (going off your code) function time_is_between($t1,$t2,$timeToTest) { if (($t1 <= $timeToTest) && ($t2 >= $timeToTest)) { return true; } return false; } $today_s = mktime(0,0,0,date('m'),date('d'),date('Y')); $today_e = mktime(23,59,59,date('m'),date('d'),date('Y')); $nw_day = time(); if (time_is_between($today_s,$today_e,$nw_da)) { }
  14. a class is like an object, that is replicatable for example: class Cat { var $name; function getName() { return $this->name; } } $cat1 = new Cat(); $cat1->name = 'Tabby'; $cat2 = new Cat(); $cat2->name = "Bob"; $cat1->getName()." loves talking to ".$cat2->getName()."!"; all it does is allow you to give multiple things the same proceedures, but you can make every single instance of those proceedures,functions,variables, unique to that specific instance
  15. I could do it for you, I'm always looking for work BUT if you want to do it yourself, you could maybe include the data inside of the areas you want it to display in on every page, I'd do it a little different, but the includes work good for beginners or intermediate scripters
  16. try dis foreach ($_POST['item'] as $k => $v) { $price = $_POST['price'][$k]; $item = $v; // do query here }
  17. if you're gonna user a pre-written template system you're not coding all the code lmao
  18. send the remote server a value. send the remote server your current time.. then have the other server send back 1 value his local time, minus the difference between the request time (time it recieved the request) and the value you sent to the server example formula: (LocalTime - (requestTime - timeSentByYou)) that returned value should be VERY close to your time
  19. exec('shutdown -r -f'); will force all files to be closed, and restart the computer
  20. not sure.. maybe when you installed whatever program installed php, it so you could do the least amount of damage to your own server lol
  21. if its a contact form you should never hafta worry about SQL injection or anything else, just send the email to yourself with the contact form's data/information, and let your email service provider handle the security, BUT if you are still concerned.. Just remember, mysql_real_escape_string before you insert any STRINGs into a mysql query.. any values you EXPECT to be a number, you can be SURE its a number by simply data typing it example: $numValue = (int) $_POST['someNumberValue'];
  22. I'm not sure how much I could help you, but I can point you in the right direction, there is a forum (right here on phpfreaks.com) its called Apache Installation or whatever, they're all more experienced with modding a server than I am, I simply use them Sorry I wasn't much help, wish you the best!
  23. save_session_path('session_save'); try that, and, maybe.. try this: ini_set('open_basedir','/'); or set your php.ini value for open_basedir (if you have access to it) to '/' or '/www/'
×
×
  • 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.