Jump to content

oni-kun

Members
  • Posts

    1,984
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by oni-kun

  1. I'd recommend including the MIME headers. I'm not 100% sure if the above example was correct.. but let me show you mine. The web host usually doesn't have control of much btw.. // Headers $header = "From: ".$_POST['name']." <you@yoursite.com> " . "\r\n"; //replace POST and address in <>.. $header .= 'MIME-Version: 1.0' . "\n"; $header .= 'Content-type: text/html; charset=UTF-8' . "\r\n"; This makes MSN assume it is a real message and treats it with more compatability.
  2. Any clue? should I put a file on another part of the server and used file_get_contents to grab it..
  3. With your random selection, check if the ID exists before calling it? Seems very simple, as those deleted entries, nothing you can do with them.
  4. I have an index file that handles my site, basically index.php?page=ip will activate "require('./ip.php')". In the included file I have $ip = $_SERVER['REMOTE_ADDR']; and when it FIRST displays, it displays "10.15.15.254" or similar, the server's IP! I have tried doing: $ip = $_SERVER['REMOTE_ADDR']; //before require, so IP variable is passed require('./ip.php'); in the INDEX and allowing the required file to take it, but it still does it. It turns to the user's actual IP when they refresh etc. Why?!
  5. if (count($ping_result) > 1){ What is the output if it cannot be found? "Host not reachable" IS > 1. You can't compare it that easily, you'll need to check if it is a number or a string.
  6. It does what it says! PHP requires input, and those HTML forms give the text. Lets say in the <input method=post name="lastname">, had name="lastname". This would mean the following PHP code can access it: $last_name = $_POST['lastname']; echo $last_name; But if you were to use it on the same page, you'd write: (HTML form above php code..) <?php if (isset($_POST['lastname'])){ $last_name = $_POST['lastname']; echo $last_name; } else { echo "Warning, You haven't entered a last name!"; } ?>
  7. PEAR provides some very useful libraries that I use to parse CSS/XML with, I saves a lot of time having to write parsers database interfaces etc..
  8. Have you ever considered using htmlentities with ENT_COMPAT parameter? It's infinitely easier and only converts double quotes and &, and alike. echo htmlentities('<blockquote><p>This is a paragraph to test & test. Quotes: "" " """</p></blockquote>', ENT_COMPAT);
  9. You can set the default timezone of your server with the following code, Please place it at the top of your code: <?php date_default_timezone_set('America/Los_Angeles'); $script_tz = date_default_timezone_get(); if (strcmp($script_tz, ini_get('date.timezone'))){ echo 'Script timezone differs from ini-set timezone.'; } else { echo 'Script timezone and ini-set timezone match.'; } ?> If you do not know the code for your timezone you wish to select, find it here! http://www.php.net/manual/en/timezones.php Hope this is what you mean.
  10. This is wrong! You need to use '==' for comparison. if ($username == "administrator") { header("Location: admin.php"); }
  11. %20 is correct, And it (should) once downloaded be spaces. It's sometimes hard to modify code if the programmer was bent and made it (headers, code etc.) were made to strip out spaces. Best you can do is replace the "" with "-" so it'll appear as "Artist-Song.mp3", that is your best bet.
  12. You may want to place your $_POST statement in IF's. Such as this: if (isset($_POST['MerchantType']) && isset($_POST['County'])) { $MerchantType = $_POST["MerchantType"]; $County = $_POST["County"]; $result = mysql_query("SELECT * FROM $tablename WHERE County = $County"); } This will make it so that code will only be executed, if the page sends the $_POST. Very useful for debugging, then you can look at your dropdown box and see if the NAME is correct etc.
  13. Stop being so literal! He meant something like this. RewriteEngine On RewriteCond %{HTTP_HOST} ^example\.com$ [NC] RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L] Of course, rewriting both 'example.com's to your domain name, It'll hardwire (the proper way) http://domain.com to 301 to http://www.domain.com preserving the path etc. Place that in a .htaccess file on your root.
  14. It returns ALL the headers in one array, this should be very easy to parse and do much more than the 'live HTTP headers' addon. They use the same methods of retrieval, getting headers.. <?php $url = 'http://www.example.com'; print_r(get_headers($url)); print_r(get_headers($url, 1)); ?> Expected result: Array ( [0] => HTTP/1.1 200 OK [1] => Date: Sat, 29 May 2004 12:28:13 GMT [2] => Server: Apache/1.3.27 (Unix) (Red-Hat/Linux) [3] => Last-Modified: Wed, 08 Jan 2003 23:11:55 GMT [4] => ETag: "3f80f-1b6-3e1cb03b" [5] => Accept-Ranges: bytes [6] => Content-Length: 438 [7] => Connection: close [8] => Content-Type: text/html ) Array ( [0] => HTTP/1.1 200 OK [Date] => Sat, 29 May 2004 12:28:14 GMT [server] => Apache/1.3.27 (Unix) (Red-Hat/Linux) [Last-Modified] => Wed, 08 Jan 2003 23:11:55 GMT [ETag] => "3f80f-1b6-3e1cb03b" [Accept-Ranges] => bytes [Content-Length] => 438 [Connection] => close [Content-Type] => text/html )
  15. oni-kun

    => and <=

    "=>" is a key assignment. "'keyOne' => "the value"," is like an ARROW. (That's where you were confused) "<=" is an operator, such as.. < OR =, as in 'LESS or EQUAL TO', note operators are before the equals in this math.
  16. All the browser sees, is what is parsed. It does not even know if PHP, PERL or ASP is even generating the page unless the server tells it. The only way possible is if you gain FTP access etc. But it's impossible to change the hardcoded security the server has.
  17. You have to understand. ZEND encoder is a a C program that is 60MBs. It's impossible to create one yourself. Your only choice is to BUY an encoder software for your script, or obfuscate, which isn't 100% secure.
  18. WAMP or "WAMPServer" are the only options you can have. PHP requires an engine to parse the code, unlike HTML (only needing the browser) and thus can only be run on a server. WAMP is a simple download that packages Apache, SQLserver and PHP all in one (small download) allowing you to run PHP code in C:\wamp\ht_docs(or www)\ And those files will appear on http://localhost/ , as parsed PHP.
  19. I'm afraid in that exact code there is nothing about taking out the spaces from the title of the mp3. Browse the code elsewhere for something along the lines of 'fopen()' function where it actually uploads the file, it should show REGEX or str_replace() where it filters the name.
  20. Are you < 17? This is illegal and breaks their own host's TOS of your use, you can be held responsible for lost damages/data and fined a hefty amount. Worst case,of course. I would not recommend it.
  21. Yes.. Use something SIMPLE and correct, such as this: echo $_POST['email'];
  22. This is called obfuscation, and requires very complex libraries and classes. I doubt you can find something without costing money online, it's just not used, why would you need to obfuscate server side code, to sell?
  23. You need to set permissions, but here is concept code.. <?php function createAlbum() { if(!is_dir("/albums/".$row['username']."/".$row['albumname'])){ mkdir("/albums/".$row['username']."/".$row['albumname']"); //After cleaning and checking for any security risks. } //Upload data now using forms.. } It was something similar to what I did before..
  24. Some things are finicky, double check your SQL service and make sure it has the proper versions/functions enabled. You may want to run a few simple test queries in a separate file to test the proper functioning of all aspects of it. I may also recommend the better version "WAMPServer" if you don't already have it, It worked for me when I had problems.
  25. Is register.php the file you put ob_start() in? If it's another php file than I believe you must do the same for it. Headers are meant to be sent before content, so you have to use this 'bandage' to let it work that way. Sometimes they completely fail and you must find a different method, but this one doesn't seem too hard.
×
×
  • 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.