Jump to content

Fyorl

Members
  • Posts

    273
  • Joined

  • Last visited

    Never

About Fyorl

  • Birthday 09/14/1989

Contact Methods

  • AIM
    Fyorl
  • MSN
    hell_raiser_kim@hotmail.com
  • Website URL
    http://soul-scape.com

Profile Information

  • Gender
    Male
  • Location
    UK

Fyorl's Achievements

Member

Member (2/5)

0

Reputation

  1. OOP stands for Object Oriented (should be Orientated really but that's a different argument) Programming and as such is just a way of writing your code (as opposed to Procedural Programming).
  2. It would be better practice to only write methods that you use...
  3. Erm well you should only need read and execute permissions for the owner if your server's setup properly. If it's not then you might need to add execute permissions for group and/or others too. That's something only your hosts can dictate though. r-xr--r-- = 544 r-xr-xr-x = 555 rwxr--r-- = 744 (probably what it should be ideally as presumably you still want to be able to write to it)
  4. Woah, sorry, I didn't realise my reply was so badly formatted, turns out it parses 'pre' tags.
  5. If you display the text that's come directly from a textarea then you won't see any newlines because HTML ignores carriage returns. If you wanted to see the text as a text editor would display it then you need to put the output within '<pre>' tags. Anyway, to solve your you'll need to use: $lines = explode("\n", $m3u); As PHP interprets \n as the newline character when it's put inside double quotes.
  6. Try putting '#!/usr/bin/php' right at the top of the file, before the '<?php'
  7. Ooh it is indeed. You'll probably want to block passthru() and system() too then.
  8. <?php $lines = file('playlist.m3u'); $count = 0; foreach($lines as $line) { if($line[0] != '#') continue; if(trim($line) == '#EXTM3U') continue; $count++; $fcount = (string) $count; if($count < 10) $fcount = '0' . $fcount; echo "$fcount - " . substr($line, 12) . "\n"; } ?> That should be most of the logic, the output can be changed.
  9. Well I changed the method to 'get' and it submitted the get data to the right page fine. That was when it pointed directly to the PHP file. So I'd assume pointing directly to the PHP file would work with the post data too if it worked with the get data.
  10. Try putting a var_dump($_REQUEST) just above your if statement. Also try putting the full path to the php file in the form's action. If that doesn't work then try using $SERVER['PHP_SELF'] as the form action instead.
  11. Do you have a live version I could look at?
  12. But you can serialize objects and have them persist over sessions. Also, like Liquid Fire said, OOP has lots of benefits in terms of data structure and interaction. It's also much better for collaborative projects as it provides encapsulation.
  13. Well when you click the submit button does the current page refresh or are you taken to the new location? Also, try using print_r($_REQUEST); and see what output you get.
  14. OK, sorry. You need to use double quotes if you want to produce <em>valid</em> HTML. As it stands, that code will not pass any validation test. Yes, you're right, the form will post to itself. So, following the logic of your function a bit more carefully, you should have 'http://www.mysite.net/ec/login' as your form's action attribute. The first thing I would do is check that that is actually the case.
  15. Depending on how much code you allow people to post and what environment you're running it in there could potentially be a lot of room for malicious attacks. I'd say the curl functions could also be abused quite easily. Letting people use mail() would be bad too. Those are just some off the top of my head, if I think of some more I'll post them.
×
×
  • 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.