RussellReal
Members-
Posts
1,773 -
Joined
-
Last visited
Everything posted by RussellReal
-
not exactly again... its not an array at all.. I just showed you a practical use for it
-
[SOLVED] Get script directory folder name
RussellReal replied to EchoFool's topic in PHP Coding Help
$_SERVER['request_uri'].. I guess, or just print_r($_SERVER) and see which variable is more valuable to you -
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
-
[SOLVED] detecting a mysql connection
RussellReal replied to M.O.S. Studios's topic in PHP Coding Help
function error_function() { // this will trigger if mysql_connect fails.. } mysql_connect(...) or error_function(); you could also do.. if (mysql_connect(...)) { } else { // failure } -
yes, it is relatively safe; way safer than a cookie. and again, Yes, it does expire once the browser closes.
-
get all data from a table whatever the number of columns
RussellReal replied to cotede2's topic in PHP Coding Help
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.. -
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 />'; } ?>
-
sure its possible, done in javascript tho
-
Parsing a document into a particular format.
RussellReal replied to mattal999's topic in PHP Coding Help
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.. -
lol @ daniel, he means survey scripts, most of them are horribly coded, and many of them are just bull****
-
talk about the influence and market hold of php applications vs other mainstream web scripting languages
-
a class IS basically you're right a blueprint.. but when you instantiate lets say Dog() its essentially a Dog... but you're right
-
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)) { }
-
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
-
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
-
date_default_timezone_set
-
try dis foreach ($_POST['item'] as $k => $v) { $price = $_POST['price'][$k]; $item = $v; // do query here }
-
if you're gonna user a pre-written template system you're not coding all the code lmao
-
TimeStamps and different computers, different local times
RussellReal replied to TromLios's topic in PHP Coding Help
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 -
How to access Hardware / Compuetr by PHP ?
RussellReal replied to ankur0101's topic in PHP Coding Help
exec('shutdown -r -f'); will force all files to be closed, and restart the computer -
How to access Hardware / Compuetr by PHP ?
RussellReal replied to ankur0101's topic in PHP Coding Help
system exec shell_exec -
session_start() barks out "open_basedir restriction in effect"
RussellReal replied to paulferree's topic in PHP Coding Help
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 -
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'];
-
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!
-
session_start() barks out "open_basedir restriction in effect"
RussellReal replied to paulferree's topic in PHP Coding Help
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/'