-
Posts
15,229 -
Joined
-
Last visited
-
Days Won
427
Everything posted by requinix
-
Pretty sure onmouseover/onmouseout don't count for child elements. Use CSS for this instead of Javascript. #test_div > div { visibility: hidden; } #test_div:hover > div { visibility: visible; }
-
Ah. if ($pass == $row['pass']) $_SESSION['user']="$user"; header("Location: charactercreator/charcreate.php"); else die("Password does not match \n"); Do you have mod_security installed? That's the only thing I know of that changes a 500 (what you should get because of the syntax error) into a 403 (so as to not expose the fact that there was an internal server error).
-
You sure you have the right URL? What is the path to the file on the server? I mean the actual filesystem path.
-
I'm not sure what the problem is. What output did you expect to see? [edit] By the way, if you want something unique for each item, please try to use its instead of its title. That's exactly what it's for.
-
I only see one feed in there... Do you mean the items in the feed? Only look at the first one? foreach($RSS_DOC->channel->item as $RSSitem) That's the loop. Remove it, the {, the associated }, and save yourself from changing variable names by substituting in $RSSitem = $RSS_DOC->channel->item[0]; (which assumes that the feed always has at least one item in it).
-
Write And Erase Contents Of A File After A Length Of Time Has Expired
requinix replied to rad1964's topic in PHP Coding Help
Here's how I would probably do it. No formal database? Fine. Make your own rudimentary version: keep a JSON array in a file that holds all the alerts and their expiration times. Like $alerts = array( array(time() + 3600, "This alert will expire in one hour"), array(time() + 86400, "This alert will expire in 24 hours"), array(mktime(23, 59, 59), "This alert will expire at the end of today") ); [[1354304622,"This alert will expire in one hour"],[1354387422,"This alert will expire in 24 hours"],[1354348799,"This alert will expire at the end of today"]] To add an alert, 1. Read in the file and json_decode() it back into an array 2. Filter out the alerts that have expired 3. Add the new alert at the end 4. json_encode() the array and write it back into the file To show the alerts, 1. Read in the file and json_decode() it back into an array 2. Show the alerts that have not expired -
One table is definitely the way to go.
-
Tcp Client Issue - Works In Putty But Not In My Code
requinix replied to Atrociouss's topic in PHP Coding Help
"0:0"? All I see in the Java code you posted is just "0". What I'm saying is that if $out="0" then $out!=true. The way around it is exactly what I said. -
It's really unusual to search all the tables in the database. Surely you want to search a specific subset of tables?
-
You bin2hex'd the return value from encrypt().
-
Write And Erase Contents Of A File After A Length Of Time Has Expired
requinix replied to rad1964's topic in PHP Coding Help
Perhaps an explanation of what these alerts are and when they're displayed is in order? -
Write And Erase Contents Of A File After A Length Of Time Has Expired
requinix replied to rad1964's topic in PHP Coding Help
Think of it not in terms of clearing the file but whether you show its contents. - When you display the alerts, if the file is too old then don't show anything - When you display the alerts, if the file is not too old then do show it - When you add alerts, if the file is too old then overwrite everything - When you add alerts, if the file is not too old then append into it Get how that works? -
It's not. You can't authenticate on behalf of the browser and you can't tell the browser what the credentials are (short of putting them in the URL which is a bad idea). If you want to automatically authenticate people then you'll need to write/find something to let you do that, and it won't involve the server built-in authentication. Though you can store the credentials in a .htpasswd file if you so wish (so long as you don't use it to lock down the directory in Apache).
-
Write And Erase Contents Of A File After A Length Of Time Has Expired
requinix replied to rad1964's topic in PHP Coding Help
Yes. That is a very bad thing to write and one of the numerous reasons why goto is bad. Don't use goto. Use a database for this, not a file. That will give you much more control over how these alert things work and it's much easier to deal with since you don't have to worry about all the little gotchas about dealing with files. -
I assume you saw the note on step 4? (link added) Without going into details I don't know, COM objects are all registered in Windows. PHP itself doesn't have to know where the actual object DLL is. Are you sure the method is called "DeviceStatus" and not "devicestatus" like I see in the article?
-
Html Preserve, Pound Sign Convert Into Html Entities
requinix replied to Danny620's topic in PHP Coding Help
Why do you need to convert it? It has a perfectly good UTF-8 representation already. -
No, I'm saying you put the quotes in the wrong place. Compare where the quotes are in the examples I posted with where the quotes are in your code.
-
The DOCUMENT_ROOT doesn't include a trailing slash. IIRC never does. include ($_SERVER['DOCUMENT_ROOT'] . "/index.php");
-
Right idea, wrong place. Quotes around the strings you're inserting. The list of fields you're inserting into don't always have to be quoted, but if you do then use backticks ` for them. Regular double " and single ' quotes are strictly (and necessary) for string values. INSERT INTO table (field1, field2, field3) VALUES ("string 1", "string 2", "string 3") INSERT INTO table (`field`, `field2`, `field3`) VALUES ('string 3', 'string 4', 'string 5')
-
Strings in SQL need quotes.
-
Tcp Client Issue - Works In Putty But Not In My Code
requinix replied to Atrociouss's topic in PHP Coding Help
Taking a guess since I can't see the rest of the Java code, but the server will send "0". However if $out="0" then the while loop will stop (because "0"==false) and you don't get the output. Try more like while (($out = socket_read($socket, 2048) != "") { -
You're running a web server at work and you don't want anyone to know about it? Sounds awful suspicious. Leave Apache at its defaults and make sure your firewall doesn't allow external connections to port 80 and/or the Apache. Actually, when you first started Apache you may have gotten a notification from Windows' firewall asking whether to allow or block connections.
-
Looking at the docs on ResultSet and a bunch of results in Google suggests it's not possible. Which is understandable because there are cases where mysql_num_rows() doesn't work; it's only because mysql_query() buffers the results that you can use it. Try buffering the results yourself, or rework your logic so that you don't need to know how many rows there are ahead of time (if at all).
-
As the comments in that file say, Listen is about what address and port Apache itself listens on. That has absolutely nothing to do with where the user is located. See the "allow from all" in your vhost configuration? Try changing that. Anybody else trying the site will get a 403.