All pastes #275731 Raw Edit

Mine

public text v1 · immutable
·published 2006-12-11 19:35 UTC
rendered paste body
  system.environmentVariable("SCRIPT_FILENAME")=file.absolutePath
  system.environmentVariable("REDIRECT_STATUS")="200 OK"
  
  if Requesttype="GET" then
    #if targetwin32
      command = """"+app.PHPLocation.absolutePath+""" """+file.absolutePath+""""
    #else
      command = "php-cgi """+file.absolutePath+""""
    #endif
  elseif Requesttype="POST" then
    #if targetwin32
      s=PostData.replaceall("&","^^^&")
      s=s.replaceall("%","^^^%")
      command =     "echo "+s+" | """+app.PHPLocation.absolutePath+""" """+file.absolutePath+""""
    #else
      command = "echo "+s+" | php-cgi """+file.absolutePath+""""
    #endif
  else
    //there is something wrong.... bail out
    return
  end if
  
  'if f=nil then return
  
  //run
  'sh.execute(f.absolutePath)
  sh.execute(command)