Jump to content

GingerRobot

Staff Alumni
  • Posts

    4,082
  • Joined

  • Last visited

Everything posted by GingerRobot

  1. I can't remember what the default size it, but it can be changed. Mutley: Does your host actually allow you to increase the memory limit?
  2. Yeah, it is. I had a few problems with it slowing down my computer when i last used it though. I switched to Avira which seemed ok though i'm now using McAfee since my university provides it for free. As for spyware, i normally use spybot and ad aware.
  3. You may wish to read this article on storing hierarchical data: http://dev.mysql.com/tech-resources/articles/hierarchical-data.html
  4. It looks to me like you're overcomplicating the issue. You don't need to search and then replace - you can just use preg_replace. preg_match() only returns the first match - you have to use preg_match_all() to find all matches in a string. I suspect this is causing all of your URLs to be replaced by the first one. Something like this should work: <?php $patterns[] = "|\[url\](.*?)\[/url\]|is"; $patterns[] = "|\[url=(.*?)\](.*?)\[/url\]|is"; $replacements[] = '<a href="$1">$1</a>'; $replacements[] = '<a href="$1">$2</a>'; preg_replace($patterns,$replacements,$string); ?>
  5. Yeah - it uses safari: http://www.apple.com/iphone/features/safari.html
  6. Well we all know CV's just been trying to prove that he does indeed make the longest posts
  7. Yes, that's possible. You'd just need to parse the web page to find out if the gamertag exists or not. Of course, the website might not be too happy with you bombarding them with requests. $alpha = "A B C D E F G H I J K L M N O P Q R S T U V W X Y Z"; $alphaArray = split(" ", $alha); The range function exists for a reason
  8. You need to set the CURLOPT_FOLLOWLOCATION option to false and the CURLOPT_RETURNTRANSFER option to true. Then parse the returned data for the location. The method of redirection determines where you need to look. For example, if you're being redirected with an HTTP header, then you'll also need to set the CURLOPT_HEADER option to true and look for the text after 'location'
  9. Perhaps it's just me, but i've absolutely no idea what your question is. What is the problem?
  10. I would start by adding these two lines to the top of your script: error_reporting(E_ALL); ini_set('display_errors','On'); This will mean you'll actually be seeing all of the error messages. For starters, you'll get a whole host of undefined constant messages for these lines: $array_name[business]="$_POST[business]"; Since the key of the array should be quoted, like so: $array_name['business']=$_POST['business'];
  11. Not quite. The == operator has a higher precedence than the && operator. Therefore, $filesize3 would first be evaluated, then $filesize4 == 0 would be evaluated assuming $filesize3 is true, owing to shortcut evaluation.
  12. Err, isn't it randomized because you made it so? $PokémonRand2= rand(1, 49);
  13. You need to order your query by your date, then keep track of the month. When it changes, echo out and reset the total. I couldn't see where this was actually needed in your code, but it would look something like this: <?php $sql = "SELECT *,DATE_FORMAT(yourdatefield,'%c') AS month FROM yourtable ORDER BY yourdatefield"; $result = mysql_query($sql) or trigger_error(mysql_error(),E_USER_ERROR); $prevmonth = mysql_result($result,0,'month'); $total = 0; while($row=mysql_fetch_assoc($result)){ if($prevmonth != $row['month']){ echo $total.'<hr />'; $total = 0; $prevmonth = $row['month']; } echo $row['hours']; //echo out any other information $total += $row['hours']; } ?> I've assumed you have some sort of timestamp stored in your database and have therefore extracted the month from this.
  14. That's not going to work. That would be fine if you wanted to let html files be parsed as php but, as i understand it, those html files no longer exist. You'll need to use the mod_rewrite apache module, with the following in a .htaccess file in your web root: RewriteEngine on RewriteRule (.*?)\.html$ $1.php
  15. Yep, that should be fine. And that sounds about right. When the user registers, you should store this validation code in the database too. You'd then search the database for the validation code that the user provides and then active that user's account.
  16. See this post: http://www.phpfreaks.com/forums/index.php/topic,211483.msg963158.html#msg963158
  17. Doesn't really matter either way so long as the link couldn't be guessed.
  18. Why's that? Since PHP uses the $ symbol for variables, there's no issue with using reserved words as variable names.
  19. Start by reading this sticky. You need to make sure you have no output whatsoever(that includes whitespace) prior to using session_start();
  20. $username is still undefined. Where are you trying to get it from? The database? Oh, and the second parameter for mysql_result should be integer corresponding to the row in the result set you wish to use.
  21. Why don't you add a field to your database table which you can use to flag files as assigned or not? If someone uploads a file again, just change the value in the database.
  22. You need to search your database to find out the number of posts by that user prior to inserting the data. Something like: $sql = "SELECT COUNT(*) FROM yourtable WHERE username='$name'"; $result = mysql_query($sql) or trigger_error(mysql_error(),E_USER_ERROR); $num = mysql_result($result,0); if($num > 0){ //dont insert give use error message }else{ //insert the comment into the database }
  23. Meh, as far as i'm concerned, PHP freaks couldn't charge for the freelance forum. To charge for it would be to seen to implicitly provide some sort of guarantee on the quality of work. I can see the posts now..."you're making money from it; it's not fair I lost money by being scammed (because i'm retarded is by the by)". The ads aren't that intrusive. Let's go with the flow.
×
×
  • 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.