[PHP] Re: Freshmeat question

2003-01-21 Thread Martin Thoma
I am not new to programming, just to scripting languages. I have seen that Perl has some high advanced sintaxes for string processing, for example, but I don't know if the same level can also be achieved in PHP...? Sorry, I don't know that. I know that Perl has some regular-expressions, but

[PHP] Which country?

2003-01-20 Thread Martin Thoma
Hello! Is there a way to get to know from which country a user is calling the webside with my php-script? Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Getting https-page

2003-01-20 Thread Martin Thoma
Hello! You can easily get an webpage with: $fp = fopen(http://www.mydomain.com/;, r); if ($fp) exit; while(!feof($fp)) { $line .= fgets($fp, 4096); } fclose($fp); print $line; But this doesn't work with https (SSL). How can I get an https-page? Martin -- PHP General Mailing List

[PHP] Re: simple date question

2003-01-20 Thread Martin Thoma
Hi Adria, why not just using $month=date(m)? Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: Freshmeat question

2003-01-20 Thread Martin Thoma
Well, it's quite easy: Just write a php-script and start it with php myscript.php. Thats all. You could fetch a web-page with fopen: $fp = fopen(http://www.mydomain.com/;, r); $line = ; while(!feof($fp)) { $line .= fgets($fp, 4096); } fclose($fp); print $line; If you are new in

[PHP] European daylight saving summer-time.

2002-12-29 Thread Martin Thoma
Hello! I just want to get the actual date and time which works fine with date(). The problem is that php doesn't give the european daylight-saving-time in summer, so the time shown is offset by 1 hour in summer. It seems that my internet service provider doesn't adjust the clock of the server to

[PHP] How to get/wait for user-input?

2002-12-02 Thread Martin Thoma
Hello! I'm using a PHP-script as a small console-app. Is the only way to give parameters to it the $QUERY_STRING, or can I wait for the user to input something (like scanf in C)? I couldn't find anything in the docs, so perhaps this is not possible?! Martin -- PHP General Mailing List

[PHP] How to give parameters to a console php-script?

2002-12-02 Thread Martin Thoma
Hello! I start a console app with php myscript.php4 (just prints ok). How can I give parameters to it? I tried: php myscript.php4 myparameter php myscript.php4?myparameter php myscript.php4?param=myparameter But always php just returns without doing nothing (not even giving an error or

Re: [PHP] How to give parameters to a console php-script?

2002-12-02 Thread Martin Thoma
Hi, What do argv and argc tell you? Is the php.ini file set up so that these variables are shown/valid? Undefined variable: argv - so I guess this is the problem ;-) What do I have to change in the php.ini? Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] How to give parameters to a console php-script?

2002-12-02 Thread Martin Thoma
ll I found a register_argc_argv = On in my php.ini, which should work then. But I also found, that I have to use print Ok: .$_SERVER[argv][1]; instead of print Ok: .$argv[1]; Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] How to give parameters to a console php-script?

2002-12-02 Thread Martin Thoma
Martin, Ah yes, the famous 'read the upgrade notes - gotcha'! Well done, you figured it out... =dn Thanx for your help, it pointed me in the right direction ;-) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] How to send mail with authentification?

2002-11-04 Thread Martin Thoma
Hello! Our SMTP-Server has changed to authentification. Now we cannot send mails anymore using mail(). How can I set the password in mail? Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Re: How to send mail with authentification?

2002-11-04 Thread Martin Thoma
Thanx, I will try this. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Php Ready-to-go

2002-11-04 Thread Martin Thoma
Hello! Is there a way to run a php-script on a pc/windows-computer which hasn't php-installed? I thought of somekind of compiler which creates an .exe, which embeds the script and the php-environment. Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] How to escape in hidden field?

2002-09-03 Thread Martin Thoma
Try this with single quotes: INPUT TYPE=HIDDEN VALUE='Hello world' NAME=Message Year, but then I couldn't use single-quotes in the text ;-) The problem is that the content of the field is inserted by the user, so I cannot say if he uses single- and/or double-quotes. -- PHP General

