All that is necessary for evil to succeed is that good people do nothing! Support Act for America

php - Page 4 - Anarchist Cookbook
Anarchist Cookbook  

Go Back   Anarchist Cookbook > Anarchist Cookbook > Hacking > Programming
Connect with Facebook

Programming Got code?

Closed Thread
 
Thread Tools Search this Thread Display Modes
Old June 28th, 2009   #31
Palmer
Senior Member
Points: 4,560, Level: 28
Points: 4,560, Level: 28 Points: 4,560, Level: 28 Points: 4,560, Level: 28
Activity: 31%
Activity: 31% Activity: 31% Activity: 31%
 
Palmer's Avatar
 

Last Online: 6 Hours Ago 03:07 AM
Join Date: Feb 2009
Location: Florida
Posts: 1,367
Cash Credits: 17,181
Palmer RSS Feed
Send a message via AIM to Palmer Send a message via MSN to Palmer Send a message via Yahoo to Palmer Send a message via Skype™ to Palmer
That makes more sense, thanks for clarifying.
But trust me, i know what I'm talking about.
I already know that it exports it as (x)HTML and it's "server-side" etc.
I wouldn't have made this thread if I didn't know what php was.

Leezpo is just a douche bag for posting that, regardless. he still sucks ass for putting that on there and they are retarded for freaking out like "Oh noes my IP".

Anyways, who gives a fuck, on with the thread.

Quote:
<?php
$now = getdate(time());
$time = mktime(0,0,0, $now['mon'], 1, $now['year']);
$date = getdate($time);
$dayTotal = cal_days_in_month(0, $date['mon'], $date['year']);

print '<table><tr><td colspan="7"><strong>' . $date['month'] . '</strong></td></tr>';
for ($i = 0; $i < 6; $i++) {
print '<tr>';
for ($j = 1; $j <= 7; $j++) {
$dayNum = $j + $i*7 - $date['wday'];
//Print a cell with the day number in it. If it is today, highlight it.
print '<td';
if ($dayNum > 0 && $dayNum <= $dayTotal) {
print ($dayNum == $now['mday']) ? ' style="background: #ccc;">' : '>';
print $dayNum;
}
else {

print '>';
}
print '</td>';
}
print '</tr>';
if ($dayNum >= $dayTotal && $i != 6)
break;
}
print '</table>';
?>
Empty calendar pwn't. XD
(lame joke) =/
__________________
"Mein Ehre heißt Treue."
www.aftershockforums.com
Palmer is offline  
Old June 28th, 2009   #32
Twisted420
Member
Points: 2,347, Level: 19
Points: 2,347, Level: 19 Points: 2,347, Level: 19 Points: 2,347, Level: 19
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Twisted420's Avatar
 

Last Online: July 19th, 2009 06:16 AM
Join Date: Aug 2007
Location: Never, Neverland
Age: 20
Posts: 487
Cash Credits: 3,487
Twisted420 RSS Feed
A tip for you palmer, echo statments are faster than print. And instead of concatenating the different parts together, with echo, just use a comma to separate each one. It's much more efficient.

Also, whenever using for loops, if you are just incrementing or decrementing the value each time, increment the value before php reads it, like this: ++$i. Otherwise, when doing this: $i++, php must first read the value of $i, increment it, and the read it again. It's much more efficient to increment the value beforehand.

If someone has an idea of something they would like to see coded in PHP, let me know.

Last edited by Twisted420; June 28th, 2009 at 08:11 PM..
Twisted420 is offline  
Old June 29th, 2009   #33
Palmer
Senior Member
Points: 4,560, Level: 28
Points: 4,560, Level: 28 Points: 4,560, Level: 28 Points: 4,560, Level: 28
Activity: 31%
Activity: 31% Activity: 31% Activity: 31%
 
Palmer's Avatar
 

Last Online: 6 Hours Ago 03:07 AM
Join Date: Feb 2009
Location: Florida
Posts: 1,367
Cash Credits: 17,181
Palmer RSS Feed
Send a message via AIM to Palmer Send a message via MSN to Palmer Send a message via Yahoo to Palmer Send a message via Skype™ to Palmer
... FML.
Thanks for the tip..?
I'll have to work on that then. =/
__________________
"Mein Ehre heißt Treue."
www.aftershockforums.com
Palmer is offline  
Old June 30th, 2009   #34
DoG MikkyW
Senior Member
Points: 4,347, Level: 27
Points: 4,347, Level: 27 Points: 4,347, Level: 27 Points: 4,347, Level: 27
Activity: 3%
Activity: 3% Activity: 3% Activity: 3%
 
DoG MikkyW's Avatar
 

