Jump to content

SaMike

Members
  • Posts

    36
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

SaMike's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi! I have .swf files that have images in them. I can view them with swf decompiler on my computer but i need to have this functionality on my website. Is there any way to extract images from .swf file with php?
  2. $newString = preg_replace("/\'\"", null, $oldString)
  3. Bumping this to get opinitions if this indeed would be safe and wise to use or not
  4. I would also seperate your variables with {} like so: mysql_query( "INSERT INTO $tbl_name (category_Name, ID, test) VALUES ('{$category}', {$internalId}, '{$category2}')" ); i think its good coding practice to do this? could be wrong tho
  5. you need double _ function __construct(blahblah){ instead of function _construct(blahblah){
  6. $other_split = explode(',', $other_form); $other_int = count($other_split); $x = 0; while ($x>$other_int) { $other_link[$x] = "<a href = '$other_split[$x]'> Chapter $x </a>"; } $allLinks = implode("\s", $other_link); //this will put all links in string with space between each
  7. You're looking for Implode(), its the exact opposite of Explode; http://fi2.php.net/manual/en/function.implode.php
  8. public function validate(){ //Jos annetaan true niin kuollaan jos feilaa EDIT: TAI SIT EI XD return ((bool) $_SESSION['validate'] == $this->_generateHash()) ? true : false; } should be public function validate(){ //Jos annetaan true niin kuollaan jos feilaa EDIT: TAI SIT EI XD return ($_SESSION['validate'] == $this->_generateHash()) ? true : false; } I dont even know why i added (bool) in the first place Didnt think that one quite trough
  9. So recently i've spent lots of time learning about session fixation and found out that session without any kind of protection can be huge bitch I wrote this class for validating session and to block session hijackers. Within my closed testing i found it working (generating id blahblah) but i'd like your opinitions on this: I have three public functions for using (plus constructor). My comments here are in finnish so i'll explain: First we define class with username (this is for login scripts ) to use in creating hash, after that there's those three functions: generate_id() to generate new validation hash and store it to session. This function should be called when user has been verified and and has logged in. validate() should validate current session, simply returning true if its valid and false if it thínks session has been hijacked. suddenDeath() vill validate session and if valid, do nothing but if it thinks its hijacked, refers person to defined site (ask password at that site to revalidate user maybe?) class xSession{ var $_usr; //tallennetaan KÄYTTIS var $_salt = "customVillenSuolaTahan"; //Täs supahleet suola var $_redirect = "index.php"; //Mihin useri ohjataan jos EXTERMINOINTI tärppää function __construct($username){ //rakkennetaan $this->_usr = $username; //ei ees tarvii kommentoida varmaa } protected function _generateHash(){ $info = array(); //Alustetaan info array_push($info, $this->_usr, $this->_salt, $_SERVER['REMOTE_ADDR'], $_SERVER['HTTP_USER_AGENT']); //Lämitää vähä infoo tiskii return md5(implode('xXx', $info)); } public function generate_id(){ //Tää regeneroi id:n, pitäsi käyttää VÄHINTÄÄ loginis aina if(!isset($_SESSION['validate']) || $this->validate()){ //Ei anneta boogien tehä uutta id:tä session_regenerate_id(); //regeneroidaan id $_SESSION['validate'] = $this->_generateHash();//Tehdään ja tallennetaan validointihash } } public function validate(){ //Jos annetaan true niin kuollaan jos feilaa EDIT: TAI SIT EI XD return ((bool) $_SESSION['validate'] == $this->_generateHash()) ? true : false; } public function suddenDeath(){ //SUDDENDEATH OMG!! if(!$this->validate()) header('location: ' . $this->_redirect); } }
  10. Hi, i'd like to delete all parts like this from my string: <td class="vertTh"> blahblahbalbhalbha </td> So i want to delete everything that is between <td class="vertTh"> and </td>. There's multiple of these in string (the amount may vary). Example: if my string would be HI!<br> My name is Peter!<br> <td class="vertTh"> bloabfsdff </td> I'm a cat!<br /> <td class="vertTh"> asdadsadasdasdas dafmauahahahahahaa </td> being cat is fun! Would come: HI!<br> My name is Peter!<br> I'm a cat!<br> Being cat is fun! How would i achieve this?
  11. Well in your code you check if two core sponsors exist and if they do, you execute error message. So when you're editing either of those two sponsors, two already exists, thats why it gives out that error?
  12. Run it trough nl2br function before printing <?php $string = "This is multi-line string!"; $string = nl2br($string); echo $string; ?>
  13. Ye you should defo add that since now i checked your page and it gives internal server error if you modify orgname to organization that doesnt exist.
  14. Why not just use cookie for it? $_COOKIE['refid'] = $id;
  15. Add this to the beginning of your file: <?php ob_start(); And this to the end of your file: ob_end_flush(); ?> This allows you to use headers everywhere between those two lines.
×
×
  • 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.