[PHP] How to escape in hidden field?

2002-09-02 Thread Martin Thoma
Hello! I have a simple hidden input-field like INPUT TYPE=HIDDEN VALUE=Hello world NAME=Message Now sometimes I need to insert like: INPUT TYPE=HIDDEN VALUE=Hello \world\ NAME=Message But this makes PHP (or the browser?) cutting of the string after Hello . How can I escape the ? Martin --

[PHP] Re: How to escape in hidden field?

2002-09-02 Thread Martin Thoma
Using the htmlspecialchars() function, so that Hello \world\ will be written in pure HTML: Hello quot;worldquot; Thanx a lot! But how do I get it back to 'Hello world'? Do I have to do it manually? Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Re: How to escape in hidden field?

2002-09-02 Thread Martin Thoma
Hi, Its really stupid to use that command because there is not any function to come back to the real way. You should just addslashes() to it then remove them. Hi Nicos, unfortunalty, it doesn't work to use stripslashes: When using: INPUT TYPE=HIDDEN VALUE=Hello \world\ NAME=Message

[PHP] Get Anchor out of Url

2002-07-16 Thread Martin Thoma
Hello! I have a page which is called by: A HREF=/myfolder/mypage.php4?MyVar1=SomethingMyVar2=Someother#JumpHere Now I want to get the Anchor #JumpHere (which could be different each time) in mypage.php4. With PATH_INFO, I only get /myfolder/mypage.php4; With QUERY_STRING, I only get

[PHP] Re: Submit code

2002-07-16 Thread Martin Thoma
I am looking for PHP code that will submit (post) a form automaically to a ANOTHER php page. I do not want to press a submit button. I have found a class at PHPClasses but it is too complicated for my needs. What is the simplest way of doing this? What is the theoretical approach? I

[PHP] Re: Get Anchor out of Url

2002-07-16 Thread Martin Thoma
Oh, it seems, that only Netscape 4 is doing this wrong... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] 1 Form, 2 Submit-Buttons

2002-07-11 Thread Martin Thoma
Hello! I want to make a form (a wizard) which has 2 Submit-Buttons (Back Next). The buttons should be images. How can I make php see, which button has been pressed? Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Forum with php

2002-06-19 Thread Martin Thoma
Hello! I saw a lot of forums (or boards) which looks almost the same and they are done in php. Is there a free forum-software in php? Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Bot?!

