Jump to content

aim25

Members
  • Posts

    81
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

aim25's Achievements

Member

Member (2/5)

0

Reputation

  1. Is it useful to save sessions (eg. session IDs and session date)?
  2. I agree with DarkWater, AJAX is the most efficient for this.
  3. Have an IF statement that checks if the photo ID exists before you output the photo.
  4. Quick yes or no: Can you instantiate multiple classes to one variable? eg. $var = new CLASS; $var = new CLASS2; Thank you for the help.
  5. aim25

    preg_match

    Quick yes or no: Is this right for validating a string (between 5 to 15 characters) which may consist of A-Z (both capital and lower case), 0-9, hyphen(-), and underscore(_)? /[^a-zA-Z0-9_\-]/ Thank you for the help.
  6. My bad, the i focused on teh code you provided.
  7. That doesn't really answer the question... Sorry.
  8. Is it possible to call a function within another function? Example: <?php class MAIN { function A() { .. some code } } class SOMETHING extends MAIN { function B() { $var = new MAIN; $var->A(); } } ?>
  9. TY, that clears makes things a lot more clear.
  10. aim25

    Why?

    Here is a good example. Play with it a bit. <?php $cds = array( 'Christina Aguilera'=>array( 'Impossible', 'Beautiful', 'Dirrty' ), 'Pink'=>array( 'Just like a pill', 'Family potrait', 'Missundaztood' ), 'Kelly Rowland'=>array( 'Stole', 'Obsession', 'Past 12' ) ); echo '<p><b>How many CDs in our collection?</b><br /> There are '.sizeof($cds)." CDs in our collection.</p>\n"; echo "<ol>\n"; foreach( $cds as $singer=>$songs ) { echo ' <li><b>'.$singer."</b>.<br />\n"; echo " <em>Songs</em>: </li>\n"; echo " <ul>\n"; asort( $songs ); // sorts the list of songs foreach( $songs as $song ) { echo ' <li>'.$song.".</li>\n"; } echo " </ul>\n"; } echo "</ol>\n"; ?>
  11. aim25

    Why?

    Use a foreach loop.
  12. My script has many classes and functions. After a while of coding i came up with a few questions. 1. If i have a variable named $temp in function A(), is it the same as the $temp in function B()? class SOMETHING { function A() { $temp; } function B() { $temp; } } 2. Lets say i have 2 classes (class A, class B) which both extend from class MAIN. In MAIN there is a variable declared; $temp. If the value of $temp is changed in class A, then accessed in class B, is the value passed between the classes? class MAIN { var $temp; } class A extends MAIN { $this->temp = 4; } class B extends MAIN { echo $this->temp; }
  13. Hey, I'm working on a registration script. But as i went through i started thinking about security. So i searched it and i got a few commands. - mysql_real_escape_string() - magic_quotes_gpc() I'm not sure how these work, and which one is better. But I've been advised that i have to use addslashes() with magic_quotes_gpc. Then I also saw things like str_replace() being used, and other ways of taking the "magic quotes" out of the string. So whats the best way to protect against sql injections?
×
×
  • 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.