Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
I don't think you can use [code]$aname == 'height' || 'width'[/code] You would need to use [code]$aname == 'height' || $aname == 'width'[/code]
-
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.
-
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)
-
Which PHP-Editor do you think is the best?
Daniel0 replied to briananderson's topic in Miscellaneous
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. -
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]
-
Which PHP-Editor do you think is the best?
Daniel0 replied to briananderson's topic in Miscellaneous
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. -
You can "skin" firefox too...
-
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 ;)
-
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]
-
The text to display on page is read from a text file..BUT
Daniel0 replied to IMakeLousyCode's topic in PHP Coding Help
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. -
[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]
-
[code]<?php echo base64_encode(file_get_contents("some_image.png")); ?>[/code] That should do it.
-
Use != instead of == or if you want to check if the field is empty then just =''
-
Discussion - Do you separate your JS, HTML, and PHP?
Daniel0 replied to roopurt18's topic in Application Design
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. -
Is it "wrong" to piggyback off someone's wireless network?
Daniel0 replied to a topic in Miscellaneous
Well, providing I knew that a connection was left intentionally open, then I probably would too (except if my connection were better). -
Is it "wrong" to piggyback off someone's wireless network?
Daniel0 replied to a topic in Miscellaneous
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)'. -
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)
-
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]
-
Couldn't you just type the URL yourself or get it from a config file or form field or something?
-
[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
-
[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?
-
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.
-
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.
-
It should output [code]BBB CCC[/code] since $value is not defined.
-
You would just make an exact copy of the current theme and then just change the header.