Jump to content

SoundreameR

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Everything posted by SoundreameR

  1. Oohohohohoho Oh my god... That was a new one... heah... thanks... I'm really blind in that time of the night... oh god... reeeeally nice one... it was the "==" darn I must stop copy paste from anywhere I see a reiterate code.. when copy something from IF (..) and just change the variable.. this is what you get... Hm... I guess I need to get some sleep... It's 02:33 AM here and I'm getting really buggy... Good night all... Thanks!
  2. $_SESSION["BLA"] = "MU"; print_r($_SESSION); thats what hes/shes pointing out^^^ even if he initialize that still no work mmmmm no need for start This was just a fraction of code... which outputs something abnormal Here is some... require_once("config.php");//зареждане на mySQL настройки require_once("functions.php");//зареждане на базови функции define("BASEDIR", getBasedir($_SERVER["PHP_SELF"]));//дефиниране на "нулева" директория if (is_array($mysql)) { $db = new mySQL($mysql["host"], $mysql["user"], $mysql["pass"], $mysql["db"]); $db_prefix = $mysql["db_prefix"]; } else die("mySQL конгигурацията е невалидна"); //инициализиране на връзка с база данни $query = $db->dbquery("SELECT * FROM ".$db_prefix."settings"); if ($query) { $settings = $db->dbarray(); if (is_array($settings)) { session_start(); $_SESSION["shit"] == "MUUU"; print_r($_SESSION); } else die("Невалидни настройки"); } else die("Невалидни настройки"); //извличане на настройки и инициализиране на сесия The script passes to the session_start() and when it comes to print_r, it spits out only "Array ( )"
  3. I tried puting session_start() on different places (no effect). I tried to put it at the first line of the first file, I tried on the first line of the first included (require_once) file. Absolutely no effect...
  4. I'm making an oop site on PHP 5/Apache 2/WinXP. I tested the session system of php with a simple script to start a session and firstly echo that this is a new session and then set a $_SESSION["used"] variable to something that the next time the page opens it indicates that this variable is set to something and this session is old. Ok. It works. But when i start a session in my new site's scripts the session is registered, there is a session file, there is a session cookie (PHPSESSID), the session opens with the same ID every time I run the script, but I can't set any data in $_SESSION. I even tried this: $_SESSION["BLA"] = "MU"; print_r($_SESSION); And it output Array ( ) !!! ??? :-\ Any ideas?
  5. Thanks dude! It works very nice! Now how about a pattern to filter the href data of an anchor?
  6. Hi again guyz... I have a very dumb problem... If I have a html output, how can I get only the content of a specific tag, removing everything else, including TEXT. strip_tags helped in removing some tags, but the text is still there... Ex.: If there is a bunch of code, I want to get only the content of <h2></h2> tags. Like this: Input code: bla bla <br> muhaha <br> <h2>[NEEDED CONTENT]<h2> foo foo foo <br> the bar <br> emo mu <br> <h2>[NEEDED CONTENT 2]<h2> etc... Output code: <h2>[NEEDED CONTENT]<h2> <h2>[NEEDED CONTENT 2]<h2>
  7. Hi guys.. I really hate RegEx, it's a mistery for me how to construct a regex pattern in order to make some changes in a string with preg_replace(). Sooo... here is my problem: // clean if tag //need to add somthing HERE $item = preg_replace('/<(\/?)(table|tr|td).*?>/is', '<$1$2>', $item); print_r($item); $item carries a html string, actually a html table which will be filtered and parsed into an array. This is a part of an open source class which provides parsing a html table in to an array. But it cleans any code contained in <td> such as <td bgcolor=#FFCC99>. All I need is, before the tags are being cleaned, the bgcolor hex value to be moved inside the table cell. Example: If there is <td bgcolor=#FFCC99> in the string somewhere or <td bgcolor=#FFFFFF> no mather of the hex code, it will be replaced with <td>#FFCC99| or like the other example <td>#FFFFFF| so I can later parse the cell content to bgcolor and actual value with something like this explode("|", $string); I hope my bad english was not fatal on this explanation
  8. Sure... [code] <? $addr = $_GET['addr']; $port = "80"; $fp = fsockopen($addr, $port, $errno, $errstr, 30); if (!$fp) { echo "$addr - OFFLINE - $errstr ($errno)"; } else { echo "$addr - ONLINE"; fclose($fp); } ?> [/code]
  9. Hello everyone, nice forum you have here... I have a strange problem going on on my home and work linux platform. And here it is... I made a little script, which tests the server status on port 80. You all know it's just a couple of lines, and it's impossible to be mistaken... Soooo... the funny thing is that, when I execute it via web browser and requiest the status of hdghfagdhfad.bg for example (as you can see, it does not exist) it gives me positive result, which is sooooo wrong... when I execute it from shell (php asd.php) the result is correct - Server Down (can't connect to port 80 on such host). Why is this happening? I was hesitating about the category of this quistion, Apache problems or PHP problems... but yet.. it's a problem all right...  ;)
×
×
  • 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.