Amezis
Members-
Content Count
536 -
Joined
-
Last visited
Everything posted by Amezis
-
Is Xml A Programming Language Or A Database Language?
Amezis replied to coolcat50's topic in Programming
XML is certainly not a programming language, neither is HTML or XHTML. You can not do any calculations with XML, it's impossible to do 2+2 with XML. XML is a general-purpose extensible markup language. XHTML and HTML are also markup languages, but with defined tags and values. It is not a database language either, but XML files can be used as databases because a XML document can easily be parsed by another program. XHTML, RSS and SVG are examples of markup languages that use the XML syntax, but none of them are related to databases. -
To display the date and time, follow the links posted by jlhaslip. If the server is located in another timezone, you will need to use date_default_timezone_set() to set another default timezone before you use time() and date(). More information about this function can be found at http://forums.xisto.com/no_longer_exists/ (click here to see a list of all supported timezones). Hope that helps
-
I am usually testing my scripts locally, thus elimitating the need to upload the files every time I update them (and the time to reload the page is obviously smaller). I've just installed XAMPP, a package containing Apache (with some extra mods), PHP (and several addons and Pear scripts), MySQL, phpMyAdmin and a few other useful scripts. I've tried other Apache+PHP+MySQL packages, including WAMP (posted by OneMinute) and Apache2Triad, but XAMPP is by far the best and most reliable one. On the other hand, it's not recommended if you want to run a public server, but it's awesome if you're only going to use it to test your scripts.
-
Content Or Menu First In The Html? What should be placed first?
Amezis replied to Amezis's topic in Search Engines
Alright. I know how important content is for SEO, but at the same time, I hesitated to place the menu at the end, as the links may seem less important for the spider when they are at after the content. The main page would surely get a good rank, but I wondered whether the bots would find the other pages as important when the links to those pages were at the end. -
Alright, I am currently re-designing my site because it still uses tables for layout Anyway, while I was working with the new code, I realised that with the CSS I was using, I could place the menu DIV before or after the content, and both would work fine. However, which solution is best for SEO? Should the content appear at the beginning of the HTML, or should the menu appear before the content in the HTML (the location when rendered with CSS would be the same).Some sites have the HTML for the menu at the beginning (such as w3.org), others have it at the bottom (such as Wikipedia). Which one is best SEO-wise?
-
Well, I don't have a PlayStation and I doubt I will buy one (I'd rather spend money on my computer ). Gran Turismo is a great game and I was wondering if there were any similar games for PC. I've looked around with no luck, it seems like Gran Turismo is the only really realistic and good racing game. :(I think the main reason to why I like GT is because there is a wide range of cars, upgrades, and lots of tracks, cups, tournaments etc to race on.
-
What Does This Do? ban = (data-login) ? lban : iban;
Amezis replied to peroim's topic in Programming
It's the same code as this: if ($data->login) { $ban = $lban;}else { $ban = $iban;} -
Thanks a lot Truefusion, but there is still one bug: If a word has been added, it will highlight everything after the word. So the script wouldn't work correctly with this: $var1 = 'A web site with information and stuff';$var2 = 'A web page with nice information and stuff'; page/site will be highlighted correctly, but I added the word "nice" in the second variable, so everything after that word has been highlighted. Any idea on how to fix that?
-
Well, I've never used foreach. And there is an error with your code. I entered these vars: $string1 = "test first and test again";$string2 = "test second and test again"; And this is what it returns: <b><b>test</b></b> second <b>and</b> <b><b>test</b></b> <b>again</b> On the words "test", there are two <b> tags, because the word "test" appears twice, and it actually highlights the words that are the same, not the words that are different. And there was another bug: $string1 = "a variable is here";$string2 = "a variable is there";// Output:<b>a</b> v<b>a</b>ri<b>a</b>ble <b>is</b> t<b>here</b>So "a" is highlighted inside the word "variable" too.
-
I need a script that compares 2 variables, and looks for a difference between them. It will then highlight the words that are different, as shown in the image below: So in the left cell, the yellow text is the text that has been removed OR replaced. In the right cell, the green text is the text that has replaced some text in the left cell, OR new text. This script will be used to compare 2 versions of a document stored in the database, to see the difference between each change (all revisions are stored in the database). I know that it's possible with PHP, because Wikipedia, which is coded in PHP, uses it, but I have absolutely no clue on how to do it. Any suggestions? Note: This was originally posted back here, but that topic seems dead, so I decided to make a new topic.
-
I need a script that compares 2 variables, and looks for a difference between them. It will then highlight the words that are different, as shown in the image below: So in the left cell, the yellow text is the text that has been removed OR replaced. In the right cell, the green text is the text that has replaced some text in the left cell, OR new text. This script will be used to compare 2 versions of a document stored in the database, to see the difference between each change (all revisions are stored in the database). I know that it's possible with PHP, because Wikipedia, which is coded in PHP, uses it, but I have absolutely no clue on how to do it. If you could make that script, it would be great!!
-
The official abbreviation is Fx, not FF.
-
Well, Microsoft has just released Windows Internet Explorer 7 (note that MSIE is no more, it is now WIE ). What are your opinions about the new IE, if you have tried it? Is it better than Opera or Firefox? Personally, I think it is better than MSIE 6, and pretty much the same thing as FX, but I still miss features that are integrated into Opera, such as a mail client, IRC client and mouse gestures. There is also a major change when rendering web sites: The text is anti-aliased. Personally, I don't like that, as small, anti-aliased text is harder to read on computer monitors. So what are your opinions?
-
It didn't help me much, but I finally found out how I could fix everything. Here's the code I'm using: RewriteEngine onRewriteCond %{REQUEST_FILENAME} !-fRewriteRule (.+)$ item.php?n=$1
-
Well, I ran into a problem. I tried to make a code that matched everything, except strings containing the word "php", "gif", "jpg" etc. I tried doing something like this, but it didn't work: ([^\b(php|gif|jpg)\b]+)$ But that works just like if I would do this:([^phgifj]+)$ That code is a part of a larger code that only works partially: RewriteEngine onRewriteRule ([^\b(php|gif|jpg)\b]+)$ item.php?n=$1 Some strings, such as asd works, but fgh doesn't work. Any help for either of these problems would be greatly appreciated! As you might see, I'm no master with regex... well, not yet
-
Thanks a lot! I didn't think about using str_replace inside the preg_replace
-
I live in Oslo, the capital of Norway. It's a great country to live in, and it is the country in the world with the highest HDI.
-
I need a code that replaces all spaces between [[ ]] brackets with an underscore. So, basically, I write this into a variable: bla bla something [[some text]] more text here And I want a script to change it to this:bla bla something [[some_text]] more text here Any suggestions?
-
md5 is not possible to "decrypt", so it's very safe. The only way to find out what the MD5 hash is, would be to either brute force or to search in an md5 database. MD5 databases are databases storing thousands of MD5 hashes and the words they are linked to. If you salt the passwords, there won't be any databases that stores a password with a salt (not any large databases as far as I know), so doing a md5 with this script should be very secure: <?php$hash = md5($password . $user_registration_date . $password . $user_id . $username);?> It might be a long code, but hey, it's safe!
-
Wow! That's all I needed! Thanks a lot!!! I can't believe it was that easy, but many, many thanks once again!!
-
Ok, great. If you're able to find a solution, then I would be very grateful!
-
Well, I want to do this to secure folders and files that cannot be loaded by regular visitors. I'm pretty sure that there is no good way to secure images and .exe files using PHP, that's why I'm using .htaccess for it. Heck, I will have to make two login systems: One protecting the folder, and one identifying the user.I know it is possible, because I have seen several systems using it. And I don't really see why I should do a popup login screen with Javascript, there wouldn't be much sense making one. A popup login like .htaccess made with javascript wouldn't be more useful than a regular login form.I have to use .htaccess. There is no way, as far as I know, to make better login system which protects all types of files (PSD, JPG, GIF, EXE, ZIP, RAR, and so on) except .htaccess. But again, I want to make it possible to allow the .htaccess login to work for the PHP files, so the user don't have to log in twice.
-
No, I want something like the cPanel login screen, which can be made using a .htaccess file. I do not have problems using .htaccess, but I want PHP to detect the submitted info, which is in this case the username and password.A javascript login would be plain stupid and not secure at all, and it's not possible to make the .htaccess login box with javascript, and I don't see why I would use java for it.If someone still don't understand my problem, then I'll try to explain it again:I have a .htaccess file pointing to a password file outside the public directory with 4 usernames and passwords, which protects a specific directory. When the user submits the correct username and password, PHP will detect the username used for the login so it can be either stored in a cookie or saved as a session so it can be possible to echo the user name later.
-
I was thinking about a popup login box, preferably made with .htaccess. I want the PHP script to simply detect what the entered information is (username, password).