Jump to content

Deoctor

Members
  • Posts

    663
  • Joined

  • Last visited

Everything posted by Deoctor

  1. Deoctor

    Error

    change it like this might be it work.. <?php include'config.php';?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>MagicPkz - Item Prices</title> <meta http-equiv="Content-Type" content="text/html; charset=us-ascii" /> <link rel="stylesheet" type="text/css" href="styles.css" /> </head> <body> <div class="container"> <div class="header"> <div class="sitename">MagicPkz</div> </div> <?php require_once("navagation.php") ?> <? if($_GET['t'] == 'id') { $id="{$_GET['hd']}"; if ($list_q = mysql_query("SELECT * FROM grandex WHERE id='$id'")) { if (mysql_num_rows($list_q)) { while($list_b=mysql_fetch_array($list_q)) { ?> <table width="70%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#000000"> <b><font size="5" face="Arial, Helvetica, sans-serif"><br /><?=$list_f['sitename'];?></font></b> <thread> <tr bordercolor="hh.png" class="tablee"> <th width="20%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Item Name</font></b></div></th> <th width="15%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Item ID</font></b></div></th> <th width="11%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Premium Member?</font></b></div></th> <th width="14%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Added on</font></b></div></th> <th width="15%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Status</font></b></div></th> </tr> </thread> <tr class="tablee"> <center><td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center><b><?=$list_f['name'];?></b></font></center></td> <td width="21%"><font size="2" face="Arial, Helvetica, sans-serif"><center><?=$list_f['itemid'];?></font></center></td> <td width="11%"><font size="2" face="Arial, Helvetica, sans-serif"><center></font></center></th> <td width="14%"><font size="2" face="Arial, Helvetica, sans-serif"><center> <?=$list_f['added'];?></font></center></td> <td width="15%"><font size="2" face="Arial, Helvetica, sans-serif"> <center><? if($list_f['prem'] == 0) { echo '<strong><font color="#FF0000">No</font></strong>'; }else{ echo '<strong><font color="#008000">Yes</font></strong>'; } ?> </font></td> </tr></center> <table width="70%" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#000000"> <b><font size="3" face="Arial, Helvetica, sans-serif"><br />Other Info</font></b> <thread> <tr bordercolor="hh.png" class="tablee"> <th width="33%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Site ID</font></b></div></th> <th width="33%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Site Rank</font></b></div></th> <th width="33%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Site Type</font></b></div></th> </tr> </thread> <tr class="tablee"> <center><td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center><?=$list_f['id'];?></font></center></td> <td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center> <? if($list_f['prem'] == 1) { echo '<strong><font color="#FFD700">Golden</font></strong>'; }else{ echo '<strong><font color="#333333">Regular</font></strong>'; } ?> </font></td> <td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center><?=$list_f['sitetype'];?></font></center></td> </tr></center> <table width="15%" border="1" cellspacing="0" align="center" cellpadding="0" bordercolor="#000000"> <tr><br> <th bgcolor="#00b2ff" align="center"><b><font face="Arial, Helvetica, sans-serif" size="2"><font color="#FFFFFF">Same Window:</font></font></b></td> </tr> <tr> <td align="center"><font face="Arial, Helvetica, sans-serif" size="2"><font color="FFFFFF"><a href="http://<?=$list_f['sitehost'];?>"><?=$list_f['sitehost'];?></a></font></font></td> </tr> <th bgcolor="#00b2ff" align="center"><b><font face="Arial, Helvetica, sans-serif" size="2"><font color="#FFFFFF">New Window:</font></font></b></td> </tr> <tr> <td align="center"><font face="Arial, Helvetica, sans-serif" size="2"><font color="FFFFFF"><a href="http://<?=$list_f['sitehost'];?>" target="_blank"><?=$list_f['sitehost'];?></a></font></font></td> </tr> </table> <? } } } } ?> <!--Start of Main--> <table class="tables" border="1" cellspacing="0" cellpadding="0" align="center" bordercolor="#000000" id="resultTable"> <b><font size="3" face="Arial, Helvetica, sans-serif"><br /><br /><center>Item List</center></font></b> <thead> <tr bordercolor="hh.png" bgcolor="#000000"> <th width="33%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Item Name</font></b></div></th> <th width="30%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Item ID</font></b></div></th> <th width="11%" class="tablef"><div align="center"><b><font color="#FFFFFF" size="2" face="Arial, Helvetica, sans-serif">Premium Member?</font></b></div></th> </tr> </thead> <?php if ($list_q = mysql_query("SELECT * FROM grandex ORDER BY name desc")) { if (mysql_num_rows($list_q)) { while($list_b=mysql_fetch_array($list_q)) { ?> <tbody> <tr class="tablee"> <td width="33%"><font size="2" face="Arial, Helvetica, sans-serif"><center><b><?=$list_b['name'];?></b></font></td></center> <td width="30%"><font size="2" face="Arial, Helvetica, sans-serif"><center><?=$list_b['itemid'];?></center></font></td> <td width="11%"><font size="2" face="Arial, Helvetica, sans-serif"><center> <? if($list_f['prem'] == 0) { echo '<strong><font color="#FF0000">No</font></strong>'; }else{ echo '<strong><font color="#008000">Yes</font></strong>'; } ?></font></td></center> </tr> </tbody> <?php } } else { echo "<center><b>No Items In Database.<br>Please Check Back Later.</b></center>"; } } else { trigger_error(mysql_error()); } ?> <!--End of Main--> </div> </div> </body> </html>
  2. Deoctor

    Error

    is this ur complete index page???
  3. willing to do it out. mail u the amount and details
  4. do u want to check if the user comes from a valid site of urs then it should go there or else it should redirect him to login page..is it correct??
  5. is this ur complete code.. coz u have one extra } in the code at the last..
  6. try mysql_fetch_array instead of assoc
  7. does ur check whether are correctly typing the file name
  8. if the values satisfy the image/jpg,image/png...all image types then allow.. otherwise disallow
  9. for getimagesize() mime part <?php $info = getimagesize("1.jpg"); foreach($info as $key => $value) { echo $key . ' - ' . $value . '<br />'; } ?>
  10. You can do it using this trick: 1.open a popup window 2. write there the value of a desired text box 3. open print dialog automatically Here's an example similar to the one I used once: function printtext(elem) { popup = window.open('','popup','toolbar=no,menubar=no,width=200,height=150'); popup.document.open(); popup.document.write("<html><head></head><body onload='print()'>"); popup.document.write(elem); popup.document.write("</body></html>"); popup.document.close(); } Then you should call it like this: <form name=f1> . . . <input type=text name=t1> <input type=button value="print it" onclick="printtext(document.f1.t1.value)"> <textarea name=t2></textarea> <input type=button value="print it" onclick="printtext(document.f1.t2.value)"> Very simple and effective. You can also print the entire form by looping through it's elements.
  11. it cannot be done in php u hve to use javascript as printing is an action done at the client side.. <form> <input type="button" value="Print this page" onClick="window.print()"> </form>
  12. now i got it out i think he is using the condition like this if fsockopen() fails then telnet the port number.. here is the telnet function but i didnt tested it ofcourse.. so Happy testing :P :P <?php class Net_Telnet { /** * @var string The remote server address. * @access private */ private $_address; /** * @var integer The remote server port. * @access private */ private $_port; /** * @var resource The remote server socket. * @access private */ private $_sock; /** * @var * @access static */ static public $CRLF = "\r\n"; /** * @var * @access public */ public $prompt; /** * Constructs a Net_Telnet object. * * @param string The remote server address, with option port * @param optional string The prompt to expect from the server. * @param optional integer The timeout for the connection attempt. * @access public */ public function __construct($address, $prompt=false, $timeout = 5) { if(preg_match("/([\w.-]+)(?:\d+))?/", $address, $matches)) { $this->_address = $matches[1]; $this->_port = $matches[2]?$matches[2]:23; } $this->prompt = $prompt; $this->_timeout = $timeout; $this->connect(); } /** * connect is called automatically from the constructor, so * we protect it. * * @access protected */ protected function connect() { $this->sock = fsockopen($this->_address, $this->_port); stream_set_timeout($this->_sock, $this->_timeout); } /** * Read a socket until we hit EOF or match a string. * * @param string The pattern to match (static currently) * @access public */ public function read_response_until($str) { $response = ''; while(1) { $char = fgetc($this->_sock); if($char === false) { return $response; } $response .= $char; if(strstr($response, $str)) { return substr($response, 0, strpos($response, $str)); } } } /** * Write to the socket, remembering to append the local CRLF. * * @param string The command to write to the socket. * @access public */ public function write_cmd($cmd) { $cmd .= self::$CRLF; fwrite($this->_sock, $cmd); } /** * A convenience method. Writes a command to the socket, and * reads until the next line prompt is returned from the server. * Returns the resulting buffer. * * @param string The command to write to the socket. * @access public */ public function command($buffer) { $this->write_cmd($buffer); $response = $this->read_response_until("$this->prompt>"); return $response; } } /* vim: set sts=2 ts=2 expandtab ai bs=2 : */ ?>
  13. use this line when u are uploading i mean in the form.. <td><input type="hidden" name="MAX_FILE_SIZE" value="100000000" /></td><tr></tr>
  14. as ur saying i dont think the time out is a problem..
  15. actually u cannot determine. coz the cpanel will use the Linux operating system, where as the Pleask is based on the Windows operating system. so u need to give an option in ur tool for the user to mention whether he is using the Cpanel or Pleask then u can perform the operations depending upon user selections.
  16. dear rob i cannot tell u weather u understood the code or not.. coz i am checking some predefined ports in the scanner.class.php, so it will write these ports correctly..just now i have checked up google.com it shows that the port 22 is closed using my code.. and coming for the testing part i have tested it as well. and ur so called mentioned port scanner from the site also uses the same fsockopen() function to check the ports. there is nothing else that it is gone do. some ports will not get scanned when u try using from the server but when u try using the scanner from ur localhost machine it works perfectly.. so try the same code in the localhost which will give u different results.. and how are u so sure that the site is giving u correct results..
  17. now i got it out u cannot create a folder at the place of htdocs so i think u are getting this error.. do one thing in the copy file change the command to copyFile($conn,"httpdocs/images/<remotefilename>","<local file>");
  18. then i think the user id and password which u r using doesnot have the full permissions to create a folder..
  19. then use the code which i gave u in the same form after the html tags gets completed.. use the php tags
  20. i think u copied my enitre code.. use this code <?php error_reporting(E_ALL ^ E_WARNING); //------------- functions //--------------------------- connect and login to server function ftpconnect($host,$user,$pass) { global $conn; $conn=ftp_connect($host) or die('Could not connect to host '.$host.'.<br /><a href="javascript:history.back(-1)">Back</a>'); //login to server if (!ftp_login($conn,$user,$pass)) { echo 'Could not connect to host '.$host.'.<br /><a href="javascript:history.back(-1)">Back</a>'; exit; } } //-------------------------- close ftp connections function ftpClose($conn) { //close ftp connection ftp_close($conn); } //------------------------ create directory function ftpMkDir($conn,$dirToCreate) { if (!ftp_mkdir($conn,$dirToCreate)) { echo "<p>Sorry the folder: $dirToCreate already exists</p>\n"; echo "<p>So continuing with copying the files</p>\n"; copyFile($conn,"index.jpg","image01.jpg"); exit; } else { echo "<p>Folder: $dirToCreate created</p>\n"; } } //------------------------ set directory permissions function ftpFolderPermission($conn,$folderChmod) { if (ftp_chmod($conn, 0777, $folderChmod) !== false) { echo "<p>$folderChmod chmoded successfully to 0777</p>\n"; } } //---------------------- copy file to new server function copyFile($conn,$remoteFile,$localFile) { if (ftp_put($conn,$remoteFile,$localFile,FTP_BINARY)) { echo "<p>successfully uploaded $localFile to $remoteFile</p>\n"; } else { echo "<p>There was a problem while uploading $remoteFile</p>\n"; } } //----------- end of functions ------------------------- //get the credentials from user $user = $_POST['username']; //change to ftp username $username = $pass = $_POST['passwd']; //change to ftp password $host = $_POST['urlname']; //change to ftp url if (($user == "") || ($pass == "") || ($host == "")) { echo "Please fill all the details."; } else { //connect to server ftpconnect($host,$user,$pass); echo "<h2>Create Folders</h2>\n"; //create directory ftpMkDir($conn,"/images"); echo "<h2>Set Folder Permissions</h2>\n"; //change folder mermissions to 0777 ftpFolderPermission($conn,"images"); echo "<h2>Upload Files</h2>\n"; //copy file to new server //connection then path to copy file to then path to file on this server copyFile($conn,"index.html","http://www.exampleofwebsite.com/template1/index.html"); } ?> but here one small problem is that if u are running this code on the second server this php function should be changed like this copyFile($conn,"http://www.exampleofwebsite.com/template1/index.html","index.html");
  21. do one thing just chnge this function like this function ftpMkDir($conn,$dirToCreate) { if (!ftp_mkdir($conn,$dirToCreate)) { echo "<p>Sorry the folder: $dirToCreate already exists</p>\n"; echo "<p>So continuing with copying the files</p>\n"; copyFile($conn,"index.jpg","image01.jpg"); exit; } else { echo "<p>Folder: $dirToCreate created</p>\n"; } }
  22. u put what ever u have given previously i just gave it for your reference also u need to change the hostname,userid and password to what ever u have already given
  23. i dont think that any thing u have given willbe useful u just gave the html form.. just give the palce ur are validation for the other things are going on.. i can give u only one solution for this $txtamt=$_post['txtdepamt']; if ($txtamt>$totalamt) { echo "Sorry transaction cannot be possible"; } else { continue with the transaction..blah...blah } use code tags to mention ur code
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.