|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Raw CMD: PORT.. whade****?
well im having some probs with using ftp_nlist in php so I thought I did it manually using fsockopen..
I tried using LIST but that didnt return much without having done the PORT command first, now I got this explenation from a site on how to use PORT: Quote:
now I understand the ip stuff but the port? p1 and p2? looks like there are 2 ports in the game?? could someone explain how this works please? ![]() |
|
#2
|
||||
|
||||
|
It is one port. The port is represented as two parts. if you have a port 1000, it is represented as individual bytes. 1000/256, 1000%256. that would be 3, 232. so p1=3 and p2=232. ask again if you dont understand.
|
|
#3
|
|||
|
|||
|
1000/256 = 3.9..
1000%256.. ermm.. whats '%' supposed to represent? I was never really good at math ![]() and how would I know what port to use for the PORT cmd? |
|
#4
|
||||
|
||||
|
Err, i should have said that the first one is integer division
So 1000/256 = 3 % is the remainder operator or modulus operator When you divide 1000/256, you get 3 as quotient and 232 as remainder. You can pick whatever port you could bind to for the PORT command. Its the port you know you can receive data on. when the server sees this command, its going to connect to that port when you request a file to be uploaded or downloaded. |
![]() |
| Viewing: Dev Shed Forums > System Administration > FTP Help > Raw CMD: PORT.. whade****? |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|