Jump to content

EdgeWalker

Members
  • Posts

    10
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

EdgeWalker's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Ok, I don't actually have the *final* solution, but I have a model of a working solution, in case anyone else ends up needing help with this. The solution *IS* to set up a proxy server, and just go ahead and use AJAX techniques, sending all the AJAX requests through the proxy. Don't know why I didn't think of that. If you don't use the proxy in any other way, it should be pretty easy to keep people off the net, at least if they're not super clever at injection and whatnot.
  2. If I wanted to set something like that up, it would be great. Actually, we already have that capability, but my bosses really don't want any direct access to the Internet by anyone but me. I am still trying to think up some solution that avoids that possibility. So far the only thing I've thought of is setting up a php based proxy server, which is far more complex than my needs. Suggestions so far appreciated, though.
  3. I considered that, but it's kind of a major overkill for what I want to do. Something like PHPProxy would work, if I took the time to figure it out, but the other users will *never* need to actually browse the internet. I will just need to grab bits of page here and there for them for special uses.
  4. (Note: If there is a name for what I'm trying to do, please tell me - I am having trouble Googling for help on my own because this is very new territory for me.) I have a WAMP server on a machine that, itself, also has internet access via another NIC. For reasons beyond my control, no other machine on the LAN has internet access. What I want to do is be able to retrieve and parse things from external sites and serve them in the local web pages. For example, our local system has UPS tracking data for shipments in it, and I can easily make a page that redirects to the UPS tracking page given a tracking number, but what I actually need to do is have my WAMP server go grab the results of a GET action and then return something I can show people on the LAN that do not otherwise have internet access. I'm not sure if I'm being clear, but any direct help (or suggestion for a useful reference) is appreciated.
  5. I want to be able to pass a variable to a callback function for my AJAX base, but the only way I could think of to keep the variable in scope was to put the callback function INSIDE the main one. Is that ok? Better solutions? function get_and_replace(url,div_id) { //Replaces the innerHTML of the div with the response from the the URL createXMLHttpRequest(); xmlHttp.open("GET",url); xmlHttp.onreadystatechange=callback; xmlHttp.send(null); function callback() { if(xmlHttp.readyState==4) { if(xmlHttp.status==200) { //HERE IS WHERE IS USE THE VARIABLE div_id div_element=document.getElementById(div_id); div_element.innerHTML=xmlHttp.responseText; } } } } (I thought this was more of a general JS question than AJAX)
  6. These are the encoding options that are provided by my text editor, so you know what I'm talking about: Here is the script itself (it's a simple test of a forced download). What happens if I save as UTF-8 (which I normally do) the file (whatever I put there as a test) does force-download, but is usually short a few bytes and is (by virtue of that) corrupted. <?php $file = "testfile.jpg"; header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); //To force download, set content-type to octet-stream. header("Content-Type: application/octet-stream"); header( "Content-Disposition: attachment; filename=$file"); header( "Content-Description: File Transfer"); @readfile($file); ?>
  7. In this case, I'm referring to the character encoding of the text file that contains the script. I don't believe this should have *any* effect on the script, but after many trials, it does seem to. I'm using Win XP Pro/Apache 2/PHP 5 and my text editor (which provides a variety of text encoding options for plain text documents) is Notepad++ The browers I've tried are FF2.0.0.4, IE 7, IE 6. It's clearly something on the server side. On one hand, this isn't really a big deal since the script is working, but if I don't know why saving it in UTF-8 would cause it not to work, I can't be sure it won't happen in the future. Would it help if I was specific about my script? I will grab it from the server and post it...
  8. I have been having a problem where any normal method of forcing a download (using headers including things like "octet-stream" etc.) all work perfectly well for me ONLY if I save the .php file in ANSI encoding, and not UTF-8, which is what I would normally use for everything else. It took me a LONG time to figure out that was causing the problem, but why is this happening? Should I do everything in ANSI?
  9. [!--quoteo(post=332992:date=Jan 3 2006, 06:30 PM:name=moberemk)--][div class=\'quotetop\']QUOTE(moberemk @ Jan 3 2006, 06:30 PM) 332992[/snapback][/div][div class=\'quotemain\'][!--quotec--] DMX doesn't have very much ability when it comes to PHP. Dreamweaver considers PHP files to be HTML files with PHP code inside, not echo commands. Therefore, your all-code pages won't work there. Sorry. Yes, the files I have been using so far have been pure PHP, no HTML in them at all, save for inside some echo commands. So how do I work around this? So are you saying that to use DMX with PHP, I should just create my HTML files and put PHP in them, save them with a php extension, but let DMX create them "as" html? (And on a side note, notepad++ is quite sufficient for making coding easier as far as visually enhancing the code for understandability. If that's the only reason for using Dreamweaver, it's not worth it. If I can't take advantage of any of the WYSIWYG features for layout, or the organizational features for large site management, I might as well continue to hand-code in notepad++., or use zend or something cheaper or open-source)
  10. I have been using PHP and MySQL for some time now, hand-coding everything in plain text editors. My new boss is insisting that I learn Dreamweaver MX (because that is what he has), so I sat down with it today. I can NOT get it to work with my PHP files though. I can open, create, and edit any kind of file, but when I open or create a PHP file I can't do anything other than enter plain text. All of the tools go dim, and I am unable to take advantage of any of the supposedly useful features of Dreamweaver. Basically I am stuck with a very hoggish text editor when looking at php files. Any advice? What might I be doing wrong here?
×
×
  • 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.