Jump to content

Draicone

Members
  • Posts

    18
  • Joined

  • Last visited

    Never

Everything posted by Draicone

  1. Easy enough. Oh yes, if you want to make your code look more graceful, use exit() instead of die() :-\
  2. [code]value='\r\n'[/code] As mentioned before, this tag is invalid. Also, a \r\n in HTML is meaningless, it translates to a carriage return followed by a line feed (i.e. an overloaded windows new line). Replace \r\n with <?php echo "\r\n"; ?> to see how it works. If your SQL surrounds the value inserted with single quotes, try adding this line just before it, assuming $html is the content of the textarea tag within the $_POST array: [code]$html = str_replace("'","\\'",$html);[/code] This should effectively escape it. If you use double quotes: [code]$html = str_replace('"','\\"',$html);[/code] If you use that other quote symbol, the `, just make sure there aren't any in your textarea tag and ignore this.
  3. [code]Action application/x-httpd-php "/php/php-cgi.exe"[/code] Try setting that to C:/php/php-cgi.exe and, if possible, don't use a ScriptAlias.
  4. If you aren't familiar with installing PHP and configuring Apache, you can use wamp server for a test server >> [url=http://wampserver.com/en/]http://wampserver.com/en/[/url] << but don't use it for a production server as it's terribly insecure.
  5. If you have problems converting, you can open all your files at once in a tabbed browsind text editor like Notepad++ and run one search and replace across all files.
  6. Have you used an AddType in your httpd.conf to map .php files to php.exe? And you have to put files in your htdocs directory unless you use a virtual host in httpd.conf.
  7. Unless you absolutely need it, there's not much point in even upgrading to MySQL 5, MySQL 4 is fast enough and powerful enough for most sites.
  8. Sorry, improvement on that code: [code] <?php function banUser($username,$reason) { // Code to ban user } $line = "/ban ABC For being ABC"; if(preg_match("/\/ban ([\w]+) (.+)/i",$line,$matches)) banUser($matches[1],$matches[2]); ?> [/code] Where's the edit function? :P
  9. Try this: [code] <?php function banUser($username,$reason) { // Code to ban a user } $line = "/ban ABC For being ABC"; preg_match("/\/ban ([\w]+) (.+)/i",$line,$matches); if(isset($matches)) { banUser($matches[1],$matches[2]); } ?> [/code] You'll have to write the code to ban the user. It compiles perfectly.
  10. I've heard you can also make the change globally across scripts in a directory using .htaccess (plugs in to the parser).
  11. Try this: [code]<?php // <db connect code etc...> while($row = mysql_fetch_array($result)) { $mailto[] = array("to"=>$row['email'],                   "subject"=>"Test email",                   "message"=>"Test email message",                   "from"=>"someone@mydomain.com",   "headers"=>"From: $from"); } mysql_close($con); foreach($mailto as $mail) mail($mail['to'],$mail['subject'],$mail['message'],$mail['headers']); ?> [/code] Hope this helps.
  12. It should actually work fine. In fact, for URLs and SRCs, you're meant to use an &amp; to encode the & (because the & denotes a HTMl character entity, which is not present, so you have to use the entity for the & itself). What PHP version are you using?
  13. This line: [code]mysql_connect(mysql.someserver.net,$username,$password);[/code] Should be ok without the quotes, because PHP will look for a defined value of each of those names, throw an error and then assume they are all one string (including the dots). Ask godaddy for your MySQL server, not the path to the local socket.
  14. Well, no, because the problem is that it is selecting the least of all those columns. You need a query for each. I suppose you can use a for loop in php to automate the process.
  15. Try right clicking and click view source (view page source in firefox), and look for the content inside the textarea html tag. It may just be a problem of the tag being prematurely closed, or the value not inserted between the tags properly.
  16. I'll assume the problem is that your SQL query does not match more than one row. You need to use an OR statement. For example: DELETE FROM `table` WHERE `username` = 'A' OR `username` = 'B' OR `username` = 'C'; And so on.
  17. Try doing it using the UNIX timestamp. [code]<?php $period = 5; $expiry_date = date('Y-m-d',time()+($period*24*60*60)); ?>[/code]
  18. Try adding a bit of HTML code to your form code: [code]<input type="hidden" name="upload" value="true" />[/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.