Last Online: 2 Days Ago 02:53 PM
Join Date: Mar 2008
Location: Florida
Age: 21
Posts: 1,228
Cash Credits: 18,023
DoG MikkyW RSS Feed
Send a message via ICQ to DoG MikkyW Send a message via AIM to DoG MikkyW Send a message via MSN to DoG MikkyW Send a message via Yahoo to DoG MikkyW
That's cool. I always wondered why Rik told me to put the increments before the var. Thanks!
DoG MikkyW is offline  
Old July 2nd, 2009   #35
Twisted420
Member
Points: 2,347, Level: 19
Points: 2,347, Level: 19 Points: 2,347, Level: 19 Points: 2,347, Level: 19
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Twisted420's Avatar
 

Last Online: July 19th, 2009 06:16 AM
Join Date: Aug 2007
Location: Never, Neverland
Age: 20
Posts: 487
Cash Credits: 3,487
Twisted420 RSS Feed
Come on people, nobody has anything PHP related they want to share? You people are no fun.
Twisted420 is offline  
Old July 2nd, 2009   #36
Xon
Senior Member
Points: 15,961, Level: 54
Points: 15,961, Level: 54 Points: 15,961, Level: 54 Points: 15,961, Level: 54
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Xon's Avatar
 

Last Online: 17 Hours Ago 04:17 PM
Join Date: Nov 2008
Location: In the blackness of my mind
Posts: 5,865
Cash Credits: 53,594
Xon RSS Feed
Send a message via ICQ to Xon Send a message via AIM to Xon Send a message via MSN to Xon Send a message via Yahoo to Xon
? What do you mean good sir?
__________________
Another Fucking Fail Thread and thanks for playing
HackServer.org
Xon is offline  
Old July 3rd, 2009   #37
DoG MikkyW
Senior Member
Points: 4,347, Level: 27
Points: 4,347, Level: 27 Points: 4,347, Level: 27 Points: 4,347, Level: 27
Activity: 3%
Activity: 3% Activity: 3% Activity: 3%
 
DoG MikkyW's Avatar
 

Last Online: 2 Days Ago 02:53 PM
Join Date: Mar 2008
Location: Florida
Age: 21
Posts: 1,228
Cash Credits: 18,023
DoG MikkyW RSS Feed
Send a message via ICQ to DoG MikkyW Send a message via AIM to DoG MikkyW Send a message via MSN to DoG MikkyW Send a message via Yahoo to DoG MikkyW
I honestly don't know PHP. I'm going to start learning it this August.
DoG MikkyW is offline  
Old July 3rd, 2009   #38
Xon
Senior Member
Points: 15,961, Level: 54
Points: 15,961, Level: 54 Points: 15,961, Level: 54 Points: 15,961, Level: 54
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Xon's Avatar
 

Last Online: 17 Hours Ago 04:17 PM
Join Date: Nov 2008
Location: In the blackness of my mind
Posts: 5,865
Cash Credits: 53,594
Xon RSS Feed
Send a message via ICQ to Xon Send a message via AIM to Xon Send a message via MSN to Xon Send a message via Yahoo to Xon
Really? I don't know much, but enough to mess with scripts and such needed for editing forums and crap.
__________________
Another Fucking Fail Thread and thanks for playing
HackServer.org
Xon is offline  
Old July 3rd, 2009   #39
Palmer
Senior Member
Points: 4,560, Level: 28
Points: 4,560, Level: 28 Points: 4,560, Level: 28 Points: 4,560, Level: 28
Activity: 31%
Activity: 31% Activity: 31% Activity: 31%
 
Palmer's Avatar
 

Last Online: 6 Hours Ago 03:07 AM
Join Date: Feb 2009
Location: Florida
Posts: 1,367
Cash Credits: 17,181
Palmer RSS Feed
Send a message via AIM to Palmer Send a message via MSN to Palmer Send a message via Yahoo to Palmer Send a message via Skype™ to Palmer
Yeah, you guys are lame, post more PHP. lol. =p
__________________
"Mein Ehre heißt Treue."
www.aftershockforums.com
Palmer is offline  
Old July 3rd, 2009   #40
Xon
Senior Member
Points: 15,961, Level: 54
Points: 15,961, Level: 54 Points: 15,961, Level: 54 Points: 15,961, Level: 54
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Xon's Avatar
 

Last Online: 17 Hours Ago 04:17 PM
Join Date: Nov 2008
Location: In the blackness of my mind
Posts: 5,865
Cash Credits: 53,594
Xon RSS Feed
Send a message via ICQ to Xon Send a message via AIM to Xon Send a message via MSN to Xon Send a message via Yahoo to Xon
Hey palmer, any good with templates and shit?
__________________
Another Fucking Fail Thread and thanks for playing
HackServer.org
Xon is offline  
Closed Thread

Tags
php


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:26 AM.


Powered by Anarchy and vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios