Jump to content

DMeerholz

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

DMeerholz's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hey, I am pretty new at this but i had the same thing the other day, I just added ob_flush(); before the normal flush and it works fine... <?php echo("Sleeping for 3 seconds."); ob_flush(); flush(); sleep(3); echo("Done."); ?> Hold on, I will find the thing I read, cause it mentioned some config stuff you could do to change it too... something about mod_gzip... Here you go http://www.phpbuilder.com/board/showthread.php?t=10317119 Hope this helps.
  2. Hi, Does anyone know why I cant show a picture with php code that resides in my cgi-bin. But showing image In the php <img src="..html/images/logo.gif"> But if in the html directory with plain html code <img src="images/logo.gif"> works fine. I thought maybe put the images folder in cgi-bin and <img src="images/logo.gif"> still doesnt work... I have chmod 777 both the cgi-bin and html directory and the image and its directory... still the same. Where should my pics lie if I want the to be accessed with cgi code? Dont worry, I will put the permissions back to something safer as soon as I sort this out... just read that 644 or 744 is good. Is that correct?
  3. Hi, Could some of you who know alot about php take a look at the code below and let me know if there are any major problems with it. What it is meant to do is... Get the html vars that are submitted to it, in this case PRNO, and then execute the program DUV with the html variables as arguments. DUV then begins doing what it needs to, but in order to free the licence I need to run the process in the background which returns control to the PHP. I am only meant to return to the client once the background process is complete so I made DUV return a unique filename that the PHP will then wait for, as soon as the file exists, the contents are sent back to the client and the file is deleted. It works great so far, tested it and I cant see any problems other than minor cleaning up to the code, adding some sort of a log, and removing the counter displays. <?php $read_var = $_REQUEST['PRNO']; $cmd = <<<EOT cd /dir1/dir2/dir3 ; /dirA/dirB/dirC/dirD/sample_executable "DUV $read_var" EOT; $waitFile = '../DUV-bin/'.trim(shell_exec($cmd)); echo "***".$waitFile."***"; $cntr = 0; while (!(file_exists($waitFile))) { $cntr++; echo $cntr; flush(); ob_flush(); sleep(1); } $readFile = fopen($waitFile,'r'); $theData = fread($readFile,filesize($waitFile)); echo $theData; unlink($waitFile); ?> I am just worried cause it seemed so simple, maybe I am forgetting something?? Would this handle say 100 connections at the same time? I tested with 10 from my side any it worked fine. Any comments or suggestions would be appreciated, even criticism. (But be nice, only a few days working with PHP so far.) Thanks, Regards, Damian
  4. Damn that was stupid, instead of echo shell_exec($a); $x = shell_exec($a); and then i just print the stuff in my program.
  5. Hi, I am just getting into PHP so be nice... This is my situation, little bit hard to explain, but I will try. Making a website that will be connected to my database. (UniVerse... if you heard of it...) Instead of loggin into the DB each time they have a program that lets you execute a UniVerse program straight from Linux. Like this... /usr/ibm/uv/bin/uvsh "TEST.WEB $PRNO" TEST.WEB is my program and $PRNO has been submitted from the web. This works fine, I do this $PRNO = $_REQUEST['PRNO']; $b = <<<EOT cd /u2/myaccount ; /usr/ibm/uv/bin/uvsh "TEST.WEB $PRNO" EOT; echo shell_exec($b); ?> I can do whatever and send it back to the client no problem, BUT... I want to make it a little more intelligent. And to do this i need to be able to return variables to PHP and then do conditional stuff based on that. I know a subroutine is meant for this, but you cant call a subroutine straight from the command line like that. I guess you need to know a bit about UniVerse to understand completely, but maybe not... Any ideas?
×
×
  • 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.