Sponsored Content
Full Discussion: PHP function kills my code?
Top Forums Shell Programming and Scripting PHP function kills my code? Post 44879 by l008com on Thursday 11th of December 2003 08:29:24 PM
Old 12-11-2003
Quote:
Originally posted by google
OK, I am very much a beginer at PHP. It appears to work fine if you add quotes around the first argument: On my PC, the output was: "Closed 9 " when trying port 22, but trying port 80, the output was "Open"

Code:
<? function sniff( $portnumber ) {
	$REMOTE_ADDR="localhost";
		$sock = fsockopen("$REMOTE_ADDR", $portnumber, $errno, $errstr, 80);
         if (!$sock)
             {
              if ($errno == 60)
                  {
                  echo "Timeout";
                  }
              else 
                  {
                  echo "Closed $errno";
                 }
            }
            else
            {
              echo "<font color=#ff3300>Open</font>";
              fclose($sock);
$sock</p>";
              }
      } ?>

<? sniff(22); ?>

Why do you keep posting then deleting your posts? Anyway most of the changes you made are no change. I don't think adding the quotes is going to make a difference because the code worked fine without them when it wasn't in its own function. Nope, just tested, no change.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

exit from telnet kills orbix process

Hi, I'm using a bourne shell to kick off a 3rd Pty app. This app uses Orbix. When I exit from the telnet session which started the app or hit CTRL-C at the command line, the orbix process dies, yet all other process remain. I've tried starting the app as a background process, but it still... (1 Reply)
Discussion started by: edgarm
1 Replies

2. UNIX for Dummies Questions & Answers

Crash Kills Printer Device

A user accidentally unplugged her server from the wall. She has rebooted twice, but the system does not recognize the default printer device, which previously was lp02. There is a file which reads /dev/lp0 and then garble. I'm a total newbie at all of this, with some Unix experience many,... (2 Replies)
Discussion started by: ckurt
2 Replies

3. SuSE

Linux kills windows :(

Hey all, I've tired installing Suse 9.2 (DVD) on my computer, dual boot. But everytime I do it Linux seems to kill my Windows install. This is my setup, a 120GB HDD and for 30GB for Windows 60GB for Data and 30 GB for Linux. Windows works fine, then install SuSe and that works fine. ... (6 Replies)
Discussion started by: woofie
6 Replies

4. Shell Programming and Scripting

application exit kills shells

Hi all, I start my application from a shell command-line. When I exit my application, it kills the shell that its returning too. Worse yet, since I have init respawning the shell all those subsequent shells get killed automatically...so I get output like the following (the >> is the prompt for... (2 Replies)
Discussion started by: q1001001
2 Replies

5. UNIX for Dummies Questions & Answers

Exiting eXceed window kills my process

Hi, I run a binary application with GUI accessibility. To launch and close the application i follow the following steps: 1.Log into a console session. Export display to the local workstation. 2.Launch X windows app ( eXceed ) 3.From terminal session go to the my application directory and... (2 Replies)
Discussion started by: shantaputi
2 Replies

6. UNIX for Dummies Questions & Answers

kills command

what are the header files required for the kills command in kernel version 2.4? (1 Reply)
Discussion started by: shwe
1 Replies

7. Shell Programming and Scripting

Script, child kills parent

Hello everyone, I'm trying to write a script, i would like to say the child kills the parent, how would i do that? (2 Replies)
Discussion started by: jessy21
2 Replies

8. UNIX for Dummies Questions & Answers

xend kills network connectivity on boot

red hat 5 update 4 64bit. linux newby. on an interactive boot i can ping -t my vm linux server from my physical MS XP workstation and a vm W2000 64 bit server until xend is started, after that i get destination unreachable. if i choose not to start xend on the interactive boot i retain... (1 Reply)
Discussion started by: slartibartfast9
1 Replies

9. UNIX for Advanced & Expert Users

A Program Which Generates a Script Which Kills It

I have a C++ program, running on Fedora Linux, which has to be able to update itself to a new version, which it can obtain from a server. The way I do this is to have it create a shell script which kills it (the parent process), uninstalls it, downloads the new version (actually it does this... (1 Reply)
Discussion started by: BrandonShw
1 Replies
FCRLS(8)							  Open-FCoE Tools							  FCRLS(8)

NAME
fcrls - Fibre Channel Read Link Error Status Block (RLS) tool SYNOPSIS
fcrls --port rport_bsg_name [--quiet] fcrls --fcid rport_port_FC-ID [--quiet] fcrls --help DESCRIPTION
The fcrls command performs Fibre Channel Read Link Error Status Block (RLS) ELS request (see FC-LS-2) via BSG over a given rport bsg name or FC-ID. fcrls takes either a rport bsg name or a rport port FC-ID as the input. To disable verbose output, use the --quiet option. OPTIONS
--port rport_bsg_name Send RLS to a rport by FC remote port bsg name, e.g., rport-7:0-1. --fcid rport_port_FC-ID Send RLS to a rport by port FC-ID, e.g., 0xce000d. --quiet Disable verbose output. --help Display a help message with basic usage instructions. EXAMPLES
Sends RLS to the FC remote port as rport-7:0-1 fcrls --port rport-7:0-1 Sends RLS to the FC remote port with 0xce000d as its port FC-ID fcrls --fcid 0xce000d SEE ALSO
fcoeadm(8) SUPPORT
fcrls is part of the fcoe-utils package, maintained through the Open-FCoE project. Resources for both developers and users can be found at the Open-FCoE website http://open-fcoe.org/. Open-FCoE 02/06/2013 FCRLS(8)
All times are GMT -4. The time now is 11:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy