Jump to content

rgrne

Members
  • Posts

    23
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

rgrne's Achievements

Member

Member (2/5)

0

Reputation

  1. rgrne

    Best web hosts?

    I hope this is a good place to post this. I saw another old post that was web host related so I thought this one might fit here too. I am hoping someone could give me some advice on the best web hosts out there for PHP and LAMP. For now I am looking for a shared server that will allow me to experiment with using PHP to generate X3D scenes as well as to hone my HTML5, PHP, and javascript skills. I will be the only person using the site. Important factors include cost, reliability (up time), reasonable speed, support, and the latest versions of PHP etc. I looked through a lot of "best of" lists but they all seem to be supported by advertising and discount deals from the hosts, so I have doubts about their objectivity. Thanks.
  2. The last time I did this I went into the (Linux) server with Putty and shell access and changed the file. But I am away on a business trip, and neglected to bring a copy of my hard to remember root password with me. I do, however, have a copy of my ftp program with me with it's own password set up. Would it cause any problem if I downloaded the php.ini file, made the change with a text editor like Notebook2, then re-uploaded the php.ini file (making a backup, of course, just in case).
  3. Suppose that when a user takes on action (clicks on something), the script opens a file for read and write, reads the contents into an array, then manipulates the array, then writes the array back into the file, then closes the file. If a second user happens to click just a little later than the first, does the fact that the file has been opened for the first user prevent it from being opened and manipulated by the second user, at least until it is closed for the first user? If not, is there an easy way to cause that to be the case? I do not want two users who accidentally clicked at the same time to cause the script to manipulate two copies of the original array at once, then have one overwrite the results of the other. I want the "later" user's manipulation to always occur after the first user's is completed, using the results of the first user's manipulation.
  4. I am looking through the PHP manual and am not clear on whether it is possible to do the following with any standard function: I want to merge one image with another, like with imagecopymerge(), but do it in an additive fashion. For example if a pixel in image 1 had a red value (red brightness) of 126, and the same pixel in image 2 had a red value of 20, then the red value of the pixel in the merged image would be 146, etc. As opposed to just replacing the image information in image 1 with that in image 2, or overlaying image 2 as a transparency over image 1.
  5. Thanks, that helps. I missed imagecolorat when i looked through the list of graphics library functions. There doesn't seem to be anything that returns an entire list of colors, though, unless I missed something else.
  6. Is there some PHP function that will look at all the pixels in an image and return a list or table of all the colors used in that image? Alternatively, is there a function that will return the color of just one pixel identified by row and column? If so I could write my own script to check all the values.
  7. I think there is an alternative way to do this if I could get script running within an iframe to refresh it's parent window, iframe and all. Anyone have any ideas?
  8. Thanks. I've been experimenting a bit with document.getElementById('testbox2').src="handlesoundplayer.php" in various places. I can get this type of statement to reload the iframe called testbox2 from its parent window, but if I put it into the script running in textbox1, it doesn't seem to recognize testbox2 - it doesn't do anything. This is true even when testbox1 is createdafter testbox2. Any ideas about this? PS: I'm totally new at Javascript - this is the first time I've tried to use it.
  9. The following code may look simplistic and what it does may seem silly, but it is an attempt to reduce a problem I'm having to the simplest possible form. If I can get the following code to operate the way I want, I will have found a way to solve a much more complicated problem: I have two iframes, called 'testbox1' and 'testbox2' Testbox2 initially displays a static page (just call it page.html). Testbox1 runs the following php script (called subframetest.php) with some javascript embedded in it: <?PHP if ($n==5){ $n=0; print "<meta HTTP-EQUIV=\"REFRESH\" CONTENT=\"1; URL=javascript:window.open('handlesound.php','testbox2');\">"; } $n=$n+1; print "<meta http-equiv=\"refresh\" content=\"4;URL=subframetest.php?n=$n\" />"; ?> What I am attempting to do is this: The second meta refresh statement keeps refreshing this script in testbox1. Each time, the variable $n gets incremented by 1. When $n finally equals 5, the first meta refresh statement, in the if conditional, is activated. The javascript in that statement causes another page (handlesound.php) to load into testbox2. The script in textbox1 is supposed to *keep running* after that, so that every time $n gets back up to five, the handlesound.php is reloaded into testbox2. What's really happening is that the first time the meta refresh statement in the if conditional runs, it loads the new frame into testbox2 just fine, but the script in testbox1 stops running. I get the statement "[object Window]" printed in testbox1. Is there a way to get the script in testbox1 to keep running after it loads a new page into testbox2? Maybe by using something other than meta refresh statements? In an nutshell, I need to have a script in one iframe running repeatedly and continuously and checking the value of a variable each time. If the variable takes on a certain value, it causes a new page to load into a second iframe. When that happens, the script in the first iframe must keep running and keep checking the value of the variable, so that when the variable takes on that certain value again, the page is reloaded into the second iframe again, ad infinitum. Thanks in advance for any help and ideas.
  10. I need to strip out non alphanumeric characters from usernames. Just stripping them out would be OK, but replacing them with some other character would be better. Is there any easy way to do this, like an equivalent of strip_tags for html characters? I'm looking into eregi and eregi_replace, but it seems like I'd have to list all possible non-alphanumeric characters and go through letter by letter. Am I missing something?
  11. I want to allow users of my site to upload images. I plan to implement security and bandwidth limiting features like only allowing files with .jpg and .png extensions, limiting the size of individual files, limiting each person's storage space, limiting the number of uploads per week, and using strip_tags () (not to mention enforcing a family friendly no porn policy, which is a separate issue). Are there any other steps I should take to keep out malicious code and hackers?
  12. I am using a two dimensional array to sort a bunch of lists alphabetically in a for loop.  I load the information into the array by assigning its values to the array elements, sort by one column in the array, then load the next list, etc.  Unfortunately, if one list is shorter than the one before it, the values of the old list will remain in the un-rewritten parts of the array.   So I need to erase all the values of the array before the next go-round.  It would be best if I could set the array back to its "pristine" condition, with no elements at all, or maybe one element equal to "null", or whatever.  I tried using unset($array), but that got rid of the array so effectively that the script could no longer read new values into it.  Then I tried unset on the individual elements, but it didn't seem to have any effect.  Finally, I just went through the array and loaded it up with "ZZZZZZZZZZZ" strings, which would sort to the end where I could ignore them.   It seems like there must be some elegant, single line function that does waht I want, but I can't find it.  Does it exist?
  13. Sort of.  One script constantly checks a simple .txt file to see if it has changed (the change will come from an external source, which will change the .txt file).  When a change occurs, the value of that change is used to change the information being displayed in iframe B.  Most importantly, the constant checking must be done in a way that does not cause the information in iframe B to keep refreshing every ten seconds.  That would cause the processes that are going on in iframe B to start over at the beginning every ten seconds.  I only want it to refresh when the change is detected, which will probably only happen, on the average, every half hour or so.  Otherwise I could just do a <META...> refresh in iframe B every ten seconds and be done with it.  I don't really care if this is all going on in the same frame or different frames or no frames at all, as long as I can check the file in the server without constantly refreshing the information that is being displayed.  Thats why I started experimenting with a <META...> refresh being performed in a second iframe.   
  14. Is there some way to do the following:? I want to have a script running in iframe A that does a <META http-equivalent...> refresh every 10 seconds to to check the status of a text file on the server (using a PHP script serverside).  When the information in the file changes, I want the information in a second iframe B, handled by a different script, to change. For various reasons I don’t want to do the <META http-equivalent...>  refresh in iframe B itself, because I don’t want that information to be constantly refreshing itself. Is there such a thing as a “target” statement for <META http-equivalent…. > like there is for links?  I found references to something called “Window-Target” and tried it but that didn’t do anything (at least in Firefox) - it just refreshed frame A no matter what I told it the target was. If there is no way to do this in HTML, can it be done with Javascript?
  15. Nevermind - managed to solve it on my own.  Tis had nothing to do with syntax for the form.  Turned out that in image outside of the form was creating some kind of "shadow" that only allowed buttons directly above it to work.  Totally diferent issue.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.