
ksugihara
Members-
Posts
43 -
Joined
-
Last visited
Never
Everything posted by ksugihara
-
Ahh ok. I guess the triple colon was also considered for Late Static Bindings, which i completely dont understand (but thats a different thread)
-
Nope. still in the works.
-
I heard that PHP6 will be implementing the 3 colons operator... does anyone know what it does?
-
Parent class accessing properties of a child class
ksugihara replied to 5kyy8lu3's topic in PHP Coding Help
<?php b::showTest(); class A { var $Test = 1; } class b extends A { static public function showTest(){ $class = new A(); echo $class->Test; } } ?> -
more info please. think; if you were answering this question, what would you need? and then give me that!
-
i assume there will be some clicking somewhere on the page, as you said you'd like to pass variables based on a user clicking a button. <form name="passing vars" method="post"> <input type="hidden" value="variable" /> <input type="hidden" value="variable2" /> <input type="button" value="Continue on without filling out any of the HIDDEN fields cause im pr0" /> </form> You are correct. It requires a form. but not one that the user can fill out.
-
thats a gallery... arent you just looking for a poll?
-
$_POST
-
Parent class accessing properties of a child class
ksugihara replied to 5kyy8lu3's topic in PHP Coding Help
Sure there is. You can call properties in the same way you would call an non-instatiated method. The real key to the example I gate was: b::isThisTrue You can call that from outside the class, or from other classes, as long as the property is public. -
well, its tough to say from here what they are doing... have you looked into any of PHP's array shuffling functions? you could implement it yourself?
-
are there any tables that can be compared? you atleast need one. whether the username always be the same, or adding a field specifically for that manner, you need atleast one table where you can compare.
-
it looks like preferenceID and my_networkID are both autoincrement, and assuming that the only time one row will be inserted into one table is when it is also inserted into the other, you could pull the info out by that. SELECT * FROM preferences WHERE my_network.id = $id AND preferences.preferenceID = $id I think theres a more efficient way to do that, but Im not to savvy with join statements.
-
mysql results are returned as an array... So this table: Users Firstname Lastname ksugihara k sugihara fr34k php freak Would look like this: array ('Users' => array('ksugihara', 'fr34k'), 'Firstname' => array('k', 'php'), 'Lastname' => array('sugihara', 'freak')) So you would need to pull out those variables... but not like a normal array.. its weird. See mysql_fetch_assoc
-
Yeah that does kinda suck... That might not be the issue, I was just asking if you did put that anywhere. You should really explore alternative scripts... this one does not appear to escape variables, or take any security precautions....
-
Do you actually know PHP? I guess more specifically, Im asking, are you looking for guidance as to getting this working, or are you looking for someone to make it work for you?
-
I suggest AJAX or JQuery. You will find dozens of awesome tutorials if you look on Google for it.
-
Ahhh alright. why populate the link w/ javascript? why not populate it with php? it seems like populating w/ javascript would not be so great.
-
$date = date("Y-m-d"); $sevenDays = addTime($date, "next week"); better?
-
you said it isnt working for you, and its working for others. So what are you seeing when you run the script. i.e. what does it produce. And what are you seeing when you run the other peoples script. This is what I mean by your result vs the others results.
-
filter results based on varying number of URL parameters
ksugihara replied to adambedford's topic in PHP Coding Help
Hmm.... Well it wouldnt be EASY, persay. And I am not going to write all the code for you... so heres some psuedo code <?php $i = 0; //Account for your vars, and generate the basic MySQL query w/ LIKE statements foreach($_GET as $a => $b) { filter = $a; value = $b; $query[$i] = "SELECT * FROM table WHERE $a LIKE $b"; $i++; } //construct your query peices $array_vals = count($query); $mysqlquery = $query[0]; for($j=1; $j <= $array_vals; $j++) { $query .= "UNION " . $query[$j]; } ?> I wont promise its the most efficient way, but it should more or less work. -
The application would not be able to figure out whether he has passed or failed until you evaluate it. This is one of the downfalls to linear programming.
-
I disagree about where the issue lies. Does span happen to have any properties in the CSS file? I believe this is a CSS issue, not a javascript. Infact, I cant even see where javascript comes into play....
-
So write your own function. <?php $sevenDays = addTime(date("Y-m-d"), "next week"); echo $sevenDays; function addTime($date, $time) { $date = explode('-', $date); $day = $date[2]; switch($time) { case "next week": $timeAdvance = 7; break; case "tomorrow": $timeAdvance = 1; break; } $futureDate = $day + $timeAdvance; $futureDate = $date[0] . "-" . $date[1] . "-" . $futureDate; return($futureDate); } ?>
-
Parent class accessing properties of a child class
ksugihara replied to 5kyy8lu3's topic in PHP Coding Help
Hopefully this helps a bit... <?php $class = new A(); $class->testIt(); b::testing2(); class A { public function testIt() { if(1 == b::isItTrue) { echo "yes!"; } else { echo "no!"; } } } class b extends A { const isItTrue = 1; static public function testing2() { echo "Envoked a non-instantiated static method!<br />"; } } ?>