Jump to content

wildteen88

Staff Alumni
  • Posts

    10,480
  • Joined

  • Last visited

    Never

Everything posted by wildteen88

  1. What is to be placed into the generated folders (tor/0, tor/1, tor/2 etc). Are you wanting to create the files desc.txt, genre.txt and title.txt in those folders?
  2. You cant just turn a function into a class.
  3. No it is to do with how PHP is configured. Not the version of PHP.
  4. The easiest way to get syntax highlighting is either use the PEAR highlighter class (if your version of PHP has PEAR Installed) or download and install Geshi.
  5. The problem is to do with how you are checking user defined variables ($_POST, $_GET, $_COOKIE). You should check to see if a user defined variable exists first before using it, eg: if(isset($_GET['some_var']) && !empty($_GET['some_var'])) The following examples is not the same: if(!empty($_GET['some_var'])) // OR if(!$_GET['some_var']) The first example tells PHP to see if the variable exists first before checking to see if it is emtpy. If you don't tell PHP to check the variable existence first PHP will assume the variable exists and tries to do what you're telling it to do. But PHP can't and returns a notice message.
  6. First step is to add PHP to the PATH Environment Variable if you havn't done so already. You must restart windows in order for the changes to take affect. Next step is is find your php.ini. It should be in your PHP Installation folder. Once you have found it open it with Notepad or some other basic text editor. Scroll down until you find the following line: ; Directory in which the loadable extensions (modules) reside. The line after it, should be like so The path within the quotes should point to PHP's extension folder. For example if PHP is installed to C:/php then the path should be C:/php/ext NOTE: If you have PHP4 installed then the path should be C:/php/extensions Next scroll down and find the following line: ;extension=php_gd2.dll And remove the semi-colon ( ; ) from the start of the line. Do the same for the ;extension=php_zip.dll line too. Save the php.ini and restart your http server (eg Apache, IIS etc). Verify the changes have been made by running the phpinfo() function within a script. You should find a GD and ZIP sub-heading.
  7. I'd recommend you to add PHP to the PATH Environment Variable instead. I do not recommended moving files outside of the PHP installation folder.
  8. thorpe missed of a closing brace, try: <?php if (isset($_POST["uname"]) && isset($_POST["pword"])) { $var1 = $_POST["uname"]; $var2 = $_POST["pword"]; // rest of your code here. } ?>
  9. For what you're wanting to do you'll need to make sure Apache is configured with a server side programming language. The most common being PHP Judging by your second question it sounds like the best option for your would be to install a simple PHP script called a shoutbox. There are many tutorials for creating a shoutbox.
  10. Yes you can encrypt your source code however such tools come in at a hefty price The only two I know of is IonCube and Zend Gaurd I dont think there is any free ones.
  11. I assume you are going to split the images into numerical folders like so: 0-1000 1001-2000 2001-3000 .. etc ... 10001-20000 20001-30000 ... etc ... 100001-110000 110001-120000 ... etc ... 290001-300000 and that all your images are gifs. if so the following code should work: <?php if(isset($_GET['img']) && is_numeric($_GET['img'])) { $imgN = $_GET['img']; $imgL = strlen($imgN); if($imgN >= 0 && $imgN <= 1000) { $folder = '0-1000'; } else { $t = substr($imgN, 0, -2); $min = (floor($t/10)*1000)+1; $max = ceil($t/10)*1000; $folder = $min.'-'.$max; } $imgP = './user/'.$folder.'/'.$imgN.'.gif'; if(file_exists($imgP)) { header('Content-type: image/gif'); echo file_get_contents($imgP); } else { echo $imgP . ' does not exist'; } } ?> RewriteEngine On RewriteRule ^([0-9]+).gif$ img.php?img=$1 img.php works out the correct folder the image should be in.
  12. Have a look over at portableapps.com/ for a list of apps which can installed/ran from a usb stick.
  13. You should be able to do this using mod_rewrite and bit of PHP. PHP will then serve the correct image from the necessary folder group based on the requested url. Most operating systems/filesystems have limits for the maximum number of files within in directories. I'd say it would be best to split them into numerical folders, something like 0-1000, 1001-2000 etc. Could you post some example urls of how your images are currently being requested.
  14. was me agreeing with you and you had to act like an ass again. I was thinking of die; which stops the script from running from that point regardless if it's the end of the document or not. Just cause I haven't used php in a while doesn't mean I don't know what's wrong, I said I was uncertain about the end; thing. In what way was I "acting like an ass"? end; or die; has nothing to do with the error mcerveni was receiving. The error was caused due to the short_open_tag setting being disabled. Not all PHP installations are configured to read code within short tags (<? ?> or <?= ?>).
  15. What happens when you go to http://localhost How do you know you've got malware? What OS are you using and versions of Apache, PHP (and MySQL) have installed?
  16. Change: fputs( $out, $line ); to fputs( $out, "$line\n");
  17. How PHP files are parsed when going to http://localhost is controlled by Apache. Adding PHP to the PATH has nothing to do with how PHP scripts are parsed, its to do with PHP's configuration. If Apache is serving the source code of the .php files then Apache is not configured correctly.
  18. That function is not used to insert data into your flat file. It is used to format the data to be inserted into to your flat file. You'll want to find the code which adds the data to the flat file.
  19. Set it to your routers ip address (192.168.2.11 ) rather than the hostname provided by DynDNS.
  20. Use \r\n or \r or \n \r\n is for Windows. \n is for *nix \r is for Macs note these characters only work in double quotes. PHP will treat these characters as-is if you use single quotes.
  21. You can not run multiple mysql queries in one mysql_query call. What you're better of doing is defining your queries in an array, call this $sql_queries then use a loop to loop through the array for running the queries, eg. // query for creating table. In this example a simple database for storing names/ages $sql_queries[] = 'CREATE TABLE `names` ( id INT(11) NOT NULL AUTO_INCREMENT, name VARCHAR(100) NOT NULL, age INT(2) NOT NULL )'; // list queries for populating the table $sql_queries[] = 'INSERT INTO `names` (`name`, `age`) VALUES (\'Sam\', 47)'; $sql_queries[] = 'INSERT INTO `names` (`name`, `age`) VALUES (\'Mike\', 13)'; $sql_queries[] = 'INSERT INTO `names` (`name`, `age`) VALUES (\'Sally\', 29)'; $sql_queries[] = 'INSERT INTO `names` (`name`, `age`) VALUES (\'Jo\', 21)'; // now process the queries foreach($sql_queries as $query) { echo 'Running Query: <b><pre>'.htmlentities($query, ENT_QUOTES).'</pre></b>'; mysql_query($query) or die('... FAIL!<br />Error: ' . mysql_error()); echo '... SUCCESS!<br />'; }
  22. Use implode to convert the array into a string, eg: $arr = array('one', 'two', 'three'); $str = implode(', ', $arr); echo $str; // OUTPUT: 'one, two, three' (without quotes)
  23. Have you restarted your server (eg Apache or IIS). I always suggest adding PHP to the PATH Environment Variable.
  24. Apache does not come with any GUI to manage the server. How Apache works is done by manually editting Apaches configuration file (httpd.conf). The "It Works" page is being served from the C:/(path/to/Apache)/htdocs and the file being displayed is called index.html. Apache will display files listed in the DirectoryIndex directive automatically if there is no file being requested in the url.
  25. Strange looking port, I can quite make out the little symbol to the right of the port. Is it not mentioned in your laptops manual? What make/model laptop do you have.
×
×
  • 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.