Learning PHP

Posted by Kaz on Aug. 10, 2006, 6:45 p.m.

So Im learning PHP and eventually will be moving my site. FGFK is designing it and hes teaching me some PHP since he forgot most of it. So does anyone have any good PHP resources I could use? Ive been using php.net so far.

I got my school schedule today.

1, 1st sem-College(Intro to comp logic,lol)

1, 2nd sem-C++ programming

2-Intro to comp(C++)

3-PE

4-Lit+physche

5-Gov

6-Lunch

7,8,9-Forgot

But this is very, very bad.

1.I couldnt fit pre-calc since it was only 1st period.

2.I have 6 study halls. SIX! I hate study hall so Im gonna take more classes and not be bored. Hell I might actually make it to 40 credits once I graduate =P I have Like 30 something now, only needed 25 to graduate.

Im going ot take my driving test the 31st, if I fail Im screwed since school starts the next week.

Yes Im still going to Jersey, still planning it =P

Yea so uhhh give me PHP sites, tips, guides, whatever.

Comments

FredFredrickson 18 years, 3 months ago

That will record the user's external IP address.

twisterghost 18 years, 3 months ago

Im taking one exrta class this year…and im actually not in the right grade for it..I think…

Im taking mentorship and doing the schools site…my mentor is one of the teachers lol. I can skip class and go hang out on a comp and say I was in mentorship. I can go during class, or after school

Kaz 18 years, 3 months ago

Alright thanks.

How would I read a different line in a txt file? Like how GM reads inis. Say I wanted what the section Game wanted in this file-

Example=435

Game=34

File=596

Or how could I read just a certain line?

Kaz 18 years, 3 months ago

Lucky you TG.

poultry 18 years, 3 months ago

echo "[input type="hidden" name="ip" value="$REMOTE_ADDDR"]";

SHOULD work.

darkpulsaromega 18 years, 3 months ago

Look for the position of the return character in your text files (13 in ASCII) and move one (or two, I forgot if positions start at 0) character ahead. Then read everything up to the equal sign (61 in ASCII) and store it. Move ahead two characters and read everything up to the next carriage return.

Kaz 18 years, 3 months ago

In GML I coukld do that easy. PHP I have no frikin clue.

Woot I just made a function! Its returns the kb of a file =P

darkpulsaromega 18 years, 3 months ago

Alright, here's what I found on php.net

It prints whatever it reads from the file line by line. Basically, you just need to replace 'echo $buffer;' with your string parsing script.

$handle = @fopen("/tmp/inputfile.txt", "r");
if ($handle) {
   while (!feof($handle)) {
       $buffer = fgets($handle, 4096);
       echo $buffer;
   }
   fclose($handle);
}

To parse the string, you'll want to use sscanf(). I think this is what you'll want to use:

list($parsedText) = sscanf($buffer,"%s = %s");

This should create an array called $parsedText. The first string in the array will be the property, and the second string will be the value.

Eternal 18 years, 3 months ago

Holy shit. I might end up making it too 25 credits exact, if I'm lucky.

Kaz 18 years, 3 months ago

LOL! I had 24 1/2 credits when i finished 10th.