[PHP] sscanf() not returning info

2005-08-27 Thread Simon Fredriksson
Can anyone tell me what is wrong here? ?php $data = a class=\new20030101\ href=\Zero01.jpg\Pic 1/a; $info = sscanf($data,a class=\%s\ href=\%s\%s/a); var_dump($info); ? Returns: array(3) { [0]= string(12) new20030101 [1]= NULL [2]= NULL } I expect: array(3) { [0]= string(11)

[PHP] Downloadcounter

2004-10-03 Thread Simon Fredriksson
I'm writing a file-download system. In order to download, the user will have to login with username and password. Now, how do I feed the file to the user if it's not under htdocs? Or should the files be under htdocs (in subdirs of course) and have some .htaccess limitations? There is a chance

[PHP] Re: Importing Excel data using PHP

2004-07-20 Thread Simon Fredriksson
You could use ODBC to do it. //Simon C.F. Scheidecker Antunes wrote: Hello all, I need to have some excel capabilities for an automated script. Excel can save files in CSV which are very easy to read and parse with PHP as they are nothing more than text files. Pear has a module called

[PHP] Won't get $_SERVER['PHP_AUTH_USER']

2004-07-20 Thread Simon Fredriksson
Has there been any changes concerning $_SERVER['PHP_AUTH_USER'] in PHP5? My news-script won't let me login after I changed from PHP 4.3.7 to 5.0.0 (Win32, Apache 1.3.31, php as module). I've checked var_dump($_SERVER) and there's no PHP_AUTH_USER in the list, just PHP_AUTH_PW. How come? It's

[PHP] Threading under win32

2004-06-18 Thread Simon Fredriksson
I'd like to know if there is any way to thread code in PHP under Windows. I need to write to two or more streams at the same time. It's not crucial that they are exactly synced, but I can't wait for one stream to finish and then let the other do the same. They have to be somewhat synced

[PHP] Detect if a file is hidden or not (win32)

2004-05-21 Thread Simon Fredriksson
Is there any built-in function to find out if a file/directory is hidden in Win32? //Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Fetching apache directoryoptions

2004-03-13 Thread Simon Fredriksson
I wonder if it's possible to get the options (such as Indexes) for a directory via PHP. Any clue? //Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Updating content on the line. (cli)

2004-03-03 Thread Simon Fredriksson
I'm building a download-manager script (like wget), in PHP. Does any of you know how I can update a line in the console? I've tried to echo chr(7) which is the backspace character, but it won't work. This kind of thing is seen in tons of console applications. Like some please wait thing that

Re: [PHP] Updating content on the line. (cli)

2004-03-03 Thread Simon Fredriksson
not sure of how you could do this, but one other thing you could do, is like I've seen certain console FTP apps do, is just do a division of the total size by whats downloaded, and have like 100 pound signs that are gradually filled in as it downloads. On Wed, 2004-03-03 at 10:53, Simon Fredriksson

Re: [PHP] Finding out the local path to a file.

2004-02-24 Thread Simon Fredriksson
Sadly, none of your tips works. __FILE__ shows the script filename, not to the path of the current dir. Where can I find out more about this kind of constants? Can't see it anywhere in the manual. The problem is this: DocumentRoot (/): D:/Web/htdocs/ Users (/~x/): D:/Web/users/ Stuff1

Re: [PHP] Finding out the local path to a file.

2004-02-24 Thread Simon Fredriksson
That was a really nice one to find out, thank you Stuart. Now, to another question (within the same scope). Is it possible for PHP to know if the attribute Indexes is in the list of allwed options? For right now, the script can list folders that are not supposed to be listed. Any ideas?

[PHP] Finding out the local path to a file.

2004-02-23 Thread Simon Fredriksson
I'm wondering if there's a way for PHP fo know the local path of REQUEST_URI. I've used a script to list directories, in order to replace the looks of the traditional Indexes look (apache). By setting DirectoryIndex to a fixed file (/list/lister.php) that file is now executed whenever there's

[PHP] Padding the decimals

2004-02-22 Thread Simon Fredriksson
Is there any functions to pad the decimals in a number? There's round() to put it down to two decimals, but what if I want to take it up to two? Example: 5 - 5.00 20 - 20.00 4.3 - 4.30 etc. //Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

[PHP] Possible to write CRC/MD5 to the file?

2004-02-22 Thread Simon Fredriksson
I wonder if it's possible to write the MD5 or CRC checksum of my scriptfile to the scriptfile. I know that if I change it, the value will change, but is there any way to calculate what it will be? Not just displaying it for the user, but actually having it written in the file. Could be pretty

[PHP] [GD] Circlediagram

2004-01-16 Thread Simon Fredriksson
Does anyone out there have any idea on how to create circlediagrams, using GD? Preferably something to set that x% of the circle is filled with one color and the rest with some other. Thinking about it, doesn't sound like an easy task with the current functions. :-\ //Simon -- PHP General

[PHP] Syntraxhighlighting for Java

2003-11-01 Thread Simon Fredriksson
I'd like to know if any of you out there know where I can find a highlight_file() sort of function, but for Java-files. Would be very helpfull in my shared development. //Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] How to deal with XML?

2003-10-27 Thread Simon Fredriksson
I think I've missed something somewhere, but how do I use XML? Everywhere, there are big hypes about XML. I could proably google quite a bit on this, but could someone give me a hint on how to use it in, say datahandling? Or to parse a website (like the php docs). //Simon -- PHP General

[PHP] Parsing colorcodes

2003-10-26 Thread Simon Fredriksson
Hiya fellow PHP coders! I have a problem. I need a function to parse mIRC-colorcodes with PHP. Unfortunaly, I'm not capable to do this myself (or I'm thinking too advanced or something). The code is built like this; chr(3) starts the color formating. After that sign, a series of numbers will

