system()

  • pureone_36
  • Novice
  • Novice
  • pureone_36
  • Posts: 24
  • Loc: earth

Post 3+ Months Ago

hell again people


im testig out a new script i have jus discovered the system() function.
i have jus come across a problem i tryed this


Code: [ Select ]
<pre>
<?php
$target = $_POST["target"];
system('ping $target -k');
?>
  1. <pre>
  2. <?php
  3. $target = $_POST["target"];
  4. system('ping $target -k');
  5. ?>


but it comes back
Quote:
can not ping $target check host name


why will it not pick up that $target as a varible ?

and how can i get around this

thanks
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • this213
  • Guru
  • Guru
  • User avatar
  • Posts: 1260
  • Loc: ./

Post 3+ Months Ago

you need to use double-quotes when trying to interpolate a variable. In other words, what you're doing with
system('ping $target -k');
is like typing in
C:\>pint $target -k
at a command line. It won't work. But if you do
system("ping $target -k");
the system will "read" $target and try to ping that.
  • pureone_36
  • Novice
  • Novice
  • pureone_36
  • Posts: 24
  • Loc: earth

Post 3+ Months Ago

yeah your right.

well i try to do a trace route on the things im pinging away at
but it wont let me it wont provide a trace route why is that?

it will ping normaly jus send 4 32 bytes packets to the target ip but wont shoe the hops.

thanks for your help

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 85 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.