Spectre
Members-
Content Count
1,034 -
Joined
-
Last visited
Everything posted by Spectre
-
Reading Site's Source Code With Php is this possible?
Spectre replied to snlildude87's topic in Programming
No, you don't need /s. You can use pattern modifiers if you wish, but only if you require certain operators to act in a slightly different way. The /i option may work, but it is most likely slower - it will treat the whole pattern as case insensitive, and matching any combination of upper and lower case characters to form a word which is much more resource intensive than binary/explicit matching. You do need to escape backslashes - but not forward slashes. Backslashes only need to be escaped because they themselves are used for 'escaping' characters. I made a mistake in my pattern. It should be: ..."/comics/(.*?)\.(jpg|...Instead of what it currently is ('.', a single dot, matches almost any character - with the exception of linebreaks, UNLESS /s is used - and the character we are trying to match here is just a normal period/fullstop/dot). -
All data sent to a client from a webserver is prefixed with headers informing the client of important information regarding the data (or chunk of data). These can only be sent once - and it occurs when the first lot of output is sent to the client, regardless of what it is. If you get a 'headers already sent' error, it means that some form of output has been sent to the client, either from PHP directly or by the webserver itself (such as, for example, having blank lines before the opening <? tag in a PHP script or having HTML before the PHP code block). Check line 20 of '/center/counter/config.php3'.
-
I originally started 'The Vent' to give members a place to yell about things, and I did state in the warning for this particular subforum that explicit language may be encountered - i.e. young members or anyone offended by such content, stay out. However, I do not and never have encouraged the use of profanity, and in my honest opinion, it makes the user look immature and foolish. The idea was that The Vent would perhaps stop the number of agressive posts made in other forums - whether or not it ended up working against Xisto I don't know. I'm obviously not a part of the 'staff' here anymore, so it doesn't really matter what I think, but I don't feel that members should be punished for doing what they are lead to believe they can do. So perhaps my original 'warning'/'rules' thread should be removed. Control issues, my friend?
-
Reading Site's Source Code With Php is this possible?
Spectre replied to snlildude87's topic in Programming
The file() function is capable of retrieving HTML documents, as are the file_get_contents(), include(), require(), and readfile() functions (although without a bit of tweaking, the last three automatically pass the retrieved data to the output buffer). file() returns an array, whereas file_get_contents() returns a single string - so file_get_contents() is more or less the equivalent of: $html = file('document_path');$html = implode("\n",$html); If you are wanting to examine the source code, it would probably be better to have a single string value rather than an array. littleweseth, whilst regular expressions are a good idea, your expression will not work - the image is stored locally, and is only referenced to in a relative manner. I would recommend narrowing it down to images that exist within the '/comics/' directory - I don't know if all 'comic of the day' images are stored there, but a quick look at the site shows that is where the current image is located, and it is the only image displayed on that page located in that directory. If that is the case, try this: $html = @file_get_contents('http://comics.com/');$pattern = '[<(img|IMG).*?(src|SRC)=\"/comics/(.*?).(jpg|JPG|gif|GIF|png|PNG)]';preg_match($pattern,$html,$matches);$image_path = 'http://comics.com/comics/'.$matches[3].'.'.$matches[4];$image = file_get_contents($image_path); Keep in mind that it may not be legal for you to leech content from that site. I would recommend you check first. -
PHP has very easy to use array handling - much easier than most other programming languages I know of (take C, for instance). An array is created with the array() function, as you are obviously already aware. The array_merge() function allows you to merge one array with another. You could probably use this to get around your problem: $array = array();if( isset($_POST['op1']) ) { $array = array(1,2,3,4);}if( isset($_POST['op2']) ) { $array = array_merge($array,array(5,6,7,8));} This would mean that if the POST variable 'op1' is set, then the array would be assigned the value of { 1,2,3,4 } - and if 'op2' is set, then the current array will be merged with an array consisting of { 5,6,7,8 } (and if only 'op2' is set, the array will only equal { 5,6,7,8 }). There are a lot of different ways to fiddle with arrays in PHP. This is just one example. Hope it helps.
-
It is possible. I'm sorry you had to view some of that stuff; some members just don't know how to behave. If you notice any inappropriate or offensive content being posted in the shoutbox, please do not hesitate to get in contact with a moderator or administrator.
-
I've used FileZilla for about two years or something now, and I'm certainly very happy with it - especially because it is open source, meaning you can improve it as you wish. It supports many great features, and supersedes even the majority of commercial FTP clients I've used.
-
Most major search engines have more or less the same general criteria of quality for ranking web sites. One factor I would try and concentrate on is building up link popularity, but only with sites that are of decent quality. Link farms etc should be avoided where possible.
-
New Pope: A Nazi! News sources poping up WORLD WIDE
Spectre replied to Darker333's topic in General Discussion
Apparently, none of you have read what Wyllt has said. Which is one of the few correct, fully truthful statements in this thread. Being apart of Hitler's Youth was compulsory at the time in Germany. Furthermore, the majority of German civillians (along with the rest of the world) were not aware of the extent of the attrocities that Hitler committed; being the charismatic man he was, and being in such a state of poverty and hardship, they saw him as a hero, with his promises of a better future. Although no one could possibly repeat such terrible crimes, and I am not trying to suggest it, think of how a lot of people see President George W. Bush - there are many, many people who support him, yet there are many, many others who view him with little more than contempt, especially after the recent Iraqi war. I will not take either side of that argument, and it's a little off topic, but you have to understand that just because German people supported Hitler in the time of war and in the lead-up to it, doesn't make them heinous war criminals. Today, we can see the terrible things that Hitler did and that he was a mad, very twisted individual. But back then, especially to someone as young as 14, none of that was known; and it was the status quo of the time to be hateful towards Jewish people, and being tought from birth that they were scum was a common practise of the time. Brainwashing is a powerful thing, especially when a nation is in such a state as Germany was in pre-war times. On a completely unrelated note, that is why the United States of America poured so much money into Japan at the end of World War II - so as to prevent a repeat of what happened with a war-torn Germany after World War I. So here is what Wyllt said again: -
Microsoft employs a whole team of people whose job is solely to prevent any breach of security on their servers. The incident of source being leaked is very, very different - firstly, people are actually interested in seeing some of the very secretive and jealously gaurded Windows source code; and secondly, reports stated that it was not leaked from Microsoft itself, but from a smaller company which was working with Microsoft on the product in question. Because of the importance of source code, I don't think it would be stored on machines that have access of any form - restricted or otherwise - to any kind of external network. On the topic of credit cards, I highly doubt that your credit card number would be submitted. If, for some reason, it was, you would be able to view and remove that information before the report was submitted. When a credit card number is being processed over the Internet, it should be done over a secure, 128-bit encryption SSL connection. Whoever sees the data (if anyone at all - the majority of error reporting will be done by computerized hypothesizing, I would imagine) will most likely not be able to see what your credit card number is. Even if they did care. That's exactly the point of Longhorn's new 'black box' feature - it reports everything. So the people handling it can work out what went wrong, without having to deal with users who wouldn't have a clue about what they're doing (which makes up something like 80% of Windows users). Even if you are an advanced user, a lot goes on behind the scenes that you don't know about (because you don't need to know about it) and never see (because you don't need to see it), so despite how much you might know about the operating system, you would not be able to write an extensive error report anyway, even if you had specialist debugging software capable of retrieving a lot of low-level data. Because Windows is at the core of all this information processing, it is obviously aware of everything that is going on, and therefore can generate a very extensive, in-depth report that can allow people to work out what went wrong and even recreate a simulation of the problem should they need to.
-
No offense, but I think you are all jumping to early conclusions. I'm not saying don't be cautious, of course, but people tend to hear a little bit of something and then make huge assumptions. It's what leads to mass paranoia. The article goes on to say: I suspect RGPHNX may have cut the article short before this in an intentional attempt to make it more... 'dramatic'. But anyway, it's basically saying that you can decide whether or not to send information to Microsoft, and if so, what sort of information and how much of it. Further more, if you do send information, it is going to be anonymous. Believe it or not, Microsoft has better things to do than collect information about you personally. Or to be more blunt - they couldn't care less about you, or what you're doing (unless it involves mass amounts of software piracy). I think this is a wonderful idea on Microsoft's part. Stop thinking about your unimportant self for a second, and imagine how much this would help businesses and organizations that experience technical difficulties all the time. It would allow them to pinpoint what's going wrong and when, under what conditions it is happening, and what they should fix or try and avoid doing. On another note, why do so many people seem to think that Microsoft's primary goal is to invade people's privacy? Whilst I'm sure that in reality, they have little respect for it other than as is legally required, the only real reason that they would want to collect information about consumers is for marketing-related purposes; and most such data is mass collected and aggregated, for the record, so they can't individually identify you anyway. I don't think they are going to spend billions of dollars on finding out who you've been talking to on the Internet or how much porn you have been downloading. Why? Because even I don't care about that. Oh, I just read whyme's post; and I think he is absolutely right. Microsoft doesn't want to know what you personally are doing. The real truth is that if Microsoft doesn't handle your information as they say they will in privacy policies, terms of use statements, and end-user license agreements, you can sue them. The real truth is that all such details of information handling is given straight to you by Microsoft. It's not they are hiding it - it's just that you are too lazy to read it.
-
There are a number of ways in which such a system can work, and a number of reasons for using it. Some of the more common reasons are for security, as has been mentioned, but also for tracking purposes - it's more practical to store the number of times a file has been accessed through a tracking script than look through a log file to count the access attempts.The ways in which it can work vary. It can be a unique file ID corrosponding to only that file which will then be looked up in the database, but that is more likely to be for tracking purposes than security reasons. If it was for security, it would more likely be a session hash or something else that uniquely identified you and the file you were seeking, rather than a simple file ID. So anyway, after the file is located, it will usually do one of two things: i) Redirect you to the location of the actual file (eg. header('Location: /file.mp3')), or ii) Get the contents of the file and send it to you directly. The latter is more commonly used in situations where security is a priority; if you are redirected to a direct download point, then you can obviously just use that URL again later and not have to go through the initial process.Hope that helps.
-
Server/webpage I need to make and access a server in C++
Spectre replied to linkmaster03's topic in Programming
Look up socket programming in C++. There are many very good guides, articles and source code snippets available to learn from.I only code in C and not in C++, so whilst I could give you a quick demo, I'm not 100% sure of what would might need to be changed to make it operate correctly in C++.Also, it depends on which platform you are operating on. Whilst Win32 uses winsock, nix-based operating systems do not. -
Generic TLD's and CCTLD's are fine; it's just redirection services such as .tk and .cjb.net that are on a second or third level which cannot be used as domain names.
-
I am growing tired of how about 65% of threads that were originally started to express something else entirely somehow wind up being a 'Why FireFox is so much better than Internet Explorer' thread. Unless it has been specifically asked, no one particularly wants to know about which browsers of the two you prefer to use, nor how FireFox contains some feature that is totally better than what something else does - and believe it or not, using FireFox doesn't make you any better or any more intelligent than someone who uses Internet Explorer (I use neither), and trying to belittle them on these grounds alone just makes you look foolish.So please, stop turning everything into a heated discussion of whether or not you like FireFox or any of its extensions. I think we all get the picture. There are various threads around that have been started especially for that purpose, and if you can't find one, start your own. But just stop robbing everyone else of their right to discuss anything other than browsers.-Spectre.
-
Get Rid Of The Banner Ads In Yahoo Mail This is a legal way
Spectre replied to trihhoang's topic in General Discussion
Why does everything always turn into a 'FireFox is better than IE, LOL!' thread?Nice work, trihhoang. -
You can't just connect to any given port that is already in use and expect it to magically work. I'm not exactly sure of what program you are using, but if it isn't peer-to-peer (ie. connects would-be chatters directly to each other), then it needs to have a server listening somewhere on a specified port. I believe it is a violation of Xisto's TOS to run resident programs on the server, so I don't think it's a great option. Unless I have taken this entirely the wrong way, and completely misunderstood what you're asking.The way most CGI web-based chat systems work is by storing all received messages in the database, which is then periodically checked by the script and delivered to each user in that chat session. Which is why you may have noticed your window constantly reloading if you've ever used such a system.I would recommend you either get someone to host an IRC channel or an operating chat server for you, or let the idea go. Unless, as I've already said, I've taken something the wrong way.
-
Indexing On Subdomains index.html does not show up
Spectre replied to unicornrose's topic in Web Hosting Support
Pre-defined index files (eg. index.html, index.php, etc) aren't automatically recognized by Apache. You have to specifically specify them with the DirectoryIndex directive in the httpd.conf file. However, .htaccess files (if enabled) overwrite entries in the configuration file. Whilst the DirectoryIndex is certainly useful, you do not need it to specify indexes that already exist in Apache's core configuration file. I'm not entirely sure of all existing entries on Xisto's server, but I do know that both index.html and index.php are present. -
Domain Parking Questions.. parking domains
Spectre replied to tariqrf's topic in Web Hosting Support
Please try and check that your questions haven't already been asked and answered before requesting support. As has already been pointed out by badinfluence, this problem has been clearly explained here. *Thread closed. -
Using the $_SESSION variable is fine and workable. Just note that you need to include session_start(); within each script that will access that session information before attempting to retrieve values from the array. So for example, in every other script that is used externally thereafter: session_start();$lang = $_SESSION['lang']; On another note, using the include() function is more or less the equivalent of taking the data from the specified file, and placing it in the script at hand; which means that if the file being called in the include() function is a PHP script, it will have access to all of the existing variables, including $_POST; so, for example, '/instlang/install.language.danish.php' would be able to retrieve $_POST['language']. I think that's sort of what you're asking.
-
I'm not entirely sure what the form in question is for or exactly what fields exist, but it would probably be better to have three text fields - one for the month, the day, and the year (doesn't have to be in that order, obviously). Also remember to specify which is which. You could then parse the data knowing exactly how it should be formatted, and pass it to the mentioned strtotime() function.
-
Url Redirection redirect a page web to another page
Spectre replied to geo3001's topic in Programming
It is always better to use server-side languages over client-side languages if it is possible and practical. Always! Also keep in mind that you can only modify headers if no other output has been sent previously (although that's obvious to experienced users, not everyone knows it). So this wouldn't work: echo 'blah';header('blah'); -
Indexing On Subdomains index.html does not show up
Spectre replied to unicornrose's topic in Web Hosting Support
There's your problem. 'DirectoryIndex' denotes which files will be used as a pre-defined directory index seperated by a space, in the order given (so if it's 'a b', then 'a' will be used first; if not found, 'b'). So you'll need to add index.html in there somewhere. Just in case you haven't figured that out yet. -
Hmm, to ping an IP address from scratch, you would have to harness the ICMP (see RFC792). I suppose it could be done in PHP, but it is quite complex, and due to the nature of the language (it isn't really intended for such purposes), it could get quite resource intensive. Another, more realistic option would be to use the system() function in PHP to execute a PING command and capture the output. I've never actually used it for this specific purpose myself, so I don't know how well it would work. Not all servers allow this though, due to security issues - I don't know if Xisto does or not. Oh, and BuffaloHELP, Windows batch scripting isn't PHP.
-
How To Retrieve Image Or Data On A Webpage ?
Spectre replied to kvarnerexpress's topic in Programming
Do you know anything about socket programming? There good examples floating around, but basically, you need to initialize a socket, connect to the server, and receive the data in streams. To receive data from a socket connection, use something like: int recvd = 1;while( recvd > 0 ) { recvd = recv(the_socket,the_buffer,the_chunk_size,0); /* Where: the_socket = pointer to an initialized socket; the_buffer = preferably char type array for storing received data; the_chunk_size = how much data to receive in bytes. Once recvd = 0, it is assumed that all data has been received. */} Obviously not the best option, but I think it should work. As for manipulating the data, what exactly do you want to do with it?