Jump to content

chantown

Members
  • Posts

    134
  • Joined

  • Last visited

    Never

Everything posted by chantown

  1. So, the PHP website runs a lot of queries How do you tell which ones are specifically slowing down the server? (stats/analysis?)
  2. Instead of doing this: if($action=="1" || $action=="2" || $action=="6" || $action=="99").. Can I do a shortcut? if($action==[2,6,3])) something like this?
  3. For example. In my index.php, I have a simple text box. I put in a word, and click Submit. I want to have my C++ script analyze this word, and do some calculations. Then, I want to pass this back to my PHP, and spit out the length, etc. to the audience. The question is: How can I use both PHP and C++ to do things?? Thank you!
  4. Hi, is there anyway to set limits within ONE select query? SELECT * FROM my_table WHERE (date = '123') <<< SET A LIMIT of 4 here. OR (name = 'sun') << SET A LIMIT of 3 here. I know that it's possible to break this into 2 SELECTS and UNION them. But is there a way to keep 1 query, and set limits between the "ORs"? thank you!
  5. Hello, Does anybody know how to find the GET variable? www.domain.com?UNKOWN=255 Is there a way to figure out what Unknown is (using some method?) and also get the value? Thanks!
  6. Well, even with this it doesn't really work: RewriteRule ^/([0-9a-z])$ /index.php?code=$1 [L]
  7. Hello there, I have a mod rewrite that doesn't seem to work Options +FollowSymLinks (optional) Options +Indexes (optional) RewriteEngine On RewriteRule ^/([0-9a-z])$ /?code=$1 [L] Basically, I would like www.domain.com/stuff123 ------> www.domain.com/?code=stuff123 Can someone find anything wrong with my code? Thanks!
  8. What is the maximum size of php sessions? For example, this has been a really weird problem lately. I have a form which a user types a Question. This question is then stored in a Session. Then I Header("Location: ") To redirect to another page, then echo the Session. The weird thing is, sometimes, it works, sometimes it doesn't!! It's really really weird. If I click around my site (logged into my site), then it works. If I just enter my site and post the Question (logged in), it won't work.
  9. What is that? I'm total noob about it. Can u explain more about it please? Thanks!
  10. Hi, I'd like to know if anyone knows how to do this: Suppose I have a form where people submit stuff through a textbox. Each time they submit something, their score +1. Their timestamp is recorded. How can I make a list of "This week's top submitters"?
  11. what? I don't get it. SELECT * FROM table WHERE MATCH(...) AGAINST(...) ORDER BY RELEVANCE BUt I cannot use the word "relevance" , of course
  12. Nevermind, i got it! preg_replace( "#[^a-zA-Z0-9 ]#", "", $input);
  13. Hi, Let's say I have a string: abc = "The fox's tail & legs were big!!!@"; How do make abc so that it removes EVERY symbol but the alphabets and the spaces? to "The foxs tail legs were big" Thanks!
  14. Does anyone know if (by default) PHP use sendmail or postfix to send a mail()?
  15. $from = "MIME-Version: 1.0" . "\r\n"; $from .= "Content-type:text/html;charset=iso-8859-1" . "\r\n"; $from .= "From: ".$from_name." <".$from_email.">"."\r\n"; $from .= 'X-Mailer: PHP/' . phpversion(); Are these enough?
  16. to mass mail 80,000 emails to a university, do you think it will go through? I am a student and I have a list of all my universitie's students in a text file. I want to send an email to all of them using php mail().
  17. With "IN" SELECT * FROM users WHERE username IN ('%gal','%saa'); ^^ that doesn't work. But this works: SELECT * FROM users WHERE username LIKE '%gal' OR username LIKE '%saa'; Is there any way I can make it work the first way? Because it saves space + convenicency a lot. thanks!
  18. I figured it out! I removed the file path in my PHP.ini for storing sessions. And then i restarted server. and tada!
  19. Edit: I did start and end the session correctly.
  20. My website is really weird: I log in, and the username session holds. But that's the only thing that holds. Other sessions gets erased! I try to set //test.php <?php $_SESSION['test'] = "yessss"; print_r($_SESSION); ?> When I go to test.php, I see my sessions for my username and my test. But when I go out of the "test.php", my username session holds but my "test" session doesn't hold anymore. Does anyone know whats wrong? Is there any way to "reset" the Sessions? (in php.ini, there's a thing called session handler = files or something?) I'm really super confused. I transferred all my files to another server, and all sessions work fine. They all hold. But for some reason this server I have keep erases the session after I leave the page. Can someone help me please? Thanks!
  21. In Apache 2.x, I can do this: include("../../misc/test.php"); but in Apache 1.x, this says include file error not found any help please?
  22. Hi, thanks for the responses this is exactly what i'm doing: <?php $image = open_image('test.jpg') or die("No good"); die("yes, it works"); ?> When i run this, nothing happens! i get a blank page. Just blank. No words, nothing
×
×
  • 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.