Jump to content

phpSensei

Members
  • Posts

    2,838
  • Joined

  • Last visited

    Never

Everything posted by phpSensei

  1. lol the PHPfreaks staff are really going at it!
  2. use the in_array function I dont know what you mean push 1 column to the right.
  3. this good or bad coder stuff has become pretty damn annoying. You either CODE something that works properly and can handle itself under most circumstances or it doesn't. I see alot of overkill in most object oriented programing nowadays because all the big guys do it so I have to do it too... most people don't even know why they use OOP, they believe its a whole different language. Wether its echo "Hello World" or $systemlewkrlssomecrazyasssunnecessarylineofcodeWEfkefewr=ewr->println($systehm->output(new string("Hello World")));
  4. I dont get it, your taking a value grabbed from an Array ($qarray2) and then for looping it or does it contain another array?
  5. Speaking of people we need to ban.... lol he/she ? took my joke so seriously, Premiso, chill. And if it was your home longer, you would have a "i can haz cool title?" under your username
  6. If anyone posts stupid crap, I will personally beat the crap out of you. This place has been my home for a while, you better not ruin it.. *erm* KingPhillip.
  7. You have to properly escape the string, use mysql_real_escape_string
  8. $sample= array( 'first' => array( 'first1' => 1, 'first2' => 2, 'first3' => 3, 'first4' => 4 ), 'second' => array( 'second1' => 1, 'second2' => 2, 'second3' => 3, 'second4' => 4 )); write_ini_file($sample, 'config.ini', true);
  9. Does some have any ideas? well, since you have named array keys, you must access them by their name, using integers will not work, if your array keys were the default integers, then your code would work. If i used a name i.e. echo $val['ID'] by getting the results of the array it wont echo any results... Im just curios where did it went wrong.. because $val isn't defined in your code. You Mean $keyws in your case
  10. From the Documentation: function write_ini_file($assoc_arr, $path, $has_sections=FALSE) { $content = ""; if ($has_sections) { foreach ($assoc_arr as $key=>$elem) { $content .= "[".$key."]\n"; foreach ($elem as $key2=>$elem2) { if(is_array($elem2)) { for($i=0;$i<count($elem2);$i++) { $content .= $key2."[] = \"".$elem2[$i]."\"\n"; } } else if($elem2=="") $content .= $key2." = \n"; else $content .= $key2." = \"".$elem2."\"\n"; } } } else { foreach ($assoc_arr as $key=>$elem) { if(is_array($elem)) { for($i=0;$i<count($elem);$i++) { $content .= $key2."[] = \"".$elem[$i]."\"\n"; } } else if($elem=="") $content .= $key2." = \n"; else $content .= $key2." = \"".$elem."\"\n"; } } if (!$handle = fopen($path, 'w')) { return false; } if (!fwrite($handle, $content)) { return false; } fclose($handle); return true; }
  11. copy($_FILES['Filedata']['tmp_name'], $uploadFile); I ment that line of Code. Move_uploaded_file is a safer option as it requires the file to be a valid HTTP POST upload.
  12. if your uploading files, and im assuming you mean through HTTP POST then use move_uploaded_file()
  13. http://arsenalgraphics.com/clock.php See how i implemented. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <script> function countdown_clock(year, month, day, hour, minute, format) { //I chose a div as the container for the timer, but //it can be an input tag inside a form, or anything //who's displayed content can be changed through //client-side scripting. html_code = '<div id="countdown"></div>'; document.write(html_code); Today = new Date(); Todays_Year = Today.getFullYear() - 2000; Todays_Month = Today.getMonth(); <?php $date = getdate(); $second = $date["seconds"]; $minute = $date["minutes"]; $hour = $date["hours"]; $day = $date["mday"]; $month = $date["mon"]; $month_name = $date["month"]; $year = $date["year"]; ?> //Computes the time difference between the client computer and the server. Server_Date = (new Date(<?= $year - 2000 ?>, <?= $month ?>, <?= $day ?>, <?= $hour ?>, <?= $minute ?>, <?= $second ?>)).getTime(); Todays_Date = (new Date(Todays_Year, Todays_Month, Today.getDate(), Today.getHours(), Today.getMinutes(), Today.getSeconds())).getTime(); countdown(year, month, day, hour, minute, (Todays_Date - Server_Date), format); } function countdown(year, month, day, hour, minute, time_difference, format) { Today = new Date(); Todays_Year = Today.getFullYear() - 2000; Todays_Month = Today.getMonth(); //Convert today's date and the target date into miliseconds. Todays_Date = (new Date(Todays_Year, Todays_Month, Today.getDate(), Today.getHours(), Today.getMinutes(), Today.getSeconds())).getTime(); Target_Date = (new Date(year, month, day, hour, minute, 00)).getTime(); //Find their difference, and convert that into seconds. //Taking into account the time differential between the client computer and the server. Time_Left = Math.round((Target_Date - Todays_Date + time_difference) / 1000); if(Time_Left < 0) Time_Left = 0; switch(format) { case 0: //The simplest way to display the time left. document.all.countdown.innerHTML = Time_Left + ' seconds'; break; case 1: //More datailed. days = Math.floor(Time_Left / (60 * 60 * 24)); Time_Left %= (60 * 60 * 24); hours = Math.floor(Time_Left / (60 * 60)); Time_Left %= (60 * 60); minutes = Math.floor(Time_Left / 60); Time_Left %= 60; seconds = Time_Left; dps = 's'; hps = 's'; mps = 's'; sps = 's'; //ps is short for plural suffix. if(days == 1) dps =''; if(hours == 1) hps =''; if(minutes == 1) mps =''; if(seconds == 1) sps =''; document.all.countdown.innerHTML = days + ' day' + dps + ' '; document.all.countdown.innerHTML += hours + ' hour' + hps + ' '; document.all.countdown.innerHTML += minutes + ' minute' + mps + ' and '; document.all.countdown.innerHTML += seconds + ' second' + sps; break; default: document.all.countdown.innerHTML = Time_Left + ' seconds'; } //Recursive call, keeps the clock ticking. setTimeout('countdown(' + year + ',' + month + ',' + day + ',' + hour + ',' + minute + ',' + time_difference + ', ' + format + ');', 1000); } </script> </head> <body> <script> countdown_clock(12, 12, 25, 00, 00, 1); </script> </body> </html> <body> <script> countdown_clock(12, 12, 25, 00, 00, 1); </script> </body>
  14. This error occurs for the following reasons: 1. Wrong credentials 2. Wrong Endpoint 3. not used urlencode 4. Sometime wrong date formate.
  15. echo="$results I think the equal operator is the problem? Parse error: syntax error, unexpected '=' on line 38
  16. The $data variable is defined outside of the class scope.
  17. UPDATE table1,table2 SET table1.col=a,table2.col2=b WHERE items.id=month.id; This is more of a mysql question, it shouldn't be posted here, your query is all wrong. You can even use a JOIN statement.
  18. I believe I am allowed to have any software I want installed, all I need to do is call them and have it setup... Thanks Little Guy, I never thought of that. Cheers
  19. It plays a big role actually, Theres 6 judges, 3 for design and the other 3 for the coding.... tell me about it ... :'(
  20. Thank You Zane, I can't use books or notes on anything during the competition itself, but as you know I am limited to internet access the whole way there, so having all the manuals will be a big help. I has American friends ! I think this would really help me take it a step further with the mobile site feature, Its things like these that really do bring the WOW factor to the competition. Thanks, I believe this will something I will add this more towards the end of the competition, I will try and break down my Overall work into different steps, and try to get atleast 1 whole day for extra cool stuff to add.
  21. Hello Everyone, I have been super absent from PHPfreaks, but I do come back with great news. I will be competing in Leipzig (Germany) at the Skills World Competition 2012, even though the timing is early and its not for another year, Team Canada is starting to get prepared now. I spoke with the President of Media at my college and they gathered some tutors, experts, and setup classes to get me ready. However I think the best place to train would be here since this is where I originally started my journey and thanks to everyone here I was successful at the Canadian Level. The World's Competition will be hard, I will have to go against the best Post-Secondary (college/university) students from around the World to win the title. I havn't heard much of what the competition will present this year but I know its going to be 2 weeks of stay at Leipzig, Germany. Since I received so much support the first time including everyone from here, I thought I would make a thread to get as much advise, wisdom, and intel as possible to get me ready. I know that they are asking for a complete CMS system from scratch that implements Templates and such. Also for the competition we will have 0 resources, meaning its completely from scratch, I think we get 5 min internet access on separate computer. Opening Ceremony for 2009 Wish me all the best, pray for me, this is where my journey begins to the Worlds, so please don't hesitate to give me any advise or knowledge you possible have, anything would help.Also if anyone has been to that city in Germany, give me some info on that too, would very much appreciate it. edit: sorry for not replying the PMs, I have been very busy with me and my designers new Company with recently started, here's the logo btw, I removed the name because of the rules... http://a6.sphotos.ak.fbcdn.net/hphotos-ak-ash4/309290_10150323926415073_566765072_8274644_660494608_n.jpg (let me know what you think)
×
×
  • 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.