[PHP] Animating with GD?

2003-08-27 Thread Simon Fredriksson
Is it possible to create GIF animations using GD? //Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] FTP hosting PHP releases?

2003-08-26 Thread Simon Fredriksson
Is there any official FTP server hosting the PHP tar balls? I've done a shell script that downloads, compiles and installs PHP. Problem is that it's kinda hard to fetch the tarballs since there are no good static links. They seem to change with every release. Trying to run wget

[PHP] php-cli stopping on exit.

2003-08-26 Thread Simon Fredriksson
Can someone explain why PHP freezes when I don't specify a file for it? Like when I run php -v it outputs: PHP 4.3.3 (cli) (built: Aug 24 2003 22:05:23) Copyright (c) 1997-2003 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies Then stops. It doesn't return to the

Re: [PHP] Not fair: REMOTE_HOST

2003-08-21 Thread Simon Fredriksson
It does exist, if the server is set to resolve automatily. From PHP docs: Your web server must be configured to create this variable. For example in Apache you'll need HostnameLookups On inside httpd.conf for it to exist. //Simon John Taylor-Johnston wrote: Aw gee, $_SERVER['REMOTE_HOST']

[PHP] [PROBLEM] Killed sshd, want to start it via PHP script.

2003-08-14 Thread Simon Fredriksson
Oops, I did it again! Once again, I've managed to kill SSHd on my server. Hurray! _ What I want to do now, is make a script start it again. I could just reboot the machine the hard way or carry a monitor/keyboard there, but I don't wanna do that at 7am. System: Linux Slackware 8.1 What I

Re: [PHP] [PROBLEM] Killed sshd, want to start it via PHP script.

