Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
How would we know how to fix it without seeing your HTML and CSS? Besides, this has nothing to do with PHP.
-
I didn't bother to read all your code, but you say that it will receive the same extension as the old filename. That means you must know the extension, so can't you just use something like $new_filename.$extension?
-
Infinite loops are bad. That's all I have to say on the subject. Depends. For web development, yes. I haven't done a lot of application programming, but AFAIK it's an infinite loop that keeps the application from terminating just after starting.
-
http://en.wikipedia.org/wiki/Recursion#Recursion_in_computer_science
-
1. last name: steelman 2. firstname: ronald 3. graduation year: (20)06
-
[SOLVED] Fractional Indices and Negative Numbers
Daniel0 replied to GingerRobot's topic in PHP Coding Help
You are aware that ^ is a bitwise operator and not an arithmetic operator in PHP, right? It means bitwise xor. That might give unexpected/unintended results. E.g. <?php echo 5^9; ?> outputs 12 and not 1953125 because 5 in binary is 00000101 and 3 in binary is 00001001, then the only bits that are set (but not in both) is the 4 and 8 meaning it'll give 00001100 which is 12 in decimal. Edit: See: http://www.phpfreaks.com/tutorials/151/0.php -
Nope. 0/0 is undefined. http://mathforum.org/dr.math/faq/faq.divideby0.html Sure, but sin 360 = 0 and cos 360 = 1. tan x is defined as sin x/cos x therefore must tan 360 = sin 360/cos 360 = 0/1 = 0
-
http://php.net/operators.arithmetic http://php.net/math http://php.net/bc That's what you need to know. Something like 1+2 is not an equation (note spelling). It means when two things are equal, but if you only have one thing (i.e. 1+2) then it cannot be an equation. Something like 1+2=3 or 1+x=3 would be an equation. What you are talking about are expressions. Equations are used to state equality between two expressions.
-
AFAIK the computer itself distinguishes between text and images. Take for example two files: text.jpg and text.txt text.txt contains "test" and test.jpg is an image saying "test". <?php echo 'text.txt contents:\n----------------------------\n'.file_get_contents('text.txt').'\n----------------------------\ntext.jpg contents:\n----------------------------\n\n'.file_get_contents('text.jpg').'\n----------------------------'; ?> Output would be something like this: text.txt contents: ---------------------------- test ---------------------------- test.jpg contents: ---------------------------- *unreadable data here* ---------------------------- The difference is that while both an image and a text string is displayed on a computer monitor it will just be pixels but you couldn't get the computer to compare the image and the text (without OCR software) and you can't easily get the computer to e.g. "automatically" change the text to "hello" instead once the initial data was generated, but you can with strings.
-
I suppose that it technically wouldn't be text then. It's just a number of e.g. black pixels on a white background arranged so you can read it as text. PHP cannot format text. That is just not what it is designed to do.
-
From what I know you should do fine with a Visa card no matter what country it is issued in. You could just try. If it accepts your card then it works, if it doesn't, well... then you can't use your card.
-
[SOLVED] Most important PHP functions to learn in 3 hours
Daniel0 replied to richardw's topic in Miscellaneous
Ah, I see... print returns true (well, actually it returns int 1, but that'll still evaluate to true) and therefore $displayed will hold the value of true. It will only be printed if $displayed is false. I forgot print returned a value, I can't remember ever having used it. -
[nobbc] is the tag to use... not bold bold Edit: I see you tried to use the <i> tag in the string, but that is still using HTML and it is the HTML that is making it italic when rendered by a browser. It just outputs <i>Hello</i>.
-
[SOLVED] Most important PHP functions to learn in 3 hours
Daniel0 replied to richardw's topic in Miscellaneous
Very simple conditional message output. I've used this in a few situations, usually for error messages. <?php // If some message hasn't already been displayed, then show it. If it hasn't, then don't show it. $displayed = $displayed ? $displayed : print("Some message."); ?> You can't do that with echo. You can, but you need to change it a bit. <?php echo $displayed ? null : "Some message."; ?> -
[quote author=mattison link=topic=118552.msg678267#msg678267 date=1187814932] i have voted for other, as i like custom forums, made from a package and then rescripted, but out of any non payed, PHPBB - easy to customise SMF - profetional and great forums (just like PHPfreaks) [/quote] Preferring phpBB or SMF is kind of irrelevant in this case as the question is which [i]paid[/i] forum system you prefer. Neither of the two are paid.
-
There was probably a reason why it was locked. I doubt they'll open it again.
-
HTML is a markup language and PHP is a programming/scripting language. HTML can do things PHP can't too.
-
Argument 2, 3 and 4 are optional. You don't need them. You need argument 2 (filename) or course if you are going to save it.
-
intalling PECL extensions
Daniel0 replied to a2bardeals's topic in PHP Installation and Configuration
Have you tried something like $ pecl install apc ? -
Best way to add a PHP element to an HTML page?
Daniel0 replied to Lady_452's topic in PHP Coding Help
You can do it in .htm pages. You just need to setup the server up to do so: AddType application/x-httpd-php .htm (httpd.conf or .htaccess) Other than that I really don't understand your question. -
There is SMF for example which this forum is.
-
It looks really good. Try putting outline:none; on the tabs, that'll remove the, well... outline that's created around them when clicking them in Firefox.
-
If it contains 0000-00-00 then it isn't null, but I'm not sure what she means. Btw, how come your username says Jennifer, but you sign your post Nadine? o_O
-
[SOLVED] Determine what server platform your deploying on?
Daniel0 replied to tim_perrett's topic in PHP Coding Help
You can use php_uname('s'); to determine the server OS. Note that there is a built in constant called DIRECTORY_SEPARATOR which contains the directory separator for the server OS (i.e. \ for Windows and / for Unix).