User Profile

Collapse

Profile Sidebar

Collapse
henryrhenryr
henryrhenryr
Last Activity: Nov 23 '10, 08:18 AM
Joined: Jun 4 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • Hi Dan

    Thanks for the reply. I've been away for a while.

    My guess is that when the file is uploaded it goes into the temp folder and is owned by '48' - the httpd user. When the PHP script then transfers it to the relevant folder in the web-root, it the owner is not changed.

    I have attempted to 'chown' using a PHP script but that doesn't work - this is why I want to determine the current user/group of the running...
    See more | Go to post

    Leave a comment:


  • How to Find out the current USER/GROUP of the php script

    Hi

    I am trying to debug an upload script and I need to know what the user/group is of the php-script that's running.

    My problem is that the webserver settings have '48' as the user/group - presumably 48 means httpd. But when I upload files through PHP, they are moved from the temp folder and the permissions are 744 with the owner as '48'. This means I can't change the file in FTP/SSH.

    I am trying to...
    See more | Go to post

  • henryrhenryr
    replied to 403 on CSS via Sym Link
    Well it turns out it was permissions. I had uploaded a whole folder and this was causing problems. Making a new folder and copying the contents across solved the problem.
    See more | Go to post

    Leave a comment:


  • henryrhenryr
    started a topic 403 on CSS via Sym Link

    403 on CSS via Sym Link

    Hi

    I have a css file stored outside the server root and a symbolic link to it in the server root. The result is a 403 (Forbidden) error from the server.

    EG:

    /var/www/html = where my site is
    /var/www/css = where my css is
    /var/www/css/test.css = my css file
    /var/www/html/css = symbolic link to /var/www/css

    Code:
    www.domain.com/css/test.css --> error 403
    I have included...
    See more | Go to post

  • henryrhenryr
    replied to match an exact word within a string
    in PHP
    Code:
    $str='tree:sweet:house:gate:tent'
    if (strpos($str,'sweet')>=0) {
      //is there
    }
    This is a bit blunt and will fail on words like 'ate' which will match 'gate' but it's quicker than strstr(). You can use preg_match:

    Code:
    $str='tree:sweet:house:gate:tent'
    if (preg_match($regex,$str)>0) {
      //at least one match
    }
    ps. you need the right...
    See more | Go to post
    Last edited by henryrhenryr; Aug 4 '08, 09:19 AM. Reason: typo

    Leave a comment:


  • henryrhenryr
    replied to Power saving
    in PHP
    This isn't php...

    but according to help:

    Code:
    shutdown -m //computername
    for windows (ps you can see this help message by typing "shutdown -?" in command prompt).

    You could run this from PHP using exec.

    You can try PsExec to run commands on remote machines. Again you would need to work out the correct command and then insert it into the exec() function...
    See more | Go to post

    Leave a comment:


  • henryrhenryr
    replied to Network PC IP address view
    in PHP
    If the PC is connected to your PHP application (ie website) then you can get the IP address from $_SERVER['REMOTE_ADDR']

    So you just need to collect this value in a database or other storage medium. If you log the time against the IP then you can say at one point in time, which computers were connected.

    You could alternatively run ping with php exec() function and record the output:

    eg

    ...
    See more | Go to post

    Leave a comment:


  • henryrhenryr
    replied to Tool bar
    in PHP
    Do you want the toolbar permanently in the users' browsers? You would need to write your own add-on. The firefox setup isn't too hard - at least for simple requirements...

    http://www.rietta.com/firefox/Tutorial/conf.html

    is a tutorial, many available

    Of course the toolbar will be browser specific so you'll need to program one for each browser. I bet you could hack up the yahoo-firefox toolbar as a starting...
    See more | Go to post

    Leave a comment:


  • I don't believe it - are you saying absolutely no way possible? Couldn't he write javascript which generates its own scroll bar and controls it according to exactly his parameters?

    Nothing is impossible - I'm not saying I know how though!
    See more | Go to post

    Leave a comment:


  • Are the divs getting smaller as the window gets smaller?

    Try adding the following. You see the horizantal scroll when the window is smaller than 700px wide. If you don't apply width to the div then they will automatically try to fit inside the window.

    Code:
    body {
      width: 700px
    }
    You can also use "min-width" which lets the divs "flow" to the edges for large...
    See more | Go to post

    Leave a comment:


  • henryrhenryr
    replied to Obtaining power values
    in PHP
    Here is something you could use for the .bat script:

    http://www.robvanderwoude.com/files/battrun_xp.txt...
    See more | Go to post

    Leave a comment:


  • henryrhenryr
    replied to PHP -Mail problem
    in PHP
    Hi Roshin

    Sorry it wasn't as easy as I suggested! You can fix it, as the error says, by enabling ssl. I didn't realise WAMP doesn't enable by default...

    Quick Instructions:
    open php.ini
    uncomment line ";extension=php _openssl.dll"
    restart WAMP

    Verbose...
    - you should find a link to php.ini if you left click on the WAMP icon in the taskbar
    - look for "config...
    See more | Go to post

    Leave a comment:


  • henryrhenryr
    replied to How To Convert Php File Into Pdf Format
    in PHP
    Try http://www.fpdf.org/

    It's a php class which generates a pdf.
    See more | Go to post

    Leave a comment:


  • henryrhenryr
    replied to Obtaining power values
    in PHP
    You would probably need to install a script on the target PC which sends the values to your server - eg, inserts into a database.

    ie...

    1. Shell Script:
    Collects the information.
    Goes to a URL (eg script.php?ip=1 92.168.2.2&powe r=240W) (you could have it launch this URL in a browser window or there is probably a command line way to do this too).
    (You could do this with PHP but you would need...
    See more | Go to post

    Leave a comment:


  • henryrhenryr
    replied to expires header on php generated image
    in PHP
    That's fine! I'd seen this one but it seems like it was one of those occasions where I just didn't type the right thing into google yesterday!

    I just found this:
    http://php.dtbaker.com.au/post/cachi..._php_imagejpeg

    The solution is to use the last-modified header based on the filemtime() for the input file. The article has a solution if you have no input file too. The browser now caches the images....
    See more | Go to post

    Leave a comment:


  • henryrhenryr
    replied to PHP -Mail problem
    in PHP
    I found that phpmailer was the easiest solution. I attempted to setup the SMTP in php and found it wouldn't quite work but I got phpmailer working in about 5 minutes.

    Another method I did try in Windows was to use blat with stunnel and then use exec() to send the blat command to your computer. You can google blat and stunnel - both free software.

    Unless you have a specific reason not to try phpmailer, I really would...
    See more | Go to post

    Leave a comment:


  • henryrhenryr
    replied to PHP -Mail problem
    in PHP
    try phpmailer:

    http://sourceforge.net/projects/phpmailer

    When you download it, look in the examples and there is one for gmail. It doesn't require any changes to your php setup, just setup the script correctly as in the example...
    See more | Go to post

    Leave a comment:


  • henryrhenryr
    replied to chmod question
    in PHP
    I changed the default user and group in the apache configuration file - the server is just for testing so it doesn't matter (I hope!) - I got fed up of my scripts breaking because they weren't allowed.

    There is a line in the apache2.conf

    User ...
    Group ...

    I used my user and group.
    See more | Go to post

    Leave a comment:


  • henryrhenryr
    started a topic expires header on php generated image
    in PHP

    expires header on php generated image

    I am trying to make my php-generated images cache. Here is a summary of the script with the headers. It doesn't seem to cache though. Do I need to do something special to make sure it caches?

    [code=php]
    //summarised

    //resize...
    $file= $_GET['file'];
    $o= imagecreatefrom gif($file);
    $i= imagecreatetrue color($w,$h);
    imagecopyresamp led($i,$o,0,0,0 ,0,$w,$h,$wo,$h o);

    //output...
    See more | Go to post

  • henryrhenryr
    replied to fsockopen and gmail timeout mystery
    in PHP
    Yes, it was being blocked by the web-host's firewall.

    Thanks for tips!

    Henry
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...