2002-06-04 Thread Martin Thoma
Hello! Perhaps you know the programms called Bot, which allows the user to ask questions just by writing it in natural speak or which guides the user in some process. I wonder if there is a (free?) solution of this somewhere in the net. Martin -- PHP General Mailing List (http://www.php.net/)

Re: [PHP] Bot?!

2002-06-04 Thread Martin Thoma
Well, the bot should work on a webpage and obviously php would be the best solution. And what exactly has this got to do with PHP? - Original Message - From: Martin Thoma [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Tuesday, June 04, 2002 3:14 PM Subject: [PHP] Bot?! Hello

[PHP] Stdout to file

2002-05-13 Thread Martin Thoma
Hello! How is it possible to change the standard-output temporarly to a file? I want to put the output of a script in 2 different files, so it is not possible to use php myscript.php4 file.txt. Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit:

Re: [PHP] Stdout to file

2002-05-13 Thread Martin Thoma
man tee -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Problem with object

2002-05-10 Thread Martin Thoma
Hello! I have an object: class Entry { var $ip; var $host; } Which is stored in an array: $aLines = array(); ... array_push($aLines, new Entry($ip)); // Do this several times Now I want to resolve the hostname from ip adresses: foreach ($aLines as $entry) { if ($entry-host == )

[PHP] Free array

2002-05-10 Thread Martin Thoma
Hello! I'm working with an array (about 20 MB), which is shifted to several other arrays and so on. When I shift a array to another, I don't need to source-array anymore. PHP is able to handle 2 of the arrays, but by using more, I get errors about allocating memory. How can I tell PHP to release

[PHP] Getting page with fopen

2002-04-25 Thread Martin Thoma
Hello! I'm trying to find out on which rank my side is at google automatically. I'm trying the following code, but I get a strange error: $Url = http://www.google.de/search?q=MySearchWord;; // Gives Warning: No error on line [where fopen is] $Url = http://www.google.de/;; // Works for ($i =

Re: [PHP] Getting page with fopen

2002-04-25 Thread Martin Thoma
Google is probably trying to send you a cookie in which case you cannot use fopen. You need to use curl or snoopy(?). Thanx, that could be the problem. Unfortunatly, curl is not compiled in my php-version, and what is snoopy?! ;-) Any other ideas/examples? Martin -- PHP General Mailing

Re: [PHP] Solved Getting page with fopen

2002-04-25 Thread Martin Thoma
Ah, it works with fsockopen: $fp = fsockopen (www.google.com, 80, $errno, $errstr, 30); if (!$fp) { print Fehler: $errstr ($errno)\n; } else { fputs ($fp, GET / HTTP/1.0\r\nHost: $Url\r\n\r\n); while (!feof($fp)) { $sLine .= fgets ($fp, 4096); } } fclose ($fp); -- PHP

[PHP] Re: Open Download-Box

2002-04-22 Thread Martin Thoma
this is a problem of IE, not of PHP. Year, but since I controll IE with PHP, I thought someone has a php-workaround. Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Open Download-Box

2002-04-18 Thread Martin Thoma
Hello! I have a PDF-File, which the user should download (it should not open in the browser, even if the Adobe-Reader-Pluging is installed). I use: $filename = $DOCUMENT_ROOT./.$QUERY_STRING; $fd = fopen ($filename, rb); $contents = fread ($fd, filesize ($filename)); fclose ($fd);

Re: [PHP] Open Download-Box

2002-04-18 Thread Martin Thoma
try header(Content-type: application/pdf); Thanx, but it doesn't work, too, on IE. Another effect is, that Netscape now opens it in the broser window instead of downloding it. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] Replacing words

2002-03-08 Thread Martin Thoma
Hello! I use $txt = preg_replace(#((?php .*?/A)|$search)#se, '\2==\1? \1:$replace', $txt); to replace some text in $txt. The problem: Parts of words are replaced, too. How can I make preg_replace replace only words, which means, that the word is followed by space . , -, but not by other

[PHP] Re: HOWTO: detect browser's script enabled?

2002-01-29 Thread Martin Thoma
Hm, the easiest way would be, try SCRIPT LANGUAGE=Javascript SRC=myfile.js/SCRIPT where myfile.js contains simply nothing. Everytime the file is downloaded, someone uses Javascript. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

[PHP] Re: Printing JPEG images generated with ImageJPEG with IE/WIN

2002-01-25 Thread Martin Thoma
Hm, it could be that IE tries to reload the picture (which isn't there anymore because the form-data has been expired). Perhaps saving the picture temporarly on the server will prevent the problem. Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL

[PHP] Connect to Mail-Server

2002-01-25 Thread Martin Thoma
Hello! Somewhere I read something on how to connect to a mail-server with php and to send and receive mails on a very basic level (calling Helo to the mail-server and so on). Does anybody know, where I can get those information exactly? Martin -- PHP General Mailing List

Re: [PHP] Split files

2002-01-23 Thread Martin Thoma
Hi and thaks for your answer. ... Making any sense? Year, so I have to do it manually (thought someone could preveting me from reinvent the wheel... ;-) What are you really trying to achieve? I'm trying to split a large binary file (2 GB) into peaces of 700 MB to burn it on a cd. It's a

[PHP] Split files

2002-01-22 Thread Martin Thoma
Hello! Is there a PHP-function to split binary files into pieces of a several size and glue them together later? Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list

[PHP] How to protect JavaScript?

2002-01-16 Thread Martin Thoma
Hello! I want to protect a JavaScript: It should only be readable out of the document, where it is included (with script language=javascript src=/myjs.js). But it should not be possible to read it directly with www.myserver.de/myjs.js. I thought I could do this with PHP (f.e. check the

[PHP] Re: Parsing?

2002-01-16 Thread Martin Thoma
Hi Tony, you could do this by getting the file through http, which means not open it with fopen(filename.php4, r) but with fopen(http://servername/filename.php4;, r). Then you get exactly the way to browser sees it. But this is very slow if you fetch a lot of files. Martin -- PHP General

Re: [PHP] How to protect JavaScript?

2002-01-16 Thread Martin Thoma
Hi Bart, I think it's the same problem as with php: You could only protect it, when a HTTP_REFERRER is send (which Netscape does not do): Description: Assume we have under http://www.quux-corp.de/~quux/ some pages with inlined GIF graphics. These graphics are nice, so others directly

Re: [PHP] How to protect JavaScript?

2002-01-16 Thread Martin Thoma
Hi Bart, thanx for your answer. This would only be true if your javascript files were parsed with php.If not, then php can't do anything about it of course. This is possible, I tried it out. Look into mod_rewrite. I haven't used it in the sense that you're looking for, but I don't see why

[PHP] Re: strpos

2001-11-15 Thread Martin Thoma
strpos return false if the search fails. You have therefore to test for: if (strpos(...,...) === false) or if (strpos(...,...) !== false) Martin Jtjohnston wrote: I suppose I'm doing this right? I want to know if the user entered \.jpeg or \.jpg. If he didn't, it should error. It

[PHP] Regular expressions?

2001-11-15 Thread Martin Thoma
Hello! I need to search for strings between html-tags. For example, I need to know if the String Searchstring is between H2 and /H2 (case-insensitive). How is it done? I think I need regular expressions, but I have no idea about it. I'm not getting to clever out of the php-documentaion. Where

Re: [PHP] Re: strpos

2001-11-15 Thread Martin Thoma
if (!strpos(...)) will be better... Why? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]

[PHP] Session-id in url, not in cookies

2001-09-27 Thread Martin Thoma
Hello! How can I make the session-id ONLY be stored in the url, even if the user has cookies enabled? I have no access to the php.ini-file. Any ideas? Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL

[PHP] VariableName

2001-05-24 Thread Martin Thoma
Hello ! I want to make a dynamic formular, on which the user can enter a different number of names. So to make the form I do: for ($i = 0; $i $anzahl; $i++) { printf (INPUT TYPE=\TEXT\ NAME=\Name%.0d\ VALUE=\\ SIZE=20\\n, $i); } Now I want to set all the Varables Name0, Name1, Name2 etc. to

Re: [PHP] VariableName

2001-05-24 Thread Martin Thoma
; } So if $n was 3 and $default_value was 0, you'd have three variables who's value was 0: $Name1 $Name2 $Name3 Variable variables are the way to go. They're so cool :) I wonder if Java has anything like that... Plutarck Martin Thoma [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED

[PHP] New session...

2001-05-24 Thread Martin Thoma
Hello ! I want the user to have a chance to reset the session and get a new session_id on one page. I tried: session_name(MyId); session_register(MyId); session_unregister(MyId); session_register(MyId); But it doesn't worked. session_destroy doesn't work, too. What I want is, the PHP

[PHP] Color of Pixel

2001-05-19 Thread Martin Thoma
Hello ! I got a jpg-picture on my disk. Is there any way to find out the color of a pixel (let's say, I want to know, which color the pixel 1,12 on image img.jpg is.) Ideas ? Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional

[PHP] Undefined Variables / PHP 4.0.4pl1

2001-05-18 Thread Martin Thoma
Hello ! I just installed PHP 4.0.4pl1 over an existing PHP 4.0.1 on Win98 with Apache. Alle works greate, but I get a lot of warnings: Warning: Undefined variable: MyVariable in filename The warnings weren't there in the earlier version. How can I turn of these warnings ? Regards Martin

Re: [PHP] Who has PHP4 and FTP experience?

2001-05-18 Thread Martin Thoma
Whats the problem ? ;-) Gunter Ohrner schrieb: Hi! I'm looking for some hints for the PHP ftp module as I have some problems using it - if anyone has experience in using the PHP ftp module it would be very cool someone could send me an email... g Greetinx, Gunter Ohrner --

Re: [PHP] Undefined Variables / PHP 4.0.4pl1

2001-05-18 Thread Martin Thoma
Thanx a lot, I found it in php.ini ! Johnson, Kirk schrieb: If you have access to php.ini, see the Error handling and logging section. Else, see http://www.php.net/manual/en/ref.errorfunc.php Kirk -Original Message- From: Martin Thoma [mailto:[EMAIL PROTECTED]] Sent: Friday

[PHP] if... then... else with HTML

2001-04-23 Thread Martin Thoma
Hello ! I want to do something like if (condition) output this html-block else output that html-block Without printig or echoing the html-block out (because the block has a lot of , which I all would have to slash out...) How can I do that ? Martin -- PHP General Mailing List

Re: [PHP] if... then... else with HTML

2001-04-23 Thread Martin Thoma
Ah, I forgott the {} ;-) ?php if(strstr($HTTP_USER_AGENT,MSIE)) { ? centerbYou are using Internet Explorer/b/center ? } else { ? centerbYou are not using Internet Explorer/b/center ? } ? Martin Thoma schrieb: Hello ! I want to do something like if (condition) output this html-block

[PHP] X509

2001-04-07 Thread Martin Thoma
Hello ! I want to write a small script to decrypt/encrypt/sign emails with the X509-protocoll. Does anybody know, where to get information about this protocoll ? Does anybody has some examples how to use it in php ? Any ready-to-go-code ? Any help is welcome ! Martin -- PHP General

[PHP] Fetch side with Cookies

2001-03-15 Thread Martin Thoma
Hello ! I have a side, which I can only access when a special cookie is set. I want to access and analyse the side with php. So I could not use fopen("http://www.thesidename.com", "r"), because this will not transmit the cookie. I thought of something with sockets and sending a HTTP-Get with

[PHP] How to str-replace

2001-03-13 Thread Martin Thoma
Hi ! How can I replace a string (like "TABLE") case-insensitive (replace also "table", "Table","tABle"...) ? str_replace is case-sensitive. Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To

Re: [PHP] How to str-replace

2001-03-13 Thread Martin Thoma
I found out to use eregi_replace. Martin Thoma schrieb: Hi ! How can I replace a string (like "TABLE") case-insensitive (replace also "table", "Table","tABle"...) ? str_replace is case-sensitive. Martin -- PHP General Mailing List (http://www.p

[PHP] Replace everything except of...

2001-03-13 Thread Martin Thoma
Hello ! How can I use eregi_replace to replace every "BR" with "", except when it's "BBR" ?? Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail:

[PHP] Standard-Output

2001-02-18 Thread Martin Thoma
Hello ! Which is the name for the standard-output on Linux ? The background: I want to use PGP (2.6.3.) to put the encrypted file out on standard-output. Regards Martin -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands,

[PHP] Using Pipes / PGP

2001-02-18 Thread Martin Thoma
Hm, this is getting much more complicated as I thought. I want to use PGP. This works fine with temporary Files: You say to PGP: "Please take the file message.txt and encrypt it to the file encrypt.txt". Ok. But this could be a possible securety-hole, because the message-file is available on

[PHP] Mail-Encryption

2001-02-06 Thread Martin Thoma
Hello ! I want to send mails via the "mail"-command which are encrypted and which uses the certificates used by Netscape Messenger and Outlook (if you export the files, it's extention is .p12). - How do I generate such keys (in general) ? - How can I send an encrypted email from an Unix-Server

Re: [PHP] Off Subject, but can't find any info elsewhere

2001-02-03 Thread Martin Thoma
Go to developers.netscape.com, there you can find newsgroups where you can get help. Martin Toby Miller schrieb: Web Developers, I know this has nothing to do with PHP, but some bright minds out there might have run across it. It's about Netscape 6 mouseovers. I've read elsewhere that