oni-kun
Members-
Posts
1,984 -
Joined
-
Last visited
-
Days Won
1
Everything posted by oni-kun
-
How do I make stuff like <!-- IF --> or <!-- ENDIF -->
oni-kun replied to Ruko's topic in PHP Coding Help
Those are called SSI's, Or Server Side Includes and do not relate in sense to PHP unfortunately. -
Vim can. There's a few useful highlighters here: http://www.andre-simon.de/ http://tohtml.com/ It should generate indentation/proper highlighting for many languages, Which is what you want. I'm sure google can find many more.
-
It's fairly obvious, The variable $username does not exist. Why not fix that first?
-
What is the exact error you are getting?
-
Ironically: https://www.google.com/adsense/login/en_US/ This works on Chrome (Linux), But does not work in any way on Firefox (Same as your screenshot). I had to use a proxy to get the stylesheet to work, I thought I was the only one!. This could remain a huge problem for many people who will not know how to get around this... They seemed to have done "Maintainance" according to their blog: http://adsense.blogspot.com/ But that was on the tenth. This problem has been for me, for atleast a month.
-
Indexes don't populate themselves. You should be aware of how to handle them if they're not set, especially if they are modified by the users themselves. if (isset($_GET['id'])) { $id = (int)$_GET['id']; } else { $id = 1; //Default, for example. }
-
I really want to punch Justin Bieber in the face!
oni-kun replied to Orionsbelter's topic in Miscellaneous
I was at the pharmacy of my local supermarket, while waiting for my prescription all the magazines at a table were of him. My god. It was funny 80% of the content was "His mom is still boss," and goes on about him not eating right or things. I pray this blows over soon, I do not want to hear of it in the news when I wake up. -
The accessable session is just a superglobal array. You can access it like so: session_start(); $_SESSION['key'] = $value; $_SESSION[1][2] = "Value"; If you're calling session_start() (thus starting the session) it will send a cookie to the user with the PHP Session ID. Using cookies is very much the same thing, but is obviously prone to being viewed by users, so it is best to store information in sessions that should be used in-application, such as data retrieved/or to be sent to the database. Cookies or sessions are just your preferrence.
-
Formatting and tags would help for reference.. Why are you applying base64_encode over urlencode?
-
Notice his using of FOREACH, A FOR loop with an iterator would consume much more memory per iteration.
-
It shouldn't be hard at all. $i = 0; while($i<32) { unset($file[$i]); $i++; } I'm using a while loop as you see, since it uses less memory than a for loop.
-
Ah. Maybe a similar field to go along with it. If you have attendances per say, As TINYINT then you can get their total attendence without any thing special. Reasons can simply become another field as an index of reasons, As that type as signed will allow up to 128 types of reasons.
-
I always wondered what these warning signs meant
oni-kun replied to oni-kun's topic in Miscellaneous
-
Why not set the attendence to TINYINT to be false or true, But false default? A list of students (populated from database) and checkmarks can be easily generated, each chechbox can be an array (IE: attended[])
-
Depends what you're voting for. I can always set up a script to vote every x amount of minutes. Hell.... You could parse portion of PHP as an image (IE a pixel on the screen), and if it is in cache it could stop the ability to post (end the session,etc). I don't think someone would ever even think of an image allowing/disallowing the script.
-
Are you serious? If you want to have "file.php/hello" You'll need to use mod_rewrite which will require the $_GET anyway.
-
http://www.safenow.org/ I never knew
-
It's simple, Matches are stored in an array; so you could do this. $address = "494 Main, Brook, NC, 19076"; $valid = "/((\d+)\s+(\w+)),\s+(\w+),\s+([A-Z]{2,5}),\s+(\d{5})/"; if ( preg_match( $valid, $address, $matches ) == 1 ) { print "Street: ${matches[1]}<br />"; print "Street number: ${matches[2]}<br />"; print "Street name: ${matches[3]}<br />"; print "City: ${matches[4]}<br />"; print "State: ${matches[5]}<br />"; print "Zip: ${matches[6]}<br />"; }
-
The rest isn't too hard, Here: "/((\d+)\s+(\w+)),\s+(\w+),\s+([A-Z]{2,3}),\s+(\d{5})/" Note the ranges, so it will conform to your length rules.
-
if(preg_match("~Mozilla/[^ ]+ \((iPhone|iPod); U; CPU [^;]+ Mac OS X; [^)]+\) AppleWebKit/[^ ]+ \(KHTML, like Gecko\) Version/[^ ]+ Mobile/[^ ]+ Safari/[^ ]+~",$ua ,$match)) { $DEVICE_TYPE="MOBILE"; } elseif(stristr($ua,'iphone') or stristr($ua,'ipod')){ $DEVICE_TYPE="MOBILE"; } That should handle all iPhone/iPod Touch related platforms. Your code is very unstructured though, I'd recommend you brush up on IF/CASE statements and formatting.
-
You could read the documentation: http://code.google.com/apis/chart/docs/making_charts.html But here are a few examples: http://psychopyko.com/tutorial/how-to-use-google-charts/ http://charts.hohli.com/ (Some sort of generator)
-
Very true, but as TeamAtomic suggested registration is the only tried and true method. You could simply disallow a subrange of an IP to vote for, say, 5 minutes. It would only affect the small amount of AOL customers, and there's no way someone would wait 200 minutes to vote 40 times.
-
PHP4 host but PHP5 code, don't know what to do?
oni-kun replied to budder's topic in PHP Coding Help
Actually Notepad++ does follow the current indentation. The indentation you gave as an example, is... Should we say, superfluous. I don't think you need 300 whitespace characters per page of code for help. -
Why not look at the PayPal documentation? Your question does not make very much sense, unfortunately.