Jump to content
php.lv forumi

Ja atrod portu, nevar uzpiezt pogu.


Janka no Benzin Tanka

Recommended Posts

Labdien!

Gribēju palūgt vai kāds nevar uzrakstīt skriptu, piemērs:

Ja skripts atrod, ka "tāds" ports ir atvērts "tādai" ip, tad nevar saitā uzpiest pogu.

 

Reku piemēram skripts, kurš atrod portu:

<?php

 

$site = "php.net";

$port = 80;

 

$fp = fsockopen($site,$port,$errno,$errstr,10);

if(!$fp)

{

echo "Cannot connect to server";

}

 

else{

echo "Connect was successful - no errors on Port ".$port." at ".$site;

fclose($fp);

}

 

?>

 

Pogas piemērs:

<form action="processing.php" method="post">

< input type="submit" name"submit" value="Poga" >

</form>

 

 

Tagad viņus vajag savienot, lai nevarētu pogu uzpiest, ja ports ir atvērts. Bet ja neatrod portu, tad pogu var uzpiest.

Edited by Janka no Benzin Tanka
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...