Asheeown
-
Posts
471 -
Joined
-
Last visited
Posts posted by Asheeown
-
-
An fgets command pulls data from a socket connection, is their any limit to the amount of data fgets can receive or does it always get 100% of what the socket connection can produce?
-
Bump, I guess, just a simple question
-
-
When connected with a socket connection to a server is it limited or does it display the full session everytime you call for it?
For example I'm connected to a server and I call the data at 20 lines but in between the next call 300 more lines of data come in, will it get all 320 lines the next time or is it limited to say 200 lines?
-
Okay I'm so close, please can someone help me
It looks like this now:
if (preg_match('/([\[.+\]])\s+(.+)/', $v, $chars)) { echo("$chars[1] $chars[2]"); echo "<br>"; }
It correctly splits every kind of directive, except the directive name is totally gone and only a closing bracket is shown, like below
] Connected on remote
Should be
Status Connected on remote
-
If I use:
<?php $Array = explode("\r\n", $Strip); foreach($Array as $v) { if (preg_match('/^(\[.+\])\s*(.+)\s*$/', $v, $reg)) { echo $reg[1] . " " . $reg[2]; echo "<br>"; } } ?>
Just to split the string in half and separate it with a bunch of spaces it works for some
[Directive 1] Test message
But doesn't for others
[Chat] Text: [in-Message Bracketed Text] .
When text is enclosed in brackets further on in the text it will just separate the last character with the spaces, in this case the period. But it does work when brackets.
[Chat] [username] says: test message
-
I need to split my text and the category is in brackets
[Category Name] Text
How can I use the [] brackets in preg_match without it thinking I'm looking for a set of characters?
-
A concept I never have gotten, when I look at example scripts that use preg functions and look for "p@$[2!*@]" (Made Up) I can never understand it.
I need to decipher text coming in through a telnet connection, it's organized but I still can't seem to work it out, let me give an example:
This is an example of what would come in, the directives are changed for confusion purposes:
/status
Status Text
---
[Directive 1] Test message
[Directive 1] [sub Directive 1]: Test message
[Directive 1] [sub Directive 1] [sub Sub Directive 1]: Test message
[Directive 2] Something for directive 2
[Directive 3] Something for directive 3
/status
Most Recent Status
---
Now what happens in this telnet session is the following:
1. Server connects to client
2. Server sends command /status
3. The first time everything from /status to the --- is pulled
4. While the session goes along those directives are sent to the server, just little bits of information, when the server is ready to pull again and store all the information received it will send the status command again, everything from the last --- to the new --- is taken and stripped
5. All directives and sub directives can be in an array the list isn't that long
This is how it should come out:
Directive 1 sent "Test message"
Directive 1 sent "Test message" from Sub Directive 1
Directive 1 sent "Test message" from Sub Directive 1 by Sub Sub Directive 1
Directive 2 sent "Something for directive 2"
Directive 3 sent "Something for directive 3"
Status = Most recent status
If anyone could help that would be great, a tutorial on text stripping would also be fantastic, all this information is just a test the real telnet session actually makes sense to the people who know what it's doing. Sorry for any confusion and just ask if you have any questions.
-
<?php if($nume<0) { // <---- Bracket ONE opened while ($data = mysql_fetch_assoc($query)) { // <---- Bracket TWO opened ?> <tr bgcolor=#EEEEEE> <tr style="background-color:#EAEAEA;" onmouseover="this.style.backgroundColor='#0099FF'" onmouseout="this.style.backgroundColor='#EAEAEA'"> <td><?php echo "{$data["login"]}"?></td> <td><?php echo "{$data["fname"]","{$data["lname"]}"?></td> <td><?php echo "{$data["hub"]}"?></td> </tr> <?php } // <---- Bracket ONE closed ?> </table> <?php } // <---- Bracket TWO closed ?>
-
Limit the session starts and the header changes to one common page only, for instance if incCommon.php is going to be directly or indirectly included on a page it can hold the session_start() and header details and the rest of the pages don't need to set it if they are called after this page.
-
Try this:
<?php $site = gethostbyname($_SERVER['HTTP_HOST']); $port = 80; $fp = @fsockopen($site, $port, $errno, $errstr, 10); if(!$fp){ echo "<b>The port is NOT open!</b>"; }else{ echo "<b>The port is open!</b>"; fclose($fp); } ?>
-
Alright, that's it, finally after all this time I have figured it out. Can't say much for the help but I can say thanks for the attempts for the people who did try like Dark, or Xan.
If anyone would like to know, the thing I was trying to accomplish was kill a background process if a user was inactive for a certain amount of time. I thought the only way possible was to log the process ID when the script was executed and have a cron job kill it if the user was inactive. I have now thought on the script side. Now at the top of the script when it refreshes which is every 30 seconds in the background it will check if the user is inactive and if so it will run a die() command.
So simple yet for almost a month I couldn't figure it out...solved.
-
Bump
-
Bump :-\
-
Bump
-
I love using an SVN, you can set one up for free and it doesn't take much. You can track revisions so you can see each what you've done, see differences, revert, and you always have a backup, just update to an earlier revision.
-
Don't delete your boot.ini file...change it.
http://support.microsoft.com/kb/289022
And changing the drive letters shouldn't mean a thing at all
-
Var_dump just brings back com_object no information
Bump.
-
If you don't want to use sessions and you want to take more security measures just encrypt the data in the hidden field, they can screw with it but when unencrypted on the following page it will bounce anything not formally correct to it's encryption standards.
-
However he's not using that var for identification and if it were to have sql injection in it that's another issue that should be dealt with anyway.
-
Simple way to do it is use a hidden field
<?php echo "<input type=\"hidden\" name=\"chosenGroup\" value=\"$group\" />"; ?>
-
Did you happen to take a look at the 14 other posts before that one? Oh yeah they were bumps, DAYS apart from each other, it just gets a little annoying when you ask a logical question that someone could simply answer yet they just don't look or post something stupid like your post relating absolutely nothing towards the topic just here to be a dick. So please don't post if you don't have anything beneficial to contribute.
-
NO ONE can answer that question? Really? I see people post the absolute dumbest questions on this forum and still get answers, I post a simple logic question and it just gets passed by? I leave posts for days but it doesn't matter, 10 minutes after I bump it 90% dumb topics cover it up and throw it off to the next page.
I would love a simple yes or no answer to my question I posted above, I'll quote it every day until I get an answer.
-
As I said the switch statement is best for organization.
<?php switch ($_GET['Page']) { case "Links": include("Links.php"); break; case "About": include("AboutUs.php"); break; case "Contact": include("ContactUs.php"); break; default: echo("The page you have requested either no longer exists or has been moved to another location."); } ?>
[SOLVED] Display limit for fsocksopen?
in PHP Coding Help
Posted
And that will pull all data in the connection no matter how big?