Jump to content

mark_nsx

Members
  • Posts

    29
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

mark_nsx's Achievements

Member

Member (2/5)

0

Reputation

  1. Hi there, I have a script that pulls in a weather feed via FTP then writes the output to a file. This script is run everyday at 3pm by cron. Heres the shell script: #!/bin/sh HOST='ftp.weatheronline.co.uk' USER='my username' PASSWD='my password' FILE='/var/www/vhosts/mysite.com/httpdocs/_shell/weatherfeed.csv' touch $FILE ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD get $FILE quit END_SCRIPT and the cron job * 12 * * * /var/www/vhosts/mysite.com/httpdocs/_shell/getweatherfeed And when the cron runs I receive the following error: local: ./var/www/vhosts/mysite.com/httpdocs/_shell/weatherfeed.csv: No such file or directory Im just confused why the script is not running as it should. The permissions on the folder _shell is 777. Any help is much appreciated! I've been stuck on this problem for 2 days now :'(
  2. Hi guys. I'm having problems with RewriteRule. Basically I have a sever with 1 static IP and several domains pointing to it (A records.). What I want to do is capture the domain name of those A records (i.e. www.sample.com) and rewrite it as subdomain of the main server (sample.maindomain.com) without altering the URL in the address bar. Here's what I got which isn't working: RewriteEngine On RewriteRule ^www.(.*).com$ http://$1.maindomain.com [L]
  3. It's not noticeable in my application's case since it just updates the progress bar while the user is uploading a video. Thanks for all the help!
  4. /********* * Javascript for file upload demo * Copyright (C) Tomas Larsson 2006 * http://tomas.epineer.se/ * Licence: * The contents of this file are subject to the Mozilla Public * License Version 1.1 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.mozilla.org/MPL/ * * Software distributed under this License is distributed on an "AS * IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or * implied. See the License for the specific language governing * rights and limitations under the License. */ function PeriodicalAjax(url, parameters, frequency, decay, onSuccess, onFailure) { function createRequestObject() { var xhr; try { xhr = new XMLHttpRequest(); } catch (e) { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } return xhr; } function send() { if(!stopped) { var async = true; var browserName = navigator.userAgent.toLowerCase(); if (browserName.indexOf('safari/') != -1){ async = false; } xhr.open('post', url, async); xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); xhr.onreadystatechange = function() { self.onComplete(); }; xhr.send(parameters); } } this.stop = function() { stopped = true; clearTimeout(this.timer); } this.start = function() { stopped = false; this.onTimerEvent(); } this.onComplete = function() { if(this.stopped) return false; if ( xhr.readyState == 4) { if(xhr.status == 200) { if(xhr.responseText == lastResponse) { decay = decay * originalDecay; } else { decay = 1; } lastResponse = xhr.responseText; if(onSuccess instanceof Function) { onSuccess(xhr); } this.timer = setTimeout(function() { self.onTimerEvent(); }, decay * frequency * 1000); } else { if(onFailure instanceof Function) { onFailure(xhr); } } } } this.getResponse = function() { if(xhr.responseText) { return xhr.responseText; } } this.onTimerEvent = function() { send(); } var self = this; var stopped = false; var originalDecay = decay || 1.2; decay = originalDecay; var xhr = createRequestObject(); var lastResponse = ""; this.start(); } function ProgressTracker(sid, options) { this.onSuccess = function(xhr) { if(parseInt(xhr.responseText) >= 100) { periodicalAjax.stop(); if(options.onComplete instanceof Function) { options.onComplete(); } } else if(xhr.responseText && xhr.responseText != lastResponse) { if(options.onProgressChange instanceof Function) { options.onProgressChange(xhr.responseText); } if(options.progressBar && options.progressBar.style) { options.progressBar.style.width = parseInt(xhr.responseText) + "%"; $('numeric').innerHTML = parseInt(xhr.responseText) + "%"; } } } this.onFailure = function(xhr) { if(options.onFailure instanceof Function) { options.onFailure(xhr.responseText); } else { alert(xhr.responseText); } periodicalAjax.stop(); } var self = this; var lastResponse = -1; options = options || {}; var url = options.url || '/videos/progress'; var frequency = options.frequency || 0.5; var decay = options.decay || 2; var periodicalAjax = new PeriodicalAjax(url, 'sid=' + sid, frequency, decay, function(request){self.onSuccess(request);},function(request){self.onFailure(request);}); } function beginUpload(sid) { document.postform.submit(); var pb = document.getElementById("progress"); pb.parentNode.parentNode.style.display='block'; new ProgressTracker(sid,{ progressBar: pb, onFailure: function(msg) { Element.hide(pb.parentNode); alert(msg); } }); }
  5. Yes I have and it gave me a Refused to set unsafe header Connection..
  6. Solved! For some reason the asynchronous variable in the open() call must be set to false for it to work in Safari, true in other browsers.
  7. I did set the content length by calling this line; xhr.setRequestHeader('Content-Length', parameters.length); and its still throwing this error in Safari 3 "Refused to set unsafe header Content-Length".
  8. I tried setting the Content-Length header and it returned the error "Refused to set unsafe header Content-Length".
  9. Hi guys. I've implemented a simple AJAX request object which works fine in most browsers apart from Safari. The js error console returned this error "Refused to set unsafe header Connection". Here's the code snippet: function createRequestObject() { var xhr; try { xhr = new XMLHttpRequest(); } catch (e) { xhr = new ActiveXObject("Microsoft.XMLHTTP"); } return xhr; } function send() { if(!stopped) { xhr.open('post', url, true); xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); xhr.onreadystatechange = function() { self.onComplete(); }; xhr.send(parameters); } } Does anybody know the fix for this? Cheers!
  10. its the output of tinyMCE editor. for some reason it changes the source of the images inserted to it when i submit the form.
  11. sorry my description wasn't clear..i have to implement this in php for my dynamic code..
  12. hi guys i need your help. basically i need to grab all image tags and modify its source by replacing multiple "../../../" with two "../../" eg. <img src="../../ .." /> cheers!
  13. the the table has precautions to prevent dupes..its just that i have a merge function which generates those dupes..
×
×
  • 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.