Daniel0
Staff Alumni-
Posts
11,885 -
Joined
-
Last visited
Everything posted by Daniel0
-
You can write an SVN post-hook script to update the version on the staging server. It's even simpler if the Subversion server is on that server as well.
-
It's an undetonated bomb?
-
The post area expands when I click the edit button thus pushing everything further down the page. You can turn quick edit off though if you wish.
-
[SOLVED] script instead of site
Daniel0 replied to Silverado_NL's topic in PHPFreaks.com Website Feedback
You may post it here: http://www.phpfreaks.com/forums/index.php/board,62.0.html -
Try to run the queries directly on the database and check your results.
-
Oh yeah that too. It's like checking if the string category equals the string a which is obviously false.
-
You need to check up on data types. It's one of the fundamental concepts of computer science. You are still using a string literal. You need to replace 'amount' with either amount or `amount`. The regular quotes won't work because these signify strings in SQL.
-
And even worse, doing SELECT 'amount' AS sum will select the string literal amount, not the field value amount. That's also why you get zero. You have two strings amount. Converting them to an integer (which is implicitly done using the arithmetic subtraction operator) gives you int 1. So 1-1=0.
-
Am I allowed to encrypt a project that uses open source files?
Daniel0 replied to killerb's topic in Miscellaneous
You can create whatever license you want. -
The index is the key with which you access an element in an array. In your case of $_GET['action'] you are trying to retrieve the index called action on the array called $_GET. In your case that index doesn't exist and you'll get a notice from PHP. You can use isset or key_exists to check this.
-
Displaying files of another directory, in a different page.
Daniel0 replied to Tammy's topic in PHP Coding Help
How exactly doesn't it work? Try this: <?php $path = '/home/path/glitters/quotes'; $webpath = '/glitters/quotes/'; foreach (new DirectoryIterator($path) as $item) { if (!$item->isFile() || ($filename = $item->getFilename()) == 'index.php' ) { continue; } echo '<a href="' . $webpath . $filename . '" class="subnav">' . str_replace(array('_', '-'), ' ', basename($filename, '.php')) . '</a><br>'; } ?> -
I just ignore people with large chunks of code without or [php] tags. If they cannot even be bothered to do that then I won't be bothered to spend my spare time on helping them for free.
-
[SOLVED] Changing all site files from html to php
Daniel0 replied to ultrasound0000's topic in Miscellaneous
That's perfectly okay. -
[SOLVED] Changing all site files from html to php
Daniel0 replied to ultrasound0000's topic in Miscellaneous
I have no experience with IIS whatsoever, but I found this using a search on Google: http://www.isapirewrite.com/ -
[SOLVED] Changing all site files from html to php
Daniel0 replied to ultrasound0000's topic in Miscellaneous
He is moving/renaming the pages. This means the old, index and linked-to page will now result in a 404. That will negatively effect his rankings. At least that's how I interpret his post. -
[SOLVED] Changing all site files from html to php
Daniel0 replied to ultrasound0000's topic in Miscellaneous
Assuming you use the same filenames, but with a php extension instead of html, then you can do this using Apache's httpd.conf or .htaccess: RewriteEngine on RewriteRule (.*)\.html$ $1.php [R=301,L] Edit: I should learn to read the entire post before replying. You're using IIS. Anyway, yes, you do need 301 redirects if you don't want to hurt your rankings. -
Editing a post converts leading spaces to html codes
Daniel0 replied to rhodesa's topic in PHPFreaks.com Website Feedback
It's a bug in SMF. It happens sometimes with the tags too. -
http://www.phpfreaks.com/forums/index.php?type=rss;action=.xml;board=*board_id*
-
There are certainly a lot of differences between XHTML and HTML. First of all, HTML is based on SGML whereas XHTML is based on XML. The X is short or extensible, i.e. Extensible Hypertext Markup Language. Unless XHTML is served as application/xhtml+xml then it won't (and should not) be treated as XML by the UAs. If it's served as text/html then it will be treated as HTML. Some people think that it is the DTD that determines whether it is XHTML or HTML, but that is wrong. The DTD is merely a document containing grammar constraints. Of course if you serve XHTML as text/html then you miss out on the "extensible" part of XHTML, but if you serve it as application/xhtml+xml then you won't have any IE users for sure. XHTML, when served as such, can be extended by any other XML based technology using XML namespaces. An example of that could be MathML. Inserting the following in an XHTML document: <math xmlns="http://www.w3.org/1998/Math/MathML"> <mrow> <mi>y</mi> <mo>=</mo> <mfrac> <mn>1</mn> <msqrt> <mrow> <msup> <mi>x</mi> <mn>2</mn> </msup> <mo>+</mo> <mn>1</mn> </mrow> </msqrt> </mfrac> </mrow> </math> Would produce something like [tex]y=\frac{1}{\sqrt{x^2}+1}[/tex] when served as application/xhtml+xml, but if you serve it as text/html then it'll look like y = 1 x 2 + 1 because all those elements are invalid in HTML and as such ignored. Another example is SVG for embedding vector graphics. Here is another difference: HTML-style <style type="text/css"> <!-- h1 { font-size: 1em; } </style> XHTML-style <style type="text/css"> <![CDATA[ h1 { font-size: 1em; } ]]> </code> If the former snippet is (wrongly) served as application/xhtml+xml then it won't work, and similarly, if the latter snippet is (wrongly) served as text/html then it will not work either. Furthermore, the default character set for HTML is latin-1 (ISO-8859-1), but the default character set for XHTML is UTF-8. Indeed the only character sets an XML parser is required to support is UTF-8 and UTF-16. This can result in an odd output littered with strange symbols if you do it wrongly. The thing is, you cannot use XHTML for Internet Explorer. It simply does not support it (the user will be prompted to download the page because IE doesn't know what to do with it). Some people have proposed to use content negotiation to serve different content to different UAs, but the problem is that a lot of the UAs lie about what they do accept. You will for instance find */* in IE's Accept header, but this is quite obviously untrue. That would constitute supporting literally every thinkable MIME type, including those which have not yet been invented. This would mean that it claims to support application/xhtml+xml as well, but it is fairly easy to verify that it does in fact not. Moreover, the working draft of XHTML 2 is not backwards compatible with XHTML 1.x or HTML 4.x. HTML 5 will be backwards compatible. It doesn't look like XHTML 2 is going very strong whereas HTML 5 is well on its way. There are a number of subtle syntactical differences between XHTML and HTML. Most notably the XML self closing tag. HTML does not support this. If you have <img src="foo.jpg" /> in HTML (or indeed XHTML served as text/html which then de jure is HTML) then it will technically speaking be invalid. The / is regarded as an invalid attribute and discarded. So a lot of those websites featuring "Valid XHTML 1.0" should say "Invalid HTML 4.01". All of those are just some of the differences between XHTML and XML. In 2007, HÃ¥kon Wium Lie (CTO of Opera and W3C member) said "So, I don't think XHTML is a realistic option for the masses. HTML5 is it." (source). Microsoft has also expressed that XHTML will not be supported in IE in the near future. Numerous other notable people in the industry have also stated that HTML is the way to go. There is no reason why you cannot do that in HTML as well. By the way, I'm going to sticky this topic.
-
Don't take it as offense. I'm merely saying that one should have a broad knowledge of their entire tool set such that they can better make an educated estimation as to what would be better to choose in a given scenario. Part of what makes you a good programmer is that you are able to pick the right tool for the right job. If something for some reason is better than the latest cutting edge whiz-bang technology or whatever you perceive to be "cooler", then use that instead. Considering that you're 16 years old, it wouldn't take long before to you an increasing extent will be required to argue for your opinions during your education. Just because something is newer doesn't necessarily make it better. That fallacy is called argumentum ad novitatem. XHTML does have some application, but for a regular website I do not think it's the right tool to use.
-
http://www.phpfreaks.com/forums/index.php/topic,241905.msg1128777.html#msg1128777 What separates pros from amateurs is that the former group knows why and when to use a specific tool. Just saying.
-
I experienced that yesterday, but not anymore. I figured there were problems with the network or something.
-
Is it Important to Create a Web Service for PHP Based Application
Daniel0 replied to binumathew's topic in Application Design
It depends on YOUR requirements! -
How can we Get all the Text in the Webpage?
Daniel0 replied to binumathew's topic in Application Design
preg_replace('#</?html>#i', '', file_get_contents('http://www.phpfreaks.com')); I don't understand what you're trying to do though. -
92.3% of all statistics are made on the fly. It's a rhetorical effect, like when you say "this takes forever" although the running time of the operation isn't in fact infinitely long. I agree though. It shouldn't be that difficult to find a PHP job. N1CK3RS0N, you might be looking the wrong places for work.