Jump to content

Daniel0

Staff Alumni
  • Posts

    11,885
  • Joined

  • Last visited

Everything posted by Daniel0

  1. I don't think you can use [code]$aname == 'height' || 'width'[/code] You would need to use [code]$aname == 'height' || $aname == 'width'[/code]
  2. I don't. I think places like that are lame. There is a similar website in Denmark, where I come from, and it suck too.
  3. 1. Do not use (nonbreaking-)spaces to move the text in to be centered. Use the text-align CSS attribute. 2. Make sure it validates: http://validator.w3.org 3. Use XHTML instead of HTML. 4. Instead of [quote] For Now Visit: Visit Kieran's official site For Now Visit: Visit Kieran's official Index For Now Visit: Visit my official MySpace page [/quote] use [quote]For now visit: Kieran's official site Kieran's official Index My official MySpace page[/quote] 5. Put a page header (e.g. using h1)
  4. I don't see the point in using notepad. There is no syntax highlighting and no automatic indendtion and such things. I don't think it's "cool" to make the job more difficult. I believe it will improve your efficiency with code-completion, automatic indendtion, syntax highlighting etc.
  5. I would write it like this: [code]<?php function authorise($user) { echo $user; if($user == TRUE) { if(!mssql_query("SELECT USER_ID FROM users WHERE uNAME = {$user}")) { echo "You are not entered in the Database, please see the Administrator"; exit; } else { $success = TRUE; } } else { $success = FALSE; } return $success; } ?>[/code]
  6. I can't remember if I've already posted in this topic, so I'll just do it. I voted Other, because I like Zend Studio the best.
  7. You can "skin" firefox too...
  8. It checks if $this->authorise($user) not returns true (returns false). So if $this->authorise returns true if the user is authorized then it checks if the user is not authorized. What happens if $user is null, empty, false or something similar depends on what is inside the function. It's spelled authori[b]z[/b]ed by the way ;)
  9. To reverse it just: image.php: [code]<?php $string = "bla bla encoded image bla bla"; header("Content-type: ..."); // write the mime-type instead of the dots echo base64_decode($string); ?>[/code] other_file.html: [code] ... <img src='image.php' alt='image' /> ...[/code] Or you may do it like this if you want it in one file: some_file.php: [code]<?php $string = "bla bla encoded image bla bla"; if(isset($_GET['image'])) { header("Content-type: ..."); // write the mime-type instead of the dots echo base64_decode($string); die(); } echo "<img src='some_file.php?image' alt='image' />"; ?> [/code]
  10. No... you can have a file open AND view it in a browser at the same time. And multiple users can see the same file at the same time.
  11. [code]<?php // we have $last_post_time defined as when the user last posted if($last_post_time+3600 > time()) { // user may not post } else { // user may post } ?>[/code]
  12. [code]<?php echo base64_encode(file_get_contents("some_image.png")); ?>[/code] That should do it.
  13. Use != instead of == or if you want to check if the field is empty then just =''
  14. I usually keep most of the javascript in seperate files, sometimes in a folder for it self. When I code I always start the file with <?php and end it with ?>. It don't end and start again. In big applications I make a template system, else I just echo it. If many lines I use heredoc.
  15. Well, providing I knew that a connection was left intentionally open, then I probably would too (except if my connection were better).
  16. But how would you know if it's intentionally open? As ober says, many people don't know how to lock it down/encrypt it, so how would you know if it's open because they chose so, or if it's open because they don't know that it's open to all/don't know how to lock it? Edit: I voted 'Yes (always)'.
  17. You could do something like: [code]SELECT * FROM topics ORDER BY id DESC LIMIT 10;[/code] or [code]SELECT * FROM topics ORDER BY date DESC LIMIT 10;[/code] (date will have to be a timestamp)
  18. Here you go... (grrr, I can't attach it... <_<) [url=http://img227.imageshack.us/my.php?image=mydesktopvo4.png][img]http://img227.imageshack.us/img227/3388/mydesktopvo4.th.png[/img][/url]
  19. Couldn't you just type the URL yourself or get it from a config file or form field or something?
  20. [code]<?php $url = parse_url($the_url); if($url['host'] != 'example.com') { // do stuff here } ?>[/code] I'm not sure what you mean, but this does what I think you mean. You might wan't to read this: http://www.php.net/manual/en/function.parse-url.php
  21. [quote author=Barand link=topic=107539.msg431612#msg431612 date=1157897351] Because the British establishment seems incapable of coming up with standard structures for code (be it phone area codes or postcodes) I store postcode fields twice in my postcode table, formatted and with no spaces for searching [pre]| W1H 7YH  | W1H7YH  | | ST64 2HG  | ST642HG  | | N12 2ES  | N122ES  |[/pre] [/quote] Wouldn't it be easier to do [code]str_replace(' ','',$string)[/code] on them?
  22. http://www.phpfreaks.com/forums/index.php?action=profile;u=33508;sa=showPosts He is just re-asking his question for help with his warez site again. This topic should be closed.
  23. example_fake_cron.php: [code]#!/usr/bin/php <?php while(1==1) { system("rm -rf /user/somebody/public_html/some_script/tmp/*"); sleep(3600*15); } ?>[/code] Commands to run in shell: [code]chmod +x example_fake_cron.php ./example_fake_cron.php[/code] Note that if you have the PHP executable at another path you would have to edit the shebang-line ([tt]#!/usr/bin/php[/tt]) to match your installation.
  24. It should output [code]BBB CCC[/code] since $value is not defined.
  25. You would just make an exact copy of the current theme and then just change the header.
×
×
  • 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.