2003-08-14 Thread Simon Fredriksson
Apache not running as root is a good thing, but probably is... Since it appears you are not the admin of the box, ask them to install Webmin (http://www.webmin.org/webmin) and to give your userid access to the ssh component. Webmin is installed, it's just not turned on. I am the administrator

Re: [PHP] [PROBLEM] Killed sshd, want to start it via PHP script.

2003-08-11 Thread Simon Fredriksson
Yeah, but as it is, I can't start those things :P I must be root to do so. Apache is not running as root. //Simon Jason Wong wrote: On Monday 11 August 2003 13:01, Simon Fredriksson wrote: Anyway; I want to make some sort of PHP backdoor to start sshd again. As far as I know, only root

[PHP] Re: connecting access (*.mdb) database with PHP

2003-08-03 Thread Simon Fredriksson
Unless you can find some Access-Class I think ODBC is the way to go. No idea how you can solve it if you're using a *nix server though. //Simon Pehepe Php wrote: how can I connect access database(*.mdb) with php? what is the code? I will be happy if you write php code. Thank you!

[PHP] Re: How is this possible?

2003-07-28 Thread Simon Fredriksson
Ryan A wrote: Hi, I am trying to get my data into a very similar layout as this: http://hostfilter.com/ComparePlan.asp?IntVal1=389IntVal2=546IntVal3=605 see the table with the plans...how is he getting that in one table? what kind of logic is that? the best I can do is for each column I have to

[PHP] Re: How is this possible?

2003-07-28 Thread Simon Fredriksson
Just solved your problem and made a better solution for my previous answer. The code is available at http://mirror27.sytes.net/~webhost/ //Simon Ryan A wrote: Hi, I am trying to get my data into a very similar layout as this:

[PHP] Sending POST-data

2003-07-25 Thread Simon Fredriksson
I'm making a search-engine script for my site that redirects users to other search engines. Point is that on the website, there's a drop-down box with some engines and one textfield. 1. User enter the search query. 2. User selects which engine to use. 3. User submits. 4. PHP scripts checks

[PHP] Rewrite img and a tags.

2003-07-25 Thread Simon Fredriksson
How can I easiest rewrite A and IMG tags? I'm fetching a page with fsockopen() and I need to rewrite these tags before sending it on to a user. My own theory is that it's made with Regular Expressions. I just don't know these myself. Thanks. //Laban -- PHP General Mailing List

Re: [PHP] Re: classes v. functions

2003-07-19 Thread Simon Fredriksson
I've been working like that for about two years and just recently I got enlighted in the use of classes. I've built a few sites and after a while on each of them I run into a problem. Say I wanna add a meta-refresh tag or send a cookie; with my earlier code, that brought out hell... more or

[PHP] Re: socket programming

2003-07-15 Thread Simon Fredriksson
Michael P. Carel wrote: Hi to all, Is it possible to run php in the web running in a specified port without installing apache in Linux? Can anyone give a sample code for this? I'm searching this for a week but i really can find one. Please help us. Regards, Mike Do you mean to host websites

[PHP] Mp3 Conversion, using PHP

2003-07-14 Thread Simon Fredriksson
I'm wondering if there's any crazy dude out there that would like to join me in making a class for PHP to convert Mp3's to Mp3Pro. Even better would be if it could take other formats aswell, but mainly MP3 to MP3Pro. There are a few reasons why I want it in PHP. One is that PHP is

Re: [PHP] Need PHP on Win2000 Pro

2003-07-13 Thread Simon Fredriksson
When I make console scripts for *nix in PHP I have the shebang line and after that ?php #!/usr/bin/php -q ?php ... ? Is PHP as powerful as perl on the console area yet? //Simon John A. Thomason wrote: Thanks for your help. Also, I checked out your tutorial and Apache and PHP. I have Apache

[PHP] Re: connecting to access database

2003-07-12 Thread Simon Fredriksson
If you're using a windows platform, an easy way out is using ODBC. Besides that there are a few classes out there, but I've not found any that were good enough, or they were commercial. //Simon Pehepe Php wrote: How can we connect microsoft access database(*.mdb) or excel(*.xls) with php?

Re: [PHP] Couple of questions form a PHP newbie

2003-07-11 Thread Simon Fredriksson
If that's the case I recommend using multiple files instead of one big. Just come up with some structure for them. I'd say 10-20MB text is pretty much. //Simon Jason Giangrande wrote: Thanks for your help guys. The checkboxes thing is working great. Michael, regarding using files instead of

[PHP] Re: fread() question

2003-07-11 Thread Simon Fredriksson
Wouldn't it be easier to use something like the following? while (!feof ($handle)) { $buffer = fgets($handle, 4096); echo $buffer; } This will read until there's nothing more to read. Isn't that what you're trying to do? Read more about it at

[PHP] Re: shoutcast communication

2003-07-10 Thread Simon Fredriksson
Hello! I have a PHP class here that can fetch that information for you from the XML sheet provided by the server. I'll send it to you if you want, I forgot where I downloaded it (you could check www.hotscripts.com though). //Simon Ben Paul wrote: Hello, I am currently streaming via shoutcast

[PHP] String conversion function

2003-07-09 Thread Simon Fredriksson
I'm wondering if there's any easy way to convert special chars to the numerical version of it. Like space converts to %20 and slash (/) to %2F. //Simon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Using PHP to stream to Shoutcastserver

2003-07-08 Thread Simon Fredriksson
Hello World! I'm interested in starting a project to broadcast music via PHP to a ShoutCAST DNAS. I'm wondering, is it possible to do this? I've searched around for good tools to broadcast but none supports my needs. As for now I'm using PHP 4.3.2 under Linux and Windows. I want this to be a